diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 2007aeb..164d277 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -22,6 +22,9 @@ CounterDataService CounterDataService = new CounterDataServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); #region 无边框拖动效果/最小化窗口/关闭窗口 [DllImport("user32.dll")]//拖动无窗体的控件 @@ -49,16 +52,13 @@ { InitializeComponent(); timePicker_startTime.Value = DateTime.Now; - timePicker_startTime.MinDate = DateTime.Now; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; + timePicker_startTime.MinDate = DateTime.Now; } // 开始检测 private void btnSave_Click(object sender, EventArgs e) { - if(!text_devType.Text.Equals("计数器") && text_channelNo.Text.Equals("")) + if(!text_devType.Text.Equals("频率计数器") && text_channelNo.Text.Equals("")) { MessageBox.Show("请选择通道!"); return; @@ -68,7 +68,7 @@ MessageBox.Show("请选择频率稳定度采样时间!"); return; } - if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked && !checkBox_count.Checked) + if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked ) { MessageBox.Show("请选择检测项目!"); return; @@ -86,50 +86,6 @@ if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - CounterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - inDetecCounterId = -1; - - }).Start(); - } - } } else { @@ -137,7 +93,6 @@ if (checkBox_accuracy.Checked) accuracy = "-2"; if (checkBox_bootFeature.Checked) bootFeature = "-2"; if (checkBox_ageRate.Checked) ageRate = "-2"; - if (checkBox_count.Checked) counterDetec = "-2"; } if (checkBox_stability.Checked) @@ -149,7 +104,7 @@ } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text); this.HideMaskAction(); @@ -254,5 +209,7 @@ { getEndTime(); } + + } } diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 2007aeb..164d277 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -22,6 +22,9 @@ CounterDataService CounterDataService = new CounterDataServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); #region 无边框拖动效果/最小化窗口/关闭窗口 [DllImport("user32.dll")]//拖动无窗体的控件 @@ -49,16 +52,13 @@ { InitializeComponent(); timePicker_startTime.Value = DateTime.Now; - timePicker_startTime.MinDate = DateTime.Now; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; + timePicker_startTime.MinDate = DateTime.Now; } // 开始检测 private void btnSave_Click(object sender, EventArgs e) { - if(!text_devType.Text.Equals("计数器") && text_channelNo.Text.Equals("")) + if(!text_devType.Text.Equals("频率计数器") && text_channelNo.Text.Equals("")) { MessageBox.Show("请选择通道!"); return; @@ -68,7 +68,7 @@ MessageBox.Show("请选择频率稳定度采样时间!"); return; } - if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked && !checkBox_count.Checked) + if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked ) { MessageBox.Show("请选择检测项目!"); return; @@ -86,50 +86,6 @@ if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - CounterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - inDetecCounterId = -1; - - }).Start(); - } - } } else { @@ -137,7 +93,6 @@ if (checkBox_accuracy.Checked) accuracy = "-2"; if (checkBox_bootFeature.Checked) bootFeature = "-2"; if (checkBox_ageRate.Checked) ageRate = "-2"; - if (checkBox_count.Checked) counterDetec = "-2"; } if (checkBox_stability.Checked) @@ -149,7 +104,7 @@ } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text); this.HideMaskAction(); @@ -254,5 +209,7 @@ { getEndTime(); } + + } } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 7f555e1..4f3e7b8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -64,7 +64,6 @@ this.channel4 = new DevComponents.Editors.ComboItem(); this.channel5 = new DevComponents.Editors.ComboItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.checkBox_ageRate = new System.Windows.Forms.CheckBox(); this.checkBox_bootFeature = new System.Windows.Forms.CheckBox(); this.checkBox_accuracy = new System.Windows.Forms.CheckBox(); @@ -75,13 +74,13 @@ this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label6 = new System.Windows.Forms.Label(); - this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.radio_100s = new System.Windows.Forms.RadioButton(); this.radio_20s = new System.Windows.Forms.RadioButton(); this.radio_10s = new System.Windows.Forms.RadioButton(); this.radio_1s = new System.Windows.Forms.RadioButton(); + this.label6 = new System.Windows.Forms.Label(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -534,7 +533,6 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.checkBox_count); this.groupBox1.Controls.Add(this.checkBox_ageRate); this.groupBox1.Controls.Add(this.checkBox_bootFeature); this.groupBox1.Controls.Add(this.checkBox_accuracy); @@ -547,27 +545,16 @@ this.groupBox1.Enabled = false; this.groupBox1.Location = new System.Drawing.Point(10, 210); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(617, 140); + this.groupBox1.Size = new System.Drawing.Size(617, 127); this.groupBox1.TabIndex = 39; this.groupBox1.TabStop = false; this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(114, 55); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 351; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // checkBox_ageRate // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(467, 25); + this.checkBox_ageRate.Location = new System.Drawing.Point(467, 29); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 350; @@ -578,7 +565,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 25); + this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 29); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 349; @@ -589,7 +576,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(232, 25); + this.checkBox_accuracy.Location = new System.Drawing.Point(232, 29); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 347; @@ -600,7 +587,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(114, 25); + this.checkBox_stability.Location = new System.Drawing.Point(114, 29); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 348; @@ -621,7 +608,7 @@ this.endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.endTime.IsPopupCalendarOpen = false; - this.endTime.Location = new System.Drawing.Point(395, 94); + this.endTime.Location = new System.Drawing.Point(401, 75); // // // @@ -653,7 +640,7 @@ this.endTime.MonthCalendar.TodayButtonVisible = true; this.endTime.Name = "endTime"; this.endTime.ShowUpDown = true; - this.endTime.Size = new System.Drawing.Size(180, 23); + this.endTime.Size = new System.Drawing.Size(210, 23); this.endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.endTime.TabIndex = 44; this.endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -671,7 +658,7 @@ this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.startTime.IsPopupCalendarOpen = false; - this.startTime.Location = new System.Drawing.Point(107, 94); + this.startTime.Location = new System.Drawing.Point(107, 75); // // // @@ -703,7 +690,7 @@ this.startTime.MonthCalendar.TodayButtonVisible = true; this.startTime.Name = "startTime"; this.startTime.ShowUpDown = true; - this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Size = new System.Drawing.Size(200, 23); this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.startTime.TabIndex = 43; this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -711,7 +698,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(290, 92); + this.label3.Location = new System.Drawing.Point(298, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -722,7 +709,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(5, 92); + this.label12.Location = new System.Drawing.Point(5, 73); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -733,7 +720,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(5, 23); + this.label13.Location = new System.Drawing.Point(5, 27); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -749,12 +736,64 @@ this.groupBox2.Controls.Add(this.radio_1s); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Enabled = false; - this.groupBox2.Location = new System.Drawing.Point(9, 353); + this.groupBox2.Location = new System.Drawing.Point(9, 342); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(618, 53); this.groupBox2.TabIndex = 40; this.groupBox2.TabStop = false; // + // radio_100s + // + this.radio_100s.AutoSize = true; + this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_100s.Location = new System.Drawing.Point(468, 19); + this.radio_100s.Name = "radio_100s"; + this.radio_100s.Size = new System.Drawing.Size(57, 24); + this.radio_100s.TabIndex = 47; + this.radio_100s.TabStop = true; + this.radio_100s.Tag = "100"; + this.radio_100s.Text = "100s"; + this.radio_100s.UseVisualStyleBackColor = true; + // + // radio_20s + // + this.radio_20s.AutoSize = true; + this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_20s.Location = new System.Drawing.Point(349, 20); + this.radio_20s.Name = "radio_20s"; + this.radio_20s.Size = new System.Drawing.Size(49, 24); + this.radio_20s.TabIndex = 46; + this.radio_20s.TabStop = true; + this.radio_20s.Tag = "20"; + this.radio_20s.Text = "20s"; + this.radio_20s.UseVisualStyleBackColor = true; + // + // radio_10s + // + this.radio_10s.AutoSize = true; + this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_10s.Location = new System.Drawing.Point(233, 19); + this.radio_10s.Name = "radio_10s"; + this.radio_10s.Size = new System.Drawing.Size(49, 24); + this.radio_10s.TabIndex = 45; + this.radio_10s.TabStop = true; + this.radio_10s.Tag = "10"; + this.radio_10s.Text = "10s"; + this.radio_10s.UseVisualStyleBackColor = true; + // + // radio_1s + // + this.radio_1s.AutoSize = true; + this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_1s.Location = new System.Drawing.Point(115, 20); + this.radio_1s.Name = "radio_1s"; + this.radio_1s.Size = new System.Drawing.Size(41, 24); + this.radio_1s.TabIndex = 44; + this.radio_1s.TabStop = true; + this.radio_1s.Tag = "1"; + this.radio_1s.Text = "1s"; + this.radio_1s.UseVisualStyleBackColor = true; + // // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); @@ -812,58 +851,6 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // - // radio_100s - // - this.radio_100s.AutoSize = true; - this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_100s.Location = new System.Drawing.Point(468, 19); - this.radio_100s.Name = "radio_100s"; - this.radio_100s.Size = new System.Drawing.Size(57, 24); - this.radio_100s.TabIndex = 47; - this.radio_100s.TabStop = true; - this.radio_100s.Tag = "100"; - this.radio_100s.Text = "100s"; - this.radio_100s.UseVisualStyleBackColor = true; - // - // radio_20s - // - this.radio_20s.AutoSize = true; - this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_20s.Location = new System.Drawing.Point(349, 20); - this.radio_20s.Name = "radio_20s"; - this.radio_20s.Size = new System.Drawing.Size(49, 24); - this.radio_20s.TabIndex = 46; - this.radio_20s.TabStop = true; - this.radio_20s.Tag = "20"; - this.radio_20s.Text = "20s"; - this.radio_20s.UseVisualStyleBackColor = true; - // - // radio_10s - // - this.radio_10s.AutoSize = true; - this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_10s.Location = new System.Drawing.Point(233, 19); - this.radio_10s.Name = "radio_10s"; - this.radio_10s.Size = new System.Drawing.Size(49, 24); - this.radio_10s.TabIndex = 45; - this.radio_10s.TabStop = true; - this.radio_10s.Tag = "10"; - this.radio_10s.Text = "10s"; - this.radio_10s.UseVisualStyleBackColor = true; - // - // radio_1s - // - this.radio_1s.AutoSize = true; - this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_1s.Location = new System.Drawing.Point(115, 20); - this.radio_1s.Name = "radio_1s"; - this.radio_1s.Size = new System.Drawing.Size(41, 24); - this.radio_1s.TabIndex = 44; - this.radio_1s.TabStop = true; - this.radio_1s.Tag = "1"; - this.radio_1s.Text = "1s"; - this.radio_1s.UseVisualStyleBackColor = true; - // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -931,7 +918,6 @@ public System.Windows.Forms.CheckBox checkBox_startNow; public DevComponents.Editors.DateTimeAdv.DateTimeInput endTime; public DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; - public System.Windows.Forms.CheckBox checkBox_count; public System.Windows.Forms.CheckBox checkBox_ageRate; public System.Windows.Forms.CheckBox checkBox_bootFeature; public System.Windows.Forms.CheckBox checkBox_accuracy; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 2007aeb..164d277 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -22,6 +22,9 @@ CounterDataService CounterDataService = new CounterDataServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); #region 无边框拖动效果/最小化窗口/关闭窗口 [DllImport("user32.dll")]//拖动无窗体的控件 @@ -49,16 +52,13 @@ { InitializeComponent(); timePicker_startTime.Value = DateTime.Now; - timePicker_startTime.MinDate = DateTime.Now; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; + timePicker_startTime.MinDate = DateTime.Now; } // 开始检测 private void btnSave_Click(object sender, EventArgs e) { - if(!text_devType.Text.Equals("计数器") && text_channelNo.Text.Equals("")) + if(!text_devType.Text.Equals("频率计数器") && text_channelNo.Text.Equals("")) { MessageBox.Show("请选择通道!"); return; @@ -68,7 +68,7 @@ MessageBox.Show("请选择频率稳定度采样时间!"); return; } - if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked && !checkBox_count.Checked) + if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked ) { MessageBox.Show("请选择检测项目!"); return; @@ -86,50 +86,6 @@ if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - CounterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - inDetecCounterId = -1; - - }).Start(); - } - } } else { @@ -137,7 +93,6 @@ if (checkBox_accuracy.Checked) accuracy = "-2"; if (checkBox_bootFeature.Checked) bootFeature = "-2"; if (checkBox_ageRate.Checked) ageRate = "-2"; - if (checkBox_count.Checked) counterDetec = "-2"; } if (checkBox_stability.Checked) @@ -149,7 +104,7 @@ } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text); this.HideMaskAction(); @@ -254,5 +209,7 @@ { getEndTime(); } + + } } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 7f555e1..4f3e7b8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -64,7 +64,6 @@ this.channel4 = new DevComponents.Editors.ComboItem(); this.channel5 = new DevComponents.Editors.ComboItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.checkBox_ageRate = new System.Windows.Forms.CheckBox(); this.checkBox_bootFeature = new System.Windows.Forms.CheckBox(); this.checkBox_accuracy = new System.Windows.Forms.CheckBox(); @@ -75,13 +74,13 @@ this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label6 = new System.Windows.Forms.Label(); - this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.radio_100s = new System.Windows.Forms.RadioButton(); this.radio_20s = new System.Windows.Forms.RadioButton(); this.radio_10s = new System.Windows.Forms.RadioButton(); this.radio_1s = new System.Windows.Forms.RadioButton(); + this.label6 = new System.Windows.Forms.Label(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -534,7 +533,6 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.checkBox_count); this.groupBox1.Controls.Add(this.checkBox_ageRate); this.groupBox1.Controls.Add(this.checkBox_bootFeature); this.groupBox1.Controls.Add(this.checkBox_accuracy); @@ -547,27 +545,16 @@ this.groupBox1.Enabled = false; this.groupBox1.Location = new System.Drawing.Point(10, 210); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(617, 140); + this.groupBox1.Size = new System.Drawing.Size(617, 127); this.groupBox1.TabIndex = 39; this.groupBox1.TabStop = false; this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(114, 55); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 351; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // checkBox_ageRate // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(467, 25); + this.checkBox_ageRate.Location = new System.Drawing.Point(467, 29); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 350; @@ -578,7 +565,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 25); + this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 29); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 349; @@ -589,7 +576,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(232, 25); + this.checkBox_accuracy.Location = new System.Drawing.Point(232, 29); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 347; @@ -600,7 +587,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(114, 25); + this.checkBox_stability.Location = new System.Drawing.Point(114, 29); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 348; @@ -621,7 +608,7 @@ this.endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.endTime.IsPopupCalendarOpen = false; - this.endTime.Location = new System.Drawing.Point(395, 94); + this.endTime.Location = new System.Drawing.Point(401, 75); // // // @@ -653,7 +640,7 @@ this.endTime.MonthCalendar.TodayButtonVisible = true; this.endTime.Name = "endTime"; this.endTime.ShowUpDown = true; - this.endTime.Size = new System.Drawing.Size(180, 23); + this.endTime.Size = new System.Drawing.Size(210, 23); this.endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.endTime.TabIndex = 44; this.endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -671,7 +658,7 @@ this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.startTime.IsPopupCalendarOpen = false; - this.startTime.Location = new System.Drawing.Point(107, 94); + this.startTime.Location = new System.Drawing.Point(107, 75); // // // @@ -703,7 +690,7 @@ this.startTime.MonthCalendar.TodayButtonVisible = true; this.startTime.Name = "startTime"; this.startTime.ShowUpDown = true; - this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Size = new System.Drawing.Size(200, 23); this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.startTime.TabIndex = 43; this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -711,7 +698,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(290, 92); + this.label3.Location = new System.Drawing.Point(298, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -722,7 +709,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(5, 92); + this.label12.Location = new System.Drawing.Point(5, 73); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -733,7 +720,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(5, 23); + this.label13.Location = new System.Drawing.Point(5, 27); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -749,12 +736,64 @@ this.groupBox2.Controls.Add(this.radio_1s); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Enabled = false; - this.groupBox2.Location = new System.Drawing.Point(9, 353); + this.groupBox2.Location = new System.Drawing.Point(9, 342); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(618, 53); this.groupBox2.TabIndex = 40; this.groupBox2.TabStop = false; // + // radio_100s + // + this.radio_100s.AutoSize = true; + this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_100s.Location = new System.Drawing.Point(468, 19); + this.radio_100s.Name = "radio_100s"; + this.radio_100s.Size = new System.Drawing.Size(57, 24); + this.radio_100s.TabIndex = 47; + this.radio_100s.TabStop = true; + this.radio_100s.Tag = "100"; + this.radio_100s.Text = "100s"; + this.radio_100s.UseVisualStyleBackColor = true; + // + // radio_20s + // + this.radio_20s.AutoSize = true; + this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_20s.Location = new System.Drawing.Point(349, 20); + this.radio_20s.Name = "radio_20s"; + this.radio_20s.Size = new System.Drawing.Size(49, 24); + this.radio_20s.TabIndex = 46; + this.radio_20s.TabStop = true; + this.radio_20s.Tag = "20"; + this.radio_20s.Text = "20s"; + this.radio_20s.UseVisualStyleBackColor = true; + // + // radio_10s + // + this.radio_10s.AutoSize = true; + this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_10s.Location = new System.Drawing.Point(233, 19); + this.radio_10s.Name = "radio_10s"; + this.radio_10s.Size = new System.Drawing.Size(49, 24); + this.radio_10s.TabIndex = 45; + this.radio_10s.TabStop = true; + this.radio_10s.Tag = "10"; + this.radio_10s.Text = "10s"; + this.radio_10s.UseVisualStyleBackColor = true; + // + // radio_1s + // + this.radio_1s.AutoSize = true; + this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_1s.Location = new System.Drawing.Point(115, 20); + this.radio_1s.Name = "radio_1s"; + this.radio_1s.Size = new System.Drawing.Size(41, 24); + this.radio_1s.TabIndex = 44; + this.radio_1s.TabStop = true; + this.radio_1s.Tag = "1"; + this.radio_1s.Text = "1s"; + this.radio_1s.UseVisualStyleBackColor = true; + // // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); @@ -812,58 +851,6 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // - // radio_100s - // - this.radio_100s.AutoSize = true; - this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_100s.Location = new System.Drawing.Point(468, 19); - this.radio_100s.Name = "radio_100s"; - this.radio_100s.Size = new System.Drawing.Size(57, 24); - this.radio_100s.TabIndex = 47; - this.radio_100s.TabStop = true; - this.radio_100s.Tag = "100"; - this.radio_100s.Text = "100s"; - this.radio_100s.UseVisualStyleBackColor = true; - // - // radio_20s - // - this.radio_20s.AutoSize = true; - this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_20s.Location = new System.Drawing.Point(349, 20); - this.radio_20s.Name = "radio_20s"; - this.radio_20s.Size = new System.Drawing.Size(49, 24); - this.radio_20s.TabIndex = 46; - this.radio_20s.TabStop = true; - this.radio_20s.Tag = "20"; - this.radio_20s.Text = "20s"; - this.radio_20s.UseVisualStyleBackColor = true; - // - // radio_10s - // - this.radio_10s.AutoSize = true; - this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_10s.Location = new System.Drawing.Point(233, 19); - this.radio_10s.Name = "radio_10s"; - this.radio_10s.Size = new System.Drawing.Size(49, 24); - this.radio_10s.TabIndex = 45; - this.radio_10s.TabStop = true; - this.radio_10s.Tag = "10"; - this.radio_10s.Text = "10s"; - this.radio_10s.UseVisualStyleBackColor = true; - // - // radio_1s - // - this.radio_1s.AutoSize = true; - this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_1s.Location = new System.Drawing.Point(115, 20); - this.radio_1s.Name = "radio_1s"; - this.radio_1s.Size = new System.Drawing.Size(41, 24); - this.radio_1s.TabIndex = 44; - this.radio_1s.TabStop = true; - this.radio_1s.Tag = "1"; - this.radio_1s.Text = "1s"; - this.radio_1s.UseVisualStyleBackColor = true; - // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -931,7 +918,6 @@ public System.Windows.Forms.CheckBox checkBox_startNow; public DevComponents.Editors.DateTimeAdv.DateTimeInput endTime; public DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; - public System.Windows.Forms.CheckBox checkBox_count; public System.Windows.Forms.CheckBox checkBox_ageRate; public System.Windows.Forms.CheckBox checkBox_bootFeature; public System.Windows.Forms.CheckBox checkBox_accuracy; diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index ecfc137..19169bb 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -3,6 +3,8 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.Tools; using DevComponents.DotNetBar.Controls; using DevComponents.Editors; @@ -36,7 +38,7 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); CounterDataService counterDataService = new CounterDataServiceImpl(); - + SensitivityService sensitivityService = new SensitivityServiceImpl(); public Action HideMaskAction { @@ -53,7 +55,7 @@ cbBox_devType.DisplayMember = "Name"; cbBox_devType.ValueMember = "Code"; - btnSave.Text = "添加"; + btnSave.Text = "保存"; if (HomeCtrlForm.channelFreeList.Count > 0) { cbBox_channelFree.Items.Add(""); @@ -61,12 +63,11 @@ { cbBox_channelFree.Items.Add(item); } - } else { text_channelNo.WatermarkText = "无空闲通道"; - + groupBox1.Enabled = false; } } @@ -116,6 +117,14 @@ return; } } + if (checkBox_accuracy.Checked || checkBox_stability.Checked || checkBox_ageRate.Checked || checkBox_bootFeature.Checked) + { + if (text_channelNo.Text.Trim() == "") + { + MessageBox.Show("请选择通道号!"); + return; + } + } // 取得输入框的参数 string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; @@ -133,64 +142,18 @@ { long deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo); if (deviceId != -1) - { - + { string stability = "-3"; string accuracy = "-3"; string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (checkBox_startNow.Checked || startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1"; } if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (SetDevTestDlg.inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - SetDevTestDlg.inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - counterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - SetDevTestDlg.inDetecCounterId = -1; - - }).Start(); - } - } + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -207,7 +170,7 @@ else if (radio_20s.Checked) interval = "20"; else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text); // 重新加载首页的通道状态 HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -218,7 +181,7 @@ } else { - LogHelper.WriteErrorLog(this.GetType(), "添仪器[" + devName + "]失败"); + LogHelper.WriteErrorLog(this.GetType(), "添加仪器[" + devName + "]失败"); } } else if (labelTitle.Text.Equals("修改")) @@ -256,21 +219,23 @@ private void cbBox_devType_SelectedIndexChanged(object sender, EventArgs e) { - text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; + text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; } private void cbBox_channelFree_SelectedIndexChanged(object sender, EventArgs e) { text_channelNo.Text = cbBox_channelFree.SelectedItem.ToString(); - - if (text_channelNo.Text != "") + if (text_channelNo.Text.Equals("")) { - checkBox_startNow.Enabled = true; - groupBox1.Enabled = true; + groupBox1.Enabled = false; + checkBox_accuracy.Checked = false; + checkBox_stability.Checked = false; + checkBox_ageRate.Checked = false; + checkBox_bootFeature.Checked = false; } else { - groupBox1.Enabled = false; checkBox_startNow.Enabled = false; + groupBox1.Enabled = true; } } diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 2007aeb..164d277 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -22,6 +22,9 @@ CounterDataService CounterDataService = new CounterDataServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); #region 无边框拖动效果/最小化窗口/关闭窗口 [DllImport("user32.dll")]//拖动无窗体的控件 @@ -49,16 +52,13 @@ { InitializeComponent(); timePicker_startTime.Value = DateTime.Now; - timePicker_startTime.MinDate = DateTime.Now; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; + timePicker_startTime.MinDate = DateTime.Now; } // 开始检测 private void btnSave_Click(object sender, EventArgs e) { - if(!text_devType.Text.Equals("计数器") && text_channelNo.Text.Equals("")) + if(!text_devType.Text.Equals("频率计数器") && text_channelNo.Text.Equals("")) { MessageBox.Show("请选择通道!"); return; @@ -68,7 +68,7 @@ MessageBox.Show("请选择频率稳定度采样时间!"); return; } - if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked && !checkBox_count.Checked) + if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked ) { MessageBox.Show("请选择检测项目!"); return; @@ -86,50 +86,6 @@ if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - CounterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - inDetecCounterId = -1; - - }).Start(); - } - } } else { @@ -137,7 +93,6 @@ if (checkBox_accuracy.Checked) accuracy = "-2"; if (checkBox_bootFeature.Checked) bootFeature = "-2"; if (checkBox_ageRate.Checked) ageRate = "-2"; - if (checkBox_count.Checked) counterDetec = "-2"; } if (checkBox_stability.Checked) @@ -149,7 +104,7 @@ } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text); this.HideMaskAction(); @@ -254,5 +209,7 @@ { getEndTime(); } + + } } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 7f555e1..4f3e7b8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -64,7 +64,6 @@ this.channel4 = new DevComponents.Editors.ComboItem(); this.channel5 = new DevComponents.Editors.ComboItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.checkBox_ageRate = new System.Windows.Forms.CheckBox(); this.checkBox_bootFeature = new System.Windows.Forms.CheckBox(); this.checkBox_accuracy = new System.Windows.Forms.CheckBox(); @@ -75,13 +74,13 @@ this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label6 = new System.Windows.Forms.Label(); - this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.radio_100s = new System.Windows.Forms.RadioButton(); this.radio_20s = new System.Windows.Forms.RadioButton(); this.radio_10s = new System.Windows.Forms.RadioButton(); this.radio_1s = new System.Windows.Forms.RadioButton(); + this.label6 = new System.Windows.Forms.Label(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -534,7 +533,6 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.checkBox_count); this.groupBox1.Controls.Add(this.checkBox_ageRate); this.groupBox1.Controls.Add(this.checkBox_bootFeature); this.groupBox1.Controls.Add(this.checkBox_accuracy); @@ -547,27 +545,16 @@ this.groupBox1.Enabled = false; this.groupBox1.Location = new System.Drawing.Point(10, 210); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(617, 140); + this.groupBox1.Size = new System.Drawing.Size(617, 127); this.groupBox1.TabIndex = 39; this.groupBox1.TabStop = false; this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(114, 55); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 351; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // checkBox_ageRate // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(467, 25); + this.checkBox_ageRate.Location = new System.Drawing.Point(467, 29); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 350; @@ -578,7 +565,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 25); + this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 29); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 349; @@ -589,7 +576,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(232, 25); + this.checkBox_accuracy.Location = new System.Drawing.Point(232, 29); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 347; @@ -600,7 +587,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(114, 25); + this.checkBox_stability.Location = new System.Drawing.Point(114, 29); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 348; @@ -621,7 +608,7 @@ this.endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.endTime.IsPopupCalendarOpen = false; - this.endTime.Location = new System.Drawing.Point(395, 94); + this.endTime.Location = new System.Drawing.Point(401, 75); // // // @@ -653,7 +640,7 @@ this.endTime.MonthCalendar.TodayButtonVisible = true; this.endTime.Name = "endTime"; this.endTime.ShowUpDown = true; - this.endTime.Size = new System.Drawing.Size(180, 23); + this.endTime.Size = new System.Drawing.Size(210, 23); this.endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.endTime.TabIndex = 44; this.endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -671,7 +658,7 @@ this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.startTime.IsPopupCalendarOpen = false; - this.startTime.Location = new System.Drawing.Point(107, 94); + this.startTime.Location = new System.Drawing.Point(107, 75); // // // @@ -703,7 +690,7 @@ this.startTime.MonthCalendar.TodayButtonVisible = true; this.startTime.Name = "startTime"; this.startTime.ShowUpDown = true; - this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Size = new System.Drawing.Size(200, 23); this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.startTime.TabIndex = 43; this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -711,7 +698,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(290, 92); + this.label3.Location = new System.Drawing.Point(298, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -722,7 +709,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(5, 92); + this.label12.Location = new System.Drawing.Point(5, 73); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -733,7 +720,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(5, 23); + this.label13.Location = new System.Drawing.Point(5, 27); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -749,12 +736,64 @@ this.groupBox2.Controls.Add(this.radio_1s); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Enabled = false; - this.groupBox2.Location = new System.Drawing.Point(9, 353); + this.groupBox2.Location = new System.Drawing.Point(9, 342); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(618, 53); this.groupBox2.TabIndex = 40; this.groupBox2.TabStop = false; // + // radio_100s + // + this.radio_100s.AutoSize = true; + this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_100s.Location = new System.Drawing.Point(468, 19); + this.radio_100s.Name = "radio_100s"; + this.radio_100s.Size = new System.Drawing.Size(57, 24); + this.radio_100s.TabIndex = 47; + this.radio_100s.TabStop = true; + this.radio_100s.Tag = "100"; + this.radio_100s.Text = "100s"; + this.radio_100s.UseVisualStyleBackColor = true; + // + // radio_20s + // + this.radio_20s.AutoSize = true; + this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_20s.Location = new System.Drawing.Point(349, 20); + this.radio_20s.Name = "radio_20s"; + this.radio_20s.Size = new System.Drawing.Size(49, 24); + this.radio_20s.TabIndex = 46; + this.radio_20s.TabStop = true; + this.radio_20s.Tag = "20"; + this.radio_20s.Text = "20s"; + this.radio_20s.UseVisualStyleBackColor = true; + // + // radio_10s + // + this.radio_10s.AutoSize = true; + this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_10s.Location = new System.Drawing.Point(233, 19); + this.radio_10s.Name = "radio_10s"; + this.radio_10s.Size = new System.Drawing.Size(49, 24); + this.radio_10s.TabIndex = 45; + this.radio_10s.TabStop = true; + this.radio_10s.Tag = "10"; + this.radio_10s.Text = "10s"; + this.radio_10s.UseVisualStyleBackColor = true; + // + // radio_1s + // + this.radio_1s.AutoSize = true; + this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_1s.Location = new System.Drawing.Point(115, 20); + this.radio_1s.Name = "radio_1s"; + this.radio_1s.Size = new System.Drawing.Size(41, 24); + this.radio_1s.TabIndex = 44; + this.radio_1s.TabStop = true; + this.radio_1s.Tag = "1"; + this.radio_1s.Text = "1s"; + this.radio_1s.UseVisualStyleBackColor = true; + // // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); @@ -812,58 +851,6 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // - // radio_100s - // - this.radio_100s.AutoSize = true; - this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_100s.Location = new System.Drawing.Point(468, 19); - this.radio_100s.Name = "radio_100s"; - this.radio_100s.Size = new System.Drawing.Size(57, 24); - this.radio_100s.TabIndex = 47; - this.radio_100s.TabStop = true; - this.radio_100s.Tag = "100"; - this.radio_100s.Text = "100s"; - this.radio_100s.UseVisualStyleBackColor = true; - // - // radio_20s - // - this.radio_20s.AutoSize = true; - this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_20s.Location = new System.Drawing.Point(349, 20); - this.radio_20s.Name = "radio_20s"; - this.radio_20s.Size = new System.Drawing.Size(49, 24); - this.radio_20s.TabIndex = 46; - this.radio_20s.TabStop = true; - this.radio_20s.Tag = "20"; - this.radio_20s.Text = "20s"; - this.radio_20s.UseVisualStyleBackColor = true; - // - // radio_10s - // - this.radio_10s.AutoSize = true; - this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_10s.Location = new System.Drawing.Point(233, 19); - this.radio_10s.Name = "radio_10s"; - this.radio_10s.Size = new System.Drawing.Size(49, 24); - this.radio_10s.TabIndex = 45; - this.radio_10s.TabStop = true; - this.radio_10s.Tag = "10"; - this.radio_10s.Text = "10s"; - this.radio_10s.UseVisualStyleBackColor = true; - // - // radio_1s - // - this.radio_1s.AutoSize = true; - this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_1s.Location = new System.Drawing.Point(115, 20); - this.radio_1s.Name = "radio_1s"; - this.radio_1s.Size = new System.Drawing.Size(41, 24); - this.radio_1s.TabIndex = 44; - this.radio_1s.TabStop = true; - this.radio_1s.Tag = "1"; - this.radio_1s.Text = "1s"; - this.radio_1s.UseVisualStyleBackColor = true; - // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -931,7 +918,6 @@ public System.Windows.Forms.CheckBox checkBox_startNow; public DevComponents.Editors.DateTimeAdv.DateTimeInput endTime; public DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; - public System.Windows.Forms.CheckBox checkBox_count; public System.Windows.Forms.CheckBox checkBox_ageRate; public System.Windows.Forms.CheckBox checkBox_bootFeature; public System.Windows.Forms.CheckBox checkBox_accuracy; diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index ecfc137..19169bb 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -3,6 +3,8 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.Tools; using DevComponents.DotNetBar.Controls; using DevComponents.Editors; @@ -36,7 +38,7 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); CounterDataService counterDataService = new CounterDataServiceImpl(); - + SensitivityService sensitivityService = new SensitivityServiceImpl(); public Action HideMaskAction { @@ -53,7 +55,7 @@ cbBox_devType.DisplayMember = "Name"; cbBox_devType.ValueMember = "Code"; - btnSave.Text = "添加"; + btnSave.Text = "保存"; if (HomeCtrlForm.channelFreeList.Count > 0) { cbBox_channelFree.Items.Add(""); @@ -61,12 +63,11 @@ { cbBox_channelFree.Items.Add(item); } - } else { text_channelNo.WatermarkText = "无空闲通道"; - + groupBox1.Enabled = false; } } @@ -116,6 +117,14 @@ return; } } + if (checkBox_accuracy.Checked || checkBox_stability.Checked || checkBox_ageRate.Checked || checkBox_bootFeature.Checked) + { + if (text_channelNo.Text.Trim() == "") + { + MessageBox.Show("请选择通道号!"); + return; + } + } // 取得输入框的参数 string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; @@ -133,64 +142,18 @@ { long deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo); if (deviceId != -1) - { - + { string stability = "-3"; string accuracy = "-3"; string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (checkBox_startNow.Checked || startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1"; } if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (SetDevTestDlg.inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - SetDevTestDlg.inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - counterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - SetDevTestDlg.inDetecCounterId = -1; - - }).Start(); - } - } + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -207,7 +170,7 @@ else if (radio_20s.Checked) interval = "20"; else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text); // 重新加载首页的通道状态 HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -218,7 +181,7 @@ } else { - LogHelper.WriteErrorLog(this.GetType(), "添仪器[" + devName + "]失败"); + LogHelper.WriteErrorLog(this.GetType(), "添加仪器[" + devName + "]失败"); } } else if (labelTitle.Text.Equals("修改")) @@ -256,21 +219,23 @@ private void cbBox_devType_SelectedIndexChanged(object sender, EventArgs e) { - text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; + text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; } private void cbBox_channelFree_SelectedIndexChanged(object sender, EventArgs e) { text_channelNo.Text = cbBox_channelFree.SelectedItem.ToString(); - - if (text_channelNo.Text != "") + if (text_channelNo.Text.Equals("")) { - checkBox_startNow.Enabled = true; - groupBox1.Enabled = true; + groupBox1.Enabled = false; + checkBox_accuracy.Checked = false; + checkBox_stability.Checked = false; + checkBox_ageRate.Checked = false; + checkBox_bootFeature.Checked = false; } else { - groupBox1.Enabled = false; checkBox_startNow.Enabled = false; + groupBox1.Enabled = true; } } diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 29d4d57..7c1cfbc 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -210,16 +210,16 @@ devList = new DataTable(); // 设置表格的列 - devList.Columns.Add("index", Type.GetType("System.String")); - devList.Columns.Add("regTime", Type.GetType("System.String")); - devList.Columns.Add("devName", Type.GetType("System.String")); - devList.Columns.Add("devModel", Type.GetType("System.String")); - devList.Columns.Add("devCode", Type.GetType("System.String")); - devList.Columns.Add("customComp", Type.GetType("System.String")); - devList.Columns.Add("customName", Type.GetType("System.String")); - devList.Columns.Add("status", Type.GetType("System.String")); - devList.Columns.Add("channelNo", Type.GetType("System.String")); - devList.Columns.Add("id", Type.GetType("System.Int64")); + devList.Columns.Add("index", Type.GetType("System.String"));//0 + devList.Columns.Add("regTime", Type.GetType("System.String"));//1 + devList.Columns.Add("devName", Type.GetType("System.String"));//2 + devList.Columns.Add("devModel", Type.GetType("System.String"));//3 + devList.Columns.Add("devCode", Type.GetType("System.String"));//4 + devList.Columns.Add("customComp", Type.GetType("System.String"));//5 + devList.Columns.Add("customName", Type.GetType("System.String"));//6 + devList.Columns.Add("status", Type.GetType("System.String"));//7 + devList.Columns.Add("channelNo", Type.GetType("System.String"));//8 + devList.Columns.Add("id", Type.GetType("System.Int64"));//9 // 分页查询数据库 string devName = ""; @@ -500,10 +500,8 @@ editDlg.inputCustName.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value; editDlg.text_channelNo.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[8].Value; editDlg.btnSave.Text = "保存"; - if (((string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[rowIndex].Cells[7].Value).Equals("检测中")) { - editDlg.btn_downChannelList.Enabled = false; - editDlg.text_channelNo.ReadOnly = true; DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DetectionItem detectionItem = (detectionItemService.search(id, true))[0]; editDlg.groupBox1.Enabled = false; @@ -517,6 +515,10 @@ } if (!detectionItem.BootFeature.Equals("-3")) editDlg.checkBox_bootFeature.Checked = true; if (!detectionItem.AgeRate.Equals("-3")) editDlg.checkBox_ageRate.Checked = true; + editDlg.groupBox2.Enabled = false; + editDlg.groupBox1.Enabled = false; + editDlg.btn_downChannelList.Enabled = false; + editDlg.text_channelNo.Enabled = false; } editDlg.HideMaskAction += () => { @@ -539,7 +541,7 @@ private void btnDelete_Click(object sender, EventArgs e) { - if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[7].Value).Equals("检测中")) { MessageBox.Show("该仪器在检测中,无法删除!"); return; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 2007aeb..164d277 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -22,6 +22,9 @@ CounterDataService CounterDataService = new CounterDataServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); #region 无边框拖动效果/最小化窗口/关闭窗口 [DllImport("user32.dll")]//拖动无窗体的控件 @@ -49,16 +52,13 @@ { InitializeComponent(); timePicker_startTime.Value = DateTime.Now; - timePicker_startTime.MinDate = DateTime.Now; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; + timePicker_startTime.MinDate = DateTime.Now; } // 开始检测 private void btnSave_Click(object sender, EventArgs e) { - if(!text_devType.Text.Equals("计数器") && text_channelNo.Text.Equals("")) + if(!text_devType.Text.Equals("频率计数器") && text_channelNo.Text.Equals("")) { MessageBox.Show("请选择通道!"); return; @@ -68,7 +68,7 @@ MessageBox.Show("请选择频率稳定度采样时间!"); return; } - if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked && !checkBox_count.Checked) + if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked ) { MessageBox.Show("请选择检测项目!"); return; @@ -86,50 +86,6 @@ if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - CounterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - inDetecCounterId = -1; - - }).Start(); - } - } } else { @@ -137,7 +93,6 @@ if (checkBox_accuracy.Checked) accuracy = "-2"; if (checkBox_bootFeature.Checked) bootFeature = "-2"; if (checkBox_ageRate.Checked) ageRate = "-2"; - if (checkBox_count.Checked) counterDetec = "-2"; } if (checkBox_stability.Checked) @@ -149,7 +104,7 @@ } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text); this.HideMaskAction(); @@ -254,5 +209,7 @@ { getEndTime(); } + + } } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 7f555e1..4f3e7b8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -64,7 +64,6 @@ this.channel4 = new DevComponents.Editors.ComboItem(); this.channel5 = new DevComponents.Editors.ComboItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.checkBox_ageRate = new System.Windows.Forms.CheckBox(); this.checkBox_bootFeature = new System.Windows.Forms.CheckBox(); this.checkBox_accuracy = new System.Windows.Forms.CheckBox(); @@ -75,13 +74,13 @@ this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label6 = new System.Windows.Forms.Label(); - this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.radio_100s = new System.Windows.Forms.RadioButton(); this.radio_20s = new System.Windows.Forms.RadioButton(); this.radio_10s = new System.Windows.Forms.RadioButton(); this.radio_1s = new System.Windows.Forms.RadioButton(); + this.label6 = new System.Windows.Forms.Label(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -534,7 +533,6 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.checkBox_count); this.groupBox1.Controls.Add(this.checkBox_ageRate); this.groupBox1.Controls.Add(this.checkBox_bootFeature); this.groupBox1.Controls.Add(this.checkBox_accuracy); @@ -547,27 +545,16 @@ this.groupBox1.Enabled = false; this.groupBox1.Location = new System.Drawing.Point(10, 210); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(617, 140); + this.groupBox1.Size = new System.Drawing.Size(617, 127); this.groupBox1.TabIndex = 39; this.groupBox1.TabStop = false; this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(114, 55); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 351; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // checkBox_ageRate // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(467, 25); + this.checkBox_ageRate.Location = new System.Drawing.Point(467, 29); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 350; @@ -578,7 +565,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 25); + this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 29); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 349; @@ -589,7 +576,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(232, 25); + this.checkBox_accuracy.Location = new System.Drawing.Point(232, 29); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 347; @@ -600,7 +587,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(114, 25); + this.checkBox_stability.Location = new System.Drawing.Point(114, 29); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 348; @@ -621,7 +608,7 @@ this.endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.endTime.IsPopupCalendarOpen = false; - this.endTime.Location = new System.Drawing.Point(395, 94); + this.endTime.Location = new System.Drawing.Point(401, 75); // // // @@ -653,7 +640,7 @@ this.endTime.MonthCalendar.TodayButtonVisible = true; this.endTime.Name = "endTime"; this.endTime.ShowUpDown = true; - this.endTime.Size = new System.Drawing.Size(180, 23); + this.endTime.Size = new System.Drawing.Size(210, 23); this.endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.endTime.TabIndex = 44; this.endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -671,7 +658,7 @@ this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.startTime.IsPopupCalendarOpen = false; - this.startTime.Location = new System.Drawing.Point(107, 94); + this.startTime.Location = new System.Drawing.Point(107, 75); // // // @@ -703,7 +690,7 @@ this.startTime.MonthCalendar.TodayButtonVisible = true; this.startTime.Name = "startTime"; this.startTime.ShowUpDown = true; - this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Size = new System.Drawing.Size(200, 23); this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.startTime.TabIndex = 43; this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -711,7 +698,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(290, 92); + this.label3.Location = new System.Drawing.Point(298, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -722,7 +709,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(5, 92); + this.label12.Location = new System.Drawing.Point(5, 73); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -733,7 +720,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(5, 23); + this.label13.Location = new System.Drawing.Point(5, 27); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -749,12 +736,64 @@ this.groupBox2.Controls.Add(this.radio_1s); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Enabled = false; - this.groupBox2.Location = new System.Drawing.Point(9, 353); + this.groupBox2.Location = new System.Drawing.Point(9, 342); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(618, 53); this.groupBox2.TabIndex = 40; this.groupBox2.TabStop = false; // + // radio_100s + // + this.radio_100s.AutoSize = true; + this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_100s.Location = new System.Drawing.Point(468, 19); + this.radio_100s.Name = "radio_100s"; + this.radio_100s.Size = new System.Drawing.Size(57, 24); + this.radio_100s.TabIndex = 47; + this.radio_100s.TabStop = true; + this.radio_100s.Tag = "100"; + this.radio_100s.Text = "100s"; + this.radio_100s.UseVisualStyleBackColor = true; + // + // radio_20s + // + this.radio_20s.AutoSize = true; + this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_20s.Location = new System.Drawing.Point(349, 20); + this.radio_20s.Name = "radio_20s"; + this.radio_20s.Size = new System.Drawing.Size(49, 24); + this.radio_20s.TabIndex = 46; + this.radio_20s.TabStop = true; + this.radio_20s.Tag = "20"; + this.radio_20s.Text = "20s"; + this.radio_20s.UseVisualStyleBackColor = true; + // + // radio_10s + // + this.radio_10s.AutoSize = true; + this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_10s.Location = new System.Drawing.Point(233, 19); + this.radio_10s.Name = "radio_10s"; + this.radio_10s.Size = new System.Drawing.Size(49, 24); + this.radio_10s.TabIndex = 45; + this.radio_10s.TabStop = true; + this.radio_10s.Tag = "10"; + this.radio_10s.Text = "10s"; + this.radio_10s.UseVisualStyleBackColor = true; + // + // radio_1s + // + this.radio_1s.AutoSize = true; + this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_1s.Location = new System.Drawing.Point(115, 20); + this.radio_1s.Name = "radio_1s"; + this.radio_1s.Size = new System.Drawing.Size(41, 24); + this.radio_1s.TabIndex = 44; + this.radio_1s.TabStop = true; + this.radio_1s.Tag = "1"; + this.radio_1s.Text = "1s"; + this.radio_1s.UseVisualStyleBackColor = true; + // // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); @@ -812,58 +851,6 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // - // radio_100s - // - this.radio_100s.AutoSize = true; - this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_100s.Location = new System.Drawing.Point(468, 19); - this.radio_100s.Name = "radio_100s"; - this.radio_100s.Size = new System.Drawing.Size(57, 24); - this.radio_100s.TabIndex = 47; - this.radio_100s.TabStop = true; - this.radio_100s.Tag = "100"; - this.radio_100s.Text = "100s"; - this.radio_100s.UseVisualStyleBackColor = true; - // - // radio_20s - // - this.radio_20s.AutoSize = true; - this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_20s.Location = new System.Drawing.Point(349, 20); - this.radio_20s.Name = "radio_20s"; - this.radio_20s.Size = new System.Drawing.Size(49, 24); - this.radio_20s.TabIndex = 46; - this.radio_20s.TabStop = true; - this.radio_20s.Tag = "20"; - this.radio_20s.Text = "20s"; - this.radio_20s.UseVisualStyleBackColor = true; - // - // radio_10s - // - this.radio_10s.AutoSize = true; - this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_10s.Location = new System.Drawing.Point(233, 19); - this.radio_10s.Name = "radio_10s"; - this.radio_10s.Size = new System.Drawing.Size(49, 24); - this.radio_10s.TabIndex = 45; - this.radio_10s.TabStop = true; - this.radio_10s.Tag = "10"; - this.radio_10s.Text = "10s"; - this.radio_10s.UseVisualStyleBackColor = true; - // - // radio_1s - // - this.radio_1s.AutoSize = true; - this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_1s.Location = new System.Drawing.Point(115, 20); - this.radio_1s.Name = "radio_1s"; - this.radio_1s.Size = new System.Drawing.Size(41, 24); - this.radio_1s.TabIndex = 44; - this.radio_1s.TabStop = true; - this.radio_1s.Tag = "1"; - this.radio_1s.Text = "1s"; - this.radio_1s.UseVisualStyleBackColor = true; - // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -931,7 +918,6 @@ public System.Windows.Forms.CheckBox checkBox_startNow; public DevComponents.Editors.DateTimeAdv.DateTimeInput endTime; public DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; - public System.Windows.Forms.CheckBox checkBox_count; public System.Windows.Forms.CheckBox checkBox_ageRate; public System.Windows.Forms.CheckBox checkBox_bootFeature; public System.Windows.Forms.CheckBox checkBox_accuracy; diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index ecfc137..19169bb 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -3,6 +3,8 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.Tools; using DevComponents.DotNetBar.Controls; using DevComponents.Editors; @@ -36,7 +38,7 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); CounterDataService counterDataService = new CounterDataServiceImpl(); - + SensitivityService sensitivityService = new SensitivityServiceImpl(); public Action HideMaskAction { @@ -53,7 +55,7 @@ cbBox_devType.DisplayMember = "Name"; cbBox_devType.ValueMember = "Code"; - btnSave.Text = "添加"; + btnSave.Text = "保存"; if (HomeCtrlForm.channelFreeList.Count > 0) { cbBox_channelFree.Items.Add(""); @@ -61,12 +63,11 @@ { cbBox_channelFree.Items.Add(item); } - } else { text_channelNo.WatermarkText = "无空闲通道"; - + groupBox1.Enabled = false; } } @@ -116,6 +117,14 @@ return; } } + if (checkBox_accuracy.Checked || checkBox_stability.Checked || checkBox_ageRate.Checked || checkBox_bootFeature.Checked) + { + if (text_channelNo.Text.Trim() == "") + { + MessageBox.Show("请选择通道号!"); + return; + } + } // 取得输入框的参数 string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; @@ -133,64 +142,18 @@ { long deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo); if (deviceId != -1) - { - + { string stability = "-3"; string accuracy = "-3"; string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (checkBox_startNow.Checked || startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1"; } if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (SetDevTestDlg.inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - SetDevTestDlg.inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - counterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - SetDevTestDlg.inDetecCounterId = -1; - - }).Start(); - } - } + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -207,7 +170,7 @@ else if (radio_20s.Checked) interval = "20"; else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text); // 重新加载首页的通道状态 HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -218,7 +181,7 @@ } else { - LogHelper.WriteErrorLog(this.GetType(), "添仪器[" + devName + "]失败"); + LogHelper.WriteErrorLog(this.GetType(), "添加仪器[" + devName + "]失败"); } } else if (labelTitle.Text.Equals("修改")) @@ -256,21 +219,23 @@ private void cbBox_devType_SelectedIndexChanged(object sender, EventArgs e) { - text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; + text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; } private void cbBox_channelFree_SelectedIndexChanged(object sender, EventArgs e) { text_channelNo.Text = cbBox_channelFree.SelectedItem.ToString(); - - if (text_channelNo.Text != "") + if (text_channelNo.Text.Equals("")) { - checkBox_startNow.Enabled = true; - groupBox1.Enabled = true; + groupBox1.Enabled = false; + checkBox_accuracy.Checked = false; + checkBox_stability.Checked = false; + checkBox_ageRate.Checked = false; + checkBox_bootFeature.Checked = false; } else { - groupBox1.Enabled = false; checkBox_startNow.Enabled = false; + groupBox1.Enabled = true; } } diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 29d4d57..7c1cfbc 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -210,16 +210,16 @@ devList = new DataTable(); // 设置表格的列 - devList.Columns.Add("index", Type.GetType("System.String")); - devList.Columns.Add("regTime", Type.GetType("System.String")); - devList.Columns.Add("devName", Type.GetType("System.String")); - devList.Columns.Add("devModel", Type.GetType("System.String")); - devList.Columns.Add("devCode", Type.GetType("System.String")); - devList.Columns.Add("customComp", Type.GetType("System.String")); - devList.Columns.Add("customName", Type.GetType("System.String")); - devList.Columns.Add("status", Type.GetType("System.String")); - devList.Columns.Add("channelNo", Type.GetType("System.String")); - devList.Columns.Add("id", Type.GetType("System.Int64")); + devList.Columns.Add("index", Type.GetType("System.String"));//0 + devList.Columns.Add("regTime", Type.GetType("System.String"));//1 + devList.Columns.Add("devName", Type.GetType("System.String"));//2 + devList.Columns.Add("devModel", Type.GetType("System.String"));//3 + devList.Columns.Add("devCode", Type.GetType("System.String"));//4 + devList.Columns.Add("customComp", Type.GetType("System.String"));//5 + devList.Columns.Add("customName", Type.GetType("System.String"));//6 + devList.Columns.Add("status", Type.GetType("System.String"));//7 + devList.Columns.Add("channelNo", Type.GetType("System.String"));//8 + devList.Columns.Add("id", Type.GetType("System.Int64"));//9 // 分页查询数据库 string devName = ""; @@ -500,10 +500,8 @@ editDlg.inputCustName.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value; editDlg.text_channelNo.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[8].Value; editDlg.btnSave.Text = "保存"; - if (((string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[rowIndex].Cells[7].Value).Equals("检测中")) { - editDlg.btn_downChannelList.Enabled = false; - editDlg.text_channelNo.ReadOnly = true; DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DetectionItem detectionItem = (detectionItemService.search(id, true))[0]; editDlg.groupBox1.Enabled = false; @@ -517,6 +515,10 @@ } if (!detectionItem.BootFeature.Equals("-3")) editDlg.checkBox_bootFeature.Checked = true; if (!detectionItem.AgeRate.Equals("-3")) editDlg.checkBox_ageRate.Checked = true; + editDlg.groupBox2.Enabled = false; + editDlg.groupBox1.Enabled = false; + editDlg.btn_downChannelList.Enabled = false; + editDlg.text_channelNo.Enabled = false; } editDlg.HideMaskAction += () => { @@ -539,7 +541,7 @@ private void btnDelete_Click(object sender, EventArgs e) { - if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[7].Value).Equals("检测中")) { MessageBox.Show("该仪器在检测中,无法删除!"); return; diff --git a/RbFreqStandMeasure/info/ageRate.designer.cs b/RbFreqStandMeasure/info/ageRate.designer.cs index c676897..5780827 100644 --- a/RbFreqStandMeasure/info/ageRate.designer.cs +++ b/RbFreqStandMeasure/info/ageRate.designer.cs @@ -67,7 +67,7 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(316, 8); + this.label1.Location = new System.Drawing.Point(318, 35); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(83, 27); @@ -78,7 +78,7 @@ // this.label4.BackColor = System.Drawing.Color.Transparent; this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(197, 8); + this.label4.Location = new System.Drawing.Point(199, 35); this.label4.Margin = new System.Windows.Forms.Padding(0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(119, 27); @@ -115,7 +115,7 @@ this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label3.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label3.Location = new System.Drawing.Point(316, 35); + this.label3.Location = new System.Drawing.Point(318, 8); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(83, 27); @@ -126,7 +126,7 @@ // this.label5.BackColor = System.Drawing.Color.Transparent; this.label5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label5.Location = new System.Drawing.Point(229, 35); + this.label5.Location = new System.Drawing.Point(231, 8); this.label5.Margin = new System.Windows.Forms.Padding(0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(87, 27); diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 2007aeb..164d277 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -22,6 +22,9 @@ CounterDataService CounterDataService = new CounterDataServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); #region 无边框拖动效果/最小化窗口/关闭窗口 [DllImport("user32.dll")]//拖动无窗体的控件 @@ -49,16 +52,13 @@ { InitializeComponent(); timePicker_startTime.Value = DateTime.Now; - timePicker_startTime.MinDate = DateTime.Now; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; + timePicker_startTime.MinDate = DateTime.Now; } // 开始检测 private void btnSave_Click(object sender, EventArgs e) { - if(!text_devType.Text.Equals("计数器") && text_channelNo.Text.Equals("")) + if(!text_devType.Text.Equals("频率计数器") && text_channelNo.Text.Equals("")) { MessageBox.Show("请选择通道!"); return; @@ -68,7 +68,7 @@ MessageBox.Show("请选择频率稳定度采样时间!"); return; } - if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked && !checkBox_count.Checked) + if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked ) { MessageBox.Show("请选择检测项目!"); return; @@ -86,50 +86,6 @@ if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - CounterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - inDetecCounterId = -1; - - }).Start(); - } - } } else { @@ -137,7 +93,6 @@ if (checkBox_accuracy.Checked) accuracy = "-2"; if (checkBox_bootFeature.Checked) bootFeature = "-2"; if (checkBox_ageRate.Checked) ageRate = "-2"; - if (checkBox_count.Checked) counterDetec = "-2"; } if (checkBox_stability.Checked) @@ -149,7 +104,7 @@ } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text); this.HideMaskAction(); @@ -254,5 +209,7 @@ { getEndTime(); } + + } } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 7f555e1..4f3e7b8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -64,7 +64,6 @@ this.channel4 = new DevComponents.Editors.ComboItem(); this.channel5 = new DevComponents.Editors.ComboItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.checkBox_ageRate = new System.Windows.Forms.CheckBox(); this.checkBox_bootFeature = new System.Windows.Forms.CheckBox(); this.checkBox_accuracy = new System.Windows.Forms.CheckBox(); @@ -75,13 +74,13 @@ this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label6 = new System.Windows.Forms.Label(); - this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.radio_100s = new System.Windows.Forms.RadioButton(); this.radio_20s = new System.Windows.Forms.RadioButton(); this.radio_10s = new System.Windows.Forms.RadioButton(); this.radio_1s = new System.Windows.Forms.RadioButton(); + this.label6 = new System.Windows.Forms.Label(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -534,7 +533,6 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.checkBox_count); this.groupBox1.Controls.Add(this.checkBox_ageRate); this.groupBox1.Controls.Add(this.checkBox_bootFeature); this.groupBox1.Controls.Add(this.checkBox_accuracy); @@ -547,27 +545,16 @@ this.groupBox1.Enabled = false; this.groupBox1.Location = new System.Drawing.Point(10, 210); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(617, 140); + this.groupBox1.Size = new System.Drawing.Size(617, 127); this.groupBox1.TabIndex = 39; this.groupBox1.TabStop = false; this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(114, 55); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 351; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // checkBox_ageRate // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(467, 25); + this.checkBox_ageRate.Location = new System.Drawing.Point(467, 29); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 350; @@ -578,7 +565,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 25); + this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 29); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 349; @@ -589,7 +576,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(232, 25); + this.checkBox_accuracy.Location = new System.Drawing.Point(232, 29); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 347; @@ -600,7 +587,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(114, 25); + this.checkBox_stability.Location = new System.Drawing.Point(114, 29); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 348; @@ -621,7 +608,7 @@ this.endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.endTime.IsPopupCalendarOpen = false; - this.endTime.Location = new System.Drawing.Point(395, 94); + this.endTime.Location = new System.Drawing.Point(401, 75); // // // @@ -653,7 +640,7 @@ this.endTime.MonthCalendar.TodayButtonVisible = true; this.endTime.Name = "endTime"; this.endTime.ShowUpDown = true; - this.endTime.Size = new System.Drawing.Size(180, 23); + this.endTime.Size = new System.Drawing.Size(210, 23); this.endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.endTime.TabIndex = 44; this.endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -671,7 +658,7 @@ this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.startTime.IsPopupCalendarOpen = false; - this.startTime.Location = new System.Drawing.Point(107, 94); + this.startTime.Location = new System.Drawing.Point(107, 75); // // // @@ -703,7 +690,7 @@ this.startTime.MonthCalendar.TodayButtonVisible = true; this.startTime.Name = "startTime"; this.startTime.ShowUpDown = true; - this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Size = new System.Drawing.Size(200, 23); this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.startTime.TabIndex = 43; this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -711,7 +698,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(290, 92); + this.label3.Location = new System.Drawing.Point(298, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -722,7 +709,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(5, 92); + this.label12.Location = new System.Drawing.Point(5, 73); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -733,7 +720,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(5, 23); + this.label13.Location = new System.Drawing.Point(5, 27); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -749,12 +736,64 @@ this.groupBox2.Controls.Add(this.radio_1s); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Enabled = false; - this.groupBox2.Location = new System.Drawing.Point(9, 353); + this.groupBox2.Location = new System.Drawing.Point(9, 342); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(618, 53); this.groupBox2.TabIndex = 40; this.groupBox2.TabStop = false; // + // radio_100s + // + this.radio_100s.AutoSize = true; + this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_100s.Location = new System.Drawing.Point(468, 19); + this.radio_100s.Name = "radio_100s"; + this.radio_100s.Size = new System.Drawing.Size(57, 24); + this.radio_100s.TabIndex = 47; + this.radio_100s.TabStop = true; + this.radio_100s.Tag = "100"; + this.radio_100s.Text = "100s"; + this.radio_100s.UseVisualStyleBackColor = true; + // + // radio_20s + // + this.radio_20s.AutoSize = true; + this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_20s.Location = new System.Drawing.Point(349, 20); + this.radio_20s.Name = "radio_20s"; + this.radio_20s.Size = new System.Drawing.Size(49, 24); + this.radio_20s.TabIndex = 46; + this.radio_20s.TabStop = true; + this.radio_20s.Tag = "20"; + this.radio_20s.Text = "20s"; + this.radio_20s.UseVisualStyleBackColor = true; + // + // radio_10s + // + this.radio_10s.AutoSize = true; + this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_10s.Location = new System.Drawing.Point(233, 19); + this.radio_10s.Name = "radio_10s"; + this.radio_10s.Size = new System.Drawing.Size(49, 24); + this.radio_10s.TabIndex = 45; + this.radio_10s.TabStop = true; + this.radio_10s.Tag = "10"; + this.radio_10s.Text = "10s"; + this.radio_10s.UseVisualStyleBackColor = true; + // + // radio_1s + // + this.radio_1s.AutoSize = true; + this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_1s.Location = new System.Drawing.Point(115, 20); + this.radio_1s.Name = "radio_1s"; + this.radio_1s.Size = new System.Drawing.Size(41, 24); + this.radio_1s.TabIndex = 44; + this.radio_1s.TabStop = true; + this.radio_1s.Tag = "1"; + this.radio_1s.Text = "1s"; + this.radio_1s.UseVisualStyleBackColor = true; + // // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); @@ -812,58 +851,6 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // - // radio_100s - // - this.radio_100s.AutoSize = true; - this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_100s.Location = new System.Drawing.Point(468, 19); - this.radio_100s.Name = "radio_100s"; - this.radio_100s.Size = new System.Drawing.Size(57, 24); - this.radio_100s.TabIndex = 47; - this.radio_100s.TabStop = true; - this.radio_100s.Tag = "100"; - this.radio_100s.Text = "100s"; - this.radio_100s.UseVisualStyleBackColor = true; - // - // radio_20s - // - this.radio_20s.AutoSize = true; - this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_20s.Location = new System.Drawing.Point(349, 20); - this.radio_20s.Name = "radio_20s"; - this.radio_20s.Size = new System.Drawing.Size(49, 24); - this.radio_20s.TabIndex = 46; - this.radio_20s.TabStop = true; - this.radio_20s.Tag = "20"; - this.radio_20s.Text = "20s"; - this.radio_20s.UseVisualStyleBackColor = true; - // - // radio_10s - // - this.radio_10s.AutoSize = true; - this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_10s.Location = new System.Drawing.Point(233, 19); - this.radio_10s.Name = "radio_10s"; - this.radio_10s.Size = new System.Drawing.Size(49, 24); - this.radio_10s.TabIndex = 45; - this.radio_10s.TabStop = true; - this.radio_10s.Tag = "10"; - this.radio_10s.Text = "10s"; - this.radio_10s.UseVisualStyleBackColor = true; - // - // radio_1s - // - this.radio_1s.AutoSize = true; - this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_1s.Location = new System.Drawing.Point(115, 20); - this.radio_1s.Name = "radio_1s"; - this.radio_1s.Size = new System.Drawing.Size(41, 24); - this.radio_1s.TabIndex = 44; - this.radio_1s.TabStop = true; - this.radio_1s.Tag = "1"; - this.radio_1s.Text = "1s"; - this.radio_1s.UseVisualStyleBackColor = true; - // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -931,7 +918,6 @@ public System.Windows.Forms.CheckBox checkBox_startNow; public DevComponents.Editors.DateTimeAdv.DateTimeInput endTime; public DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; - public System.Windows.Forms.CheckBox checkBox_count; public System.Windows.Forms.CheckBox checkBox_ageRate; public System.Windows.Forms.CheckBox checkBox_bootFeature; public System.Windows.Forms.CheckBox checkBox_accuracy; diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index ecfc137..19169bb 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -3,6 +3,8 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.Tools; using DevComponents.DotNetBar.Controls; using DevComponents.Editors; @@ -36,7 +38,7 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); CounterDataService counterDataService = new CounterDataServiceImpl(); - + SensitivityService sensitivityService = new SensitivityServiceImpl(); public Action HideMaskAction { @@ -53,7 +55,7 @@ cbBox_devType.DisplayMember = "Name"; cbBox_devType.ValueMember = "Code"; - btnSave.Text = "添加"; + btnSave.Text = "保存"; if (HomeCtrlForm.channelFreeList.Count > 0) { cbBox_channelFree.Items.Add(""); @@ -61,12 +63,11 @@ { cbBox_channelFree.Items.Add(item); } - } else { text_channelNo.WatermarkText = "无空闲通道"; - + groupBox1.Enabled = false; } } @@ -116,6 +117,14 @@ return; } } + if (checkBox_accuracy.Checked || checkBox_stability.Checked || checkBox_ageRate.Checked || checkBox_bootFeature.Checked) + { + if (text_channelNo.Text.Trim() == "") + { + MessageBox.Show("请选择通道号!"); + return; + } + } // 取得输入框的参数 string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; @@ -133,64 +142,18 @@ { long deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo); if (deviceId != -1) - { - + { string stability = "-3"; string accuracy = "-3"; string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (checkBox_startNow.Checked || startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1"; } if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (SetDevTestDlg.inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - SetDevTestDlg.inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - counterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - SetDevTestDlg.inDetecCounterId = -1; - - }).Start(); - } - } + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -207,7 +170,7 @@ else if (radio_20s.Checked) interval = "20"; else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text); // 重新加载首页的通道状态 HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -218,7 +181,7 @@ } else { - LogHelper.WriteErrorLog(this.GetType(), "添仪器[" + devName + "]失败"); + LogHelper.WriteErrorLog(this.GetType(), "添加仪器[" + devName + "]失败"); } } else if (labelTitle.Text.Equals("修改")) @@ -256,21 +219,23 @@ private void cbBox_devType_SelectedIndexChanged(object sender, EventArgs e) { - text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; + text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; } private void cbBox_channelFree_SelectedIndexChanged(object sender, EventArgs e) { text_channelNo.Text = cbBox_channelFree.SelectedItem.ToString(); - - if (text_channelNo.Text != "") + if (text_channelNo.Text.Equals("")) { - checkBox_startNow.Enabled = true; - groupBox1.Enabled = true; + groupBox1.Enabled = false; + checkBox_accuracy.Checked = false; + checkBox_stability.Checked = false; + checkBox_ageRate.Checked = false; + checkBox_bootFeature.Checked = false; } else { - groupBox1.Enabled = false; checkBox_startNow.Enabled = false; + groupBox1.Enabled = true; } } diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 29d4d57..7c1cfbc 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -210,16 +210,16 @@ devList = new DataTable(); // 设置表格的列 - devList.Columns.Add("index", Type.GetType("System.String")); - devList.Columns.Add("regTime", Type.GetType("System.String")); - devList.Columns.Add("devName", Type.GetType("System.String")); - devList.Columns.Add("devModel", Type.GetType("System.String")); - devList.Columns.Add("devCode", Type.GetType("System.String")); - devList.Columns.Add("customComp", Type.GetType("System.String")); - devList.Columns.Add("customName", Type.GetType("System.String")); - devList.Columns.Add("status", Type.GetType("System.String")); - devList.Columns.Add("channelNo", Type.GetType("System.String")); - devList.Columns.Add("id", Type.GetType("System.Int64")); + devList.Columns.Add("index", Type.GetType("System.String"));//0 + devList.Columns.Add("regTime", Type.GetType("System.String"));//1 + devList.Columns.Add("devName", Type.GetType("System.String"));//2 + devList.Columns.Add("devModel", Type.GetType("System.String"));//3 + devList.Columns.Add("devCode", Type.GetType("System.String"));//4 + devList.Columns.Add("customComp", Type.GetType("System.String"));//5 + devList.Columns.Add("customName", Type.GetType("System.String"));//6 + devList.Columns.Add("status", Type.GetType("System.String"));//7 + devList.Columns.Add("channelNo", Type.GetType("System.String"));//8 + devList.Columns.Add("id", Type.GetType("System.Int64"));//9 // 分页查询数据库 string devName = ""; @@ -500,10 +500,8 @@ editDlg.inputCustName.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value; editDlg.text_channelNo.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[8].Value; editDlg.btnSave.Text = "保存"; - if (((string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[rowIndex].Cells[7].Value).Equals("检测中")) { - editDlg.btn_downChannelList.Enabled = false; - editDlg.text_channelNo.ReadOnly = true; DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DetectionItem detectionItem = (detectionItemService.search(id, true))[0]; editDlg.groupBox1.Enabled = false; @@ -517,6 +515,10 @@ } if (!detectionItem.BootFeature.Equals("-3")) editDlg.checkBox_bootFeature.Checked = true; if (!detectionItem.AgeRate.Equals("-3")) editDlg.checkBox_ageRate.Checked = true; + editDlg.groupBox2.Enabled = false; + editDlg.groupBox1.Enabled = false; + editDlg.btn_downChannelList.Enabled = false; + editDlg.text_channelNo.Enabled = false; } editDlg.HideMaskAction += () => { @@ -539,7 +541,7 @@ private void btnDelete_Click(object sender, EventArgs e) { - if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[7].Value).Equals("检测中")) { MessageBox.Show("该仪器在检测中,无法删除!"); return; diff --git a/RbFreqStandMeasure/info/ageRate.designer.cs b/RbFreqStandMeasure/info/ageRate.designer.cs index c676897..5780827 100644 --- a/RbFreqStandMeasure/info/ageRate.designer.cs +++ b/RbFreqStandMeasure/info/ageRate.designer.cs @@ -67,7 +67,7 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(316, 8); + this.label1.Location = new System.Drawing.Point(318, 35); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(83, 27); @@ -78,7 +78,7 @@ // this.label4.BackColor = System.Drawing.Color.Transparent; this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(197, 8); + this.label4.Location = new System.Drawing.Point(199, 35); this.label4.Margin = new System.Windows.Forms.Padding(0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(119, 27); @@ -115,7 +115,7 @@ this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label3.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label3.Location = new System.Drawing.Point(316, 35); + this.label3.Location = new System.Drawing.Point(318, 8); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(83, 27); @@ -126,7 +126,7 @@ // this.label5.BackColor = System.Drawing.Color.Transparent; this.label5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label5.Location = new System.Drawing.Point(229, 35); + this.label5.Location = new System.Drawing.Point(231, 8); this.label5.Margin = new System.Windows.Forms.Padding(0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(87, 27); diff --git a/RbFreqStandMeasure/info/stability.designer.cs b/RbFreqStandMeasure/info/stability.designer.cs index 63e8678..791a330 100644 --- a/RbFreqStandMeasure/info/stability.designer.cs +++ b/RbFreqStandMeasure/info/stability.designer.cs @@ -32,8 +32,6 @@ this.label_devModel = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // label_customerName @@ -41,7 +39,7 @@ this.label_customerName.BackColor = System.Drawing.Color.Transparent; this.label_customerName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_customerName.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label_customerName.Location = new System.Drawing.Point(197, 126); + this.label_customerName.Location = new System.Drawing.Point(197, 91); this.label_customerName.Margin = new System.Windows.Forms.Padding(0); this.label_customerName.Name = "label_customerName"; this.label_customerName.Size = new System.Drawing.Size(83, 27); @@ -64,7 +62,7 @@ // this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(110, 126); + this.label2.Location = new System.Drawing.Point(110, 91); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(87, 27); @@ -84,36 +82,10 @@ this.label9.Text = "测量结果:"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(197, 82); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(83, 27); - this.label1.TabIndex = 86; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label4 - // - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(110, 82); - this.label4.Margin = new System.Windows.Forms.Padding(0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(87, 27); - this.label4.TabIndex = 85; - this.label4.Text = "标准偏差:"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // // stability // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.White; - this.Controls.Add(this.label1); - this.Controls.Add(this.label4); this.Controls.Add(this.label_customerName); this.Controls.Add(this.label_devModel); this.Controls.Add(this.label2); @@ -129,7 +101,5 @@ private System.Windows.Forms.Label label_devModel; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label4; } } diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 2007aeb..164d277 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -22,6 +22,9 @@ CounterDataService CounterDataService = new CounterDataServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); #region 无边框拖动效果/最小化窗口/关闭窗口 [DllImport("user32.dll")]//拖动无窗体的控件 @@ -49,16 +52,13 @@ { InitializeComponent(); timePicker_startTime.Value = DateTime.Now; - timePicker_startTime.MinDate = DateTime.Now; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; + timePicker_startTime.MinDate = DateTime.Now; } // 开始检测 private void btnSave_Click(object sender, EventArgs e) { - if(!text_devType.Text.Equals("计数器") && text_channelNo.Text.Equals("")) + if(!text_devType.Text.Equals("频率计数器") && text_channelNo.Text.Equals("")) { MessageBox.Show("请选择通道!"); return; @@ -68,7 +68,7 @@ MessageBox.Show("请选择频率稳定度采样时间!"); return; } - if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked && !checkBox_count.Checked) + if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked ) { MessageBox.Show("请选择检测项目!"); return; @@ -86,50 +86,6 @@ if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - CounterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - inDetecCounterId = -1; - - }).Start(); - } - } } else { @@ -137,7 +93,6 @@ if (checkBox_accuracy.Checked) accuracy = "-2"; if (checkBox_bootFeature.Checked) bootFeature = "-2"; if (checkBox_ageRate.Checked) ageRate = "-2"; - if (checkBox_count.Checked) counterDetec = "-2"; } if (checkBox_stability.Checked) @@ -149,7 +104,7 @@ } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text); this.HideMaskAction(); @@ -254,5 +209,7 @@ { getEndTime(); } + + } } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 7f555e1..4f3e7b8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -64,7 +64,6 @@ this.channel4 = new DevComponents.Editors.ComboItem(); this.channel5 = new DevComponents.Editors.ComboItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.checkBox_ageRate = new System.Windows.Forms.CheckBox(); this.checkBox_bootFeature = new System.Windows.Forms.CheckBox(); this.checkBox_accuracy = new System.Windows.Forms.CheckBox(); @@ -75,13 +74,13 @@ this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label6 = new System.Windows.Forms.Label(); - this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.radio_100s = new System.Windows.Forms.RadioButton(); this.radio_20s = new System.Windows.Forms.RadioButton(); this.radio_10s = new System.Windows.Forms.RadioButton(); this.radio_1s = new System.Windows.Forms.RadioButton(); + this.label6 = new System.Windows.Forms.Label(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -534,7 +533,6 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.checkBox_count); this.groupBox1.Controls.Add(this.checkBox_ageRate); this.groupBox1.Controls.Add(this.checkBox_bootFeature); this.groupBox1.Controls.Add(this.checkBox_accuracy); @@ -547,27 +545,16 @@ this.groupBox1.Enabled = false; this.groupBox1.Location = new System.Drawing.Point(10, 210); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(617, 140); + this.groupBox1.Size = new System.Drawing.Size(617, 127); this.groupBox1.TabIndex = 39; this.groupBox1.TabStop = false; this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(114, 55); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 351; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // checkBox_ageRate // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(467, 25); + this.checkBox_ageRate.Location = new System.Drawing.Point(467, 29); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 350; @@ -578,7 +565,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 25); + this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 29); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 349; @@ -589,7 +576,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(232, 25); + this.checkBox_accuracy.Location = new System.Drawing.Point(232, 29); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 347; @@ -600,7 +587,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(114, 25); + this.checkBox_stability.Location = new System.Drawing.Point(114, 29); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 348; @@ -621,7 +608,7 @@ this.endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.endTime.IsPopupCalendarOpen = false; - this.endTime.Location = new System.Drawing.Point(395, 94); + this.endTime.Location = new System.Drawing.Point(401, 75); // // // @@ -653,7 +640,7 @@ this.endTime.MonthCalendar.TodayButtonVisible = true; this.endTime.Name = "endTime"; this.endTime.ShowUpDown = true; - this.endTime.Size = new System.Drawing.Size(180, 23); + this.endTime.Size = new System.Drawing.Size(210, 23); this.endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.endTime.TabIndex = 44; this.endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -671,7 +658,7 @@ this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.startTime.IsPopupCalendarOpen = false; - this.startTime.Location = new System.Drawing.Point(107, 94); + this.startTime.Location = new System.Drawing.Point(107, 75); // // // @@ -703,7 +690,7 @@ this.startTime.MonthCalendar.TodayButtonVisible = true; this.startTime.Name = "startTime"; this.startTime.ShowUpDown = true; - this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Size = new System.Drawing.Size(200, 23); this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.startTime.TabIndex = 43; this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -711,7 +698,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(290, 92); + this.label3.Location = new System.Drawing.Point(298, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -722,7 +709,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(5, 92); + this.label12.Location = new System.Drawing.Point(5, 73); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -733,7 +720,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(5, 23); + this.label13.Location = new System.Drawing.Point(5, 27); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -749,12 +736,64 @@ this.groupBox2.Controls.Add(this.radio_1s); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Enabled = false; - this.groupBox2.Location = new System.Drawing.Point(9, 353); + this.groupBox2.Location = new System.Drawing.Point(9, 342); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(618, 53); this.groupBox2.TabIndex = 40; this.groupBox2.TabStop = false; // + // radio_100s + // + this.radio_100s.AutoSize = true; + this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_100s.Location = new System.Drawing.Point(468, 19); + this.radio_100s.Name = "radio_100s"; + this.radio_100s.Size = new System.Drawing.Size(57, 24); + this.radio_100s.TabIndex = 47; + this.radio_100s.TabStop = true; + this.radio_100s.Tag = "100"; + this.radio_100s.Text = "100s"; + this.radio_100s.UseVisualStyleBackColor = true; + // + // radio_20s + // + this.radio_20s.AutoSize = true; + this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_20s.Location = new System.Drawing.Point(349, 20); + this.radio_20s.Name = "radio_20s"; + this.radio_20s.Size = new System.Drawing.Size(49, 24); + this.radio_20s.TabIndex = 46; + this.radio_20s.TabStop = true; + this.radio_20s.Tag = "20"; + this.radio_20s.Text = "20s"; + this.radio_20s.UseVisualStyleBackColor = true; + // + // radio_10s + // + this.radio_10s.AutoSize = true; + this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_10s.Location = new System.Drawing.Point(233, 19); + this.radio_10s.Name = "radio_10s"; + this.radio_10s.Size = new System.Drawing.Size(49, 24); + this.radio_10s.TabIndex = 45; + this.radio_10s.TabStop = true; + this.radio_10s.Tag = "10"; + this.radio_10s.Text = "10s"; + this.radio_10s.UseVisualStyleBackColor = true; + // + // radio_1s + // + this.radio_1s.AutoSize = true; + this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_1s.Location = new System.Drawing.Point(115, 20); + this.radio_1s.Name = "radio_1s"; + this.radio_1s.Size = new System.Drawing.Size(41, 24); + this.radio_1s.TabIndex = 44; + this.radio_1s.TabStop = true; + this.radio_1s.Tag = "1"; + this.radio_1s.Text = "1s"; + this.radio_1s.UseVisualStyleBackColor = true; + // // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); @@ -812,58 +851,6 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // - // radio_100s - // - this.radio_100s.AutoSize = true; - this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_100s.Location = new System.Drawing.Point(468, 19); - this.radio_100s.Name = "radio_100s"; - this.radio_100s.Size = new System.Drawing.Size(57, 24); - this.radio_100s.TabIndex = 47; - this.radio_100s.TabStop = true; - this.radio_100s.Tag = "100"; - this.radio_100s.Text = "100s"; - this.radio_100s.UseVisualStyleBackColor = true; - // - // radio_20s - // - this.radio_20s.AutoSize = true; - this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_20s.Location = new System.Drawing.Point(349, 20); - this.radio_20s.Name = "radio_20s"; - this.radio_20s.Size = new System.Drawing.Size(49, 24); - this.radio_20s.TabIndex = 46; - this.radio_20s.TabStop = true; - this.radio_20s.Tag = "20"; - this.radio_20s.Text = "20s"; - this.radio_20s.UseVisualStyleBackColor = true; - // - // radio_10s - // - this.radio_10s.AutoSize = true; - this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_10s.Location = new System.Drawing.Point(233, 19); - this.radio_10s.Name = "radio_10s"; - this.radio_10s.Size = new System.Drawing.Size(49, 24); - this.radio_10s.TabIndex = 45; - this.radio_10s.TabStop = true; - this.radio_10s.Tag = "10"; - this.radio_10s.Text = "10s"; - this.radio_10s.UseVisualStyleBackColor = true; - // - // radio_1s - // - this.radio_1s.AutoSize = true; - this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_1s.Location = new System.Drawing.Point(115, 20); - this.radio_1s.Name = "radio_1s"; - this.radio_1s.Size = new System.Drawing.Size(41, 24); - this.radio_1s.TabIndex = 44; - this.radio_1s.TabStop = true; - this.radio_1s.Tag = "1"; - this.radio_1s.Text = "1s"; - this.radio_1s.UseVisualStyleBackColor = true; - // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -931,7 +918,6 @@ public System.Windows.Forms.CheckBox checkBox_startNow; public DevComponents.Editors.DateTimeAdv.DateTimeInput endTime; public DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; - public System.Windows.Forms.CheckBox checkBox_count; public System.Windows.Forms.CheckBox checkBox_ageRate; public System.Windows.Forms.CheckBox checkBox_bootFeature; public System.Windows.Forms.CheckBox checkBox_accuracy; diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index ecfc137..19169bb 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -3,6 +3,8 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.Tools; using DevComponents.DotNetBar.Controls; using DevComponents.Editors; @@ -36,7 +38,7 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); CounterDataService counterDataService = new CounterDataServiceImpl(); - + SensitivityService sensitivityService = new SensitivityServiceImpl(); public Action HideMaskAction { @@ -53,7 +55,7 @@ cbBox_devType.DisplayMember = "Name"; cbBox_devType.ValueMember = "Code"; - btnSave.Text = "添加"; + btnSave.Text = "保存"; if (HomeCtrlForm.channelFreeList.Count > 0) { cbBox_channelFree.Items.Add(""); @@ -61,12 +63,11 @@ { cbBox_channelFree.Items.Add(item); } - } else { text_channelNo.WatermarkText = "无空闲通道"; - + groupBox1.Enabled = false; } } @@ -116,6 +117,14 @@ return; } } + if (checkBox_accuracy.Checked || checkBox_stability.Checked || checkBox_ageRate.Checked || checkBox_bootFeature.Checked) + { + if (text_channelNo.Text.Trim() == "") + { + MessageBox.Show("请选择通道号!"); + return; + } + } // 取得输入框的参数 string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; @@ -133,64 +142,18 @@ { long deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo); if (deviceId != -1) - { - + { string stability = "-3"; string accuracy = "-3"; string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (checkBox_startNow.Checked || startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1"; } if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (SetDevTestDlg.inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - SetDevTestDlg.inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - counterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - SetDevTestDlg.inDetecCounterId = -1; - - }).Start(); - } - } + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -207,7 +170,7 @@ else if (radio_20s.Checked) interval = "20"; else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text); // 重新加载首页的通道状态 HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -218,7 +181,7 @@ } else { - LogHelper.WriteErrorLog(this.GetType(), "添仪器[" + devName + "]失败"); + LogHelper.WriteErrorLog(this.GetType(), "添加仪器[" + devName + "]失败"); } } else if (labelTitle.Text.Equals("修改")) @@ -256,21 +219,23 @@ private void cbBox_devType_SelectedIndexChanged(object sender, EventArgs e) { - text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; + text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; } private void cbBox_channelFree_SelectedIndexChanged(object sender, EventArgs e) { text_channelNo.Text = cbBox_channelFree.SelectedItem.ToString(); - - if (text_channelNo.Text != "") + if (text_channelNo.Text.Equals("")) { - checkBox_startNow.Enabled = true; - groupBox1.Enabled = true; + groupBox1.Enabled = false; + checkBox_accuracy.Checked = false; + checkBox_stability.Checked = false; + checkBox_ageRate.Checked = false; + checkBox_bootFeature.Checked = false; } else { - groupBox1.Enabled = false; checkBox_startNow.Enabled = false; + groupBox1.Enabled = true; } } diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 29d4d57..7c1cfbc 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -210,16 +210,16 @@ devList = new DataTable(); // 设置表格的列 - devList.Columns.Add("index", Type.GetType("System.String")); - devList.Columns.Add("regTime", Type.GetType("System.String")); - devList.Columns.Add("devName", Type.GetType("System.String")); - devList.Columns.Add("devModel", Type.GetType("System.String")); - devList.Columns.Add("devCode", Type.GetType("System.String")); - devList.Columns.Add("customComp", Type.GetType("System.String")); - devList.Columns.Add("customName", Type.GetType("System.String")); - devList.Columns.Add("status", Type.GetType("System.String")); - devList.Columns.Add("channelNo", Type.GetType("System.String")); - devList.Columns.Add("id", Type.GetType("System.Int64")); + devList.Columns.Add("index", Type.GetType("System.String"));//0 + devList.Columns.Add("regTime", Type.GetType("System.String"));//1 + devList.Columns.Add("devName", Type.GetType("System.String"));//2 + devList.Columns.Add("devModel", Type.GetType("System.String"));//3 + devList.Columns.Add("devCode", Type.GetType("System.String"));//4 + devList.Columns.Add("customComp", Type.GetType("System.String"));//5 + devList.Columns.Add("customName", Type.GetType("System.String"));//6 + devList.Columns.Add("status", Type.GetType("System.String"));//7 + devList.Columns.Add("channelNo", Type.GetType("System.String"));//8 + devList.Columns.Add("id", Type.GetType("System.Int64"));//9 // 分页查询数据库 string devName = ""; @@ -500,10 +500,8 @@ editDlg.inputCustName.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value; editDlg.text_channelNo.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[8].Value; editDlg.btnSave.Text = "保存"; - if (((string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[rowIndex].Cells[7].Value).Equals("检测中")) { - editDlg.btn_downChannelList.Enabled = false; - editDlg.text_channelNo.ReadOnly = true; DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DetectionItem detectionItem = (detectionItemService.search(id, true))[0]; editDlg.groupBox1.Enabled = false; @@ -517,6 +515,10 @@ } if (!detectionItem.BootFeature.Equals("-3")) editDlg.checkBox_bootFeature.Checked = true; if (!detectionItem.AgeRate.Equals("-3")) editDlg.checkBox_ageRate.Checked = true; + editDlg.groupBox2.Enabled = false; + editDlg.groupBox1.Enabled = false; + editDlg.btn_downChannelList.Enabled = false; + editDlg.text_channelNo.Enabled = false; } editDlg.HideMaskAction += () => { @@ -539,7 +541,7 @@ private void btnDelete_Click(object sender, EventArgs e) { - if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[7].Value).Equals("检测中")) { MessageBox.Show("该仪器在检测中,无法删除!"); return; diff --git a/RbFreqStandMeasure/info/ageRate.designer.cs b/RbFreqStandMeasure/info/ageRate.designer.cs index c676897..5780827 100644 --- a/RbFreqStandMeasure/info/ageRate.designer.cs +++ b/RbFreqStandMeasure/info/ageRate.designer.cs @@ -67,7 +67,7 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(316, 8); + this.label1.Location = new System.Drawing.Point(318, 35); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(83, 27); @@ -78,7 +78,7 @@ // this.label4.BackColor = System.Drawing.Color.Transparent; this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(197, 8); + this.label4.Location = new System.Drawing.Point(199, 35); this.label4.Margin = new System.Windows.Forms.Padding(0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(119, 27); @@ -115,7 +115,7 @@ this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label3.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label3.Location = new System.Drawing.Point(316, 35); + this.label3.Location = new System.Drawing.Point(318, 8); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(83, 27); @@ -126,7 +126,7 @@ // this.label5.BackColor = System.Drawing.Color.Transparent; this.label5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label5.Location = new System.Drawing.Point(229, 35); + this.label5.Location = new System.Drawing.Point(231, 8); this.label5.Margin = new System.Windows.Forms.Padding(0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(87, 27); diff --git a/RbFreqStandMeasure/info/stability.designer.cs b/RbFreqStandMeasure/info/stability.designer.cs index 63e8678..791a330 100644 --- a/RbFreqStandMeasure/info/stability.designer.cs +++ b/RbFreqStandMeasure/info/stability.designer.cs @@ -32,8 +32,6 @@ this.label_devModel = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // label_customerName @@ -41,7 +39,7 @@ this.label_customerName.BackColor = System.Drawing.Color.Transparent; this.label_customerName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_customerName.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label_customerName.Location = new System.Drawing.Point(197, 126); + this.label_customerName.Location = new System.Drawing.Point(197, 91); this.label_customerName.Margin = new System.Windows.Forms.Padding(0); this.label_customerName.Name = "label_customerName"; this.label_customerName.Size = new System.Drawing.Size(83, 27); @@ -64,7 +62,7 @@ // this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(110, 126); + this.label2.Location = new System.Drawing.Point(110, 91); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(87, 27); @@ -84,36 +82,10 @@ this.label9.Text = "测量结果:"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(197, 82); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(83, 27); - this.label1.TabIndex = 86; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label4 - // - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(110, 82); - this.label4.Margin = new System.Windows.Forms.Padding(0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(87, 27); - this.label4.TabIndex = 85; - this.label4.Text = "标准偏差:"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // // stability // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.White; - this.Controls.Add(this.label1); - this.Controls.Add(this.label4); this.Controls.Add(this.label_customerName); this.Controls.Add(this.label_devModel); this.Controls.Add(this.label2); @@ -129,7 +101,5 @@ private System.Windows.Forms.Label label_devModel; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label4; } } diff --git a/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs b/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs index 360b1eb..eefaa8d 100644 --- a/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs @@ -480,7 +480,7 @@ this.label11.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label11.Location = new System.Drawing.Point(801, 89); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(45, 30); + this.label11.Size = new System.Drawing.Size(64, 30); this.label11.TabIndex = 16; this.label11.Text = "VRMS"; this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -554,7 +554,7 @@ this.label6.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label6.Location = new System.Drawing.Point(801, 39); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(45, 30); + this.label6.Size = new System.Drawing.Size(64, 30); this.label6.TabIndex = 10; this.label6.Text = "VRMS"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 2007aeb..164d277 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -22,6 +22,9 @@ CounterDataService CounterDataService = new CounterDataServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); #region 无边框拖动效果/最小化窗口/关闭窗口 [DllImport("user32.dll")]//拖动无窗体的控件 @@ -49,16 +52,13 @@ { InitializeComponent(); timePicker_startTime.Value = DateTime.Now; - timePicker_startTime.MinDate = DateTime.Now; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; + timePicker_startTime.MinDate = DateTime.Now; } // 开始检测 private void btnSave_Click(object sender, EventArgs e) { - if(!text_devType.Text.Equals("计数器") && text_channelNo.Text.Equals("")) + if(!text_devType.Text.Equals("频率计数器") && text_channelNo.Text.Equals("")) { MessageBox.Show("请选择通道!"); return; @@ -68,7 +68,7 @@ MessageBox.Show("请选择频率稳定度采样时间!"); return; } - if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked && !checkBox_count.Checked) + if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked ) { MessageBox.Show("请选择检测项目!"); return; @@ -86,50 +86,6 @@ if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - CounterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - inDetecCounterId = -1; - - }).Start(); - } - } } else { @@ -137,7 +93,6 @@ if (checkBox_accuracy.Checked) accuracy = "-2"; if (checkBox_bootFeature.Checked) bootFeature = "-2"; if (checkBox_ageRate.Checked) ageRate = "-2"; - if (checkBox_count.Checked) counterDetec = "-2"; } if (checkBox_stability.Checked) @@ -149,7 +104,7 @@ } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text); this.HideMaskAction(); @@ -254,5 +209,7 @@ { getEndTime(); } + + } } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 7f555e1..4f3e7b8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -64,7 +64,6 @@ this.channel4 = new DevComponents.Editors.ComboItem(); this.channel5 = new DevComponents.Editors.ComboItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.checkBox_ageRate = new System.Windows.Forms.CheckBox(); this.checkBox_bootFeature = new System.Windows.Forms.CheckBox(); this.checkBox_accuracy = new System.Windows.Forms.CheckBox(); @@ -75,13 +74,13 @@ this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label6 = new System.Windows.Forms.Label(); - this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.radio_100s = new System.Windows.Forms.RadioButton(); this.radio_20s = new System.Windows.Forms.RadioButton(); this.radio_10s = new System.Windows.Forms.RadioButton(); this.radio_1s = new System.Windows.Forms.RadioButton(); + this.label6 = new System.Windows.Forms.Label(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -534,7 +533,6 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.checkBox_count); this.groupBox1.Controls.Add(this.checkBox_ageRate); this.groupBox1.Controls.Add(this.checkBox_bootFeature); this.groupBox1.Controls.Add(this.checkBox_accuracy); @@ -547,27 +545,16 @@ this.groupBox1.Enabled = false; this.groupBox1.Location = new System.Drawing.Point(10, 210); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(617, 140); + this.groupBox1.Size = new System.Drawing.Size(617, 127); this.groupBox1.TabIndex = 39; this.groupBox1.TabStop = false; this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(114, 55); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 351; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // checkBox_ageRate // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(467, 25); + this.checkBox_ageRate.Location = new System.Drawing.Point(467, 29); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 350; @@ -578,7 +565,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 25); + this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 29); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 349; @@ -589,7 +576,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(232, 25); + this.checkBox_accuracy.Location = new System.Drawing.Point(232, 29); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 347; @@ -600,7 +587,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(114, 25); + this.checkBox_stability.Location = new System.Drawing.Point(114, 29); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 348; @@ -621,7 +608,7 @@ this.endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.endTime.IsPopupCalendarOpen = false; - this.endTime.Location = new System.Drawing.Point(395, 94); + this.endTime.Location = new System.Drawing.Point(401, 75); // // // @@ -653,7 +640,7 @@ this.endTime.MonthCalendar.TodayButtonVisible = true; this.endTime.Name = "endTime"; this.endTime.ShowUpDown = true; - this.endTime.Size = new System.Drawing.Size(180, 23); + this.endTime.Size = new System.Drawing.Size(210, 23); this.endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.endTime.TabIndex = 44; this.endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -671,7 +658,7 @@ this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.startTime.IsPopupCalendarOpen = false; - this.startTime.Location = new System.Drawing.Point(107, 94); + this.startTime.Location = new System.Drawing.Point(107, 75); // // // @@ -703,7 +690,7 @@ this.startTime.MonthCalendar.TodayButtonVisible = true; this.startTime.Name = "startTime"; this.startTime.ShowUpDown = true; - this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Size = new System.Drawing.Size(200, 23); this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.startTime.TabIndex = 43; this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -711,7 +698,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(290, 92); + this.label3.Location = new System.Drawing.Point(298, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -722,7 +709,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(5, 92); + this.label12.Location = new System.Drawing.Point(5, 73); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -733,7 +720,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(5, 23); + this.label13.Location = new System.Drawing.Point(5, 27); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -749,12 +736,64 @@ this.groupBox2.Controls.Add(this.radio_1s); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Enabled = false; - this.groupBox2.Location = new System.Drawing.Point(9, 353); + this.groupBox2.Location = new System.Drawing.Point(9, 342); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(618, 53); this.groupBox2.TabIndex = 40; this.groupBox2.TabStop = false; // + // radio_100s + // + this.radio_100s.AutoSize = true; + this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_100s.Location = new System.Drawing.Point(468, 19); + this.radio_100s.Name = "radio_100s"; + this.radio_100s.Size = new System.Drawing.Size(57, 24); + this.radio_100s.TabIndex = 47; + this.radio_100s.TabStop = true; + this.radio_100s.Tag = "100"; + this.radio_100s.Text = "100s"; + this.radio_100s.UseVisualStyleBackColor = true; + // + // radio_20s + // + this.radio_20s.AutoSize = true; + this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_20s.Location = new System.Drawing.Point(349, 20); + this.radio_20s.Name = "radio_20s"; + this.radio_20s.Size = new System.Drawing.Size(49, 24); + this.radio_20s.TabIndex = 46; + this.radio_20s.TabStop = true; + this.radio_20s.Tag = "20"; + this.radio_20s.Text = "20s"; + this.radio_20s.UseVisualStyleBackColor = true; + // + // radio_10s + // + this.radio_10s.AutoSize = true; + this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_10s.Location = new System.Drawing.Point(233, 19); + this.radio_10s.Name = "radio_10s"; + this.radio_10s.Size = new System.Drawing.Size(49, 24); + this.radio_10s.TabIndex = 45; + this.radio_10s.TabStop = true; + this.radio_10s.Tag = "10"; + this.radio_10s.Text = "10s"; + this.radio_10s.UseVisualStyleBackColor = true; + // + // radio_1s + // + this.radio_1s.AutoSize = true; + this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_1s.Location = new System.Drawing.Point(115, 20); + this.radio_1s.Name = "radio_1s"; + this.radio_1s.Size = new System.Drawing.Size(41, 24); + this.radio_1s.TabIndex = 44; + this.radio_1s.TabStop = true; + this.radio_1s.Tag = "1"; + this.radio_1s.Text = "1s"; + this.radio_1s.UseVisualStyleBackColor = true; + // // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); @@ -812,58 +851,6 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // - // radio_100s - // - this.radio_100s.AutoSize = true; - this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_100s.Location = new System.Drawing.Point(468, 19); - this.radio_100s.Name = "radio_100s"; - this.radio_100s.Size = new System.Drawing.Size(57, 24); - this.radio_100s.TabIndex = 47; - this.radio_100s.TabStop = true; - this.radio_100s.Tag = "100"; - this.radio_100s.Text = "100s"; - this.radio_100s.UseVisualStyleBackColor = true; - // - // radio_20s - // - this.radio_20s.AutoSize = true; - this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_20s.Location = new System.Drawing.Point(349, 20); - this.radio_20s.Name = "radio_20s"; - this.radio_20s.Size = new System.Drawing.Size(49, 24); - this.radio_20s.TabIndex = 46; - this.radio_20s.TabStop = true; - this.radio_20s.Tag = "20"; - this.radio_20s.Text = "20s"; - this.radio_20s.UseVisualStyleBackColor = true; - // - // radio_10s - // - this.radio_10s.AutoSize = true; - this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_10s.Location = new System.Drawing.Point(233, 19); - this.radio_10s.Name = "radio_10s"; - this.radio_10s.Size = new System.Drawing.Size(49, 24); - this.radio_10s.TabIndex = 45; - this.radio_10s.TabStop = true; - this.radio_10s.Tag = "10"; - this.radio_10s.Text = "10s"; - this.radio_10s.UseVisualStyleBackColor = true; - // - // radio_1s - // - this.radio_1s.AutoSize = true; - this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_1s.Location = new System.Drawing.Point(115, 20); - this.radio_1s.Name = "radio_1s"; - this.radio_1s.Size = new System.Drawing.Size(41, 24); - this.radio_1s.TabIndex = 44; - this.radio_1s.TabStop = true; - this.radio_1s.Tag = "1"; - this.radio_1s.Text = "1s"; - this.radio_1s.UseVisualStyleBackColor = true; - // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -931,7 +918,6 @@ public System.Windows.Forms.CheckBox checkBox_startNow; public DevComponents.Editors.DateTimeAdv.DateTimeInput endTime; public DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; - public System.Windows.Forms.CheckBox checkBox_count; public System.Windows.Forms.CheckBox checkBox_ageRate; public System.Windows.Forms.CheckBox checkBox_bootFeature; public System.Windows.Forms.CheckBox checkBox_accuracy; diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index ecfc137..19169bb 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -3,6 +3,8 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.Tools; using DevComponents.DotNetBar.Controls; using DevComponents.Editors; @@ -36,7 +38,7 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); CounterDataService counterDataService = new CounterDataServiceImpl(); - + SensitivityService sensitivityService = new SensitivityServiceImpl(); public Action HideMaskAction { @@ -53,7 +55,7 @@ cbBox_devType.DisplayMember = "Name"; cbBox_devType.ValueMember = "Code"; - btnSave.Text = "添加"; + btnSave.Text = "保存"; if (HomeCtrlForm.channelFreeList.Count > 0) { cbBox_channelFree.Items.Add(""); @@ -61,12 +63,11 @@ { cbBox_channelFree.Items.Add(item); } - } else { text_channelNo.WatermarkText = "无空闲通道"; - + groupBox1.Enabled = false; } } @@ -116,6 +117,14 @@ return; } } + if (checkBox_accuracy.Checked || checkBox_stability.Checked || checkBox_ageRate.Checked || checkBox_bootFeature.Checked) + { + if (text_channelNo.Text.Trim() == "") + { + MessageBox.Show("请选择通道号!"); + return; + } + } // 取得输入框的参数 string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; @@ -133,64 +142,18 @@ { long deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo); if (deviceId != -1) - { - + { string stability = "-3"; string accuracy = "-3"; string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (checkBox_startNow.Checked || startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1"; } if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (SetDevTestDlg.inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - SetDevTestDlg.inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - counterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - SetDevTestDlg.inDetecCounterId = -1; - - }).Start(); - } - } + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -207,7 +170,7 @@ else if (radio_20s.Checked) interval = "20"; else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text); // 重新加载首页的通道状态 HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -218,7 +181,7 @@ } else { - LogHelper.WriteErrorLog(this.GetType(), "添仪器[" + devName + "]失败"); + LogHelper.WriteErrorLog(this.GetType(), "添加仪器[" + devName + "]失败"); } } else if (labelTitle.Text.Equals("修改")) @@ -256,21 +219,23 @@ private void cbBox_devType_SelectedIndexChanged(object sender, EventArgs e) { - text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; + text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; } private void cbBox_channelFree_SelectedIndexChanged(object sender, EventArgs e) { text_channelNo.Text = cbBox_channelFree.SelectedItem.ToString(); - - if (text_channelNo.Text != "") + if (text_channelNo.Text.Equals("")) { - checkBox_startNow.Enabled = true; - groupBox1.Enabled = true; + groupBox1.Enabled = false; + checkBox_accuracy.Checked = false; + checkBox_stability.Checked = false; + checkBox_ageRate.Checked = false; + checkBox_bootFeature.Checked = false; } else { - groupBox1.Enabled = false; checkBox_startNow.Enabled = false; + groupBox1.Enabled = true; } } diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 29d4d57..7c1cfbc 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -210,16 +210,16 @@ devList = new DataTable(); // 设置表格的列 - devList.Columns.Add("index", Type.GetType("System.String")); - devList.Columns.Add("regTime", Type.GetType("System.String")); - devList.Columns.Add("devName", Type.GetType("System.String")); - devList.Columns.Add("devModel", Type.GetType("System.String")); - devList.Columns.Add("devCode", Type.GetType("System.String")); - devList.Columns.Add("customComp", Type.GetType("System.String")); - devList.Columns.Add("customName", Type.GetType("System.String")); - devList.Columns.Add("status", Type.GetType("System.String")); - devList.Columns.Add("channelNo", Type.GetType("System.String")); - devList.Columns.Add("id", Type.GetType("System.Int64")); + devList.Columns.Add("index", Type.GetType("System.String"));//0 + devList.Columns.Add("regTime", Type.GetType("System.String"));//1 + devList.Columns.Add("devName", Type.GetType("System.String"));//2 + devList.Columns.Add("devModel", Type.GetType("System.String"));//3 + devList.Columns.Add("devCode", Type.GetType("System.String"));//4 + devList.Columns.Add("customComp", Type.GetType("System.String"));//5 + devList.Columns.Add("customName", Type.GetType("System.String"));//6 + devList.Columns.Add("status", Type.GetType("System.String"));//7 + devList.Columns.Add("channelNo", Type.GetType("System.String"));//8 + devList.Columns.Add("id", Type.GetType("System.Int64"));//9 // 分页查询数据库 string devName = ""; @@ -500,10 +500,8 @@ editDlg.inputCustName.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value; editDlg.text_channelNo.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[8].Value; editDlg.btnSave.Text = "保存"; - if (((string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[rowIndex].Cells[7].Value).Equals("检测中")) { - editDlg.btn_downChannelList.Enabled = false; - editDlg.text_channelNo.ReadOnly = true; DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DetectionItem detectionItem = (detectionItemService.search(id, true))[0]; editDlg.groupBox1.Enabled = false; @@ -517,6 +515,10 @@ } if (!detectionItem.BootFeature.Equals("-3")) editDlg.checkBox_bootFeature.Checked = true; if (!detectionItem.AgeRate.Equals("-3")) editDlg.checkBox_ageRate.Checked = true; + editDlg.groupBox2.Enabled = false; + editDlg.groupBox1.Enabled = false; + editDlg.btn_downChannelList.Enabled = false; + editDlg.text_channelNo.Enabled = false; } editDlg.HideMaskAction += () => { @@ -539,7 +541,7 @@ private void btnDelete_Click(object sender, EventArgs e) { - if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[7].Value).Equals("检测中")) { MessageBox.Show("该仪器在检测中,无法删除!"); return; diff --git a/RbFreqStandMeasure/info/ageRate.designer.cs b/RbFreqStandMeasure/info/ageRate.designer.cs index c676897..5780827 100644 --- a/RbFreqStandMeasure/info/ageRate.designer.cs +++ b/RbFreqStandMeasure/info/ageRate.designer.cs @@ -67,7 +67,7 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(316, 8); + this.label1.Location = new System.Drawing.Point(318, 35); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(83, 27); @@ -78,7 +78,7 @@ // this.label4.BackColor = System.Drawing.Color.Transparent; this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(197, 8); + this.label4.Location = new System.Drawing.Point(199, 35); this.label4.Margin = new System.Windows.Forms.Padding(0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(119, 27); @@ -115,7 +115,7 @@ this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label3.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label3.Location = new System.Drawing.Point(316, 35); + this.label3.Location = new System.Drawing.Point(318, 8); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(83, 27); @@ -126,7 +126,7 @@ // this.label5.BackColor = System.Drawing.Color.Transparent; this.label5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label5.Location = new System.Drawing.Point(229, 35); + this.label5.Location = new System.Drawing.Point(231, 8); this.label5.Margin = new System.Windows.Forms.Padding(0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(87, 27); diff --git a/RbFreqStandMeasure/info/stability.designer.cs b/RbFreqStandMeasure/info/stability.designer.cs index 63e8678..791a330 100644 --- a/RbFreqStandMeasure/info/stability.designer.cs +++ b/RbFreqStandMeasure/info/stability.designer.cs @@ -32,8 +32,6 @@ this.label_devModel = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // label_customerName @@ -41,7 +39,7 @@ this.label_customerName.BackColor = System.Drawing.Color.Transparent; this.label_customerName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_customerName.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label_customerName.Location = new System.Drawing.Point(197, 126); + this.label_customerName.Location = new System.Drawing.Point(197, 91); this.label_customerName.Margin = new System.Windows.Forms.Padding(0); this.label_customerName.Name = "label_customerName"; this.label_customerName.Size = new System.Drawing.Size(83, 27); @@ -64,7 +62,7 @@ // this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(110, 126); + this.label2.Location = new System.Drawing.Point(110, 91); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(87, 27); @@ -84,36 +82,10 @@ this.label9.Text = "测量结果:"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(197, 82); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(83, 27); - this.label1.TabIndex = 86; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label4 - // - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(110, 82); - this.label4.Margin = new System.Windows.Forms.Padding(0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(87, 27); - this.label4.TabIndex = 85; - this.label4.Text = "标准偏差:"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // // stability // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.White; - this.Controls.Add(this.label1); - this.Controls.Add(this.label4); this.Controls.Add(this.label_customerName); this.Controls.Add(this.label_devModel); this.Controls.Add(this.label2); @@ -129,7 +101,5 @@ private System.Windows.Forms.Label label_devModel; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label4; } } diff --git a/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs b/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs index 360b1eb..eefaa8d 100644 --- a/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs @@ -480,7 +480,7 @@ this.label11.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label11.Location = new System.Drawing.Point(801, 89); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(45, 30); + this.label11.Size = new System.Drawing.Size(64, 30); this.label11.TabIndex = 16; this.label11.Text = "VRMS"; this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -554,7 +554,7 @@ this.label6.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label6.Location = new System.Drawing.Point(801, 39); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(45, 30); + this.label6.Size = new System.Drawing.Size(64, 30); this.label6.TabIndex = 10; this.label6.Text = "VRMS"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; diff --git a/RbFreqStandMeasure/status/Coordinate.cs b/RbFreqStandMeasure/status/Coordinate.cs index 0f8a990..82c91cb 100644 --- a/RbFreqStandMeasure/status/Coordinate.cs +++ b/RbFreqStandMeasure/status/Coordinate.cs @@ -205,16 +205,18 @@ int offset = padding + 5; gp.DrawEllipse(dashPen, offset, offset, this.Width - offset * 2, this.Width - offset * 2);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter, offset + inter, this.Width - offset * 2 - 2* inter, this.Width - offset * 2 - 2 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 - gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter * 2, offset + inter*2, this.Width - offset * 2 - 4 * inter, this.Width - offset * 2 - 4 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 + gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter * 3, offset + inter*3, this.Width - offset * 2 - 6 * inter, this.Width - offset * 2 - 6 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 // 画点 - X = 100; - Y = 100; - gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("USA"), X, Y); + brush = new SolidBrush(Color.Gray); + X = this.Width - padding - offset - inter; + Y = this.Height/2; + gp.DrawString("30", scaleFont, brush, new Point(X, Y)); + //gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("USA"), X, Y); - X = 200; - Y = 300; - gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("CHN"), X, Y); + X = X-50*2; + gp.DrawString("60", scaleFont, brush, new Point(X, Y)); + //gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("CHN"), X, Y); g.DrawImage(bit, 0, 0); gp.Dispose(); diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 2007aeb..164d277 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -22,6 +22,9 @@ CounterDataService CounterDataService = new CounterDataServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); #region 无边框拖动效果/最小化窗口/关闭窗口 [DllImport("user32.dll")]//拖动无窗体的控件 @@ -49,16 +52,13 @@ { InitializeComponent(); timePicker_startTime.Value = DateTime.Now; - timePicker_startTime.MinDate = DateTime.Now; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; + timePicker_startTime.MinDate = DateTime.Now; } // 开始检测 private void btnSave_Click(object sender, EventArgs e) { - if(!text_devType.Text.Equals("计数器") && text_channelNo.Text.Equals("")) + if(!text_devType.Text.Equals("频率计数器") && text_channelNo.Text.Equals("")) { MessageBox.Show("请选择通道!"); return; @@ -68,7 +68,7 @@ MessageBox.Show("请选择频率稳定度采样时间!"); return; } - if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked && !checkBox_count.Checked) + if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked ) { MessageBox.Show("请选择检测项目!"); return; @@ -86,50 +86,6 @@ if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - CounterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - inDetecCounterId = -1; - - }).Start(); - } - } } else { @@ -137,7 +93,6 @@ if (checkBox_accuracy.Checked) accuracy = "-2"; if (checkBox_bootFeature.Checked) bootFeature = "-2"; if (checkBox_ageRate.Checked) ageRate = "-2"; - if (checkBox_count.Checked) counterDetec = "-2"; } if (checkBox_stability.Checked) @@ -149,7 +104,7 @@ } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text); this.HideMaskAction(); @@ -254,5 +209,7 @@ { getEndTime(); } + + } } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 7f555e1..4f3e7b8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -64,7 +64,6 @@ this.channel4 = new DevComponents.Editors.ComboItem(); this.channel5 = new DevComponents.Editors.ComboItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.checkBox_ageRate = new System.Windows.Forms.CheckBox(); this.checkBox_bootFeature = new System.Windows.Forms.CheckBox(); this.checkBox_accuracy = new System.Windows.Forms.CheckBox(); @@ -75,13 +74,13 @@ this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label6 = new System.Windows.Forms.Label(); - this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.radio_100s = new System.Windows.Forms.RadioButton(); this.radio_20s = new System.Windows.Forms.RadioButton(); this.radio_10s = new System.Windows.Forms.RadioButton(); this.radio_1s = new System.Windows.Forms.RadioButton(); + this.label6 = new System.Windows.Forms.Label(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -534,7 +533,6 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.checkBox_count); this.groupBox1.Controls.Add(this.checkBox_ageRate); this.groupBox1.Controls.Add(this.checkBox_bootFeature); this.groupBox1.Controls.Add(this.checkBox_accuracy); @@ -547,27 +545,16 @@ this.groupBox1.Enabled = false; this.groupBox1.Location = new System.Drawing.Point(10, 210); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(617, 140); + this.groupBox1.Size = new System.Drawing.Size(617, 127); this.groupBox1.TabIndex = 39; this.groupBox1.TabStop = false; this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(114, 55); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 351; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // checkBox_ageRate // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(467, 25); + this.checkBox_ageRate.Location = new System.Drawing.Point(467, 29); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 350; @@ -578,7 +565,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 25); + this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 29); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 349; @@ -589,7 +576,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(232, 25); + this.checkBox_accuracy.Location = new System.Drawing.Point(232, 29); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 347; @@ -600,7 +587,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(114, 25); + this.checkBox_stability.Location = new System.Drawing.Point(114, 29); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 348; @@ -621,7 +608,7 @@ this.endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.endTime.IsPopupCalendarOpen = false; - this.endTime.Location = new System.Drawing.Point(395, 94); + this.endTime.Location = new System.Drawing.Point(401, 75); // // // @@ -653,7 +640,7 @@ this.endTime.MonthCalendar.TodayButtonVisible = true; this.endTime.Name = "endTime"; this.endTime.ShowUpDown = true; - this.endTime.Size = new System.Drawing.Size(180, 23); + this.endTime.Size = new System.Drawing.Size(210, 23); this.endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.endTime.TabIndex = 44; this.endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -671,7 +658,7 @@ this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.startTime.IsPopupCalendarOpen = false; - this.startTime.Location = new System.Drawing.Point(107, 94); + this.startTime.Location = new System.Drawing.Point(107, 75); // // // @@ -703,7 +690,7 @@ this.startTime.MonthCalendar.TodayButtonVisible = true; this.startTime.Name = "startTime"; this.startTime.ShowUpDown = true; - this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Size = new System.Drawing.Size(200, 23); this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.startTime.TabIndex = 43; this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -711,7 +698,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(290, 92); + this.label3.Location = new System.Drawing.Point(298, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -722,7 +709,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(5, 92); + this.label12.Location = new System.Drawing.Point(5, 73); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -733,7 +720,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(5, 23); + this.label13.Location = new System.Drawing.Point(5, 27); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -749,12 +736,64 @@ this.groupBox2.Controls.Add(this.radio_1s); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Enabled = false; - this.groupBox2.Location = new System.Drawing.Point(9, 353); + this.groupBox2.Location = new System.Drawing.Point(9, 342); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(618, 53); this.groupBox2.TabIndex = 40; this.groupBox2.TabStop = false; // + // radio_100s + // + this.radio_100s.AutoSize = true; + this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_100s.Location = new System.Drawing.Point(468, 19); + this.radio_100s.Name = "radio_100s"; + this.radio_100s.Size = new System.Drawing.Size(57, 24); + this.radio_100s.TabIndex = 47; + this.radio_100s.TabStop = true; + this.radio_100s.Tag = "100"; + this.radio_100s.Text = "100s"; + this.radio_100s.UseVisualStyleBackColor = true; + // + // radio_20s + // + this.radio_20s.AutoSize = true; + this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_20s.Location = new System.Drawing.Point(349, 20); + this.radio_20s.Name = "radio_20s"; + this.radio_20s.Size = new System.Drawing.Size(49, 24); + this.radio_20s.TabIndex = 46; + this.radio_20s.TabStop = true; + this.radio_20s.Tag = "20"; + this.radio_20s.Text = "20s"; + this.radio_20s.UseVisualStyleBackColor = true; + // + // radio_10s + // + this.radio_10s.AutoSize = true; + this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_10s.Location = new System.Drawing.Point(233, 19); + this.radio_10s.Name = "radio_10s"; + this.radio_10s.Size = new System.Drawing.Size(49, 24); + this.radio_10s.TabIndex = 45; + this.radio_10s.TabStop = true; + this.radio_10s.Tag = "10"; + this.radio_10s.Text = "10s"; + this.radio_10s.UseVisualStyleBackColor = true; + // + // radio_1s + // + this.radio_1s.AutoSize = true; + this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_1s.Location = new System.Drawing.Point(115, 20); + this.radio_1s.Name = "radio_1s"; + this.radio_1s.Size = new System.Drawing.Size(41, 24); + this.radio_1s.TabIndex = 44; + this.radio_1s.TabStop = true; + this.radio_1s.Tag = "1"; + this.radio_1s.Text = "1s"; + this.radio_1s.UseVisualStyleBackColor = true; + // // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); @@ -812,58 +851,6 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // - // radio_100s - // - this.radio_100s.AutoSize = true; - this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_100s.Location = new System.Drawing.Point(468, 19); - this.radio_100s.Name = "radio_100s"; - this.radio_100s.Size = new System.Drawing.Size(57, 24); - this.radio_100s.TabIndex = 47; - this.radio_100s.TabStop = true; - this.radio_100s.Tag = "100"; - this.radio_100s.Text = "100s"; - this.radio_100s.UseVisualStyleBackColor = true; - // - // radio_20s - // - this.radio_20s.AutoSize = true; - this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_20s.Location = new System.Drawing.Point(349, 20); - this.radio_20s.Name = "radio_20s"; - this.radio_20s.Size = new System.Drawing.Size(49, 24); - this.radio_20s.TabIndex = 46; - this.radio_20s.TabStop = true; - this.radio_20s.Tag = "20"; - this.radio_20s.Text = "20s"; - this.radio_20s.UseVisualStyleBackColor = true; - // - // radio_10s - // - this.radio_10s.AutoSize = true; - this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_10s.Location = new System.Drawing.Point(233, 19); - this.radio_10s.Name = "radio_10s"; - this.radio_10s.Size = new System.Drawing.Size(49, 24); - this.radio_10s.TabIndex = 45; - this.radio_10s.TabStop = true; - this.radio_10s.Tag = "10"; - this.radio_10s.Text = "10s"; - this.radio_10s.UseVisualStyleBackColor = true; - // - // radio_1s - // - this.radio_1s.AutoSize = true; - this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_1s.Location = new System.Drawing.Point(115, 20); - this.radio_1s.Name = "radio_1s"; - this.radio_1s.Size = new System.Drawing.Size(41, 24); - this.radio_1s.TabIndex = 44; - this.radio_1s.TabStop = true; - this.radio_1s.Tag = "1"; - this.radio_1s.Text = "1s"; - this.radio_1s.UseVisualStyleBackColor = true; - // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -931,7 +918,6 @@ public System.Windows.Forms.CheckBox checkBox_startNow; public DevComponents.Editors.DateTimeAdv.DateTimeInput endTime; public DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; - public System.Windows.Forms.CheckBox checkBox_count; public System.Windows.Forms.CheckBox checkBox_ageRate; public System.Windows.Forms.CheckBox checkBox_bootFeature; public System.Windows.Forms.CheckBox checkBox_accuracy; diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index ecfc137..19169bb 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -3,6 +3,8 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.Tools; using DevComponents.DotNetBar.Controls; using DevComponents.Editors; @@ -36,7 +38,7 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); CounterDataService counterDataService = new CounterDataServiceImpl(); - + SensitivityService sensitivityService = new SensitivityServiceImpl(); public Action HideMaskAction { @@ -53,7 +55,7 @@ cbBox_devType.DisplayMember = "Name"; cbBox_devType.ValueMember = "Code"; - btnSave.Text = "添加"; + btnSave.Text = "保存"; if (HomeCtrlForm.channelFreeList.Count > 0) { cbBox_channelFree.Items.Add(""); @@ -61,12 +63,11 @@ { cbBox_channelFree.Items.Add(item); } - } else { text_channelNo.WatermarkText = "无空闲通道"; - + groupBox1.Enabled = false; } } @@ -116,6 +117,14 @@ return; } } + if (checkBox_accuracy.Checked || checkBox_stability.Checked || checkBox_ageRate.Checked || checkBox_bootFeature.Checked) + { + if (text_channelNo.Text.Trim() == "") + { + MessageBox.Show("请选择通道号!"); + return; + } + } // 取得输入框的参数 string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; @@ -133,64 +142,18 @@ { long deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo); if (deviceId != -1) - { - + { string stability = "-3"; string accuracy = "-3"; string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (checkBox_startNow.Checked || startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1"; } if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (SetDevTestDlg.inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - SetDevTestDlg.inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - counterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - SetDevTestDlg.inDetecCounterId = -1; - - }).Start(); - } - } + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -207,7 +170,7 @@ else if (radio_20s.Checked) interval = "20"; else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text); // 重新加载首页的通道状态 HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -218,7 +181,7 @@ } else { - LogHelper.WriteErrorLog(this.GetType(), "添仪器[" + devName + "]失败"); + LogHelper.WriteErrorLog(this.GetType(), "添加仪器[" + devName + "]失败"); } } else if (labelTitle.Text.Equals("修改")) @@ -256,21 +219,23 @@ private void cbBox_devType_SelectedIndexChanged(object sender, EventArgs e) { - text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; + text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; } private void cbBox_channelFree_SelectedIndexChanged(object sender, EventArgs e) { text_channelNo.Text = cbBox_channelFree.SelectedItem.ToString(); - - if (text_channelNo.Text != "") + if (text_channelNo.Text.Equals("")) { - checkBox_startNow.Enabled = true; - groupBox1.Enabled = true; + groupBox1.Enabled = false; + checkBox_accuracy.Checked = false; + checkBox_stability.Checked = false; + checkBox_ageRate.Checked = false; + checkBox_bootFeature.Checked = false; } else { - groupBox1.Enabled = false; checkBox_startNow.Enabled = false; + groupBox1.Enabled = true; } } diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 29d4d57..7c1cfbc 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -210,16 +210,16 @@ devList = new DataTable(); // 设置表格的列 - devList.Columns.Add("index", Type.GetType("System.String")); - devList.Columns.Add("regTime", Type.GetType("System.String")); - devList.Columns.Add("devName", Type.GetType("System.String")); - devList.Columns.Add("devModel", Type.GetType("System.String")); - devList.Columns.Add("devCode", Type.GetType("System.String")); - devList.Columns.Add("customComp", Type.GetType("System.String")); - devList.Columns.Add("customName", Type.GetType("System.String")); - devList.Columns.Add("status", Type.GetType("System.String")); - devList.Columns.Add("channelNo", Type.GetType("System.String")); - devList.Columns.Add("id", Type.GetType("System.Int64")); + devList.Columns.Add("index", Type.GetType("System.String"));//0 + devList.Columns.Add("regTime", Type.GetType("System.String"));//1 + devList.Columns.Add("devName", Type.GetType("System.String"));//2 + devList.Columns.Add("devModel", Type.GetType("System.String"));//3 + devList.Columns.Add("devCode", Type.GetType("System.String"));//4 + devList.Columns.Add("customComp", Type.GetType("System.String"));//5 + devList.Columns.Add("customName", Type.GetType("System.String"));//6 + devList.Columns.Add("status", Type.GetType("System.String"));//7 + devList.Columns.Add("channelNo", Type.GetType("System.String"));//8 + devList.Columns.Add("id", Type.GetType("System.Int64"));//9 // 分页查询数据库 string devName = ""; @@ -500,10 +500,8 @@ editDlg.inputCustName.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value; editDlg.text_channelNo.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[8].Value; editDlg.btnSave.Text = "保存"; - if (((string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[rowIndex].Cells[7].Value).Equals("检测中")) { - editDlg.btn_downChannelList.Enabled = false; - editDlg.text_channelNo.ReadOnly = true; DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DetectionItem detectionItem = (detectionItemService.search(id, true))[0]; editDlg.groupBox1.Enabled = false; @@ -517,6 +515,10 @@ } if (!detectionItem.BootFeature.Equals("-3")) editDlg.checkBox_bootFeature.Checked = true; if (!detectionItem.AgeRate.Equals("-3")) editDlg.checkBox_ageRate.Checked = true; + editDlg.groupBox2.Enabled = false; + editDlg.groupBox1.Enabled = false; + editDlg.btn_downChannelList.Enabled = false; + editDlg.text_channelNo.Enabled = false; } editDlg.HideMaskAction += () => { @@ -539,7 +541,7 @@ private void btnDelete_Click(object sender, EventArgs e) { - if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[7].Value).Equals("检测中")) { MessageBox.Show("该仪器在检测中,无法删除!"); return; diff --git a/RbFreqStandMeasure/info/ageRate.designer.cs b/RbFreqStandMeasure/info/ageRate.designer.cs index c676897..5780827 100644 --- a/RbFreqStandMeasure/info/ageRate.designer.cs +++ b/RbFreqStandMeasure/info/ageRate.designer.cs @@ -67,7 +67,7 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(316, 8); + this.label1.Location = new System.Drawing.Point(318, 35); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(83, 27); @@ -78,7 +78,7 @@ // this.label4.BackColor = System.Drawing.Color.Transparent; this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(197, 8); + this.label4.Location = new System.Drawing.Point(199, 35); this.label4.Margin = new System.Windows.Forms.Padding(0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(119, 27); @@ -115,7 +115,7 @@ this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label3.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label3.Location = new System.Drawing.Point(316, 35); + this.label3.Location = new System.Drawing.Point(318, 8); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(83, 27); @@ -126,7 +126,7 @@ // this.label5.BackColor = System.Drawing.Color.Transparent; this.label5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label5.Location = new System.Drawing.Point(229, 35); + this.label5.Location = new System.Drawing.Point(231, 8); this.label5.Margin = new System.Windows.Forms.Padding(0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(87, 27); diff --git a/RbFreqStandMeasure/info/stability.designer.cs b/RbFreqStandMeasure/info/stability.designer.cs index 63e8678..791a330 100644 --- a/RbFreqStandMeasure/info/stability.designer.cs +++ b/RbFreqStandMeasure/info/stability.designer.cs @@ -32,8 +32,6 @@ this.label_devModel = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // label_customerName @@ -41,7 +39,7 @@ this.label_customerName.BackColor = System.Drawing.Color.Transparent; this.label_customerName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_customerName.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label_customerName.Location = new System.Drawing.Point(197, 126); + this.label_customerName.Location = new System.Drawing.Point(197, 91); this.label_customerName.Margin = new System.Windows.Forms.Padding(0); this.label_customerName.Name = "label_customerName"; this.label_customerName.Size = new System.Drawing.Size(83, 27); @@ -64,7 +62,7 @@ // this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(110, 126); + this.label2.Location = new System.Drawing.Point(110, 91); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(87, 27); @@ -84,36 +82,10 @@ this.label9.Text = "测量结果:"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(197, 82); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(83, 27); - this.label1.TabIndex = 86; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label4 - // - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(110, 82); - this.label4.Margin = new System.Windows.Forms.Padding(0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(87, 27); - this.label4.TabIndex = 85; - this.label4.Text = "标准偏差:"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // // stability // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.White; - this.Controls.Add(this.label1); - this.Controls.Add(this.label4); this.Controls.Add(this.label_customerName); this.Controls.Add(this.label_devModel); this.Controls.Add(this.label2); @@ -129,7 +101,5 @@ private System.Windows.Forms.Label label_devModel; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label4; } } diff --git a/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs b/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs index 360b1eb..eefaa8d 100644 --- a/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs @@ -480,7 +480,7 @@ this.label11.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label11.Location = new System.Drawing.Point(801, 89); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(45, 30); + this.label11.Size = new System.Drawing.Size(64, 30); this.label11.TabIndex = 16; this.label11.Text = "VRMS"; this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -554,7 +554,7 @@ this.label6.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label6.Location = new System.Drawing.Point(801, 39); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(45, 30); + this.label6.Size = new System.Drawing.Size(64, 30); this.label6.TabIndex = 10; this.label6.Text = "VRMS"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; diff --git a/RbFreqStandMeasure/status/Coordinate.cs b/RbFreqStandMeasure/status/Coordinate.cs index 0f8a990..82c91cb 100644 --- a/RbFreqStandMeasure/status/Coordinate.cs +++ b/RbFreqStandMeasure/status/Coordinate.cs @@ -205,16 +205,18 @@ int offset = padding + 5; gp.DrawEllipse(dashPen, offset, offset, this.Width - offset * 2, this.Width - offset * 2);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter, offset + inter, this.Width - offset * 2 - 2* inter, this.Width - offset * 2 - 2 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 - gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter * 2, offset + inter*2, this.Width - offset * 2 - 4 * inter, this.Width - offset * 2 - 4 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 + gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter * 3, offset + inter*3, this.Width - offset * 2 - 6 * inter, this.Width - offset * 2 - 6 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 // 画点 - X = 100; - Y = 100; - gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("USA"), X, Y); + brush = new SolidBrush(Color.Gray); + X = this.Width - padding - offset - inter; + Y = this.Height/2; + gp.DrawString("30", scaleFont, brush, new Point(X, Y)); + //gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("USA"), X, Y); - X = 200; - Y = 300; - gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("CHN"), X, Y); + X = X-50*2; + gp.DrawString("60", scaleFont, brush, new Point(X, Y)); + //gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("CHN"), X, Y); g.DrawImage(bit, 0, 0); gp.Dispose(); diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs index fdb2eb6..bb130f0 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs @@ -30,6 +30,11 @@ private void InitializeComponent() { this.panelLocation = new System.Windows.Forms.Panel(); + this.label_z = new System.Windows.Forms.Label(); + this.label_y = new System.Windows.Forms.Label(); + this.label_x = new System.Windows.Forms.Label(); + this.label_lat = new System.Windows.Forms.Label(); + this.label_lng = new System.Windows.Forms.Label(); this.labelLocation = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label(); @@ -37,19 +42,22 @@ this.label9 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel(); - this.label5 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); + this.label_chnTotal = new System.Windows.Forms.Label(); + this.label_usaTotal = new System.Windows.Forms.Label(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.panelSite = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel(); this.panelTime = new System.Windows.Forms.Panel(); + this.label_mjd = new System.Windows.Forms.Label(); + this.label_time = new System.Windows.Forms.Label(); + this.label_date = new System.Windows.Forms.Label(); this.labelTime = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.panelBase = new System.Windows.Forms.Panel(); - this.label8 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); @@ -65,6 +73,11 @@ // panelLocation // this.panelLocation.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_location; + this.panelLocation.Controls.Add(this.label_z); + this.panelLocation.Controls.Add(this.label_y); + this.panelLocation.Controls.Add(this.label_x); + this.panelLocation.Controls.Add(this.label_lat); + this.panelLocation.Controls.Add(this.label_lng); this.panelLocation.Controls.Add(this.labelLocation); this.panelLocation.Controls.Add(this.label13); this.panelLocation.Controls.Add(this.label12); @@ -76,6 +89,66 @@ this.panelLocation.Size = new System.Drawing.Size(220, 289); this.panelLocation.TabIndex = 5; // + // label_z + // + this.label_z.BackColor = System.Drawing.Color.Transparent; + this.label_z.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_z.ForeColor = System.Drawing.Color.Gray; + this.label_z.Location = new System.Drawing.Point(101, 226); + this.label_z.Name = "label_z"; + this.label_z.Size = new System.Drawing.Size(109, 25); + this.label_z.TabIndex = 13; + this.label_z.Text = "快锁"; + this.label_z.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_y + // + this.label_y.BackColor = System.Drawing.Color.Transparent; + this.label_y.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_y.ForeColor = System.Drawing.Color.Gray; + this.label_y.Location = new System.Drawing.Point(101, 186); + this.label_y.Name = "label_y"; + this.label_y.Size = new System.Drawing.Size(109, 25); + this.label_y.TabIndex = 12; + this.label_y.Text = "快锁"; + this.label_y.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_x + // + this.label_x.BackColor = System.Drawing.Color.Transparent; + this.label_x.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_x.ForeColor = System.Drawing.Color.Gray; + this.label_x.Location = new System.Drawing.Point(101, 146); + this.label_x.Name = "label_x"; + this.label_x.Size = new System.Drawing.Size(109, 25); + this.label_x.TabIndex = 11; + this.label_x.Text = "快锁"; + this.label_x.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_lat + // + this.label_lat.BackColor = System.Drawing.Color.Transparent; + this.label_lat.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_lat.ForeColor = System.Drawing.Color.Gray; + this.label_lat.Location = new System.Drawing.Point(101, 106); + this.label_lat.Name = "label_lat"; + this.label_lat.Size = new System.Drawing.Size(109, 25); + this.label_lat.TabIndex = 10; + this.label_lat.Text = "快锁"; + this.label_lat.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_lng + // + this.label_lng.BackColor = System.Drawing.Color.Transparent; + this.label_lng.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_lng.ForeColor = System.Drawing.Color.Gray; + this.label_lng.Location = new System.Drawing.Point(101, 66); + this.label_lng.Name = "label_lng"; + this.label_lng.Size = new System.Drawing.Size(109, 25); + this.label_lng.TabIndex = 9; + this.label_lng.Text = "快锁"; + this.label_lng.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // labelLocation // this.labelLocation.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); @@ -151,8 +224,8 @@ // this.panel2.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_ct_list; this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.panel2.Controls.Add(this.label5); - this.panel2.Controls.Add(this.label4); + this.panel2.Controls.Add(this.label_chnTotal); + this.panel2.Controls.Add(this.label_usaTotal); this.panel2.Controls.Add(this.pictureBox2); this.panel2.Controls.Add(this.pictureBox1); this.panel2.Controls.Add(this.panelSite); @@ -162,36 +235,36 @@ this.panel2.Size = new System.Drawing.Size(785, 642); this.panel2.TabIndex = 3; // - // label5 + // label_chnTotal // - this.label5.BackColor = System.Drawing.Color.Black; - this.label5.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label5.ForeColor = System.Drawing.SystemColors.ControlLight; - this.label5.Location = new System.Drawing.Point(49, 59); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(28, 25); - this.label5.TabIndex = 7; - this.label5.Text = "1"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label_chnTotal.BackColor = System.Drawing.Color.Black; + this.label_chnTotal.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_chnTotal.ForeColor = System.Drawing.SystemColors.ControlLight; + this.label_chnTotal.Location = new System.Drawing.Point(57, 59); + this.label_chnTotal.Name = "label_chnTotal"; + this.label_chnTotal.Size = new System.Drawing.Size(28, 25); + this.label_chnTotal.TabIndex = 7; + this.label_chnTotal.Text = "1"; + this.label_chnTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label4 + // label_usaTotal // - this.label4.BackColor = System.Drawing.Color.Black; - this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.ForeColor = System.Drawing.SystemColors.ControlLight; - this.label4.Location = new System.Drawing.Point(49, 23); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(28, 25); - this.label4.TabIndex = 2; - this.label4.Text = "1"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label_usaTotal.BackColor = System.Drawing.Color.Black; + this.label_usaTotal.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_usaTotal.ForeColor = System.Drawing.SystemColors.ControlLight; + this.label_usaTotal.Location = new System.Drawing.Point(57, 23); + this.label_usaTotal.Name = "label_usaTotal"; + this.label_usaTotal.Size = new System.Drawing.Size(28, 25); + this.label_usaTotal.TabIndex = 2; + this.label_usaTotal.Text = "1"; + this.label_usaTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // pictureBox2 // - this.pictureBox2.BackColor = System.Drawing.Color.White; + this.pictureBox2.BackColor = System.Drawing.Color.Black; this.pictureBox2.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.CHN; this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBox2.Location = new System.Drawing.Point(20, 60); + this.pictureBox2.Location = new System.Drawing.Point(28, 60); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(24, 24); this.pictureBox2.TabIndex = 6; @@ -199,10 +272,10 @@ // // pictureBox1 // - this.pictureBox1.BackColor = System.Drawing.Color.White; + this.pictureBox1.BackColor = System.Drawing.Color.Black; this.pictureBox1.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.USA; this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBox1.Location = new System.Drawing.Point(20, 23); + this.pictureBox1.Location = new System.Drawing.Point(28, 23); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(24, 24); this.pictureBox1.TabIndex = 5; @@ -228,6 +301,9 @@ // panelTime // this.panelTime.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_time; + this.panelTime.Controls.Add(this.label_mjd); + this.panelTime.Controls.Add(this.label_time); + this.panelTime.Controls.Add(this.label_date); this.panelTime.Controls.Add(this.labelTime); this.panelTime.Controls.Add(this.label7); this.panelTime.Controls.Add(this.label6); @@ -237,6 +313,42 @@ this.panelTime.Size = new System.Drawing.Size(220, 197); this.panelTime.TabIndex = 4; // + // label_mjd + // + this.label_mjd.BackColor = System.Drawing.Color.Transparent; + this.label_mjd.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_mjd.ForeColor = System.Drawing.Color.Gray; + this.label_mjd.Location = new System.Drawing.Point(101, 143); + this.label_mjd.Name = "label_mjd"; + this.label_mjd.Size = new System.Drawing.Size(109, 25); + this.label_mjd.TabIndex = 8; + this.label_mjd.Text = "快锁"; + this.label_mjd.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_time + // + this.label_time.BackColor = System.Drawing.Color.Transparent; + this.label_time.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_time.ForeColor = System.Drawing.Color.Gray; + this.label_time.Location = new System.Drawing.Point(101, 103); + this.label_time.Name = "label_time"; + this.label_time.Size = new System.Drawing.Size(109, 25); + this.label_time.TabIndex = 7; + this.label_time.Text = "快锁"; + this.label_time.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_date + // + this.label_date.BackColor = System.Drawing.Color.Transparent; + this.label_date.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_date.ForeColor = System.Drawing.Color.Gray; + this.label_date.Location = new System.Drawing.Point(101, 63); + this.label_date.Name = "label_date"; + this.label_date.Size = new System.Drawing.Size(109, 25); + this.label_date.TabIndex = 6; + this.label_date.Text = "快锁"; + this.label_date.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // labelTime // this.labelTime.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); @@ -286,7 +398,7 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label8); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); this.panelBase.Controls.Add(this.label3); this.panelBase.Controls.Add(this.label2); @@ -297,17 +409,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 156); this.panelBase.TabIndex = 3; // - // label8 + // label_receiverStatus // - this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label8.ForeColor = System.Drawing.Color.Gray; - this.label8.Location = new System.Drawing.Point(99, 100); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(67, 25); - this.label8.TabIndex = 5; - this.label8.Text = "定位有效"; - this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 100); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 5; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -398,10 +510,18 @@ private System.Windows.Forms.Panel panelSite; private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label4; private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label label_clockStatus; + public System.Windows.Forms.Label label_z; + public System.Windows.Forms.Label label_y; + public System.Windows.Forms.Label label_x; + public System.Windows.Forms.Label label_lat; + public System.Windows.Forms.Label label_lng; + public System.Windows.Forms.Label label_mjd; + public System.Windows.Forms.Label label_time; + public System.Windows.Forms.Label label_date; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; + public System.Windows.Forms.Label label_chnTotal; + public System.Windows.Forms.Label label_usaTotal; } } diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 2007aeb..164d277 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -22,6 +22,9 @@ CounterDataService CounterDataService = new CounterDataServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); #region 无边框拖动效果/最小化窗口/关闭窗口 [DllImport("user32.dll")]//拖动无窗体的控件 @@ -49,16 +52,13 @@ { InitializeComponent(); timePicker_startTime.Value = DateTime.Now; - timePicker_startTime.MinDate = DateTime.Now; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; + timePicker_startTime.MinDate = DateTime.Now; } // 开始检测 private void btnSave_Click(object sender, EventArgs e) { - if(!text_devType.Text.Equals("计数器") && text_channelNo.Text.Equals("")) + if(!text_devType.Text.Equals("频率计数器") && text_channelNo.Text.Equals("")) { MessageBox.Show("请选择通道!"); return; @@ -68,7 +68,7 @@ MessageBox.Show("请选择频率稳定度采样时间!"); return; } - if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked && !checkBox_count.Checked) + if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked ) { MessageBox.Show("请选择检测项目!"); return; @@ -86,50 +86,6 @@ if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - CounterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - inDetecCounterId = -1; - - }).Start(); - } - } } else { @@ -137,7 +93,6 @@ if (checkBox_accuracy.Checked) accuracy = "-2"; if (checkBox_bootFeature.Checked) bootFeature = "-2"; if (checkBox_ageRate.Checked) ageRate = "-2"; - if (checkBox_count.Checked) counterDetec = "-2"; } if (checkBox_stability.Checked) @@ -149,7 +104,7 @@ } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text); this.HideMaskAction(); @@ -254,5 +209,7 @@ { getEndTime(); } + + } } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 7f555e1..4f3e7b8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -64,7 +64,6 @@ this.channel4 = new DevComponents.Editors.ComboItem(); this.channel5 = new DevComponents.Editors.ComboItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.checkBox_ageRate = new System.Windows.Forms.CheckBox(); this.checkBox_bootFeature = new System.Windows.Forms.CheckBox(); this.checkBox_accuracy = new System.Windows.Forms.CheckBox(); @@ -75,13 +74,13 @@ this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label6 = new System.Windows.Forms.Label(); - this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.radio_100s = new System.Windows.Forms.RadioButton(); this.radio_20s = new System.Windows.Forms.RadioButton(); this.radio_10s = new System.Windows.Forms.RadioButton(); this.radio_1s = new System.Windows.Forms.RadioButton(); + this.label6 = new System.Windows.Forms.Label(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -534,7 +533,6 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.checkBox_count); this.groupBox1.Controls.Add(this.checkBox_ageRate); this.groupBox1.Controls.Add(this.checkBox_bootFeature); this.groupBox1.Controls.Add(this.checkBox_accuracy); @@ -547,27 +545,16 @@ this.groupBox1.Enabled = false; this.groupBox1.Location = new System.Drawing.Point(10, 210); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(617, 140); + this.groupBox1.Size = new System.Drawing.Size(617, 127); this.groupBox1.TabIndex = 39; this.groupBox1.TabStop = false; this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(114, 55); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 351; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // checkBox_ageRate // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(467, 25); + this.checkBox_ageRate.Location = new System.Drawing.Point(467, 29); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 350; @@ -578,7 +565,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 25); + this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 29); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 349; @@ -589,7 +576,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(232, 25); + this.checkBox_accuracy.Location = new System.Drawing.Point(232, 29); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 347; @@ -600,7 +587,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(114, 25); + this.checkBox_stability.Location = new System.Drawing.Point(114, 29); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 348; @@ -621,7 +608,7 @@ this.endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.endTime.IsPopupCalendarOpen = false; - this.endTime.Location = new System.Drawing.Point(395, 94); + this.endTime.Location = new System.Drawing.Point(401, 75); // // // @@ -653,7 +640,7 @@ this.endTime.MonthCalendar.TodayButtonVisible = true; this.endTime.Name = "endTime"; this.endTime.ShowUpDown = true; - this.endTime.Size = new System.Drawing.Size(180, 23); + this.endTime.Size = new System.Drawing.Size(210, 23); this.endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.endTime.TabIndex = 44; this.endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -671,7 +658,7 @@ this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.startTime.IsPopupCalendarOpen = false; - this.startTime.Location = new System.Drawing.Point(107, 94); + this.startTime.Location = new System.Drawing.Point(107, 75); // // // @@ -703,7 +690,7 @@ this.startTime.MonthCalendar.TodayButtonVisible = true; this.startTime.Name = "startTime"; this.startTime.ShowUpDown = true; - this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Size = new System.Drawing.Size(200, 23); this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.startTime.TabIndex = 43; this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -711,7 +698,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(290, 92); + this.label3.Location = new System.Drawing.Point(298, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -722,7 +709,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(5, 92); + this.label12.Location = new System.Drawing.Point(5, 73); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -733,7 +720,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(5, 23); + this.label13.Location = new System.Drawing.Point(5, 27); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -749,12 +736,64 @@ this.groupBox2.Controls.Add(this.radio_1s); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Enabled = false; - this.groupBox2.Location = new System.Drawing.Point(9, 353); + this.groupBox2.Location = new System.Drawing.Point(9, 342); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(618, 53); this.groupBox2.TabIndex = 40; this.groupBox2.TabStop = false; // + // radio_100s + // + this.radio_100s.AutoSize = true; + this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_100s.Location = new System.Drawing.Point(468, 19); + this.radio_100s.Name = "radio_100s"; + this.radio_100s.Size = new System.Drawing.Size(57, 24); + this.radio_100s.TabIndex = 47; + this.radio_100s.TabStop = true; + this.radio_100s.Tag = "100"; + this.radio_100s.Text = "100s"; + this.radio_100s.UseVisualStyleBackColor = true; + // + // radio_20s + // + this.radio_20s.AutoSize = true; + this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_20s.Location = new System.Drawing.Point(349, 20); + this.radio_20s.Name = "radio_20s"; + this.radio_20s.Size = new System.Drawing.Size(49, 24); + this.radio_20s.TabIndex = 46; + this.radio_20s.TabStop = true; + this.radio_20s.Tag = "20"; + this.radio_20s.Text = "20s"; + this.radio_20s.UseVisualStyleBackColor = true; + // + // radio_10s + // + this.radio_10s.AutoSize = true; + this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_10s.Location = new System.Drawing.Point(233, 19); + this.radio_10s.Name = "radio_10s"; + this.radio_10s.Size = new System.Drawing.Size(49, 24); + this.radio_10s.TabIndex = 45; + this.radio_10s.TabStop = true; + this.radio_10s.Tag = "10"; + this.radio_10s.Text = "10s"; + this.radio_10s.UseVisualStyleBackColor = true; + // + // radio_1s + // + this.radio_1s.AutoSize = true; + this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_1s.Location = new System.Drawing.Point(115, 20); + this.radio_1s.Name = "radio_1s"; + this.radio_1s.Size = new System.Drawing.Size(41, 24); + this.radio_1s.TabIndex = 44; + this.radio_1s.TabStop = true; + this.radio_1s.Tag = "1"; + this.radio_1s.Text = "1s"; + this.radio_1s.UseVisualStyleBackColor = true; + // // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); @@ -812,58 +851,6 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // - // radio_100s - // - this.radio_100s.AutoSize = true; - this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_100s.Location = new System.Drawing.Point(468, 19); - this.radio_100s.Name = "radio_100s"; - this.radio_100s.Size = new System.Drawing.Size(57, 24); - this.radio_100s.TabIndex = 47; - this.radio_100s.TabStop = true; - this.radio_100s.Tag = "100"; - this.radio_100s.Text = "100s"; - this.radio_100s.UseVisualStyleBackColor = true; - // - // radio_20s - // - this.radio_20s.AutoSize = true; - this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_20s.Location = new System.Drawing.Point(349, 20); - this.radio_20s.Name = "radio_20s"; - this.radio_20s.Size = new System.Drawing.Size(49, 24); - this.radio_20s.TabIndex = 46; - this.radio_20s.TabStop = true; - this.radio_20s.Tag = "20"; - this.radio_20s.Text = "20s"; - this.radio_20s.UseVisualStyleBackColor = true; - // - // radio_10s - // - this.radio_10s.AutoSize = true; - this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_10s.Location = new System.Drawing.Point(233, 19); - this.radio_10s.Name = "radio_10s"; - this.radio_10s.Size = new System.Drawing.Size(49, 24); - this.radio_10s.TabIndex = 45; - this.radio_10s.TabStop = true; - this.radio_10s.Tag = "10"; - this.radio_10s.Text = "10s"; - this.radio_10s.UseVisualStyleBackColor = true; - // - // radio_1s - // - this.radio_1s.AutoSize = true; - this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_1s.Location = new System.Drawing.Point(115, 20); - this.radio_1s.Name = "radio_1s"; - this.radio_1s.Size = new System.Drawing.Size(41, 24); - this.radio_1s.TabIndex = 44; - this.radio_1s.TabStop = true; - this.radio_1s.Tag = "1"; - this.radio_1s.Text = "1s"; - this.radio_1s.UseVisualStyleBackColor = true; - // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -931,7 +918,6 @@ public System.Windows.Forms.CheckBox checkBox_startNow; public DevComponents.Editors.DateTimeAdv.DateTimeInput endTime; public DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; - public System.Windows.Forms.CheckBox checkBox_count; public System.Windows.Forms.CheckBox checkBox_ageRate; public System.Windows.Forms.CheckBox checkBox_bootFeature; public System.Windows.Forms.CheckBox checkBox_accuracy; diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index ecfc137..19169bb 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -3,6 +3,8 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.Tools; using DevComponents.DotNetBar.Controls; using DevComponents.Editors; @@ -36,7 +38,7 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); CounterDataService counterDataService = new CounterDataServiceImpl(); - + SensitivityService sensitivityService = new SensitivityServiceImpl(); public Action HideMaskAction { @@ -53,7 +55,7 @@ cbBox_devType.DisplayMember = "Name"; cbBox_devType.ValueMember = "Code"; - btnSave.Text = "添加"; + btnSave.Text = "保存"; if (HomeCtrlForm.channelFreeList.Count > 0) { cbBox_channelFree.Items.Add(""); @@ -61,12 +63,11 @@ { cbBox_channelFree.Items.Add(item); } - } else { text_channelNo.WatermarkText = "无空闲通道"; - + groupBox1.Enabled = false; } } @@ -116,6 +117,14 @@ return; } } + if (checkBox_accuracy.Checked || checkBox_stability.Checked || checkBox_ageRate.Checked || checkBox_bootFeature.Checked) + { + if (text_channelNo.Text.Trim() == "") + { + MessageBox.Show("请选择通道号!"); + return; + } + } // 取得输入框的参数 string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; @@ -133,64 +142,18 @@ { long deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo); if (deviceId != -1) - { - + { string stability = "-3"; string accuracy = "-3"; string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (checkBox_startNow.Checked || startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1"; } if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (SetDevTestDlg.inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - SetDevTestDlg.inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - counterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - SetDevTestDlg.inDetecCounterId = -1; - - }).Start(); - } - } + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -207,7 +170,7 @@ else if (radio_20s.Checked) interval = "20"; else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text); // 重新加载首页的通道状态 HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -218,7 +181,7 @@ } else { - LogHelper.WriteErrorLog(this.GetType(), "添仪器[" + devName + "]失败"); + LogHelper.WriteErrorLog(this.GetType(), "添加仪器[" + devName + "]失败"); } } else if (labelTitle.Text.Equals("修改")) @@ -256,21 +219,23 @@ private void cbBox_devType_SelectedIndexChanged(object sender, EventArgs e) { - text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; + text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; } private void cbBox_channelFree_SelectedIndexChanged(object sender, EventArgs e) { text_channelNo.Text = cbBox_channelFree.SelectedItem.ToString(); - - if (text_channelNo.Text != "") + if (text_channelNo.Text.Equals("")) { - checkBox_startNow.Enabled = true; - groupBox1.Enabled = true; + groupBox1.Enabled = false; + checkBox_accuracy.Checked = false; + checkBox_stability.Checked = false; + checkBox_ageRate.Checked = false; + checkBox_bootFeature.Checked = false; } else { - groupBox1.Enabled = false; checkBox_startNow.Enabled = false; + groupBox1.Enabled = true; } } diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 29d4d57..7c1cfbc 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -210,16 +210,16 @@ devList = new DataTable(); // 设置表格的列 - devList.Columns.Add("index", Type.GetType("System.String")); - devList.Columns.Add("regTime", Type.GetType("System.String")); - devList.Columns.Add("devName", Type.GetType("System.String")); - devList.Columns.Add("devModel", Type.GetType("System.String")); - devList.Columns.Add("devCode", Type.GetType("System.String")); - devList.Columns.Add("customComp", Type.GetType("System.String")); - devList.Columns.Add("customName", Type.GetType("System.String")); - devList.Columns.Add("status", Type.GetType("System.String")); - devList.Columns.Add("channelNo", Type.GetType("System.String")); - devList.Columns.Add("id", Type.GetType("System.Int64")); + devList.Columns.Add("index", Type.GetType("System.String"));//0 + devList.Columns.Add("regTime", Type.GetType("System.String"));//1 + devList.Columns.Add("devName", Type.GetType("System.String"));//2 + devList.Columns.Add("devModel", Type.GetType("System.String"));//3 + devList.Columns.Add("devCode", Type.GetType("System.String"));//4 + devList.Columns.Add("customComp", Type.GetType("System.String"));//5 + devList.Columns.Add("customName", Type.GetType("System.String"));//6 + devList.Columns.Add("status", Type.GetType("System.String"));//7 + devList.Columns.Add("channelNo", Type.GetType("System.String"));//8 + devList.Columns.Add("id", Type.GetType("System.Int64"));//9 // 分页查询数据库 string devName = ""; @@ -500,10 +500,8 @@ editDlg.inputCustName.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value; editDlg.text_channelNo.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[8].Value; editDlg.btnSave.Text = "保存"; - if (((string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[rowIndex].Cells[7].Value).Equals("检测中")) { - editDlg.btn_downChannelList.Enabled = false; - editDlg.text_channelNo.ReadOnly = true; DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DetectionItem detectionItem = (detectionItemService.search(id, true))[0]; editDlg.groupBox1.Enabled = false; @@ -517,6 +515,10 @@ } if (!detectionItem.BootFeature.Equals("-3")) editDlg.checkBox_bootFeature.Checked = true; if (!detectionItem.AgeRate.Equals("-3")) editDlg.checkBox_ageRate.Checked = true; + editDlg.groupBox2.Enabled = false; + editDlg.groupBox1.Enabled = false; + editDlg.btn_downChannelList.Enabled = false; + editDlg.text_channelNo.Enabled = false; } editDlg.HideMaskAction += () => { @@ -539,7 +541,7 @@ private void btnDelete_Click(object sender, EventArgs e) { - if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[7].Value).Equals("检测中")) { MessageBox.Show("该仪器在检测中,无法删除!"); return; diff --git a/RbFreqStandMeasure/info/ageRate.designer.cs b/RbFreqStandMeasure/info/ageRate.designer.cs index c676897..5780827 100644 --- a/RbFreqStandMeasure/info/ageRate.designer.cs +++ b/RbFreqStandMeasure/info/ageRate.designer.cs @@ -67,7 +67,7 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(316, 8); + this.label1.Location = new System.Drawing.Point(318, 35); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(83, 27); @@ -78,7 +78,7 @@ // this.label4.BackColor = System.Drawing.Color.Transparent; this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(197, 8); + this.label4.Location = new System.Drawing.Point(199, 35); this.label4.Margin = new System.Windows.Forms.Padding(0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(119, 27); @@ -115,7 +115,7 @@ this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label3.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label3.Location = new System.Drawing.Point(316, 35); + this.label3.Location = new System.Drawing.Point(318, 8); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(83, 27); @@ -126,7 +126,7 @@ // this.label5.BackColor = System.Drawing.Color.Transparent; this.label5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label5.Location = new System.Drawing.Point(229, 35); + this.label5.Location = new System.Drawing.Point(231, 8); this.label5.Margin = new System.Windows.Forms.Padding(0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(87, 27); diff --git a/RbFreqStandMeasure/info/stability.designer.cs b/RbFreqStandMeasure/info/stability.designer.cs index 63e8678..791a330 100644 --- a/RbFreqStandMeasure/info/stability.designer.cs +++ b/RbFreqStandMeasure/info/stability.designer.cs @@ -32,8 +32,6 @@ this.label_devModel = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // label_customerName @@ -41,7 +39,7 @@ this.label_customerName.BackColor = System.Drawing.Color.Transparent; this.label_customerName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_customerName.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label_customerName.Location = new System.Drawing.Point(197, 126); + this.label_customerName.Location = new System.Drawing.Point(197, 91); this.label_customerName.Margin = new System.Windows.Forms.Padding(0); this.label_customerName.Name = "label_customerName"; this.label_customerName.Size = new System.Drawing.Size(83, 27); @@ -64,7 +62,7 @@ // this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(110, 126); + this.label2.Location = new System.Drawing.Point(110, 91); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(87, 27); @@ -84,36 +82,10 @@ this.label9.Text = "测量结果:"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(197, 82); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(83, 27); - this.label1.TabIndex = 86; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label4 - // - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(110, 82); - this.label4.Margin = new System.Windows.Forms.Padding(0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(87, 27); - this.label4.TabIndex = 85; - this.label4.Text = "标准偏差:"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // // stability // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.White; - this.Controls.Add(this.label1); - this.Controls.Add(this.label4); this.Controls.Add(this.label_customerName); this.Controls.Add(this.label_devModel); this.Controls.Add(this.label2); @@ -129,7 +101,5 @@ private System.Windows.Forms.Label label_devModel; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label4; } } diff --git a/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs b/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs index 360b1eb..eefaa8d 100644 --- a/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs @@ -480,7 +480,7 @@ this.label11.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label11.Location = new System.Drawing.Point(801, 89); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(45, 30); + this.label11.Size = new System.Drawing.Size(64, 30); this.label11.TabIndex = 16; this.label11.Text = "VRMS"; this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -554,7 +554,7 @@ this.label6.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label6.Location = new System.Drawing.Point(801, 39); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(45, 30); + this.label6.Size = new System.Drawing.Size(64, 30); this.label6.TabIndex = 10; this.label6.Text = "VRMS"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; diff --git a/RbFreqStandMeasure/status/Coordinate.cs b/RbFreqStandMeasure/status/Coordinate.cs index 0f8a990..82c91cb 100644 --- a/RbFreqStandMeasure/status/Coordinate.cs +++ b/RbFreqStandMeasure/status/Coordinate.cs @@ -205,16 +205,18 @@ int offset = padding + 5; gp.DrawEllipse(dashPen, offset, offset, this.Width - offset * 2, this.Width - offset * 2);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter, offset + inter, this.Width - offset * 2 - 2* inter, this.Width - offset * 2 - 2 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 - gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter * 2, offset + inter*2, this.Width - offset * 2 - 4 * inter, this.Width - offset * 2 - 4 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 + gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter * 3, offset + inter*3, this.Width - offset * 2 - 6 * inter, this.Width - offset * 2 - 6 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 // 画点 - X = 100; - Y = 100; - gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("USA"), X, Y); + brush = new SolidBrush(Color.Gray); + X = this.Width - padding - offset - inter; + Y = this.Height/2; + gp.DrawString("30", scaleFont, brush, new Point(X, Y)); + //gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("USA"), X, Y); - X = 200; - Y = 300; - gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("CHN"), X, Y); + X = X-50*2; + gp.DrawString("60", scaleFont, brush, new Point(X, Y)); + //gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("CHN"), X, Y); g.DrawImage(bit, 0, 0); gp.Dispose(); diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs index fdb2eb6..bb130f0 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs @@ -30,6 +30,11 @@ private void InitializeComponent() { this.panelLocation = new System.Windows.Forms.Panel(); + this.label_z = new System.Windows.Forms.Label(); + this.label_y = new System.Windows.Forms.Label(); + this.label_x = new System.Windows.Forms.Label(); + this.label_lat = new System.Windows.Forms.Label(); + this.label_lng = new System.Windows.Forms.Label(); this.labelLocation = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label(); @@ -37,19 +42,22 @@ this.label9 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel(); - this.label5 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); + this.label_chnTotal = new System.Windows.Forms.Label(); + this.label_usaTotal = new System.Windows.Forms.Label(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.panelSite = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel(); this.panelTime = new System.Windows.Forms.Panel(); + this.label_mjd = new System.Windows.Forms.Label(); + this.label_time = new System.Windows.Forms.Label(); + this.label_date = new System.Windows.Forms.Label(); this.labelTime = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.panelBase = new System.Windows.Forms.Panel(); - this.label8 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); @@ -65,6 +73,11 @@ // panelLocation // this.panelLocation.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_location; + this.panelLocation.Controls.Add(this.label_z); + this.panelLocation.Controls.Add(this.label_y); + this.panelLocation.Controls.Add(this.label_x); + this.panelLocation.Controls.Add(this.label_lat); + this.panelLocation.Controls.Add(this.label_lng); this.panelLocation.Controls.Add(this.labelLocation); this.panelLocation.Controls.Add(this.label13); this.panelLocation.Controls.Add(this.label12); @@ -76,6 +89,66 @@ this.panelLocation.Size = new System.Drawing.Size(220, 289); this.panelLocation.TabIndex = 5; // + // label_z + // + this.label_z.BackColor = System.Drawing.Color.Transparent; + this.label_z.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_z.ForeColor = System.Drawing.Color.Gray; + this.label_z.Location = new System.Drawing.Point(101, 226); + this.label_z.Name = "label_z"; + this.label_z.Size = new System.Drawing.Size(109, 25); + this.label_z.TabIndex = 13; + this.label_z.Text = "快锁"; + this.label_z.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_y + // + this.label_y.BackColor = System.Drawing.Color.Transparent; + this.label_y.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_y.ForeColor = System.Drawing.Color.Gray; + this.label_y.Location = new System.Drawing.Point(101, 186); + this.label_y.Name = "label_y"; + this.label_y.Size = new System.Drawing.Size(109, 25); + this.label_y.TabIndex = 12; + this.label_y.Text = "快锁"; + this.label_y.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_x + // + this.label_x.BackColor = System.Drawing.Color.Transparent; + this.label_x.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_x.ForeColor = System.Drawing.Color.Gray; + this.label_x.Location = new System.Drawing.Point(101, 146); + this.label_x.Name = "label_x"; + this.label_x.Size = new System.Drawing.Size(109, 25); + this.label_x.TabIndex = 11; + this.label_x.Text = "快锁"; + this.label_x.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_lat + // + this.label_lat.BackColor = System.Drawing.Color.Transparent; + this.label_lat.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_lat.ForeColor = System.Drawing.Color.Gray; + this.label_lat.Location = new System.Drawing.Point(101, 106); + this.label_lat.Name = "label_lat"; + this.label_lat.Size = new System.Drawing.Size(109, 25); + this.label_lat.TabIndex = 10; + this.label_lat.Text = "快锁"; + this.label_lat.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_lng + // + this.label_lng.BackColor = System.Drawing.Color.Transparent; + this.label_lng.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_lng.ForeColor = System.Drawing.Color.Gray; + this.label_lng.Location = new System.Drawing.Point(101, 66); + this.label_lng.Name = "label_lng"; + this.label_lng.Size = new System.Drawing.Size(109, 25); + this.label_lng.TabIndex = 9; + this.label_lng.Text = "快锁"; + this.label_lng.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // labelLocation // this.labelLocation.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); @@ -151,8 +224,8 @@ // this.panel2.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_ct_list; this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.panel2.Controls.Add(this.label5); - this.panel2.Controls.Add(this.label4); + this.panel2.Controls.Add(this.label_chnTotal); + this.panel2.Controls.Add(this.label_usaTotal); this.panel2.Controls.Add(this.pictureBox2); this.panel2.Controls.Add(this.pictureBox1); this.panel2.Controls.Add(this.panelSite); @@ -162,36 +235,36 @@ this.panel2.Size = new System.Drawing.Size(785, 642); this.panel2.TabIndex = 3; // - // label5 + // label_chnTotal // - this.label5.BackColor = System.Drawing.Color.Black; - this.label5.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label5.ForeColor = System.Drawing.SystemColors.ControlLight; - this.label5.Location = new System.Drawing.Point(49, 59); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(28, 25); - this.label5.TabIndex = 7; - this.label5.Text = "1"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label_chnTotal.BackColor = System.Drawing.Color.Black; + this.label_chnTotal.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_chnTotal.ForeColor = System.Drawing.SystemColors.ControlLight; + this.label_chnTotal.Location = new System.Drawing.Point(57, 59); + this.label_chnTotal.Name = "label_chnTotal"; + this.label_chnTotal.Size = new System.Drawing.Size(28, 25); + this.label_chnTotal.TabIndex = 7; + this.label_chnTotal.Text = "1"; + this.label_chnTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label4 + // label_usaTotal // - this.label4.BackColor = System.Drawing.Color.Black; - this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.ForeColor = System.Drawing.SystemColors.ControlLight; - this.label4.Location = new System.Drawing.Point(49, 23); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(28, 25); - this.label4.TabIndex = 2; - this.label4.Text = "1"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label_usaTotal.BackColor = System.Drawing.Color.Black; + this.label_usaTotal.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_usaTotal.ForeColor = System.Drawing.SystemColors.ControlLight; + this.label_usaTotal.Location = new System.Drawing.Point(57, 23); + this.label_usaTotal.Name = "label_usaTotal"; + this.label_usaTotal.Size = new System.Drawing.Size(28, 25); + this.label_usaTotal.TabIndex = 2; + this.label_usaTotal.Text = "1"; + this.label_usaTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // pictureBox2 // - this.pictureBox2.BackColor = System.Drawing.Color.White; + this.pictureBox2.BackColor = System.Drawing.Color.Black; this.pictureBox2.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.CHN; this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBox2.Location = new System.Drawing.Point(20, 60); + this.pictureBox2.Location = new System.Drawing.Point(28, 60); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(24, 24); this.pictureBox2.TabIndex = 6; @@ -199,10 +272,10 @@ // // pictureBox1 // - this.pictureBox1.BackColor = System.Drawing.Color.White; + this.pictureBox1.BackColor = System.Drawing.Color.Black; this.pictureBox1.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.USA; this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBox1.Location = new System.Drawing.Point(20, 23); + this.pictureBox1.Location = new System.Drawing.Point(28, 23); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(24, 24); this.pictureBox1.TabIndex = 5; @@ -228,6 +301,9 @@ // panelTime // this.panelTime.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_time; + this.panelTime.Controls.Add(this.label_mjd); + this.panelTime.Controls.Add(this.label_time); + this.panelTime.Controls.Add(this.label_date); this.panelTime.Controls.Add(this.labelTime); this.panelTime.Controls.Add(this.label7); this.panelTime.Controls.Add(this.label6); @@ -237,6 +313,42 @@ this.panelTime.Size = new System.Drawing.Size(220, 197); this.panelTime.TabIndex = 4; // + // label_mjd + // + this.label_mjd.BackColor = System.Drawing.Color.Transparent; + this.label_mjd.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_mjd.ForeColor = System.Drawing.Color.Gray; + this.label_mjd.Location = new System.Drawing.Point(101, 143); + this.label_mjd.Name = "label_mjd"; + this.label_mjd.Size = new System.Drawing.Size(109, 25); + this.label_mjd.TabIndex = 8; + this.label_mjd.Text = "快锁"; + this.label_mjd.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_time + // + this.label_time.BackColor = System.Drawing.Color.Transparent; + this.label_time.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_time.ForeColor = System.Drawing.Color.Gray; + this.label_time.Location = new System.Drawing.Point(101, 103); + this.label_time.Name = "label_time"; + this.label_time.Size = new System.Drawing.Size(109, 25); + this.label_time.TabIndex = 7; + this.label_time.Text = "快锁"; + this.label_time.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_date + // + this.label_date.BackColor = System.Drawing.Color.Transparent; + this.label_date.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_date.ForeColor = System.Drawing.Color.Gray; + this.label_date.Location = new System.Drawing.Point(101, 63); + this.label_date.Name = "label_date"; + this.label_date.Size = new System.Drawing.Size(109, 25); + this.label_date.TabIndex = 6; + this.label_date.Text = "快锁"; + this.label_date.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // labelTime // this.labelTime.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); @@ -286,7 +398,7 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label8); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); this.panelBase.Controls.Add(this.label3); this.panelBase.Controls.Add(this.label2); @@ -297,17 +409,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 156); this.panelBase.TabIndex = 3; // - // label8 + // label_receiverStatus // - this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label8.ForeColor = System.Drawing.Color.Gray; - this.label8.Location = new System.Drawing.Point(99, 100); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(67, 25); - this.label8.TabIndex = 5; - this.label8.Text = "定位有效"; - this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 100); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 5; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -398,10 +510,18 @@ private System.Windows.Forms.Panel panelSite; private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label4; private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label label_clockStatus; + public System.Windows.Forms.Label label_z; + public System.Windows.Forms.Label label_y; + public System.Windows.Forms.Label label_x; + public System.Windows.Forms.Label label_lat; + public System.Windows.Forms.Label label_lng; + public System.Windows.Forms.Label label_mjd; + public System.Windows.Forms.Label label_time; + public System.Windows.Forms.Label label_date; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; + public System.Windows.Forms.Label label_chnTotal; + public System.Windows.Forms.Label label_usaTotal; } } diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.cs b/RbFreqStandMeasure/status/StatusCtrlForm.cs index 2337d58..68f50a9 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.cs @@ -11,14 +11,17 @@ { public partial class StatusCtrlForm : UserControl { + public static StatusCtrlForm statusCtrlForm; + public static Coordinate coo; public StatusCtrlForm() { InitializeComponent(); + statusCtrlForm = this; //panelSite.BackgroundImage = Properties.Resources.地球; - //Coordinate coo = new Coordinate(); - //panelSite.Controls.Add(coo); - //coo.Show(); + coo = new Coordinate(); + panelSite.Controls.Add(coo); + coo.Show(); } } } diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 2007aeb..164d277 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -22,6 +22,9 @@ CounterDataService CounterDataService = new CounterDataServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); #region 无边框拖动效果/最小化窗口/关闭窗口 [DllImport("user32.dll")]//拖动无窗体的控件 @@ -49,16 +52,13 @@ { InitializeComponent(); timePicker_startTime.Value = DateTime.Now; - timePicker_startTime.MinDate = DateTime.Now; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; + timePicker_startTime.MinDate = DateTime.Now; } // 开始检测 private void btnSave_Click(object sender, EventArgs e) { - if(!text_devType.Text.Equals("计数器") && text_channelNo.Text.Equals("")) + if(!text_devType.Text.Equals("频率计数器") && text_channelNo.Text.Equals("")) { MessageBox.Show("请选择通道!"); return; @@ -68,7 +68,7 @@ MessageBox.Show("请选择频率稳定度采样时间!"); return; } - if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked && !checkBox_count.Checked) + if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked ) { MessageBox.Show("请选择检测项目!"); return; @@ -86,50 +86,6 @@ if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - CounterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - inDetecCounterId = -1; - - }).Start(); - } - } } else { @@ -137,7 +93,6 @@ if (checkBox_accuracy.Checked) accuracy = "-2"; if (checkBox_bootFeature.Checked) bootFeature = "-2"; if (checkBox_ageRate.Checked) ageRate = "-2"; - if (checkBox_count.Checked) counterDetec = "-2"; } if (checkBox_stability.Checked) @@ -149,7 +104,7 @@ } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text); this.HideMaskAction(); @@ -254,5 +209,7 @@ { getEndTime(); } + + } } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 7f555e1..4f3e7b8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -64,7 +64,6 @@ this.channel4 = new DevComponents.Editors.ComboItem(); this.channel5 = new DevComponents.Editors.ComboItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.checkBox_ageRate = new System.Windows.Forms.CheckBox(); this.checkBox_bootFeature = new System.Windows.Forms.CheckBox(); this.checkBox_accuracy = new System.Windows.Forms.CheckBox(); @@ -75,13 +74,13 @@ this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label6 = new System.Windows.Forms.Label(); - this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.radio_100s = new System.Windows.Forms.RadioButton(); this.radio_20s = new System.Windows.Forms.RadioButton(); this.radio_10s = new System.Windows.Forms.RadioButton(); this.radio_1s = new System.Windows.Forms.RadioButton(); + this.label6 = new System.Windows.Forms.Label(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -534,7 +533,6 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.checkBox_count); this.groupBox1.Controls.Add(this.checkBox_ageRate); this.groupBox1.Controls.Add(this.checkBox_bootFeature); this.groupBox1.Controls.Add(this.checkBox_accuracy); @@ -547,27 +545,16 @@ this.groupBox1.Enabled = false; this.groupBox1.Location = new System.Drawing.Point(10, 210); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(617, 140); + this.groupBox1.Size = new System.Drawing.Size(617, 127); this.groupBox1.TabIndex = 39; this.groupBox1.TabStop = false; this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(114, 55); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 351; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // checkBox_ageRate // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(467, 25); + this.checkBox_ageRate.Location = new System.Drawing.Point(467, 29); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 350; @@ -578,7 +565,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 25); + this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 29); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 349; @@ -589,7 +576,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(232, 25); + this.checkBox_accuracy.Location = new System.Drawing.Point(232, 29); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 347; @@ -600,7 +587,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(114, 25); + this.checkBox_stability.Location = new System.Drawing.Point(114, 29); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 348; @@ -621,7 +608,7 @@ this.endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.endTime.IsPopupCalendarOpen = false; - this.endTime.Location = new System.Drawing.Point(395, 94); + this.endTime.Location = new System.Drawing.Point(401, 75); // // // @@ -653,7 +640,7 @@ this.endTime.MonthCalendar.TodayButtonVisible = true; this.endTime.Name = "endTime"; this.endTime.ShowUpDown = true; - this.endTime.Size = new System.Drawing.Size(180, 23); + this.endTime.Size = new System.Drawing.Size(210, 23); this.endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.endTime.TabIndex = 44; this.endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -671,7 +658,7 @@ this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.startTime.IsPopupCalendarOpen = false; - this.startTime.Location = new System.Drawing.Point(107, 94); + this.startTime.Location = new System.Drawing.Point(107, 75); // // // @@ -703,7 +690,7 @@ this.startTime.MonthCalendar.TodayButtonVisible = true; this.startTime.Name = "startTime"; this.startTime.ShowUpDown = true; - this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Size = new System.Drawing.Size(200, 23); this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.startTime.TabIndex = 43; this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -711,7 +698,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(290, 92); + this.label3.Location = new System.Drawing.Point(298, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -722,7 +709,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(5, 92); + this.label12.Location = new System.Drawing.Point(5, 73); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -733,7 +720,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(5, 23); + this.label13.Location = new System.Drawing.Point(5, 27); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -749,12 +736,64 @@ this.groupBox2.Controls.Add(this.radio_1s); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Enabled = false; - this.groupBox2.Location = new System.Drawing.Point(9, 353); + this.groupBox2.Location = new System.Drawing.Point(9, 342); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(618, 53); this.groupBox2.TabIndex = 40; this.groupBox2.TabStop = false; // + // radio_100s + // + this.radio_100s.AutoSize = true; + this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_100s.Location = new System.Drawing.Point(468, 19); + this.radio_100s.Name = "radio_100s"; + this.radio_100s.Size = new System.Drawing.Size(57, 24); + this.radio_100s.TabIndex = 47; + this.radio_100s.TabStop = true; + this.radio_100s.Tag = "100"; + this.radio_100s.Text = "100s"; + this.radio_100s.UseVisualStyleBackColor = true; + // + // radio_20s + // + this.radio_20s.AutoSize = true; + this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_20s.Location = new System.Drawing.Point(349, 20); + this.radio_20s.Name = "radio_20s"; + this.radio_20s.Size = new System.Drawing.Size(49, 24); + this.radio_20s.TabIndex = 46; + this.radio_20s.TabStop = true; + this.radio_20s.Tag = "20"; + this.radio_20s.Text = "20s"; + this.radio_20s.UseVisualStyleBackColor = true; + // + // radio_10s + // + this.radio_10s.AutoSize = true; + this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_10s.Location = new System.Drawing.Point(233, 19); + this.radio_10s.Name = "radio_10s"; + this.radio_10s.Size = new System.Drawing.Size(49, 24); + this.radio_10s.TabIndex = 45; + this.radio_10s.TabStop = true; + this.radio_10s.Tag = "10"; + this.radio_10s.Text = "10s"; + this.radio_10s.UseVisualStyleBackColor = true; + // + // radio_1s + // + this.radio_1s.AutoSize = true; + this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_1s.Location = new System.Drawing.Point(115, 20); + this.radio_1s.Name = "radio_1s"; + this.radio_1s.Size = new System.Drawing.Size(41, 24); + this.radio_1s.TabIndex = 44; + this.radio_1s.TabStop = true; + this.radio_1s.Tag = "1"; + this.radio_1s.Text = "1s"; + this.radio_1s.UseVisualStyleBackColor = true; + // // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); @@ -812,58 +851,6 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // - // radio_100s - // - this.radio_100s.AutoSize = true; - this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_100s.Location = new System.Drawing.Point(468, 19); - this.radio_100s.Name = "radio_100s"; - this.radio_100s.Size = new System.Drawing.Size(57, 24); - this.radio_100s.TabIndex = 47; - this.radio_100s.TabStop = true; - this.radio_100s.Tag = "100"; - this.radio_100s.Text = "100s"; - this.radio_100s.UseVisualStyleBackColor = true; - // - // radio_20s - // - this.radio_20s.AutoSize = true; - this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_20s.Location = new System.Drawing.Point(349, 20); - this.radio_20s.Name = "radio_20s"; - this.radio_20s.Size = new System.Drawing.Size(49, 24); - this.radio_20s.TabIndex = 46; - this.radio_20s.TabStop = true; - this.radio_20s.Tag = "20"; - this.radio_20s.Text = "20s"; - this.radio_20s.UseVisualStyleBackColor = true; - // - // radio_10s - // - this.radio_10s.AutoSize = true; - this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_10s.Location = new System.Drawing.Point(233, 19); - this.radio_10s.Name = "radio_10s"; - this.radio_10s.Size = new System.Drawing.Size(49, 24); - this.radio_10s.TabIndex = 45; - this.radio_10s.TabStop = true; - this.radio_10s.Tag = "10"; - this.radio_10s.Text = "10s"; - this.radio_10s.UseVisualStyleBackColor = true; - // - // radio_1s - // - this.radio_1s.AutoSize = true; - this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_1s.Location = new System.Drawing.Point(115, 20); - this.radio_1s.Name = "radio_1s"; - this.radio_1s.Size = new System.Drawing.Size(41, 24); - this.radio_1s.TabIndex = 44; - this.radio_1s.TabStop = true; - this.radio_1s.Tag = "1"; - this.radio_1s.Text = "1s"; - this.radio_1s.UseVisualStyleBackColor = true; - // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -931,7 +918,6 @@ public System.Windows.Forms.CheckBox checkBox_startNow; public DevComponents.Editors.DateTimeAdv.DateTimeInput endTime; public DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; - public System.Windows.Forms.CheckBox checkBox_count; public System.Windows.Forms.CheckBox checkBox_ageRate; public System.Windows.Forms.CheckBox checkBox_bootFeature; public System.Windows.Forms.CheckBox checkBox_accuracy; diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index ecfc137..19169bb 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -3,6 +3,8 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.Tools; using DevComponents.DotNetBar.Controls; using DevComponents.Editors; @@ -36,7 +38,7 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); CounterDataService counterDataService = new CounterDataServiceImpl(); - + SensitivityService sensitivityService = new SensitivityServiceImpl(); public Action HideMaskAction { @@ -53,7 +55,7 @@ cbBox_devType.DisplayMember = "Name"; cbBox_devType.ValueMember = "Code"; - btnSave.Text = "添加"; + btnSave.Text = "保存"; if (HomeCtrlForm.channelFreeList.Count > 0) { cbBox_channelFree.Items.Add(""); @@ -61,12 +63,11 @@ { cbBox_channelFree.Items.Add(item); } - } else { text_channelNo.WatermarkText = "无空闲通道"; - + groupBox1.Enabled = false; } } @@ -116,6 +117,14 @@ return; } } + if (checkBox_accuracy.Checked || checkBox_stability.Checked || checkBox_ageRate.Checked || checkBox_bootFeature.Checked) + { + if (text_channelNo.Text.Trim() == "") + { + MessageBox.Show("请选择通道号!"); + return; + } + } // 取得输入框的参数 string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; @@ -133,64 +142,18 @@ { long deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo); if (deviceId != -1) - { - + { string stability = "-3"; string accuracy = "-3"; string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (checkBox_startNow.Checked || startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1"; } if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (SetDevTestDlg.inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - SetDevTestDlg.inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - counterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - SetDevTestDlg.inDetecCounterId = -1; - - }).Start(); - } - } + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -207,7 +170,7 @@ else if (radio_20s.Checked) interval = "20"; else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text); // 重新加载首页的通道状态 HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -218,7 +181,7 @@ } else { - LogHelper.WriteErrorLog(this.GetType(), "添仪器[" + devName + "]失败"); + LogHelper.WriteErrorLog(this.GetType(), "添加仪器[" + devName + "]失败"); } } else if (labelTitle.Text.Equals("修改")) @@ -256,21 +219,23 @@ private void cbBox_devType_SelectedIndexChanged(object sender, EventArgs e) { - text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; + text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; } private void cbBox_channelFree_SelectedIndexChanged(object sender, EventArgs e) { text_channelNo.Text = cbBox_channelFree.SelectedItem.ToString(); - - if (text_channelNo.Text != "") + if (text_channelNo.Text.Equals("")) { - checkBox_startNow.Enabled = true; - groupBox1.Enabled = true; + groupBox1.Enabled = false; + checkBox_accuracy.Checked = false; + checkBox_stability.Checked = false; + checkBox_ageRate.Checked = false; + checkBox_bootFeature.Checked = false; } else { - groupBox1.Enabled = false; checkBox_startNow.Enabled = false; + groupBox1.Enabled = true; } } diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 29d4d57..7c1cfbc 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -210,16 +210,16 @@ devList = new DataTable(); // 设置表格的列 - devList.Columns.Add("index", Type.GetType("System.String")); - devList.Columns.Add("regTime", Type.GetType("System.String")); - devList.Columns.Add("devName", Type.GetType("System.String")); - devList.Columns.Add("devModel", Type.GetType("System.String")); - devList.Columns.Add("devCode", Type.GetType("System.String")); - devList.Columns.Add("customComp", Type.GetType("System.String")); - devList.Columns.Add("customName", Type.GetType("System.String")); - devList.Columns.Add("status", Type.GetType("System.String")); - devList.Columns.Add("channelNo", Type.GetType("System.String")); - devList.Columns.Add("id", Type.GetType("System.Int64")); + devList.Columns.Add("index", Type.GetType("System.String"));//0 + devList.Columns.Add("regTime", Type.GetType("System.String"));//1 + devList.Columns.Add("devName", Type.GetType("System.String"));//2 + devList.Columns.Add("devModel", Type.GetType("System.String"));//3 + devList.Columns.Add("devCode", Type.GetType("System.String"));//4 + devList.Columns.Add("customComp", Type.GetType("System.String"));//5 + devList.Columns.Add("customName", Type.GetType("System.String"));//6 + devList.Columns.Add("status", Type.GetType("System.String"));//7 + devList.Columns.Add("channelNo", Type.GetType("System.String"));//8 + devList.Columns.Add("id", Type.GetType("System.Int64"));//9 // 分页查询数据库 string devName = ""; @@ -500,10 +500,8 @@ editDlg.inputCustName.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value; editDlg.text_channelNo.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[8].Value; editDlg.btnSave.Text = "保存"; - if (((string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[rowIndex].Cells[7].Value).Equals("检测中")) { - editDlg.btn_downChannelList.Enabled = false; - editDlg.text_channelNo.ReadOnly = true; DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DetectionItem detectionItem = (detectionItemService.search(id, true))[0]; editDlg.groupBox1.Enabled = false; @@ -517,6 +515,10 @@ } if (!detectionItem.BootFeature.Equals("-3")) editDlg.checkBox_bootFeature.Checked = true; if (!detectionItem.AgeRate.Equals("-3")) editDlg.checkBox_ageRate.Checked = true; + editDlg.groupBox2.Enabled = false; + editDlg.groupBox1.Enabled = false; + editDlg.btn_downChannelList.Enabled = false; + editDlg.text_channelNo.Enabled = false; } editDlg.HideMaskAction += () => { @@ -539,7 +541,7 @@ private void btnDelete_Click(object sender, EventArgs e) { - if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[7].Value).Equals("检测中")) { MessageBox.Show("该仪器在检测中,无法删除!"); return; diff --git a/RbFreqStandMeasure/info/ageRate.designer.cs b/RbFreqStandMeasure/info/ageRate.designer.cs index c676897..5780827 100644 --- a/RbFreqStandMeasure/info/ageRate.designer.cs +++ b/RbFreqStandMeasure/info/ageRate.designer.cs @@ -67,7 +67,7 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(316, 8); + this.label1.Location = new System.Drawing.Point(318, 35); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(83, 27); @@ -78,7 +78,7 @@ // this.label4.BackColor = System.Drawing.Color.Transparent; this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(197, 8); + this.label4.Location = new System.Drawing.Point(199, 35); this.label4.Margin = new System.Windows.Forms.Padding(0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(119, 27); @@ -115,7 +115,7 @@ this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label3.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label3.Location = new System.Drawing.Point(316, 35); + this.label3.Location = new System.Drawing.Point(318, 8); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(83, 27); @@ -126,7 +126,7 @@ // this.label5.BackColor = System.Drawing.Color.Transparent; this.label5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label5.Location = new System.Drawing.Point(229, 35); + this.label5.Location = new System.Drawing.Point(231, 8); this.label5.Margin = new System.Windows.Forms.Padding(0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(87, 27); diff --git a/RbFreqStandMeasure/info/stability.designer.cs b/RbFreqStandMeasure/info/stability.designer.cs index 63e8678..791a330 100644 --- a/RbFreqStandMeasure/info/stability.designer.cs +++ b/RbFreqStandMeasure/info/stability.designer.cs @@ -32,8 +32,6 @@ this.label_devModel = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // label_customerName @@ -41,7 +39,7 @@ this.label_customerName.BackColor = System.Drawing.Color.Transparent; this.label_customerName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_customerName.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label_customerName.Location = new System.Drawing.Point(197, 126); + this.label_customerName.Location = new System.Drawing.Point(197, 91); this.label_customerName.Margin = new System.Windows.Forms.Padding(0); this.label_customerName.Name = "label_customerName"; this.label_customerName.Size = new System.Drawing.Size(83, 27); @@ -64,7 +62,7 @@ // this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(110, 126); + this.label2.Location = new System.Drawing.Point(110, 91); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(87, 27); @@ -84,36 +82,10 @@ this.label9.Text = "测量结果:"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(197, 82); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(83, 27); - this.label1.TabIndex = 86; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label4 - // - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(110, 82); - this.label4.Margin = new System.Windows.Forms.Padding(0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(87, 27); - this.label4.TabIndex = 85; - this.label4.Text = "标准偏差:"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // // stability // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.White; - this.Controls.Add(this.label1); - this.Controls.Add(this.label4); this.Controls.Add(this.label_customerName); this.Controls.Add(this.label_devModel); this.Controls.Add(this.label2); @@ -129,7 +101,5 @@ private System.Windows.Forms.Label label_devModel; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label4; } } diff --git a/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs b/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs index 360b1eb..eefaa8d 100644 --- a/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs @@ -480,7 +480,7 @@ this.label11.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label11.Location = new System.Drawing.Point(801, 89); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(45, 30); + this.label11.Size = new System.Drawing.Size(64, 30); this.label11.TabIndex = 16; this.label11.Text = "VRMS"; this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -554,7 +554,7 @@ this.label6.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label6.Location = new System.Drawing.Point(801, 39); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(45, 30); + this.label6.Size = new System.Drawing.Size(64, 30); this.label6.TabIndex = 10; this.label6.Text = "VRMS"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; diff --git a/RbFreqStandMeasure/status/Coordinate.cs b/RbFreqStandMeasure/status/Coordinate.cs index 0f8a990..82c91cb 100644 --- a/RbFreqStandMeasure/status/Coordinate.cs +++ b/RbFreqStandMeasure/status/Coordinate.cs @@ -205,16 +205,18 @@ int offset = padding + 5; gp.DrawEllipse(dashPen, offset, offset, this.Width - offset * 2, this.Width - offset * 2);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter, offset + inter, this.Width - offset * 2 - 2* inter, this.Width - offset * 2 - 2 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 - gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter * 2, offset + inter*2, this.Width - offset * 2 - 4 * inter, this.Width - offset * 2 - 4 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 + gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter * 3, offset + inter*3, this.Width - offset * 2 - 6 * inter, this.Width - offset * 2 - 6 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 // 画点 - X = 100; - Y = 100; - gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("USA"), X, Y); + brush = new SolidBrush(Color.Gray); + X = this.Width - padding - offset - inter; + Y = this.Height/2; + gp.DrawString("30", scaleFont, brush, new Point(X, Y)); + //gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("USA"), X, Y); - X = 200; - Y = 300; - gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("CHN"), X, Y); + X = X-50*2; + gp.DrawString("60", scaleFont, brush, new Point(X, Y)); + //gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("CHN"), X, Y); g.DrawImage(bit, 0, 0); gp.Dispose(); diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs index fdb2eb6..bb130f0 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs @@ -30,6 +30,11 @@ private void InitializeComponent() { this.panelLocation = new System.Windows.Forms.Panel(); + this.label_z = new System.Windows.Forms.Label(); + this.label_y = new System.Windows.Forms.Label(); + this.label_x = new System.Windows.Forms.Label(); + this.label_lat = new System.Windows.Forms.Label(); + this.label_lng = new System.Windows.Forms.Label(); this.labelLocation = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label(); @@ -37,19 +42,22 @@ this.label9 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel(); - this.label5 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); + this.label_chnTotal = new System.Windows.Forms.Label(); + this.label_usaTotal = new System.Windows.Forms.Label(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.panelSite = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel(); this.panelTime = new System.Windows.Forms.Panel(); + this.label_mjd = new System.Windows.Forms.Label(); + this.label_time = new System.Windows.Forms.Label(); + this.label_date = new System.Windows.Forms.Label(); this.labelTime = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.panelBase = new System.Windows.Forms.Panel(); - this.label8 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); @@ -65,6 +73,11 @@ // panelLocation // this.panelLocation.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_location; + this.panelLocation.Controls.Add(this.label_z); + this.panelLocation.Controls.Add(this.label_y); + this.panelLocation.Controls.Add(this.label_x); + this.panelLocation.Controls.Add(this.label_lat); + this.panelLocation.Controls.Add(this.label_lng); this.panelLocation.Controls.Add(this.labelLocation); this.panelLocation.Controls.Add(this.label13); this.panelLocation.Controls.Add(this.label12); @@ -76,6 +89,66 @@ this.panelLocation.Size = new System.Drawing.Size(220, 289); this.panelLocation.TabIndex = 5; // + // label_z + // + this.label_z.BackColor = System.Drawing.Color.Transparent; + this.label_z.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_z.ForeColor = System.Drawing.Color.Gray; + this.label_z.Location = new System.Drawing.Point(101, 226); + this.label_z.Name = "label_z"; + this.label_z.Size = new System.Drawing.Size(109, 25); + this.label_z.TabIndex = 13; + this.label_z.Text = "快锁"; + this.label_z.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_y + // + this.label_y.BackColor = System.Drawing.Color.Transparent; + this.label_y.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_y.ForeColor = System.Drawing.Color.Gray; + this.label_y.Location = new System.Drawing.Point(101, 186); + this.label_y.Name = "label_y"; + this.label_y.Size = new System.Drawing.Size(109, 25); + this.label_y.TabIndex = 12; + this.label_y.Text = "快锁"; + this.label_y.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_x + // + this.label_x.BackColor = System.Drawing.Color.Transparent; + this.label_x.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_x.ForeColor = System.Drawing.Color.Gray; + this.label_x.Location = new System.Drawing.Point(101, 146); + this.label_x.Name = "label_x"; + this.label_x.Size = new System.Drawing.Size(109, 25); + this.label_x.TabIndex = 11; + this.label_x.Text = "快锁"; + this.label_x.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_lat + // + this.label_lat.BackColor = System.Drawing.Color.Transparent; + this.label_lat.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_lat.ForeColor = System.Drawing.Color.Gray; + this.label_lat.Location = new System.Drawing.Point(101, 106); + this.label_lat.Name = "label_lat"; + this.label_lat.Size = new System.Drawing.Size(109, 25); + this.label_lat.TabIndex = 10; + this.label_lat.Text = "快锁"; + this.label_lat.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_lng + // + this.label_lng.BackColor = System.Drawing.Color.Transparent; + this.label_lng.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_lng.ForeColor = System.Drawing.Color.Gray; + this.label_lng.Location = new System.Drawing.Point(101, 66); + this.label_lng.Name = "label_lng"; + this.label_lng.Size = new System.Drawing.Size(109, 25); + this.label_lng.TabIndex = 9; + this.label_lng.Text = "快锁"; + this.label_lng.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // labelLocation // this.labelLocation.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); @@ -151,8 +224,8 @@ // this.panel2.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_ct_list; this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.panel2.Controls.Add(this.label5); - this.panel2.Controls.Add(this.label4); + this.panel2.Controls.Add(this.label_chnTotal); + this.panel2.Controls.Add(this.label_usaTotal); this.panel2.Controls.Add(this.pictureBox2); this.panel2.Controls.Add(this.pictureBox1); this.panel2.Controls.Add(this.panelSite); @@ -162,36 +235,36 @@ this.panel2.Size = new System.Drawing.Size(785, 642); this.panel2.TabIndex = 3; // - // label5 + // label_chnTotal // - this.label5.BackColor = System.Drawing.Color.Black; - this.label5.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label5.ForeColor = System.Drawing.SystemColors.ControlLight; - this.label5.Location = new System.Drawing.Point(49, 59); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(28, 25); - this.label5.TabIndex = 7; - this.label5.Text = "1"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label_chnTotal.BackColor = System.Drawing.Color.Black; + this.label_chnTotal.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_chnTotal.ForeColor = System.Drawing.SystemColors.ControlLight; + this.label_chnTotal.Location = new System.Drawing.Point(57, 59); + this.label_chnTotal.Name = "label_chnTotal"; + this.label_chnTotal.Size = new System.Drawing.Size(28, 25); + this.label_chnTotal.TabIndex = 7; + this.label_chnTotal.Text = "1"; + this.label_chnTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label4 + // label_usaTotal // - this.label4.BackColor = System.Drawing.Color.Black; - this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.ForeColor = System.Drawing.SystemColors.ControlLight; - this.label4.Location = new System.Drawing.Point(49, 23); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(28, 25); - this.label4.TabIndex = 2; - this.label4.Text = "1"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label_usaTotal.BackColor = System.Drawing.Color.Black; + this.label_usaTotal.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_usaTotal.ForeColor = System.Drawing.SystemColors.ControlLight; + this.label_usaTotal.Location = new System.Drawing.Point(57, 23); + this.label_usaTotal.Name = "label_usaTotal"; + this.label_usaTotal.Size = new System.Drawing.Size(28, 25); + this.label_usaTotal.TabIndex = 2; + this.label_usaTotal.Text = "1"; + this.label_usaTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // pictureBox2 // - this.pictureBox2.BackColor = System.Drawing.Color.White; + this.pictureBox2.BackColor = System.Drawing.Color.Black; this.pictureBox2.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.CHN; this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBox2.Location = new System.Drawing.Point(20, 60); + this.pictureBox2.Location = new System.Drawing.Point(28, 60); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(24, 24); this.pictureBox2.TabIndex = 6; @@ -199,10 +272,10 @@ // // pictureBox1 // - this.pictureBox1.BackColor = System.Drawing.Color.White; + this.pictureBox1.BackColor = System.Drawing.Color.Black; this.pictureBox1.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.USA; this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBox1.Location = new System.Drawing.Point(20, 23); + this.pictureBox1.Location = new System.Drawing.Point(28, 23); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(24, 24); this.pictureBox1.TabIndex = 5; @@ -228,6 +301,9 @@ // panelTime // this.panelTime.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_time; + this.panelTime.Controls.Add(this.label_mjd); + this.panelTime.Controls.Add(this.label_time); + this.panelTime.Controls.Add(this.label_date); this.panelTime.Controls.Add(this.labelTime); this.panelTime.Controls.Add(this.label7); this.panelTime.Controls.Add(this.label6); @@ -237,6 +313,42 @@ this.panelTime.Size = new System.Drawing.Size(220, 197); this.panelTime.TabIndex = 4; // + // label_mjd + // + this.label_mjd.BackColor = System.Drawing.Color.Transparent; + this.label_mjd.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_mjd.ForeColor = System.Drawing.Color.Gray; + this.label_mjd.Location = new System.Drawing.Point(101, 143); + this.label_mjd.Name = "label_mjd"; + this.label_mjd.Size = new System.Drawing.Size(109, 25); + this.label_mjd.TabIndex = 8; + this.label_mjd.Text = "快锁"; + this.label_mjd.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_time + // + this.label_time.BackColor = System.Drawing.Color.Transparent; + this.label_time.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_time.ForeColor = System.Drawing.Color.Gray; + this.label_time.Location = new System.Drawing.Point(101, 103); + this.label_time.Name = "label_time"; + this.label_time.Size = new System.Drawing.Size(109, 25); + this.label_time.TabIndex = 7; + this.label_time.Text = "快锁"; + this.label_time.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_date + // + this.label_date.BackColor = System.Drawing.Color.Transparent; + this.label_date.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_date.ForeColor = System.Drawing.Color.Gray; + this.label_date.Location = new System.Drawing.Point(101, 63); + this.label_date.Name = "label_date"; + this.label_date.Size = new System.Drawing.Size(109, 25); + this.label_date.TabIndex = 6; + this.label_date.Text = "快锁"; + this.label_date.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // labelTime // this.labelTime.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); @@ -286,7 +398,7 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label8); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); this.panelBase.Controls.Add(this.label3); this.panelBase.Controls.Add(this.label2); @@ -297,17 +409,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 156); this.panelBase.TabIndex = 3; // - // label8 + // label_receiverStatus // - this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label8.ForeColor = System.Drawing.Color.Gray; - this.label8.Location = new System.Drawing.Point(99, 100); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(67, 25); - this.label8.TabIndex = 5; - this.label8.Text = "定位有效"; - this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 100); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 5; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -398,10 +510,18 @@ private System.Windows.Forms.Panel panelSite; private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label4; private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label label_clockStatus; + public System.Windows.Forms.Label label_z; + public System.Windows.Forms.Label label_y; + public System.Windows.Forms.Label label_x; + public System.Windows.Forms.Label label_lat; + public System.Windows.Forms.Label label_lng; + public System.Windows.Forms.Label label_mjd; + public System.Windows.Forms.Label label_time; + public System.Windows.Forms.Label label_date; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; + public System.Windows.Forms.Label label_chnTotal; + public System.Windows.Forms.Label label_usaTotal; } } diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.cs b/RbFreqStandMeasure/status/StatusCtrlForm.cs index 2337d58..68f50a9 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.cs @@ -11,14 +11,17 @@ { public partial class StatusCtrlForm : UserControl { + public static StatusCtrlForm statusCtrlForm; + public static Coordinate coo; public StatusCtrlForm() { InitializeComponent(); + statusCtrlForm = this; //panelSite.BackgroundImage = Properties.Resources.地球; - //Coordinate coo = new Coordinate(); - //panelSite.Controls.Add(coo); - //coo.Show(); + coo = new Coordinate(); + panelSite.Controls.Add(coo); + coo.Show(); } } } diff --git a/RbFreqStandMeasure/tools/DetectionHelper.cs b/RbFreqStandMeasure/tools/DetectionHelper.cs index 8eba3fa..1546de6 100644 --- a/RbFreqStandMeasure/tools/DetectionHelper.cs +++ b/RbFreqStandMeasure/tools/DetectionHelper.cs @@ -1,12 +1,12 @@ -using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; +using Casic.Birmm.RbFreqStandMeasure.Properties; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.Tools; using System; using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.IO; +using System.Drawing; +using System.Drawing.Drawing2D; using System.IO.Ports; using System.Linq; using System.Reflection; @@ -42,9 +42,13 @@ private static DetectionItemService detectionItemService = new DetectionItemServiceImpl(); private static DeviceService deviceService = new DeviceServiceImpl(); + + private static System.Threading.Timer timerClock; + + private static System.Threading.Timer timerSatellite; //1-STABILITY,2-ACCURACY,3-BOOT_FEATURE,4-AGE_RATE - + public static void detecAccuracy(long deviceId, SerialPort port, DateTime endTime) @@ -105,10 +109,7 @@ if (resultStability.Count == 101) { - /////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /// - + result = FreMath.Stable(resultStability) + ""; detectionItemService.updateDetecStatus(devIdStability, result, "", "", "", ""); @@ -209,10 +210,9 @@ if (resultAgeRate.Count == 15) { - /////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /// - + double r = 0.0; + double k= FreMath.DriftRate(resultAgeRate, out r); + result = k + "," + r; detectionItemService.updateDetecStatus(devIdAgeRate, "", "","", result, ""); @@ -243,7 +243,6 @@ string[] names = SerialPort.GetPortNames(); if (names.Length == 0 || Array.IndexOf(names, portName) == -1) { - MessageBox.Show("没有搜索到串口" + portName + "!"); return null; } // 设置串口参数 @@ -325,10 +324,23 @@ } // 获取铷钟数据 - public static string getClockData(SerialPort port) + public static void startClockFresh() { - string clockStatus = ""; + timerClock = new System.Threading.Timer(exeClock, null, 50, 60 * 1000); + + } + public static void exeClock(Object State) + { + string portName = ConfigHelper.GetAppConfig("clock").Split(' ')[0]; + int bandRate = Convert.ToInt32(ConfigHelper.GetAppConfig("clock").Split(' ')[1]); + SerialPort port = portOpen(portName, bandRate); + if (port == null) + { + MessageBox.Show("无法打开串口"+portName+",原子钟状态获取失败!"); + return; + } int count = 0; + string clockStatus = ""; while (count < 5) { int Readlen = port.BytesToRead; @@ -337,9 +349,9 @@ { byte[] buffer = new byte[Readlen]; port.Read(buffer, 0, Readlen);// 接收数据到buffer里面 - string data = Encoding.ASCII.GetString(buffer); + string data = Encoding.ASCII.GetString(buffer); if (data.StartsWith("$") && data.Contains("*")) - { + { string clockStatusCode = data.Split(',')[9]; switch (clockStatusCode) { @@ -352,96 +364,284 @@ default: break; } break; - } - } - count++; - } - - return clockStatus; - - - } - - // 获取卫星RMC数据 - public static string getSatelliteRMCData(SerialPort port) - { - // RMC - string strRMC = ""; - - int count = 0; - while (count < 5) - { - int Readlen = port.BytesToRead; - if (Readlen > 0) - { - byte[] buffer = new byte[Readlen]; - port.Read(buffer, 0, Readlen);// 接收数据到buffer里面 - string data = Encoding.ASCII.GetString(buffer); - string[] dataArray = data.Split('$'); - if (dataArray.Length > 9) - { - foreach (string sss in dataArray) - { - if (sss.Contains("GNRMC") && sss.Contains("*")) - { - string[] resultArray = sss.Split(','); - - string time = resultArray[1]; - time = time.Substring(0, 2) + ":" + time.Substring(2, 2) + ":" + time.Substring(4); - string status = resultArray[2]=="A"?"定位有效":"警告"; - string date = resultArray[9]; - date = date.Substring(4, 2) + "-" + date.Substring(2, 2) + "-" + date.Substring(0, 2); - - strRMC = date + "," + time + "," + status; - } - } - } - } - count++; - } - - return strRMC; - } - - // 获取卫星GSV数据 - public static string getSatelliteGSVData(SerialPort port) - { - // RMC - string strRMC = ""; - - int count = 0; - while (count < 5) - { - int Readlen = port.BytesToRead; - if (Readlen > 0) - { - byte[] buffer = new byte[Readlen]; - port.Read(buffer, 0, Readlen);// 接收数据到buffer里面 - string data = Encoding.ASCII.GetString(buffer); - string[] dataArray = data.Split('$'); - if (dataArray.Length > 9) - { - foreach (string sss in dataArray) - { - if (sss.Contains("GNRMC") && sss.Contains("*")) - { - string[] resultArray = sss.Split(','); - - string time = resultArray[1]; - time = time.Substring(0, 2) + ":" + time.Substring(2, 2) + ":" + time.Substring(4); - string status = resultArray[2] == "A" ? "定位有效" : "警告"; - string date = resultArray[9]; - date = date.Substring(4, 2) + "-" + date.Substring(2, 2) + "-" + date.Substring(0, 2); - - strRMC = date + "," + time + "," + status; - } - } } } count++; } - - return strRMC; + + HomeCtrlForm.homeCtrlForm.label_clockStatus.Text = clockStatus; + StatusCtrlForm.statusCtrlForm.label_clockStatus.Text = clockStatus; } + + // 获取卫星RMC数据 + public static void startSatelliteFresh() + { + timerSatellite = new System.Threading.Timer(exeSatellite, null, 50, 60 * 1000); + + } + public static void exeSatellite(Object State) + { + List gpList = new List(); + List bdList = new List(); + + // RMC + string portName = ConfigHelper.GetAppConfig("satellite").Split(' ')[0]; + int bandRate = Convert.ToInt32(ConfigHelper.GetAppConfig("clock").Split(' ')[1]); + SerialPort port = portOpen(portName, bandRate); + + if (port == null) + { + MessageBox.Show("无法打开串口" + portName + ",卫星数据获取失败!"); + return; + } + + int count = 0; + while (count < 5) + { + int Readlen = port.BytesToRead; + if (Readlen > 0) + { + byte[] buffer = new byte[Readlen]; + port.Read(buffer, 0, Readlen);// 接收数据到buffer里面 + string data = Encoding.ASCII.GetString(buffer); + string[] dataArray = data.Split('$'); + if (dataArray.Length > 0) + { + foreach (string sss in dataArray) + { + if (sss.Contains("GPGGA") && sss.Contains("*")) + { + string[] resultArray = sss.Split(','); + + string lat = resultArray[2].Replace(".", "").Insert(2, ".") + resultArray[3]; + string lng = resultArray[4].Replace(".", "").Insert(2, ".") + resultArray[5]; + string x = parseGGA(sss).Split(',')[0]; + string y = parseGGA(sss).Split(',')[1]; + string z = parseGGA(sss).Split(',')[2]; + + new Thread(() => { + StatusCtrlForm.statusCtrlForm.label_lat.Text = lat; + StatusCtrlForm.statusCtrlForm.label_lng.Text = lng; + StatusCtrlForm.statusCtrlForm.label_x.Text = x; + StatusCtrlForm.statusCtrlForm.label_y.Text = y; + StatusCtrlForm.statusCtrlForm.label_z.Text = z; + + }).Start(); + + } + if (sss.Contains("GNRMC") && sss.Contains("*")) + { + string[] resultArray = sss.Split(','); + + string date = resultArray[9]; + date = date.Substring(4, 2) + "-" + date.Substring(2, 2) + "-" + date.Substring(0, 2); + string mjd = getMJD(date.Substring(4, 2), date.Substring(2, 2), date.Substring(0, 2)); + + string time = resultArray[1]; + time = time.Substring(0, 2) + ":" + time.Substring(2, 2) + ":" + time.Substring(4); + + string status = resultArray[2] == "A" ? "定位有效" : "警告"; + + + new Thread(() => { + StatusCtrlForm.statusCtrlForm.label_date.Text = date; + StatusCtrlForm.statusCtrlForm.label_time.Text = time; + StatusCtrlForm.statusCtrlForm.label_receiverStatus.Text = status; + StatusCtrlForm.statusCtrlForm.label_mjd.Text = mjd; + + HomeCtrlForm.homeCtrlForm.label_receiverStatus.Text = status; + }).Start(); + } + if (sss.Contains("GPGSV") || sss.Contains("BDGSV")) + { + if (sss.Split(',')[2].Equals("1")) + { + int totalGP = 0; + int totalBD = 0; + if (sss.Contains("GPGSV")) + { + gpList.Add(sss); + totalGP = Convert.ToInt32(sss.Split(',')[1]); + } + else + { + bdList.Add(sss); + totalBD = Convert.ToInt32(sss.Split(',')[1]); + } + for (int i = 2; i <= (totalGP==0? totalBD: totalGP); i++) + { + Thread.Sleep(1000); + int count2 = 0; + while (count2 < 5) + { + Readlen = port.BytesToRead; + if (Readlen > 0) + { + buffer = new byte[Readlen]; + port.Read(buffer, 0, Readlen);// 接收数据到buffer里面 + data = Encoding.ASCII.GetString(buffer); + dataArray = data.Split('$'); + if (dataArray.Length > 0) + { + foreach (string s in dataArray) + { + if (s.Contains("GPGSV")) + { + if (sss.Split(',')[2].Equals(i + "")) + { + if (sss.Contains("GPGSV")) + { + gpList.Add(sss); + if (gpList.Count == totalGP) + { + new Thread(() => + { + StatusCtrlForm.statusCtrlForm.label_usaTotal.Text = totalGP + ""; + draw(gpList, "USA"); + }).Start(); + } + } + else + { + bdList.Add(sss); + if (bdList.Count == totalBD) + { + new Thread(() => + { + StatusCtrlForm.statusCtrlForm.label_chnTotal.Text = totalBD + ""; + draw(bdList, "CHN"); + }).Start(); + } + } + break; + } + } + } + } + } + count2++; + } + } + } + + } + } + } + break; + } + count++; + } + + } + private static string getMJD(string ys, string ms, string ds) + { + int y = Convert.ToInt32(ys) - 1900; + int m = Convert.ToInt32(ms); + int d = Convert.ToInt32(ds); + int L = 0; + if (m == 1 || m == 2) L = 1; + int njdINT = 14956 + d +(int)((y-L)*365.25)+(int)((m+1+L*12)*30.6001); + return njdINT+""; + } + + private static string parseGGA(string ggaStr) + { + double f = 1 / 298.257223563; /*基准椭球体的极扁率*/ + double a = 6378137.0; /*基准椭球体的长半径*/ + double b = 6356752.314; /*基准椭球体的短半径*/ + double e2 = f * (2 - f); /*基准椭球体的偏心率*/ + double pi_180 = Math.PI / 180; + //$GPGGA,081918.00,3954.7889938,N,11615.5667600,E,1,28,0.68,78.6748,M,-9.7970,M,02,*7D + var arr = ggaStr.Split(','); + + string m_pBs = parseCoord(arr[2], arr[3]); + string m_pLs = parseCoord(arr[4], arr[5]); + string m_pHs = Convert.ToDouble(arr[9]) + Convert.ToDouble(arr[11]) + "";// add 大地水准面高度 纠正误差 + // objBLH.b = util.parseCoord(arr[2],arr[3]); + // objBLH.l = util.parseCoord(arr[4],arr[5]); + // objBLH.h = parseFloat(arr[9]); + string X = "", Y = "", Z = ""; + double m_pB = Convert.ToDouble(m_pBs); + double m_pL = Convert.ToDouble(m_pLs); + double m_pH = Convert.ToDouble(m_pHs); + double N = a / Math.Sqrt(1 - e2 * Math.Sin(m_pB * pi_180) * Math.Sin(m_pB * Math.PI)); + X = (N + m_pH) * Math.Cos(m_pB * pi_180) * Math.Cos(m_pL * Math.PI) + ""; + Y = (N + m_pH) * Math.Cos(m_pB * pi_180) * Math.Sin(m_pL * Math.PI) + ""; + Z = (N * (1 - e2) + m_pH) * Math.Sin(m_pB * pi_180) + ""; + + return X + "," + Y + "," + Z; + } + private static string parseCoord (string coord, string dir) + { + //$GPGGA,081918.00,3954.7889938,N,11615.5667600,E,1,28,0.68,78.6748,M,-9.7970,M,02,*7D + if ( coord.Equals("")) + return null; + int n=1, sgn = 1; + switch (dir) + { + case "S": + sgn = -1; break; + case "N": + n = 2;break; + case "W": + sgn = -1; break; + case "E": + n = 3; break; + default: break; + } + return sgn * (Convert.ToDouble(coord.Substring(0, n)) + Convert.ToDouble(coord.Substring(n)) / 60) + ""; + } + private static string BLH2XYX (string objectBLH) + { + // var objectBLH ={l:116.259446,b:39.91314989666667,h:78.6748};//for test + // var N = a / Math.sqrt(1 - e2 * Math.sin(objectBLH.b * pi_180) * Math.sin(objectBLH.b * pi_180)); + // var X = (N + objectBLH.h) * Math.cos(objectBLH.b * pi_180) * Math.cos(objectBLH.l * pi_180); + // var Y = (N + objectBLH.h) * Math.cos(objectBLH.b * pi_180) * Math.sin(objectBLH.l * pi_180); + // var Z = [N * (1 - e2 ) + objectBLH.h] * Math.sin(objectBLH.b * pi_180); + // var objectXYZ = {}; + // objectXYZ.X = X; + // objectXYZ.Y = Y; + // objectXYZ.Z = Z; + string X="", Y="", Z = ""; + double m_pB = Convert.ToDouble(objectBLH.Split(',')[0]); + double m_pL = Convert.ToDouble(objectBLH.Split(',')[1]); + double m_pH = Convert.ToDouble(objectBLH.Split(',')[2]); + //double N = a / Math.Sqrt(1 - e2 * Math.Sin(m_pB * pi_180) * Math.Sin(m_pB * Math.PI)); + //X = (N + m_pH) * Math.Cos(m_pB * pi_180) * Math.Cos(m_pL * Math.PI); + //Y = (N + m_pH) * Math.Cos(m_pB * pi_180) * Math.Sin(m_pL * Math.PI); + //Z = [N * (1 - e2) + m_pH] * Math.Sin(m_pB * pi_180); + + return X+","+Y+","+Z; + } + + private static void draw(List gsvList, string type) + { + foreach (string gsv in gsvList) + { + string[] arr = gsv.Split(','); + int length = arr.Count(); + for (int i = 4; i < arr.Length; i=i+3) + { + if ((i + 3) < arr.Length) + { + int Elevation = Convert.ToInt32(arr[i + 1]); + int azimuth = Convert.ToInt32(arr[i + 2]); + double cosLen = Math.Cos(Elevation * Math.PI / 180) * (585 / 2); + double xCor = Math.Cos(azimuth * Math.PI / 180) * cosLen; + double yCor = Math.Sin(azimuth * Math.PI / 180) * cosLen; + + int x = (int)Math.Floor(610 / 2 + xCor); + int y = (int)Math.Floor(610 / 2 - yCor); + + Graphics gp = StatusCtrlForm.coo.CreateGraphics(); + gp.SmoothingMode = SmoothingMode.HighQuality; + gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject(type), x, y); + } + } + } + + } + + } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs index 46cccdc..d66a774 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/DetectionItemService.cs @@ -9,7 +9,7 @@ interface DetectionItemService { int add(long deviceId,DateTime startTime,DateTime endTime, string stability, string accuracy, - string bootFeature, string ageRate,String interval, string channelNo,string counterDetec); + string bootFeature, string ageRate,String interval, string channelNo); int update(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string counterDetec); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs index 116d139..ca34a86 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionItemServiceImpl.cs @@ -11,7 +11,7 @@ class DetectionItemServiceImpl : DetectionItemService { - public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo, string counterDetec) + public int add(long deviceId, DateTime startTime, DateTime endTime, string stability, string accuracy, string bootFeature, string ageRate, String interval, string channelNo) { int iRetval = -1; try @@ -22,8 +22,8 @@ return iRetval; } - string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL,COUNTER_DETEC)" + - " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL,@COUNTER_DETEC)"; + string sQry = "INSERT INTO r_detection_item (DEVICE_ID,START_TIME,END_TIME,STABILITY,ACCURACY,BOOT_FEATURE,AGE_RATE,STABILITY_INTERVAL)" + + " VALUES (@DEVICE_ID,@START_TIME,@END_TIME,@STABILITY,@ACCURACY,@BOOT_FEATURE,@AGE_RATE,@INTERVAL)"; MySqlCommand cmd = new MySqlCommand(sQry, DbConnectService.mySqlConnect); cmd.Parameters.Add("@DEVICE_ID", MySqlDbType.Int64, 20).Value = deviceId; @@ -34,7 +34,6 @@ cmd.Parameters.Add("@BOOT_FEATURE", MySqlDbType.String, 50).Value = bootFeature; cmd.Parameters.Add("@AGE_RATE", MySqlDbType.String, 50).Value = ageRate; cmd.Parameters.Add("@INTERVAL", MySqlDbType.String, 30).Value = interval; - cmd.Parameters.Add("@COUNTER_DETEC", MySqlDbType.String, 30).Value = counterDetec; cmd.ExecuteNonQuery(); diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index 6237254..2faf988 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs index 32a515f..80f9115 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -30,8 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CounterCtrlForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); @@ -40,7 +40,7 @@ this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.btn_dropDetecModel = new System.Windows.Forms.Button(); - this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); this.textBox_detecModel = new DevComponents.DotNetBar.Controls.TextBoxX(); this.comboBox_detecModel = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.comboItem1 = new DevComponents.Editors.ComboItem(); @@ -87,13 +87,13 @@ this.dataGridView_CounterResult.AllowUserToDeleteRows = false; this.dataGridView_CounterResult.AllowUserToResizeColumns = false; this.dataGridView_CounterResult.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView_CounterResult.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_CounterResult.BackgroundColor = System.Drawing.Color.White; this.dataGridView_CounterResult.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -106,13 +106,13 @@ this.dataGridView_CounterResult.Name = "dataGridView_CounterResult"; this.dataGridView_CounterResult.RowHeadersVisible = false; this.dataGridView_CounterResult.RowHeadersWidth = 50; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White; - this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White; + this.dataGridView_CounterResult.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView_CounterResult.RowTemplate.DefaultCellStyle.NullValue = "-"; this.dataGridView_CounterResult.RowTemplate.Height = 50; this.dataGridView_CounterResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -176,7 +176,7 @@ this.panelSource.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelSource.BackgroundImage"))); this.panelSource.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.panelSource.Controls.Add(this.btn_dropDetecModel); - this.panelSource.Controls.Add(this.textBoxX2); + this.panelSource.Controls.Add(this.text_signal); this.panelSource.Controls.Add(this.textBox_detecModel); this.panelSource.Controls.Add(this.comboBox_detecModel); this.panelSource.Controls.Add(this.label6); @@ -205,25 +205,24 @@ this.btn_dropDetecModel.UseVisualStyleBackColor = false; this.btn_dropDetecModel.Click += new System.EventHandler(this.btn_dropDetecModel_Click); // - // textBoxX2 + // text_signal // // // // - this.textBoxX2.Border.Class = "TextBoxBorder"; - this.textBoxX2.Border.CornerDiameter = 5; - this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.textBoxX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.textBoxX2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); - this.textBoxX2.Location = new System.Drawing.Point(101, 77); - this.textBoxX2.Margin = new System.Windows.Forms.Padding(0); - this.textBoxX2.MaximumSize = new System.Drawing.Size(150, 26); - this.textBoxX2.Name = "textBoxX2"; - this.textBoxX2.PreventEnterBeep = true; - this.textBoxX2.ReadOnly = true; - this.textBoxX2.Size = new System.Drawing.Size(150, 26); - this.textBoxX2.TabIndex = 17; - this.textBoxX2.Text = "33250"; + this.text_signal.Border.Class = "TextBoxBorder"; + this.text_signal.Border.CornerDiameter = 5; + this.text_signal.Border.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.text_signal.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.text_signal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); + this.text_signal.Location = new System.Drawing.Point(101, 77); + this.text_signal.Margin = new System.Windows.Forms.Padding(0); + this.text_signal.MaximumSize = new System.Drawing.Size(150, 26); + this.text_signal.Name = "text_signal"; + this.text_signal.PreventEnterBeep = true; + this.text_signal.ReadOnly = true; + this.text_signal.Size = new System.Drawing.Size(150, 26); + this.text_signal.TabIndex = 17; // // textBox_detecModel // @@ -564,7 +563,7 @@ private DevComponents.Editors.ComboItem comboItem1; private DevComponents.Editors.ComboItem comboItem2; private System.Windows.Forms.Label label6; - private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2; + private DevComponents.DotNetBar.Controls.TextBoxX text_signal; private System.Windows.Forms.Button btn_downCounterList; public DevComponents.DotNetBar.Controls.TextBoxX text_counterCode; private System.Windows.Forms.Button btn_dropDetecModel; diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 47e37f0..dafa1d5 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -35,6 +35,9 @@ long deviceId = 0; bool isAdd = false; + GPIBService gPIBService = new GPIBServiceImpl(); + GPIBService tcpService = new TCPServiceImpl(); + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F64D7 private readonly Font titleFont = new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Pixel, 134); @@ -52,8 +55,16 @@ InitTableCounter(); LoadCounterDetecInitList(); - CounterParam counterParam = dictService.getCounterParam(); - text_counterIp.Text = counterParam.GeneratorIp; + //string[] ids = gPIBService.getId(); + //string[] ips = tcpService.getId(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } private void InitTableCounter() @@ -288,6 +299,14 @@ { text_counterCode.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevCode; LoadCounterDetecInitList(); + if (gPIBService.getId() != null && gPIBService.getId().Length > 0) + { + text_signal.Text = gPIBService.getId()[0]; + } + if (tcpService.getId() != null && tcpService.getId().Length > 0) + { + text_counterIp.Text = tcpService.getId()[0]; + } } @@ -347,6 +366,11 @@ private void benDelete_Click(object sender, EventArgs e) { + if (!(dataGridView_CounterResult.SelectedRows.Count > 0)) + { + MessageBox.Show("请选择想要删除的记录!"); + return; + } if (MessageBox.Show("确认删除选中记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -456,7 +480,28 @@ } private void btnStart_Click(object sender, EventArgs e) - { + { + string[] ids = gPIBService.getId(); + string[] ips = tcpService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + else + { + MessageBox.Show("请连接信号源!"); + return; + } + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0]; + } + else + { + MessageBox.Show("请连接频率计数器!"); + return; + } + text_counterCode.ReadOnly = true; btn_downCounterList.Enabled = false; btnStart.Enabled = false; @@ -472,45 +517,27 @@ // 获取数据 List counterDetecInitList = counterDetecInitService.getAll(); - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + CounterCheckParam counterCheckParam = dictService.getCounterCheckParam(); - GPIBService gPIBService = new GPIBServiceImpl(); - GPIBService tcpService = new TCPServiceImpl(); - - - if (gPIBService.getId()==null || gPIBService.getId().Length == 0) - { - MessageBox.Show("获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } - if (tcpService.getId()==null|| tcpService.getId().Length == 0) - { - MessageBox.Show("tcpService获取id失败"); - Invoke(new MethodInvoker(delegate () - { - SetDevTestDlg.inDetecCounterId = -1; - text_counterCode.ReadOnly = false; - btn_downCounterList.Enabled = true; - btnStart.Enabled = true; - btn_dropDetecModel.Enabled = true; - textBox_detecModel.ReadOnly = false; - })); - return; - } + gPIBService.open(gPIBService.getId()[0]); tcpService.open(tcpService.getId()[0]); foreach (DataGridViewRow row in dataGridView_CounterResult.Rows) { + SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); + if (type.Equals("freq")) + { + sensitivityContentParam.Freq = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "0"; + } + else + { + sensitivityContentParam.Period = row.Cells[5].Value.ToString(); + sensitivityContentParam.CheckModel = "1"; + } + + int re = sensitivityService.beginTest(type, gPIBService, tcpService, counterCheckParam, ref sensitivityContentParam);//0:成功;-1:失败 string outValue = ""; outValue = type.Equals("freq") ? sensitivityContentParam.ReFreq : sensitivityContentParam.RePeriod; diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs index c61b003..717e407 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.Designer.cs @@ -29,11 +29,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel_toTestDev = new System.Windows.Forms.Panel(); this.labelNodata = new System.Windows.Forms.Label(); this.btnNext = new System.Windows.Forms.Button(); @@ -42,9 +42,9 @@ this.label_pageInfo = new System.Windows.Forms.Label(); this.tableToBeTested = new System.Windows.Forms.DataGridView(); this.panelBase = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.label_1111 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelBase = new System.Windows.Forms.Label(); this.panel_channelList = new System.Windows.Forms.Panel(); @@ -187,13 +187,13 @@ this.tableToBeTested.AllowUserToDeleteRows = false; this.tableToBeTested.AllowUserToResizeColumns = false; this.tableToBeTested.AllowUserToResizeRows = false; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(234)))), ((int)(((byte)(238))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.tableToBeTested.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.tableToBeTested.BackgroundColor = System.Drawing.Color.White; this.tableToBeTested.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -206,13 +206,13 @@ this.tableToBeTested.Name = "tableToBeTested"; this.tableToBeTested.RowHeadersVisible = false; this.tableToBeTested.RowHeadersWidth = 40; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.tableToBeTested.RowsDefaultCellStyle = dataGridViewCellStyle7; this.tableToBeTested.RowTemplate.DefaultCellStyle.NullValue = "-"; this.tableToBeTested.RowTemplate.Height = 32; this.tableToBeTested.Size = new System.Drawing.Size(764, 167); @@ -222,9 +222,9 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label1); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); - this.panelBase.Controls.Add(this.label3); + this.panelBase.Controls.Add(this.label_1111); this.panelBase.Controls.Add(this.label2); this.panelBase.Controls.Add(this.labelBase); this.panelBase.Location = new System.Drawing.Point(10, 5); @@ -233,17 +233,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 222); this.panelBase.TabIndex = 0; // - // label1 + // label_receiverStatus // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Gray; - this.label1.Location = new System.Drawing.Point(99, 128); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(67, 25); - this.label1.TabIndex = 3; - this.label1.Text = "定位有效"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 128); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 3; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -257,16 +257,16 @@ this.label_clockStatus.Text = "快锁"; this.label_clockStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label3 + // label_1111 // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(27, 128); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(67, 25); - this.label3.TabIndex = 1; - this.label3.Text = "接收机:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label_1111.BackColor = System.Drawing.Color.Transparent; + this.label_1111.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_1111.Location = new System.Drawing.Point(27, 128); + this.label_1111.Name = "label_1111"; + this.label_1111.Size = new System.Drawing.Size(67, 25); + this.label_1111.TabIndex = 1; + this.label_1111.Text = "接收机:"; + this.label_1111.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // @@ -317,6 +317,7 @@ this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(250, 30); this.panel5.TabIndex = 341; + this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick); // // pic_ageRate_5 // @@ -576,13 +577,13 @@ this.dataGridView_Channel.AllowUserToDeleteRows = false; this.dataGridView_Channel.AllowUserToResizeColumns = false; this.dataGridView_Channel.AllowUserToResizeRows = false; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; this.dataGridView_Channel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView_Channel.BackgroundColor = System.Drawing.Color.White; this.dataGridView_Channel.BorderStyle = System.Windows.Forms.BorderStyle.None; @@ -590,27 +591,27 @@ this.dataGridView_Channel.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable; this.dataGridView_Channel.ColumnHeadersHeight = 30; this.dataGridView_Channel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_Channel.DefaultCellStyle = dataGridViewCellStyle9; this.dataGridView_Channel.Location = new System.Drawing.Point(10, 10); this.dataGridView_Channel.Margin = new System.Windows.Forms.Padding(0); this.dataGridView_Channel.MultiSelect = false; this.dataGridView_Channel.Name = "dataGridView_Channel"; this.dataGridView_Channel.RowHeadersVisible = false; this.dataGridView_Channel.RowHeadersWidth = 30; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); - dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(203)))), ((int)(((byte)(208))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.dataGridView_Channel.RowsDefaultCellStyle = dataGridViewCellStyle10; this.dataGridView_Channel.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; this.dataGridView_Channel.RowTemplate.Height = 74; this.dataGridView_Channel.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -673,7 +674,7 @@ private System.Windows.Forms.Panel panel_channelList; private System.Windows.Forms.Label labelBase; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label_1111; private System.Windows.Forms.DataGridView tableToBeTested; private System.Windows.Forms.Label label_pageInfo; private System.Windows.Forms.Button btnPre; @@ -701,12 +702,12 @@ private System.Windows.Forms.PictureBox pic_bootFeature_2; private System.Windows.Forms.PictureBox pic_accuracy_2; private System.Windows.Forms.PictureBox pic_stability_2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label_clockStatus; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel3; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; } } diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 2578225..1ecae81 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -42,7 +42,7 @@ public static SerialPort frePort_5 = new SerialPort(); public static SerialPort clockPort = new SerialPort(); public static SerialPort satellitePort = new SerialPort(); - + #region 样式常量定影 private readonly Color titleBackColor = Color.FromArgb(63, 132, 215); // #3F84D7 @@ -53,6 +53,9 @@ { InitializeComponent(); homeCtrlForm = this; + + DetectionHelper.startClockFresh(); + DetectionHelper.startSatelliteFresh(); } private void HomeCtrlForm_Load(object sender, EventArgs e) @@ -242,7 +245,7 @@ devTestDlg.text_devCode.Text = tableToBeTested.Rows[rowIndex].Cells[3].Value.ToString(); devTestDlg.text_customerName.Text = tableToBeTested.Rows[rowIndex].Cells[4].Value.ToString(); devTestDlg.text_devType.Text = tableToBeTested.Rows[rowIndex].Cells[2].Value.ToString(); - + ((ComboBox)devTestDlg.Controls.Find("comboBox_channelNo", true)[0]).DataSource = channelFreeList; if (channelFreeList.Count > 0) { @@ -612,50 +615,8 @@ private void dataGridView_Channel_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - int rowIndex = dataGridView_Channel.CurrentCell.RowIndex; - int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; - if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) - { - if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; - DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; - DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; - - if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - == DialogResult.Yes) - { - detectionItemService.stopDetection(deviceId, startTime, endTime,true); - } - else - { - detectionItemService.stopDetection(deviceId, startTime, endTime, false); - } - LoadChannelStatus(); - LoadDevToBeTested(); - return; - } - else - { - return; - } - } - SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex+1); - //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); - //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); - //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); - //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); - //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); - //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); - //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); - channelDlg.HideMaskAction += () => - { - this.HideMask(); - }; - this.ShowMask(); - channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 - channelDlg.ShowDialog(); + + cellDoubleClick(e.RowIndex); } #endregion @@ -678,22 +639,76 @@ private void panel1_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(0); } private void panel2_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(1); } private void panel3_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(2); } private void panel4_DoubleClick(object sender, EventArgs e) { - + cellDoubleClick(3); } + private void panel5_DoubleClick(object sender, EventArgs e) + { + cellDoubleClick(4); + } + + private void cellDoubleClick(int rowIndex) + { + int colIndex = dataGridView_Channel.CurrentCell.ColumnIndex; + if (dataGridView_Channel.Rows[rowIndex].Cells[6].Value.ToString().Equals("占用")) + { + if (MessageBox.Show("该通道有正在检测的仪器,确定要停止检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + int deviceId = (int)dataGridView_Channel.Rows[rowIndex].Cells[11].Value; + DateTime startTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[4].Value; + DateTime endTime = (DateTime)dataGridView_Channel.Rows[rowIndex].Cells[5].Value; + + if (MessageBox.Show("删除之前是否保存此次检测的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + == DialogResult.Yes) + { + detectionItemService.stopDetection(deviceId, startTime, endTime, true); + } + else + { + detectionItemService.stopDetection(deviceId, startTime, endTime, false); + } + LoadChannelStatus(); + LoadDevToBeTested(); + return; + } + else + { + return; + } + } + SetDevChannelDlg channelDlg = new SetDevChannelDlg(rowIndex + 1); + //channelDlg.deviceId = Convert.ToInt32(dataGridView_Channel.Rows[rowIndex].Cells[11].Value); + //channelDlg.text_devCode.Text = dataGridView_Channel.Rows[rowIndex].Cells[2].Value.ToString(); + //channelDlg.text_devName.Text = dataGridView_Channel.Rows[rowIndex].Cells[1].Value.ToString(); + //channelDlg.text_devType.Text = dataGridView_Channel.Rows[rowIndex].Cells[12].Value.ToString(); + //channelDlg.text_devModel.Text = dataGridView_Channel.Rows[rowIndex].Cells[13].Value.ToString(); + //channelDlg.text_customerDev.Text = dataGridView_Channel.Rows[rowIndex].Cells[14].Value.ToString(); + //channelDlg.text_customerName.Text = dataGridView_Channel.Rows[rowIndex].Cells[3].Value.ToString(); + channelDlg.HideMaskAction += () => + { + this.HideMask(); + }; + this.ShowMask(); + channelDlg.StartPosition = FormStartPosition.CenterParent; // 指定窗口弹出在父窗口的中间位置 + channelDlg.ShowDialog(); + } + + + } } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index 878ce27..2f56540 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -53,7 +53,6 @@ this.cbBox_toTestDevList = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -414,7 +413,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label14); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -437,33 +435,20 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(8, 91); + this.label15.Location = new System.Drawing.Point(8, 77); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); this.label15.TabIndex = 349; this.label15.Text = "*"; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Enabled = false; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(126, 50); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 346; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - this.checkBox_count.CheckedChanged += new System.EventHandler(this.checkBox_count_CheckedChanged); - // // label14 // this.label14.AutoSize = true; this.label14.BackColor = System.Drawing.Color.Transparent; this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label14.ForeColor = System.Drawing.Color.OrangeRed; - this.label14.Location = new System.Drawing.Point(37, 20); + this.label14.Location = new System.Drawing.Point(37, 32); this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(17, 21); @@ -483,7 +468,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(416, 90); + this.timePicker_endTime.Location = new System.Drawing.Point(416, 77); // // // @@ -515,7 +500,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(195, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -534,7 +519,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(124, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 77); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -567,7 +552,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(180, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(192, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -577,7 +562,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(479, 20); + this.checkBox_ageRate.Location = new System.Drawing.Point(479, 32); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -589,7 +574,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 20); + this.checkBox_bootFeature.Location = new System.Drawing.Point(360, 32); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -601,7 +586,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(244, 20); + this.checkBox_accuracy.Location = new System.Drawing.Point(244, 32); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -613,7 +598,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(126, 20); + this.checkBox_stability.Location = new System.Drawing.Point(126, 32); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -624,7 +609,7 @@ // label7 // this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(306, 88); + this.label7.Location = new System.Drawing.Point(310, 75); this.label7.Margin = new System.Windows.Forms.Padding(0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(100, 27); @@ -635,7 +620,7 @@ // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(16, 87); + this.label6.Location = new System.Drawing.Point(16, 74); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(100, 27); @@ -646,7 +631,7 @@ // label2 // this.label2.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(16, 17); + this.label2.Location = new System.Drawing.Point(16, 29); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 27); @@ -843,7 +828,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; - private System.Windows.Forms.CheckBox checkBox_count; public DevComponents.DotNetBar.Controls.TextBoxX text_devCode; public DevComponents.DotNetBar.Controls.TextBoxX text_customerDev; public DevComponents.DotNetBar.Controls.TextBoxX text_customerName; diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index 85beb1d..b301b31 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -1,9 +1,14 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace Casic.Birmm.RbFreqStandMeasure.home @@ -31,6 +36,11 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DateTime endTimeBySystem = new DateTime(); + CounterDataService CounterDataService = new CounterDataServiceImpl(); + CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); public Action HideMaskAction { @@ -93,13 +103,12 @@ string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (check_startNow.Checked || timePicker_startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1";} if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -117,7 +126,7 @@ else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text, "-3"); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, textBox_channelNo.Text); this.HideMaskAction(); HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -146,11 +155,7 @@ text_devType.Text = deviceDto.DevTypeName; text_devModel.Text = deviceDto.DevModel; text_customerDev.Text = deviceDto.CustomerDev; - text_customerName.Text = deviceDto.CustomerName; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; - + text_customerName.Text = deviceDto.CustomerName; } // 选择开始时间 diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 232d68f..2e8e01b 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -54,7 +54,6 @@ this.comboItem4 = new DevComponents.Editors.ComboItem(); this.comboItem5 = new DevComponents.Editors.ComboItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); this.timePicker_endTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); this.timePicker_startTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); @@ -393,7 +392,6 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.checkBox_count); this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.timePicker_endTime); this.groupBox2.Controls.Add(this.timePicker_startTime); @@ -412,24 +410,13 @@ this.groupBox2.TabIndex = 36; this.groupBox2.TabStop = false; // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(124, 59); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 347; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.ForeColor = System.Drawing.Color.OrangeRed; - this.label10.Location = new System.Drawing.Point(34, 24); + this.label10.Location = new System.Drawing.Point(34, 35); this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(17, 21); @@ -449,7 +436,7 @@ this.timePicker_endTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_endTime.IsPopupCalendarOpen = false; - this.timePicker_endTime.Location = new System.Drawing.Point(414, 89); + this.timePicker_endTime.Location = new System.Drawing.Point(414, 75); // // // @@ -481,7 +468,7 @@ this.timePicker_endTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_endTime.Name = "timePicker_endTime"; this.timePicker_endTime.ShowUpDown = true; - this.timePicker_endTime.Size = new System.Drawing.Size(175, 23); + this.timePicker_endTime.Size = new System.Drawing.Size(199, 23); this.timePicker_endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_endTime.TabIndex = 20; this.timePicker_endTime.ValueChanged += new System.EventHandler(this.timePicker_endTime_ValueChanged); @@ -499,7 +486,7 @@ this.timePicker_startTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.timePicker_startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.timePicker_startTime.IsPopupCalendarOpen = false; - this.timePicker_startTime.Location = new System.Drawing.Point(122, 90); + this.timePicker_startTime.Location = new System.Drawing.Point(122, 76); this.timePicker_startTime.MinDate = new System.DateTime(2021, 4, 12, 0, 0, 0, 0); // // @@ -534,7 +521,7 @@ this.timePicker_startTime.MonthCalendar.TodayButtonVisible = true; this.timePicker_startTime.Name = "timePicker_startTime"; this.timePicker_startTime.ShowUpDown = true; - this.timePicker_startTime.Size = new System.Drawing.Size(177, 23); + this.timePicker_startTime.Size = new System.Drawing.Size(193, 23); this.timePicker_startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.timePicker_startTime.TabIndex = 21; this.timePicker_startTime.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; @@ -544,7 +531,7 @@ // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(476, 24); + this.checkBox_ageRate.Location = new System.Drawing.Point(476, 35); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 19; @@ -556,7 +543,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 24); + this.checkBox_bootFeature.Location = new System.Drawing.Point(366, 35); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 18; @@ -568,7 +555,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(241, 23); + this.checkBox_accuracy.Location = new System.Drawing.Point(241, 34); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 16; @@ -580,7 +567,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(124, 23); + this.checkBox_stability.Location = new System.Drawing.Point(124, 34); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 17; @@ -591,7 +578,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(306, 87); + this.label3.Location = new System.Drawing.Point(310, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -602,7 +589,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(14, 21); + this.label13.Location = new System.Drawing.Point(14, 32); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -616,7 +603,7 @@ this.label15.BackColor = System.Drawing.Color.Transparent; this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.ForeColor = System.Drawing.Color.OrangeRed; - this.label15.Location = new System.Drawing.Point(7, 90); + this.label15.Location = new System.Drawing.Point(7, 76); this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(17, 21); @@ -626,7 +613,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(21, 86); + this.label12.Location = new System.Drawing.Point(21, 72); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -832,7 +819,6 @@ public DevComponents.Editors.DateTimeAdv.DateTimeInput timePicker_startTime; public DevComponents.DotNetBar.Controls.ComboBoxEx comboBox_channelNo; private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_count; private System.Windows.Forms.Label label15; private System.Windows.Forms.RadioButton radio_100s; private System.Windows.Forms.RadioButton radio_20s; diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 2007aeb..164d277 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -22,6 +22,9 @@ CounterDataService CounterDataService = new CounterDataServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); + DictService dictService = new DictServiceImpl(); + SensitivityService sensitivityService = new SensitivityServiceImpl(); + CounterDataService counterDataService = new CounterDataServiceImpl(); #region 无边框拖动效果/最小化窗口/关闭窗口 [DllImport("user32.dll")]//拖动无窗体的控件 @@ -49,16 +52,13 @@ { InitializeComponent(); timePicker_startTime.Value = DateTime.Now; - timePicker_startTime.MinDate = DateTime.Now; - - if (text_devType.Text.Equals("计数器")) checkBox_count.Enabled = true; - else checkBox_count.Enabled = false; + timePicker_startTime.MinDate = DateTime.Now; } // 开始检测 private void btnSave_Click(object sender, EventArgs e) { - if(!text_devType.Text.Equals("计数器") && text_channelNo.Text.Equals("")) + if(!text_devType.Text.Equals("频率计数器") && text_channelNo.Text.Equals("")) { MessageBox.Show("请选择通道!"); return; @@ -68,7 +68,7 @@ MessageBox.Show("请选择频率稳定度采样时间!"); return; } - if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked && !checkBox_count.Checked) + if (!checkBox_accuracy.Checked && !checkBox_stability.Checked && !checkBox_ageRate.Checked && !checkBox_bootFeature.Checked ) { MessageBox.Show("请选择检测项目!"); return; @@ -86,50 +86,6 @@ if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - CounterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - inDetecCounterId = -1; - - }).Start(); - } - } } else { @@ -137,7 +93,6 @@ if (checkBox_accuracy.Checked) accuracy = "-2"; if (checkBox_bootFeature.Checked) bootFeature = "-2"; if (checkBox_ageRate.Checked) ageRate = "-2"; - if (checkBox_count.Checked) counterDetec = "-2"; } if (checkBox_stability.Checked) @@ -149,7 +104,7 @@ } - detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, timePicker_startTime.Value, timePicker_endTime.Value, stability, accuracy, bootFeature, ageRate, interval, text_channelNo.Text); this.HideMaskAction(); @@ -254,5 +209,7 @@ { getEndTime(); } + + } } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 7f555e1..4f3e7b8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -64,7 +64,6 @@ this.channel4 = new DevComponents.Editors.ComboItem(); this.channel5 = new DevComponents.Editors.ComboItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_count = new System.Windows.Forms.CheckBox(); this.checkBox_ageRate = new System.Windows.Forms.CheckBox(); this.checkBox_bootFeature = new System.Windows.Forms.CheckBox(); this.checkBox_accuracy = new System.Windows.Forms.CheckBox(); @@ -75,13 +74,13 @@ this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label6 = new System.Windows.Forms.Label(); - this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.radio_100s = new System.Windows.Forms.RadioButton(); this.radio_20s = new System.Windows.Forms.RadioButton(); this.radio_10s = new System.Windows.Forms.RadioButton(); this.radio_1s = new System.Windows.Forms.RadioButton(); + this.label6 = new System.Windows.Forms.Label(); + this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -534,7 +533,6 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.checkBox_count); this.groupBox1.Controls.Add(this.checkBox_ageRate); this.groupBox1.Controls.Add(this.checkBox_bootFeature); this.groupBox1.Controls.Add(this.checkBox_accuracy); @@ -547,27 +545,16 @@ this.groupBox1.Enabled = false; this.groupBox1.Location = new System.Drawing.Point(10, 210); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(617, 140); + this.groupBox1.Size = new System.Drawing.Size(617, 127); this.groupBox1.TabIndex = 39; this.groupBox1.TabStop = false; this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); // - // checkBox_count - // - this.checkBox_count.AutoSize = true; - this.checkBox_count.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_count.Location = new System.Drawing.Point(114, 55); - this.checkBox_count.Name = "checkBox_count"; - this.checkBox_count.Size = new System.Drawing.Size(182, 24); - this.checkBox_count.TabIndex = 351; - this.checkBox_count.Text = "频率计数器范围及灵敏度"; - this.checkBox_count.UseVisualStyleBackColor = true; - // // checkBox_ageRate // this.checkBox_ageRate.AutoSize = true; this.checkBox_ageRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_ageRate.Location = new System.Drawing.Point(467, 25); + this.checkBox_ageRate.Location = new System.Drawing.Point(467, 29); this.checkBox_ageRate.Name = "checkBox_ageRate"; this.checkBox_ageRate.Size = new System.Drawing.Size(84, 24); this.checkBox_ageRate.TabIndex = 350; @@ -578,7 +565,7 @@ // this.checkBox_bootFeature.AutoSize = true; this.checkBox_bootFeature.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 25); + this.checkBox_bootFeature.Location = new System.Drawing.Point(348, 29); this.checkBox_bootFeature.Name = "checkBox_bootFeature"; this.checkBox_bootFeature.Size = new System.Drawing.Size(84, 24); this.checkBox_bootFeature.TabIndex = 349; @@ -589,7 +576,7 @@ // this.checkBox_accuracy.AutoSize = true; this.checkBox_accuracy.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_accuracy.Location = new System.Drawing.Point(232, 25); + this.checkBox_accuracy.Location = new System.Drawing.Point(232, 29); this.checkBox_accuracy.Name = "checkBox_accuracy"; this.checkBox_accuracy.Size = new System.Drawing.Size(98, 24); this.checkBox_accuracy.TabIndex = 347; @@ -600,7 +587,7 @@ // this.checkBox_stability.AutoSize = true; this.checkBox_stability.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.checkBox_stability.Location = new System.Drawing.Point(114, 25); + this.checkBox_stability.Location = new System.Drawing.Point(114, 29); this.checkBox_stability.Name = "checkBox_stability"; this.checkBox_stability.Size = new System.Drawing.Size(98, 24); this.checkBox_stability.TabIndex = 348; @@ -621,7 +608,7 @@ this.endTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.endTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.endTime.IsPopupCalendarOpen = false; - this.endTime.Location = new System.Drawing.Point(395, 94); + this.endTime.Location = new System.Drawing.Point(401, 75); // // // @@ -653,7 +640,7 @@ this.endTime.MonthCalendar.TodayButtonVisible = true; this.endTime.Name = "endTime"; this.endTime.ShowUpDown = true; - this.endTime.Size = new System.Drawing.Size(180, 23); + this.endTime.Size = new System.Drawing.Size(210, 23); this.endTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.endTime.TabIndex = 44; this.endTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -671,7 +658,7 @@ this.startTime.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.startTime.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.startTime.IsPopupCalendarOpen = false; - this.startTime.Location = new System.Drawing.Point(107, 94); + this.startTime.Location = new System.Drawing.Point(107, 75); // // // @@ -703,7 +690,7 @@ this.startTime.MonthCalendar.TodayButtonVisible = true; this.startTime.Name = "startTime"; this.startTime.ShowUpDown = true; - this.startTime.Size = new System.Drawing.Size(180, 23); + this.startTime.Size = new System.Drawing.Size(200, 23); this.startTime.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.startTime.TabIndex = 43; this.startTime.Value = new System.DateTime(2021, 3, 24, 15, 59, 31, 0); @@ -711,7 +698,7 @@ // label3 // this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(290, 92); + this.label3.Location = new System.Drawing.Point(298, 73); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(100, 27); @@ -722,7 +709,7 @@ // label12 // this.label12.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(5, 92); + this.label12.Location = new System.Drawing.Point(5, 73); this.label12.Margin = new System.Windows.Forms.Padding(0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(100, 27); @@ -733,7 +720,7 @@ // label13 // this.label13.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(5, 23); + this.label13.Location = new System.Drawing.Point(5, 27); this.label13.Margin = new System.Windows.Forms.Padding(0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(100, 27); @@ -749,12 +736,64 @@ this.groupBox2.Controls.Add(this.radio_1s); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Enabled = false; - this.groupBox2.Location = new System.Drawing.Point(9, 353); + this.groupBox2.Location = new System.Drawing.Point(9, 342); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(618, 53); this.groupBox2.TabIndex = 40; this.groupBox2.TabStop = false; // + // radio_100s + // + this.radio_100s.AutoSize = true; + this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_100s.Location = new System.Drawing.Point(468, 19); + this.radio_100s.Name = "radio_100s"; + this.radio_100s.Size = new System.Drawing.Size(57, 24); + this.radio_100s.TabIndex = 47; + this.radio_100s.TabStop = true; + this.radio_100s.Tag = "100"; + this.radio_100s.Text = "100s"; + this.radio_100s.UseVisualStyleBackColor = true; + // + // radio_20s + // + this.radio_20s.AutoSize = true; + this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_20s.Location = new System.Drawing.Point(349, 20); + this.radio_20s.Name = "radio_20s"; + this.radio_20s.Size = new System.Drawing.Size(49, 24); + this.radio_20s.TabIndex = 46; + this.radio_20s.TabStop = true; + this.radio_20s.Tag = "20"; + this.radio_20s.Text = "20s"; + this.radio_20s.UseVisualStyleBackColor = true; + // + // radio_10s + // + this.radio_10s.AutoSize = true; + this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_10s.Location = new System.Drawing.Point(233, 19); + this.radio_10s.Name = "radio_10s"; + this.radio_10s.Size = new System.Drawing.Size(49, 24); + this.radio_10s.TabIndex = 45; + this.radio_10s.TabStop = true; + this.radio_10s.Tag = "10"; + this.radio_10s.Text = "10s"; + this.radio_10s.UseVisualStyleBackColor = true; + // + // radio_1s + // + this.radio_1s.AutoSize = true; + this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.radio_1s.Location = new System.Drawing.Point(115, 20); + this.radio_1s.Name = "radio_1s"; + this.radio_1s.Size = new System.Drawing.Size(41, 24); + this.radio_1s.TabIndex = 44; + this.radio_1s.TabStop = true; + this.radio_1s.Tag = "1"; + this.radio_1s.Text = "1s"; + this.radio_1s.UseVisualStyleBackColor = true; + // // label6 // this.label6.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); @@ -812,58 +851,6 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // - // radio_100s - // - this.radio_100s.AutoSize = true; - this.radio_100s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_100s.Location = new System.Drawing.Point(468, 19); - this.radio_100s.Name = "radio_100s"; - this.radio_100s.Size = new System.Drawing.Size(57, 24); - this.radio_100s.TabIndex = 47; - this.radio_100s.TabStop = true; - this.radio_100s.Tag = "100"; - this.radio_100s.Text = "100s"; - this.radio_100s.UseVisualStyleBackColor = true; - // - // radio_20s - // - this.radio_20s.AutoSize = true; - this.radio_20s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_20s.Location = new System.Drawing.Point(349, 20); - this.radio_20s.Name = "radio_20s"; - this.radio_20s.Size = new System.Drawing.Size(49, 24); - this.radio_20s.TabIndex = 46; - this.radio_20s.TabStop = true; - this.radio_20s.Tag = "20"; - this.radio_20s.Text = "20s"; - this.radio_20s.UseVisualStyleBackColor = true; - // - // radio_10s - // - this.radio_10s.AutoSize = true; - this.radio_10s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_10s.Location = new System.Drawing.Point(233, 19); - this.radio_10s.Name = "radio_10s"; - this.radio_10s.Size = new System.Drawing.Size(49, 24); - this.radio_10s.TabIndex = 45; - this.radio_10s.TabStop = true; - this.radio_10s.Tag = "10"; - this.radio_10s.Text = "10s"; - this.radio_10s.UseVisualStyleBackColor = true; - // - // radio_1s - // - this.radio_1s.AutoSize = true; - this.radio_1s.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.radio_1s.Location = new System.Drawing.Point(115, 20); - this.radio_1s.Name = "radio_1s"; - this.radio_1s.Size = new System.Drawing.Size(41, 24); - this.radio_1s.TabIndex = 44; - this.radio_1s.TabStop = true; - this.radio_1s.Tag = "1"; - this.radio_1s.Text = "1s"; - this.radio_1s.UseVisualStyleBackColor = true; - // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -931,7 +918,6 @@ public System.Windows.Forms.CheckBox checkBox_startNow; public DevComponents.Editors.DateTimeAdv.DateTimeInput endTime; public DevComponents.Editors.DateTimeAdv.DateTimeInput startTime; - public System.Windows.Forms.CheckBox checkBox_count; public System.Windows.Forms.CheckBox checkBox_ageRate; public System.Windows.Forms.CheckBox checkBox_bootFeature; public System.Windows.Forms.CheckBox checkBox_accuracy; diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index ecfc137..19169bb 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -3,6 +3,8 @@ using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.R_DevService.Dto; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service; +using Casic.Birmm.RbFreqStandMeasure.R_DevService.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.Tools; using DevComponents.DotNetBar.Controls; using DevComponents.Editors; @@ -36,7 +38,7 @@ DetectionItemService detectionItemService = new DetectionItemServiceImpl(); CounterDetecInitService counterDetecInitService = new CounterDetecInitServiceImpl(); CounterDataService counterDataService = new CounterDataServiceImpl(); - + SensitivityService sensitivityService = new SensitivityServiceImpl(); public Action HideMaskAction { @@ -53,7 +55,7 @@ cbBox_devType.DisplayMember = "Name"; cbBox_devType.ValueMember = "Code"; - btnSave.Text = "添加"; + btnSave.Text = "保存"; if (HomeCtrlForm.channelFreeList.Count > 0) { cbBox_channelFree.Items.Add(""); @@ -61,12 +63,11 @@ { cbBox_channelFree.Items.Add(item); } - } else { text_channelNo.WatermarkText = "无空闲通道"; - + groupBox1.Enabled = false; } } @@ -116,6 +117,14 @@ return; } } + if (checkBox_accuracy.Checked || checkBox_stability.Checked || checkBox_ageRate.Checked || checkBox_bootFeature.Checked) + { + if (text_channelNo.Text.Trim() == "") + { + MessageBox.Show("请选择通道号!"); + return; + } + } // 取得输入框的参数 string devName = ((TextBoxX) this.Controls.Find("inputDevName", true)[0]).Text; string devCode = ((TextBoxX) this.Controls.Find("inputDevCode", true)[0]).Text; @@ -133,64 +142,18 @@ { long deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo); if (deviceId != -1) - { - + { string stability = "-3"; string accuracy = "-3"; string bootFeature = "-3"; string ageRate = "-3"; string interval = ""; - string counterDetec = "-3"; if (checkBox_startNow.Checked || startTime.Value == DateTime.Now) { if (checkBox_stability.Checked) { stability = "-1"; } if (checkBox_accuracy.Checked) accuracy = "-1"; if (checkBox_bootFeature.Checked) bootFeature = "-1"; - if (checkBox_ageRate.Checked) ageRate = "-1"; - if (checkBox_count.Checked) - { - if (SetDevTestDlg.inDetecCounterId != -1) - { - // if (MessageBox.Show("有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - //== DialogResult.Yes) - // { - // deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[8].Value)); - // MessageBox.Show("删除成功", "提示"); - // LoadDevList(condition); - // } - MessageBox.Show("操作失败,有仪器正在进行频率计数器范围及灵敏度测量,无法立即开始该检测!"); - return; - } - else - { - counterDetec = "-1"; - SetDevTestDlg.inDetecCounterId = deviceId; - - new Thread(() => - { - // 获取数据 - List counterDetecInitList = counterDetecInitService.getAll(); - - SensitivityContentParam sensitivityContentParam = new SensitivityContentParam(); - //GPIBService gPIBService = new GPIBServiceImpl(); - ////TCPService tcpService = new TCPServiceImpl(); - //gPIBService.open(""); - //tcpService.open(); - foreach (CounterDetecInit counterDetecInit in counterDetecInitList) - { - //{ - //SensitivityService.beginTest()//0:成功;-1:失败 - // CounterDataService - //} - //gPIBService.close(); - counterDataService.add(deviceId, counterDetecInit.Frequency, sensitivityContentParam.ReFreq, sensitivityContentParam.VolTage, sensitivityContentParam.CheckTime, "1"); - } - - SetDevTestDlg.inDetecCounterId = -1; - - }).Start(); - } - } + if (checkBox_ageRate.Checked) ageRate = "-1"; } else { @@ -207,7 +170,7 @@ else if (radio_20s.Checked) interval = "20"; else if (radio_100s.Checked) interval = "100"; } - detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text, counterDetec); + detectionItemService.add(deviceId, startTime.Value, endTime.Value, stability, accuracy, bootFeature, ageRate, interval,text_channelNo.Text); // 重新加载首页的通道状态 HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); @@ -218,7 +181,7 @@ } else { - LogHelper.WriteErrorLog(this.GetType(), "添仪器[" + devName + "]失败"); + LogHelper.WriteErrorLog(this.GetType(), "添加仪器[" + devName + "]失败"); } } else if (labelTitle.Text.Equals("修改")) @@ -256,21 +219,23 @@ private void cbBox_devType_SelectedIndexChanged(object sender, EventArgs e) { - text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; + text_devType.Text = ((Dict)cbBox_devType.SelectedItem).Name; } private void cbBox_channelFree_SelectedIndexChanged(object sender, EventArgs e) { text_channelNo.Text = cbBox_channelFree.SelectedItem.ToString(); - - if (text_channelNo.Text != "") + if (text_channelNo.Text.Equals("")) { - checkBox_startNow.Enabled = true; - groupBox1.Enabled = true; + groupBox1.Enabled = false; + checkBox_accuracy.Checked = false; + checkBox_stability.Checked = false; + checkBox_ageRate.Checked = false; + checkBox_bootFeature.Checked = false; } else { - groupBox1.Enabled = false; checkBox_startNow.Enabled = false; + groupBox1.Enabled = true; } } diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 29d4d57..7c1cfbc 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -210,16 +210,16 @@ devList = new DataTable(); // 设置表格的列 - devList.Columns.Add("index", Type.GetType("System.String")); - devList.Columns.Add("regTime", Type.GetType("System.String")); - devList.Columns.Add("devName", Type.GetType("System.String")); - devList.Columns.Add("devModel", Type.GetType("System.String")); - devList.Columns.Add("devCode", Type.GetType("System.String")); - devList.Columns.Add("customComp", Type.GetType("System.String")); - devList.Columns.Add("customName", Type.GetType("System.String")); - devList.Columns.Add("status", Type.GetType("System.String")); - devList.Columns.Add("channelNo", Type.GetType("System.String")); - devList.Columns.Add("id", Type.GetType("System.Int64")); + devList.Columns.Add("index", Type.GetType("System.String"));//0 + devList.Columns.Add("regTime", Type.GetType("System.String"));//1 + devList.Columns.Add("devName", Type.GetType("System.String"));//2 + devList.Columns.Add("devModel", Type.GetType("System.String"));//3 + devList.Columns.Add("devCode", Type.GetType("System.String"));//4 + devList.Columns.Add("customComp", Type.GetType("System.String"));//5 + devList.Columns.Add("customName", Type.GetType("System.String"));//6 + devList.Columns.Add("status", Type.GetType("System.String"));//7 + devList.Columns.Add("channelNo", Type.GetType("System.String"));//8 + devList.Columns.Add("id", Type.GetType("System.Int64"));//9 // 分页查询数据库 string devName = ""; @@ -500,10 +500,8 @@ editDlg.inputCustName.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value; editDlg.text_channelNo.Text = (string)dataGridView_DevList.Rows[rowIndex].Cells[8].Value; editDlg.btnSave.Text = "保存"; - if (((string)dataGridView_DevList.Rows[rowIndex].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[rowIndex].Cells[7].Value).Equals("检测中")) { - editDlg.btn_downChannelList.Enabled = false; - editDlg.text_channelNo.ReadOnly = true; DetectionItemService detectionItemService = new DetectionItemServiceImpl(); DetectionItem detectionItem = (detectionItemService.search(id, true))[0]; editDlg.groupBox1.Enabled = false; @@ -517,6 +515,10 @@ } if (!detectionItem.BootFeature.Equals("-3")) editDlg.checkBox_bootFeature.Checked = true; if (!detectionItem.AgeRate.Equals("-3")) editDlg.checkBox_ageRate.Checked = true; + editDlg.groupBox2.Enabled = false; + editDlg.groupBox1.Enabled = false; + editDlg.btn_downChannelList.Enabled = false; + editDlg.text_channelNo.Enabled = false; } editDlg.HideMaskAction += () => { @@ -539,7 +541,7 @@ private void btnDelete_Click(object sender, EventArgs e) { - if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[6].Value).Equals("检测中")) + if (((string)dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[7].Value).Equals("检测中")) { MessageBox.Show("该仪器在检测中,无法删除!"); return; diff --git a/RbFreqStandMeasure/info/ageRate.designer.cs b/RbFreqStandMeasure/info/ageRate.designer.cs index c676897..5780827 100644 --- a/RbFreqStandMeasure/info/ageRate.designer.cs +++ b/RbFreqStandMeasure/info/ageRate.designer.cs @@ -67,7 +67,7 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(316, 8); + this.label1.Location = new System.Drawing.Point(318, 35); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(83, 27); @@ -78,7 +78,7 @@ // this.label4.BackColor = System.Drawing.Color.Transparent; this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(197, 8); + this.label4.Location = new System.Drawing.Point(199, 35); this.label4.Margin = new System.Windows.Forms.Padding(0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(119, 27); @@ -115,7 +115,7 @@ this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label3.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label3.Location = new System.Drawing.Point(316, 35); + this.label3.Location = new System.Drawing.Point(318, 8); this.label3.Margin = new System.Windows.Forms.Padding(0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(83, 27); @@ -126,7 +126,7 @@ // this.label5.BackColor = System.Drawing.Color.Transparent; this.label5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label5.Location = new System.Drawing.Point(229, 35); + this.label5.Location = new System.Drawing.Point(231, 8); this.label5.Margin = new System.Windows.Forms.Padding(0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(87, 27); diff --git a/RbFreqStandMeasure/info/stability.designer.cs b/RbFreqStandMeasure/info/stability.designer.cs index 63e8678..791a330 100644 --- a/RbFreqStandMeasure/info/stability.designer.cs +++ b/RbFreqStandMeasure/info/stability.designer.cs @@ -32,8 +32,6 @@ this.label_devModel = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // label_customerName @@ -41,7 +39,7 @@ this.label_customerName.BackColor = System.Drawing.Color.Transparent; this.label_customerName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_customerName.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label_customerName.Location = new System.Drawing.Point(197, 126); + this.label_customerName.Location = new System.Drawing.Point(197, 91); this.label_customerName.Margin = new System.Windows.Forms.Padding(0); this.label_customerName.Name = "label_customerName"; this.label_customerName.Size = new System.Drawing.Size(83, 27); @@ -64,7 +62,7 @@ // this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(110, 126); + this.label2.Location = new System.Drawing.Point(110, 91); this.label2.Margin = new System.Windows.Forms.Padding(0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(87, 27); @@ -84,36 +82,10 @@ this.label9.Text = "测量结果:"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label1.ForeColor = System.Drawing.SystemColors.ControlDark; - this.label1.Location = new System.Drawing.Point(197, 82); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(83, 27); - this.label1.TabIndex = 86; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label4 - // - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(110, 82); - this.label4.Margin = new System.Windows.Forms.Padding(0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(87, 27); - this.label4.TabIndex = 85; - this.label4.Text = "标准偏差:"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // // stability // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.White; - this.Controls.Add(this.label1); - this.Controls.Add(this.label4); this.Controls.Add(this.label_customerName); this.Controls.Add(this.label_devModel); this.Controls.Add(this.label2); @@ -129,7 +101,5 @@ private System.Windows.Forms.Label label_devModel; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label4; } } diff --git a/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs b/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs index 360b1eb..eefaa8d 100644 --- a/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/setting/SettingCtrlForm.Designer.cs @@ -480,7 +480,7 @@ this.label11.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label11.Location = new System.Drawing.Point(801, 89); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(45, 30); + this.label11.Size = new System.Drawing.Size(64, 30); this.label11.TabIndex = 16; this.label11.Text = "VRMS"; this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -554,7 +554,7 @@ this.label6.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label6.Location = new System.Drawing.Point(801, 39); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(45, 30); + this.label6.Size = new System.Drawing.Size(64, 30); this.label6.TabIndex = 10; this.label6.Text = "VRMS"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; diff --git a/RbFreqStandMeasure/status/Coordinate.cs b/RbFreqStandMeasure/status/Coordinate.cs index 0f8a990..82c91cb 100644 --- a/RbFreqStandMeasure/status/Coordinate.cs +++ b/RbFreqStandMeasure/status/Coordinate.cs @@ -205,16 +205,18 @@ int offset = padding + 5; gp.DrawEllipse(dashPen, offset, offset, this.Width - offset * 2, this.Width - offset * 2);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter, offset + inter, this.Width - offset * 2 - 2* inter, this.Width - offset * 2 - 2 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 - gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter * 2, offset + inter*2, this.Width - offset * 2 - 4 * inter, this.Width - offset * 2 - 4 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 + gp.DrawEllipse(new Pen(Color.FromArgb(139, 129, 76)), offset + inter * 3, offset + inter*3, this.Width - offset * 2 - 6 * inter, this.Width - offset * 2 - 6 * inter);//画椭圆的方法,x坐标、y坐标、宽、高,如果是100,则半径为50 // 画点 - X = 100; - Y = 100; - gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("USA"), X, Y); + brush = new SolidBrush(Color.Gray); + X = this.Width - padding - offset - inter; + Y = this.Height/2; + gp.DrawString("30", scaleFont, brush, new Point(X, Y)); + //gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("USA"), X, Y); - X = 200; - Y = 300; - gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("CHN"), X, Y); + X = X-50*2; + gp.DrawString("60", scaleFont, brush, new Point(X, Y)); + //gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject("CHN"), X, Y); g.DrawImage(bit, 0, 0); gp.Dispose(); diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs index fdb2eb6..bb130f0 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs @@ -30,6 +30,11 @@ private void InitializeComponent() { this.panelLocation = new System.Windows.Forms.Panel(); + this.label_z = new System.Windows.Forms.Label(); + this.label_y = new System.Windows.Forms.Label(); + this.label_x = new System.Windows.Forms.Label(); + this.label_lat = new System.Windows.Forms.Label(); + this.label_lng = new System.Windows.Forms.Label(); this.labelLocation = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label(); @@ -37,19 +42,22 @@ this.label9 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel(); - this.label5 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); + this.label_chnTotal = new System.Windows.Forms.Label(); + this.label_usaTotal = new System.Windows.Forms.Label(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.panelSite = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel(); this.panelTime = new System.Windows.Forms.Panel(); + this.label_mjd = new System.Windows.Forms.Label(); + this.label_time = new System.Windows.Forms.Label(); + this.label_date = new System.Windows.Forms.Label(); this.labelTime = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.panelBase = new System.Windows.Forms.Panel(); - this.label8 = new System.Windows.Forms.Label(); + this.label_receiverStatus = new System.Windows.Forms.Label(); this.label_clockStatus = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); @@ -65,6 +73,11 @@ // panelLocation // this.panelLocation.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_location; + this.panelLocation.Controls.Add(this.label_z); + this.panelLocation.Controls.Add(this.label_y); + this.panelLocation.Controls.Add(this.label_x); + this.panelLocation.Controls.Add(this.label_lat); + this.panelLocation.Controls.Add(this.label_lng); this.panelLocation.Controls.Add(this.labelLocation); this.panelLocation.Controls.Add(this.label13); this.panelLocation.Controls.Add(this.label12); @@ -76,6 +89,66 @@ this.panelLocation.Size = new System.Drawing.Size(220, 289); this.panelLocation.TabIndex = 5; // + // label_z + // + this.label_z.BackColor = System.Drawing.Color.Transparent; + this.label_z.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_z.ForeColor = System.Drawing.Color.Gray; + this.label_z.Location = new System.Drawing.Point(101, 226); + this.label_z.Name = "label_z"; + this.label_z.Size = new System.Drawing.Size(109, 25); + this.label_z.TabIndex = 13; + this.label_z.Text = "快锁"; + this.label_z.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_y + // + this.label_y.BackColor = System.Drawing.Color.Transparent; + this.label_y.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_y.ForeColor = System.Drawing.Color.Gray; + this.label_y.Location = new System.Drawing.Point(101, 186); + this.label_y.Name = "label_y"; + this.label_y.Size = new System.Drawing.Size(109, 25); + this.label_y.TabIndex = 12; + this.label_y.Text = "快锁"; + this.label_y.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_x + // + this.label_x.BackColor = System.Drawing.Color.Transparent; + this.label_x.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_x.ForeColor = System.Drawing.Color.Gray; + this.label_x.Location = new System.Drawing.Point(101, 146); + this.label_x.Name = "label_x"; + this.label_x.Size = new System.Drawing.Size(109, 25); + this.label_x.TabIndex = 11; + this.label_x.Text = "快锁"; + this.label_x.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_lat + // + this.label_lat.BackColor = System.Drawing.Color.Transparent; + this.label_lat.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_lat.ForeColor = System.Drawing.Color.Gray; + this.label_lat.Location = new System.Drawing.Point(101, 106); + this.label_lat.Name = "label_lat"; + this.label_lat.Size = new System.Drawing.Size(109, 25); + this.label_lat.TabIndex = 10; + this.label_lat.Text = "快锁"; + this.label_lat.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_lng + // + this.label_lng.BackColor = System.Drawing.Color.Transparent; + this.label_lng.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_lng.ForeColor = System.Drawing.Color.Gray; + this.label_lng.Location = new System.Drawing.Point(101, 66); + this.label_lng.Name = "label_lng"; + this.label_lng.Size = new System.Drawing.Size(109, 25); + this.label_lng.TabIndex = 9; + this.label_lng.Text = "快锁"; + this.label_lng.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // labelLocation // this.labelLocation.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); @@ -151,8 +224,8 @@ // this.panel2.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_ct_list; this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.panel2.Controls.Add(this.label5); - this.panel2.Controls.Add(this.label4); + this.panel2.Controls.Add(this.label_chnTotal); + this.panel2.Controls.Add(this.label_usaTotal); this.panel2.Controls.Add(this.pictureBox2); this.panel2.Controls.Add(this.pictureBox1); this.panel2.Controls.Add(this.panelSite); @@ -162,36 +235,36 @@ this.panel2.Size = new System.Drawing.Size(785, 642); this.panel2.TabIndex = 3; // - // label5 + // label_chnTotal // - this.label5.BackColor = System.Drawing.Color.Black; - this.label5.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label5.ForeColor = System.Drawing.SystemColors.ControlLight; - this.label5.Location = new System.Drawing.Point(49, 59); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(28, 25); - this.label5.TabIndex = 7; - this.label5.Text = "1"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label_chnTotal.BackColor = System.Drawing.Color.Black; + this.label_chnTotal.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_chnTotal.ForeColor = System.Drawing.SystemColors.ControlLight; + this.label_chnTotal.Location = new System.Drawing.Point(57, 59); + this.label_chnTotal.Name = "label_chnTotal"; + this.label_chnTotal.Size = new System.Drawing.Size(28, 25); + this.label_chnTotal.TabIndex = 7; + this.label_chnTotal.Text = "1"; + this.label_chnTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label4 + // label_usaTotal // - this.label4.BackColor = System.Drawing.Color.Black; - this.label4.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label4.ForeColor = System.Drawing.SystemColors.ControlLight; - this.label4.Location = new System.Drawing.Point(49, 23); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(28, 25); - this.label4.TabIndex = 2; - this.label4.Text = "1"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label_usaTotal.BackColor = System.Drawing.Color.Black; + this.label_usaTotal.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_usaTotal.ForeColor = System.Drawing.SystemColors.ControlLight; + this.label_usaTotal.Location = new System.Drawing.Point(57, 23); + this.label_usaTotal.Name = "label_usaTotal"; + this.label_usaTotal.Size = new System.Drawing.Size(28, 25); + this.label_usaTotal.TabIndex = 2; + this.label_usaTotal.Text = "1"; + this.label_usaTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // pictureBox2 // - this.pictureBox2.BackColor = System.Drawing.Color.White; + this.pictureBox2.BackColor = System.Drawing.Color.Black; this.pictureBox2.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.CHN; this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBox2.Location = new System.Drawing.Point(20, 60); + this.pictureBox2.Location = new System.Drawing.Point(28, 60); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(24, 24); this.pictureBox2.TabIndex = 6; @@ -199,10 +272,10 @@ // // pictureBox1 // - this.pictureBox1.BackColor = System.Drawing.Color.White; + this.pictureBox1.BackColor = System.Drawing.Color.Black; this.pictureBox1.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.USA; this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBox1.Location = new System.Drawing.Point(20, 23); + this.pictureBox1.Location = new System.Drawing.Point(28, 23); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(24, 24); this.pictureBox1.TabIndex = 5; @@ -228,6 +301,9 @@ // panelTime // this.panelTime.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_time; + this.panelTime.Controls.Add(this.label_mjd); + this.panelTime.Controls.Add(this.label_time); + this.panelTime.Controls.Add(this.label_date); this.panelTime.Controls.Add(this.labelTime); this.panelTime.Controls.Add(this.label7); this.panelTime.Controls.Add(this.label6); @@ -237,6 +313,42 @@ this.panelTime.Size = new System.Drawing.Size(220, 197); this.panelTime.TabIndex = 4; // + // label_mjd + // + this.label_mjd.BackColor = System.Drawing.Color.Transparent; + this.label_mjd.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_mjd.ForeColor = System.Drawing.Color.Gray; + this.label_mjd.Location = new System.Drawing.Point(101, 143); + this.label_mjd.Name = "label_mjd"; + this.label_mjd.Size = new System.Drawing.Size(109, 25); + this.label_mjd.TabIndex = 8; + this.label_mjd.Text = "快锁"; + this.label_mjd.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_time + // + this.label_time.BackColor = System.Drawing.Color.Transparent; + this.label_time.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_time.ForeColor = System.Drawing.Color.Gray; + this.label_time.Location = new System.Drawing.Point(101, 103); + this.label_time.Name = "label_time"; + this.label_time.Size = new System.Drawing.Size(109, 25); + this.label_time.TabIndex = 7; + this.label_time.Text = "快锁"; + this.label_time.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label_date + // + this.label_date.BackColor = System.Drawing.Color.Transparent; + this.label_date.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_date.ForeColor = System.Drawing.Color.Gray; + this.label_date.Location = new System.Drawing.Point(101, 63); + this.label_date.Name = "label_date"; + this.label_date.Size = new System.Drawing.Size(109, 25); + this.label_date.TabIndex = 6; + this.label_date.Text = "快锁"; + this.label_date.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // labelTime // this.labelTime.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); @@ -286,7 +398,7 @@ // panelBase // this.panelBase.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_status_base; - this.panelBase.Controls.Add(this.label8); + this.panelBase.Controls.Add(this.label_receiverStatus); this.panelBase.Controls.Add(this.label_clockStatus); this.panelBase.Controls.Add(this.label3); this.panelBase.Controls.Add(this.label2); @@ -297,17 +409,17 @@ this.panelBase.Size = new System.Drawing.Size(220, 156); this.panelBase.TabIndex = 3; // - // label8 + // label_receiverStatus // - this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.label8.ForeColor = System.Drawing.Color.Gray; - this.label8.Location = new System.Drawing.Point(99, 100); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(67, 25); - this.label8.TabIndex = 5; - this.label8.Text = "定位有效"; - this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label_receiverStatus.BackColor = System.Drawing.Color.Transparent; + this.label_receiverStatus.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_receiverStatus.ForeColor = System.Drawing.Color.Gray; + this.label_receiverStatus.Location = new System.Drawing.Point(99, 100); + this.label_receiverStatus.Name = "label_receiverStatus"; + this.label_receiverStatus.Size = new System.Drawing.Size(67, 25); + this.label_receiverStatus.TabIndex = 5; + this.label_receiverStatus.Text = "定位有效"; + this.label_receiverStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label_clockStatus // @@ -398,10 +510,18 @@ private System.Windows.Forms.Panel panelSite; private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label4; private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label label_clockStatus; + public System.Windows.Forms.Label label_z; + public System.Windows.Forms.Label label_y; + public System.Windows.Forms.Label label_x; + public System.Windows.Forms.Label label_lat; + public System.Windows.Forms.Label label_lng; + public System.Windows.Forms.Label label_mjd; + public System.Windows.Forms.Label label_time; + public System.Windows.Forms.Label label_date; + public System.Windows.Forms.Label label_receiverStatus; + public System.Windows.Forms.Label label_clockStatus; + public System.Windows.Forms.Label label_chnTotal; + public System.Windows.Forms.Label label_usaTotal; } } diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.cs b/RbFreqStandMeasure/status/StatusCtrlForm.cs index 2337d58..68f50a9 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.cs @@ -11,14 +11,17 @@ { public partial class StatusCtrlForm : UserControl { + public static StatusCtrlForm statusCtrlForm; + public static Coordinate coo; public StatusCtrlForm() { InitializeComponent(); + statusCtrlForm = this; //panelSite.BackgroundImage = Properties.Resources.地球; - //Coordinate coo = new Coordinate(); - //panelSite.Controls.Add(coo); - //coo.Show(); + coo = new Coordinate(); + panelSite.Controls.Add(coo); + coo.Show(); } } } diff --git a/RbFreqStandMeasure/tools/DetectionHelper.cs b/RbFreqStandMeasure/tools/DetectionHelper.cs index 8eba3fa..1546de6 100644 --- a/RbFreqStandMeasure/tools/DetectionHelper.cs +++ b/RbFreqStandMeasure/tools/DetectionHelper.cs @@ -1,12 +1,12 @@ -using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; +using Casic.Birmm.RbFreqStandMeasure.Properties; +using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; using Casic.Birmm.RbFreqStandMeasure.Tools; using System; using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.IO; +using System.Drawing; +using System.Drawing.Drawing2D; using System.IO.Ports; using System.Linq; using System.Reflection; @@ -42,9 +42,13 @@ private static DetectionItemService detectionItemService = new DetectionItemServiceImpl(); private static DeviceService deviceService = new DeviceServiceImpl(); + + private static System.Threading.Timer timerClock; + + private static System.Threading.Timer timerSatellite; //1-STABILITY,2-ACCURACY,3-BOOT_FEATURE,4-AGE_RATE - + public static void detecAccuracy(long deviceId, SerialPort port, DateTime endTime) @@ -105,10 +109,7 @@ if (resultStability.Count == 101) { - /////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /// - + result = FreMath.Stable(resultStability) + ""; detectionItemService.updateDetecStatus(devIdStability, result, "", "", "", ""); @@ -209,10 +210,9 @@ if (resultAgeRate.Count == 15) { - /////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /// - + double r = 0.0; + double k= FreMath.DriftRate(resultAgeRate, out r); + result = k + "," + r; detectionItemService.updateDetecStatus(devIdAgeRate, "", "","", result, ""); @@ -243,7 +243,6 @@ string[] names = SerialPort.GetPortNames(); if (names.Length == 0 || Array.IndexOf(names, portName) == -1) { - MessageBox.Show("没有搜索到串口" + portName + "!"); return null; } // 设置串口参数 @@ -325,10 +324,23 @@ } // 获取铷钟数据 - public static string getClockData(SerialPort port) + public static void startClockFresh() { - string clockStatus = ""; + timerClock = new System.Threading.Timer(exeClock, null, 50, 60 * 1000); + + } + public static void exeClock(Object State) + { + string portName = ConfigHelper.GetAppConfig("clock").Split(' ')[0]; + int bandRate = Convert.ToInt32(ConfigHelper.GetAppConfig("clock").Split(' ')[1]); + SerialPort port = portOpen(portName, bandRate); + if (port == null) + { + MessageBox.Show("无法打开串口"+portName+",原子钟状态获取失败!"); + return; + } int count = 0; + string clockStatus = ""; while (count < 5) { int Readlen = port.BytesToRead; @@ -337,9 +349,9 @@ { byte[] buffer = new byte[Readlen]; port.Read(buffer, 0, Readlen);// 接收数据到buffer里面 - string data = Encoding.ASCII.GetString(buffer); + string data = Encoding.ASCII.GetString(buffer); if (data.StartsWith("$") && data.Contains("*")) - { + { string clockStatusCode = data.Split(',')[9]; switch (clockStatusCode) { @@ -352,96 +364,284 @@ default: break; } break; - } - } - count++; - } - - return clockStatus; - - - } - - // 获取卫星RMC数据 - public static string getSatelliteRMCData(SerialPort port) - { - // RMC - string strRMC = ""; - - int count = 0; - while (count < 5) - { - int Readlen = port.BytesToRead; - if (Readlen > 0) - { - byte[] buffer = new byte[Readlen]; - port.Read(buffer, 0, Readlen);// 接收数据到buffer里面 - string data = Encoding.ASCII.GetString(buffer); - string[] dataArray = data.Split('$'); - if (dataArray.Length > 9) - { - foreach (string sss in dataArray) - { - if (sss.Contains("GNRMC") && sss.Contains("*")) - { - string[] resultArray = sss.Split(','); - - string time = resultArray[1]; - time = time.Substring(0, 2) + ":" + time.Substring(2, 2) + ":" + time.Substring(4); - string status = resultArray[2]=="A"?"定位有效":"警告"; - string date = resultArray[9]; - date = date.Substring(4, 2) + "-" + date.Substring(2, 2) + "-" + date.Substring(0, 2); - - strRMC = date + "," + time + "," + status; - } - } - } - } - count++; - } - - return strRMC; - } - - // 获取卫星GSV数据 - public static string getSatelliteGSVData(SerialPort port) - { - // RMC - string strRMC = ""; - - int count = 0; - while (count < 5) - { - int Readlen = port.BytesToRead; - if (Readlen > 0) - { - byte[] buffer = new byte[Readlen]; - port.Read(buffer, 0, Readlen);// 接收数据到buffer里面 - string data = Encoding.ASCII.GetString(buffer); - string[] dataArray = data.Split('$'); - if (dataArray.Length > 9) - { - foreach (string sss in dataArray) - { - if (sss.Contains("GNRMC") && sss.Contains("*")) - { - string[] resultArray = sss.Split(','); - - string time = resultArray[1]; - time = time.Substring(0, 2) + ":" + time.Substring(2, 2) + ":" + time.Substring(4); - string status = resultArray[2] == "A" ? "定位有效" : "警告"; - string date = resultArray[9]; - date = date.Substring(4, 2) + "-" + date.Substring(2, 2) + "-" + date.Substring(0, 2); - - strRMC = date + "," + time + "," + status; - } - } } } count++; } - - return strRMC; + + HomeCtrlForm.homeCtrlForm.label_clockStatus.Text = clockStatus; + StatusCtrlForm.statusCtrlForm.label_clockStatus.Text = clockStatus; } + + // 获取卫星RMC数据 + public static void startSatelliteFresh() + { + timerSatellite = new System.Threading.Timer(exeSatellite, null, 50, 60 * 1000); + + } + public static void exeSatellite(Object State) + { + List gpList = new List(); + List bdList = new List(); + + // RMC + string portName = ConfigHelper.GetAppConfig("satellite").Split(' ')[0]; + int bandRate = Convert.ToInt32(ConfigHelper.GetAppConfig("clock").Split(' ')[1]); + SerialPort port = portOpen(portName, bandRate); + + if (port == null) + { + MessageBox.Show("无法打开串口" + portName + ",卫星数据获取失败!"); + return; + } + + int count = 0; + while (count < 5) + { + int Readlen = port.BytesToRead; + if (Readlen > 0) + { + byte[] buffer = new byte[Readlen]; + port.Read(buffer, 0, Readlen);// 接收数据到buffer里面 + string data = Encoding.ASCII.GetString(buffer); + string[] dataArray = data.Split('$'); + if (dataArray.Length > 0) + { + foreach (string sss in dataArray) + { + if (sss.Contains("GPGGA") && sss.Contains("*")) + { + string[] resultArray = sss.Split(','); + + string lat = resultArray[2].Replace(".", "").Insert(2, ".") + resultArray[3]; + string lng = resultArray[4].Replace(".", "").Insert(2, ".") + resultArray[5]; + string x = parseGGA(sss).Split(',')[0]; + string y = parseGGA(sss).Split(',')[1]; + string z = parseGGA(sss).Split(',')[2]; + + new Thread(() => { + StatusCtrlForm.statusCtrlForm.label_lat.Text = lat; + StatusCtrlForm.statusCtrlForm.label_lng.Text = lng; + StatusCtrlForm.statusCtrlForm.label_x.Text = x; + StatusCtrlForm.statusCtrlForm.label_y.Text = y; + StatusCtrlForm.statusCtrlForm.label_z.Text = z; + + }).Start(); + + } + if (sss.Contains("GNRMC") && sss.Contains("*")) + { + string[] resultArray = sss.Split(','); + + string date = resultArray[9]; + date = date.Substring(4, 2) + "-" + date.Substring(2, 2) + "-" + date.Substring(0, 2); + string mjd = getMJD(date.Substring(4, 2), date.Substring(2, 2), date.Substring(0, 2)); + + string time = resultArray[1]; + time = time.Substring(0, 2) + ":" + time.Substring(2, 2) + ":" + time.Substring(4); + + string status = resultArray[2] == "A" ? "定位有效" : "警告"; + + + new Thread(() => { + StatusCtrlForm.statusCtrlForm.label_date.Text = date; + StatusCtrlForm.statusCtrlForm.label_time.Text = time; + StatusCtrlForm.statusCtrlForm.label_receiverStatus.Text = status; + StatusCtrlForm.statusCtrlForm.label_mjd.Text = mjd; + + HomeCtrlForm.homeCtrlForm.label_receiverStatus.Text = status; + }).Start(); + } + if (sss.Contains("GPGSV") || sss.Contains("BDGSV")) + { + if (sss.Split(',')[2].Equals("1")) + { + int totalGP = 0; + int totalBD = 0; + if (sss.Contains("GPGSV")) + { + gpList.Add(sss); + totalGP = Convert.ToInt32(sss.Split(',')[1]); + } + else + { + bdList.Add(sss); + totalBD = Convert.ToInt32(sss.Split(',')[1]); + } + for (int i = 2; i <= (totalGP==0? totalBD: totalGP); i++) + { + Thread.Sleep(1000); + int count2 = 0; + while (count2 < 5) + { + Readlen = port.BytesToRead; + if (Readlen > 0) + { + buffer = new byte[Readlen]; + port.Read(buffer, 0, Readlen);// 接收数据到buffer里面 + data = Encoding.ASCII.GetString(buffer); + dataArray = data.Split('$'); + if (dataArray.Length > 0) + { + foreach (string s in dataArray) + { + if (s.Contains("GPGSV")) + { + if (sss.Split(',')[2].Equals(i + "")) + { + if (sss.Contains("GPGSV")) + { + gpList.Add(sss); + if (gpList.Count == totalGP) + { + new Thread(() => + { + StatusCtrlForm.statusCtrlForm.label_usaTotal.Text = totalGP + ""; + draw(gpList, "USA"); + }).Start(); + } + } + else + { + bdList.Add(sss); + if (bdList.Count == totalBD) + { + new Thread(() => + { + StatusCtrlForm.statusCtrlForm.label_chnTotal.Text = totalBD + ""; + draw(bdList, "CHN"); + }).Start(); + } + } + break; + } + } + } + } + } + count2++; + } + } + } + + } + } + } + break; + } + count++; + } + + } + private static string getMJD(string ys, string ms, string ds) + { + int y = Convert.ToInt32(ys) - 1900; + int m = Convert.ToInt32(ms); + int d = Convert.ToInt32(ds); + int L = 0; + if (m == 1 || m == 2) L = 1; + int njdINT = 14956 + d +(int)((y-L)*365.25)+(int)((m+1+L*12)*30.6001); + return njdINT+""; + } + + private static string parseGGA(string ggaStr) + { + double f = 1 / 298.257223563; /*基准椭球体的极扁率*/ + double a = 6378137.0; /*基准椭球体的长半径*/ + double b = 6356752.314; /*基准椭球体的短半径*/ + double e2 = f * (2 - f); /*基准椭球体的偏心率*/ + double pi_180 = Math.PI / 180; + //$GPGGA,081918.00,3954.7889938,N,11615.5667600,E,1,28,0.68,78.6748,M,-9.7970,M,02,*7D + var arr = ggaStr.Split(','); + + string m_pBs = parseCoord(arr[2], arr[3]); + string m_pLs = parseCoord(arr[4], arr[5]); + string m_pHs = Convert.ToDouble(arr[9]) + Convert.ToDouble(arr[11]) + "";// add 大地水准面高度 纠正误差 + // objBLH.b = util.parseCoord(arr[2],arr[3]); + // objBLH.l = util.parseCoord(arr[4],arr[5]); + // objBLH.h = parseFloat(arr[9]); + string X = "", Y = "", Z = ""; + double m_pB = Convert.ToDouble(m_pBs); + double m_pL = Convert.ToDouble(m_pLs); + double m_pH = Convert.ToDouble(m_pHs); + double N = a / Math.Sqrt(1 - e2 * Math.Sin(m_pB * pi_180) * Math.Sin(m_pB * Math.PI)); + X = (N + m_pH) * Math.Cos(m_pB * pi_180) * Math.Cos(m_pL * Math.PI) + ""; + Y = (N + m_pH) * Math.Cos(m_pB * pi_180) * Math.Sin(m_pL * Math.PI) + ""; + Z = (N * (1 - e2) + m_pH) * Math.Sin(m_pB * pi_180) + ""; + + return X + "," + Y + "," + Z; + } + private static string parseCoord (string coord, string dir) + { + //$GPGGA,081918.00,3954.7889938,N,11615.5667600,E,1,28,0.68,78.6748,M,-9.7970,M,02,*7D + if ( coord.Equals("")) + return null; + int n=1, sgn = 1; + switch (dir) + { + case "S": + sgn = -1; break; + case "N": + n = 2;break; + case "W": + sgn = -1; break; + case "E": + n = 3; break; + default: break; + } + return sgn * (Convert.ToDouble(coord.Substring(0, n)) + Convert.ToDouble(coord.Substring(n)) / 60) + ""; + } + private static string BLH2XYX (string objectBLH) + { + // var objectBLH ={l:116.259446,b:39.91314989666667,h:78.6748};//for test + // var N = a / Math.sqrt(1 - e2 * Math.sin(objectBLH.b * pi_180) * Math.sin(objectBLH.b * pi_180)); + // var X = (N + objectBLH.h) * Math.cos(objectBLH.b * pi_180) * Math.cos(objectBLH.l * pi_180); + // var Y = (N + objectBLH.h) * Math.cos(objectBLH.b * pi_180) * Math.sin(objectBLH.l * pi_180); + // var Z = [N * (1 - e2 ) + objectBLH.h] * Math.sin(objectBLH.b * pi_180); + // var objectXYZ = {}; + // objectXYZ.X = X; + // objectXYZ.Y = Y; + // objectXYZ.Z = Z; + string X="", Y="", Z = ""; + double m_pB = Convert.ToDouble(objectBLH.Split(',')[0]); + double m_pL = Convert.ToDouble(objectBLH.Split(',')[1]); + double m_pH = Convert.ToDouble(objectBLH.Split(',')[2]); + //double N = a / Math.Sqrt(1 - e2 * Math.Sin(m_pB * pi_180) * Math.Sin(m_pB * Math.PI)); + //X = (N + m_pH) * Math.Cos(m_pB * pi_180) * Math.Cos(m_pL * Math.PI); + //Y = (N + m_pH) * Math.Cos(m_pB * pi_180) * Math.Sin(m_pL * Math.PI); + //Z = [N * (1 - e2) + m_pH] * Math.Sin(m_pB * pi_180); + + return X+","+Y+","+Z; + } + + private static void draw(List gsvList, string type) + { + foreach (string gsv in gsvList) + { + string[] arr = gsv.Split(','); + int length = arr.Count(); + for (int i = 4; i < arr.Length; i=i+3) + { + if ((i + 3) < arr.Length) + { + int Elevation = Convert.ToInt32(arr[i + 1]); + int azimuth = Convert.ToInt32(arr[i + 2]); + double cosLen = Math.Cos(Elevation * Math.PI / 180) * (585 / 2); + double xCor = Math.Cos(azimuth * Math.PI / 180) * cosLen; + double yCor = Math.Sin(azimuth * Math.PI / 180) * cosLen; + + int x = (int)Math.Floor(610 / 2 + xCor); + int y = (int)Math.Floor(610 / 2 - yCor); + + Graphics gp = StatusCtrlForm.coo.CreateGraphics(); + gp.SmoothingMode = SmoothingMode.HighQuality; + gp.DrawImage((Bitmap)Resources.ResourceManager.GetObject(type), x, y); + } + } + } + + } + + } } \ No newline at end of file diff --git a/RbFreqStandMeasure/tools/FreMath.cs b/RbFreqStandMeasure/tools/FreMath.cs index 5b2b8b6..66b2617 100644 --- a/RbFreqStandMeasure/tools/FreMath.cs +++ b/RbFreqStandMeasure/tools/FreMath.cs @@ -5,57 +5,56 @@ namespace Casic.Birmm.RbFreqStandMeasure.Tools { - public static class FreMath + public static class FreMath { /// - ///计算日老化率K,相关系数r + /// 计算频率稳定度 + /// + /// 相对平均频率偏差 + /// 频率稳定度σ + public static float Stable(List FreDiffList) + { + List datas = toDoubleList(FreDiffList); + return Stable(datas); + } + + /// + /// 计算日老化率K,相关系数r /// /// 相对平均频率偏差 /// 相关系数r /// 日老化率K - public static double DriftRate(List myDatas, out double r) - { - List datas = toFloatList(myDatas); - return DriftRate(datas,out r); - } - - /// - /// 计算日老化率K - /// - /// 相对平均频率偏差 - /// 日老化率K - public static double DriftRate(List myDatas) - { - List datas = toFloatList(myDatas); - return DriftRate(datas); - } - - /// - /// 计算相关系数r - /// - /// 相对平均频率偏差 - /// 相关系数r - public static double RelationRate(List myDatas) - { - List datas = toFloatList(myDatas); - return RelationRate(datas); - } - - - public static List toFloatList(List strDatas) - { - List fDatas = new List(); - foreach (String strData in strDatas) - { - fDatas.Add(float.Parse(strData)); - } - - return fDatas; - } - - private static double AvgT(List myDatas) //计算T平均 + public static double DriftRate(List myDatas, out double r) { - int N=myDatas.Count(); //参加计算的数据个数 + List datas = toFloatList(myDatas); + return DriftRate(datas, out r); + } + + /// + /// 计算日老化率K + /// + /// 相对平均频率偏差 + /// 日老化率K + public static double DriftRate(List myDatas) + { + List datas = toFloatList(myDatas); + return DriftRate(datas); + } + + /// + /// 计算相关系数r + /// + /// 相对平均频率偏差 + /// 相关系数r + public static double RelationRate(List myDatas) + { + List datas = toFloatList(myDatas); + return RelationRate(datas); + } + + private static double AvgT(List myDatas) //计算T平均 + { + int N = myDatas.Count(); //参加计算的数据个数 if (N > 0) { double sum = 0; @@ -69,7 +68,7 @@ return 0; } - private static double AvgY(List myDatas) //计算Y平均 + private static double AvgY(List myDatas) //计算Y平均 { double sum = 0; int N = myDatas.Count(); //参加计算的数据个数 @@ -86,9 +85,9 @@ } - public static double DriftRate(List myDatas) //计算日老化率K + public static double DriftRate(List myDatas) //计算日老化率K { - double b, YT=0, sumT=0; + double b, YT = 0, sumT = 0; double avgT = AvgT(myDatas); double avgY = AvgY(myDatas); @@ -104,34 +103,34 @@ return 2 * b; } - public static double DriftRate(List myDatas, out double r) //计算日老化率K,相关系数r - { - double b, YT = 0, sumTT = 0, sumYY = 0; - - double avgT = AvgT(myDatas); - double avgY = AvgY(myDatas); - - int N = myDatas.Count(); //参加计算的数据个数 - - for (int i = 1; i <= N; i++) - { - YT = YT + (myDatas[i - 1] - avgY) * (i - avgT); - sumTT = sumTT + System.Math.Pow((i - avgT), 2); - sumYY = sumYY + System.Math.Pow((myDatas[i - 1] - avgY), 2); - } - b = YT / sumTT; - r =System.Math.Abs(YT / System.Math.Sqrt(sumTT * sumYY)); - return 2 * b; - } - - public static Double RelationRate(List myDatas) //计算相关系数r + public static double DriftRate(List myDatas, out double r) //计算日老化率K,相关系数r { - double r, YT=0, sumT=0, sumY=0; + double b, YT = 0, sumTT = 0, sumYY = 0; - double avgT = AvgT(myDatas); - double avgY = AvgY(myDatas); + double avgT = AvgT(myDatas); + double avgY = AvgY(myDatas); - int N = myDatas.Count(); //参加计算的数据个数 + int N = myDatas.Count(); //参加计算的数据个数 + + for (int i = 1; i <= N; i++) + { + YT = YT + (myDatas[i - 1] - avgY) * (i - avgT); + sumTT = sumTT + System.Math.Pow((i - avgT), 2); + sumYY = sumYY + System.Math.Pow((myDatas[i - 1] - avgY), 2); + } + b = YT / sumTT; + r = System.Math.Abs(YT / System.Math.Sqrt(sumTT * sumYY)); + return 2 * b; + } + + public static Double RelationRate(List myDatas) //计算相关系数r + { + double r, YT = 0, sumT = 0, sumY = 0; + + double avgT = AvgT(myDatas); + double avgY = AvgY(myDatas); + + int N = myDatas.Count(); //参加计算的数据个数 for (int i = 1; i <= N; i++) { @@ -143,5 +142,48 @@ r = YT / System.Math.Sqrt(sumT * sumY); return r; } + + public static float Stable(List FreDiffList) //计算日稳 + { + + double sum = 0, diffY; + int N = FreDiffList.Count; //参加计算的数据个数 + if (N > 1) + { + for (int i = 1; i <= N - 1; i++) + { + diffY = FreDiffList[i] - FreDiffList[i - 1]; + sum = sum + System.Math.Pow(diffY, 2); + } + + return (float)System.Math.Sqrt(sum / (2 * N - 2)); //共N-1组数据 + } + else + return 0; + + } + + public static List toFloatList(List strDatas) + { + List fDatas = new List(); + foreach (String strData in strDatas) + { + fDatas.Add(float.Parse(strData)); + } + + return fDatas; + } + + public static List toDoubleList(List strDatas) + { + List dDatas = new List(); + foreach (String strData in strDatas) + { + dDatas.Add(double.Parse(strData)); + } + + return dDatas; + } + } }