diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index b224bc1..ac9e466 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -167,7 +167,7 @@ string sQry = "SELECT * FROM r_device where active = " + 0; if (devName != "" && devName != null) - sQry += " and DEV_NAME like '%" + devName + "%'"; + sQry += " and DEV_NAME = '" + devName + "'"; if (devCode != "" && devCode != null) sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index b224bc1..ac9e466 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -167,7 +167,7 @@ string sQry = "SELECT * FROM r_device where active = " + 0; if (devName != "" && devName != null) - sQry += " and DEV_NAME like '%" + devName + "%'"; + sQry += " and DEV_NAME = '" + devName + "'"; if (devCode != "" && devCode != null) sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs index 8d74572..3696a17 100644 --- a/RbFreqStandMeasure/RbFreqStdMeas.cs +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -573,7 +573,7 @@ break; case 3: // 频率计数器范围 - CounterCtrlForm counterForm = new CounterCtrlForm(); + CounterCtrlForm counterForm = CounterCtrlForm.GetInstance(); counterForm.Show(); panelMain.Controls.Add(counterForm); break; diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index b224bc1..ac9e466 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -167,7 +167,7 @@ string sQry = "SELECT * FROM r_device where active = " + 0; if (devName != "" && devName != null) - sQry += " and DEV_NAME like '%" + devName + "%'"; + sQry += " and DEV_NAME = '" + devName + "'"; if (devCode != "" && devCode != null) sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs index 8d74572..3696a17 100644 --- a/RbFreqStandMeasure/RbFreqStdMeas.cs +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -573,7 +573,7 @@ break; case 3: // 频率计数器范围 - CounterCtrlForm counterForm = new CounterCtrlForm(); + CounterCtrlForm counterForm = CounterCtrlForm.GetInstance(); counterForm.Show(); panelMain.Controls.Add(counterForm); break; diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index e81d805..b3005b4 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index b224bc1..ac9e466 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -167,7 +167,7 @@ string sQry = "SELECT * FROM r_device where active = " + 0; if (devName != "" && devName != null) - sQry += " and DEV_NAME like '%" + devName + "%'"; + sQry += " and DEV_NAME = '" + devName + "'"; if (devCode != "" && devCode != null) sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs index 8d74572..3696a17 100644 --- a/RbFreqStandMeasure/RbFreqStdMeas.cs +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -573,7 +573,7 @@ break; case 3: // 频率计数器范围 - CounterCtrlForm counterForm = new CounterCtrlForm(); + CounterCtrlForm counterForm = CounterCtrlForm.GetInstance(); counterForm.Show(); panelMain.Controls.Add(counterForm); break; diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index e81d805..b3005b4 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 4800a1b..96c0863 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -36,10 +36,7 @@ this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); this.labelMedian = new System.Windows.Forms.Label(); - this.btn_add = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.benDelete = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panelControl = new System.Windows.Forms.Panel(); - this.btnStart = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); @@ -59,6 +56,9 @@ this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelCounter = new System.Windows.Forms.Label(); + this.btn_add = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.benDelete = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnStart = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView_CounterResult)).BeginInit(); this.panelMedian.SuspendLayout(); @@ -142,54 +142,6 @@ this.labelMedian.Text = "结果编辑"; this.labelMedian.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // btn_add - // - this.btn_add.EnterBackColor = System.Drawing.Color.Blue; - this.btn_add.EnterForeColor = System.Drawing.Color.White; - this.btn_add.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.btn_add.FlatAppearance.BorderSize = 0; - this.btn_add.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.btn_add.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btn_add.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_add.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.btn_add.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - this.btn_add.HoverForeColor = System.Drawing.Color.White; - this.btn_add.Location = new System.Drawing.Point(155, 65); - this.btn_add.Margin = new System.Windows.Forms.Padding(0); - this.btn_add.Name = "btn_add"; - this.btn_add.PressBackColor = System.Drawing.Color.DarkBlue; - this.btn_add.PressForeColor = System.Drawing.Color.White; - this.btn_add.Radius = 5; - this.btn_add.Size = new System.Drawing.Size(111, 26); - this.btn_add.TabIndex = 14; - this.btn_add.Text = "添加"; - this.btn_add.UseVisualStyleBackColor = true; - this.btn_add.Click += new System.EventHandler(this.btn_add_Click); - // - // benDelete - // - this.benDelete.EnterBackColor = System.Drawing.Color.Blue; - this.benDelete.EnterForeColor = System.Drawing.Color.White; - this.benDelete.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.benDelete.FlatAppearance.BorderSize = 0; - this.benDelete.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.benDelete.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.benDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.benDelete.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.benDelete.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(0)))), ((int)(((byte)(18))))); - this.benDelete.HoverForeColor = System.Drawing.Color.White; - this.benDelete.Location = new System.Drawing.Point(27, 65); - this.benDelete.Margin = new System.Windows.Forms.Padding(0); - this.benDelete.Name = "benDelete"; - this.benDelete.PressBackColor = System.Drawing.Color.DarkBlue; - this.benDelete.PressForeColor = System.Drawing.Color.White; - this.benDelete.Radius = 5; - this.benDelete.Size = new System.Drawing.Size(111, 26); - this.benDelete.TabIndex = 13; - this.benDelete.Text = "删除"; - this.benDelete.UseVisualStyleBackColor = true; - this.benDelete.Click += new System.EventHandler(this.benDelete_Click); - // // panelControl // this.panelControl.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelControl.BackgroundImage"))); @@ -201,30 +153,6 @@ this.panelControl.Size = new System.Drawing.Size(288, 136); this.panelControl.TabIndex = 3; // - // btnStart - // - this.btnStart.EnterBackColor = System.Drawing.Color.Blue; - this.btnStart.EnterForeColor = System.Drawing.Color.White; - this.btnStart.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.btnStart.FlatAppearance.BorderSize = 0; - this.btnStart.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.btnStart.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnStart.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.btnStart.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - this.btnStart.HoverForeColor = System.Drawing.Color.White; - this.btnStart.Location = new System.Drawing.Point(88, 65); - this.btnStart.Margin = new System.Windows.Forms.Padding(0); - this.btnStart.Name = "btnStart"; - this.btnStart.PressBackColor = System.Drawing.Color.DarkBlue; - this.btnStart.PressForeColor = System.Drawing.Color.White; - this.btnStart.Radius = 5; - this.btnStart.Size = new System.Drawing.Size(111, 26); - this.btnStart.TabIndex = 11; - this.btnStart.Text = "启动连续检定"; - this.btnStart.UseVisualStyleBackColor = true; - this.btnStart.Click += new System.EventHandler(this.btnStart_Click); - // // labelControl // this.labelControl.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); @@ -434,6 +362,78 @@ this.labelCounter.Text = "计数器参数设置"; this.labelCounter.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // + // btn_add + // + this.btn_add.EnterBackColor = System.Drawing.Color.Blue; + this.btn_add.EnterForeColor = System.Drawing.Color.White; + this.btn_add.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btn_add.FlatAppearance.BorderSize = 0; + this.btn_add.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btn_add.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btn_add.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btn_add.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.btn_add.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btn_add.HoverForeColor = System.Drawing.Color.White; + this.btn_add.Location = new System.Drawing.Point(155, 65); + this.btn_add.Margin = new System.Windows.Forms.Padding(0); + this.btn_add.Name = "btn_add"; + this.btn_add.PressBackColor = System.Drawing.Color.DarkBlue; + this.btn_add.PressForeColor = System.Drawing.Color.White; + this.btn_add.Radius = 5; + this.btn_add.Size = new System.Drawing.Size(111, 26); + this.btn_add.TabIndex = 14; + this.btn_add.Text = "添加"; + this.btn_add.UseVisualStyleBackColor = true; + this.btn_add.Click += new System.EventHandler(this.btn_add_Click); + // + // benDelete + // + this.benDelete.EnterBackColor = System.Drawing.Color.Blue; + this.benDelete.EnterForeColor = System.Drawing.Color.White; + this.benDelete.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.benDelete.FlatAppearance.BorderSize = 0; + this.benDelete.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.benDelete.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.benDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.benDelete.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.benDelete.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(0)))), ((int)(((byte)(18))))); + this.benDelete.HoverForeColor = System.Drawing.Color.White; + this.benDelete.Location = new System.Drawing.Point(27, 65); + this.benDelete.Margin = new System.Windows.Forms.Padding(0); + this.benDelete.Name = "benDelete"; + this.benDelete.PressBackColor = System.Drawing.Color.DarkBlue; + this.benDelete.PressForeColor = System.Drawing.Color.White; + this.benDelete.Radius = 5; + this.benDelete.Size = new System.Drawing.Size(111, 26); + this.benDelete.TabIndex = 13; + this.benDelete.Text = "删除"; + this.benDelete.UseVisualStyleBackColor = true; + this.benDelete.Click += new System.EventHandler(this.benDelete_Click); + // + // btnStart + // + this.btnStart.EnterBackColor = System.Drawing.Color.Blue; + this.btnStart.EnterForeColor = System.Drawing.Color.White; + this.btnStart.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnStart.FlatAppearance.BorderSize = 0; + this.btnStart.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnStart.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnStart.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.btnStart.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btnStart.HoverForeColor = System.Drawing.Color.White; + this.btnStart.Location = new System.Drawing.Point(88, 65); + this.btnStart.Margin = new System.Windows.Forms.Padding(0); + this.btnStart.Name = "btnStart"; + this.btnStart.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnStart.PressForeColor = System.Drawing.Color.White; + this.btnStart.Radius = 5; + this.btnStart.Size = new System.Drawing.Size(111, 26); + this.btnStart.TabIndex = 11; + this.btnStart.Text = "启动连续检定"; + this.btnStart.UseVisualStyleBackColor = true; + this.btnStart.Click += new System.EventHandler(this.btnStart_Click); + // // CounterCtrlForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index b224bc1..ac9e466 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -167,7 +167,7 @@ string sQry = "SELECT * FROM r_device where active = " + 0; if (devName != "" && devName != null) - sQry += " and DEV_NAME like '%" + devName + "%'"; + sQry += " and DEV_NAME = '" + devName + "'"; if (devCode != "" && devCode != null) sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs index 8d74572..3696a17 100644 --- a/RbFreqStandMeasure/RbFreqStdMeas.cs +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -573,7 +573,7 @@ break; case 3: // 频率计数器范围 - CounterCtrlForm counterForm = new CounterCtrlForm(); + CounterCtrlForm counterForm = CounterCtrlForm.GetInstance(); counterForm.Show(); panelMain.Controls.Add(counterForm); break; diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index e81d805..b3005b4 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 4800a1b..96c0863 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -36,10 +36,7 @@ this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); this.labelMedian = new System.Windows.Forms.Label(); - this.btn_add = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.benDelete = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panelControl = new System.Windows.Forms.Panel(); - this.btnStart = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); @@ -59,6 +56,9 @@ this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelCounter = new System.Windows.Forms.Label(); + this.btn_add = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.benDelete = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnStart = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView_CounterResult)).BeginInit(); this.panelMedian.SuspendLayout(); @@ -142,54 +142,6 @@ this.labelMedian.Text = "结果编辑"; this.labelMedian.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // btn_add - // - this.btn_add.EnterBackColor = System.Drawing.Color.Blue; - this.btn_add.EnterForeColor = System.Drawing.Color.White; - this.btn_add.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.btn_add.FlatAppearance.BorderSize = 0; - this.btn_add.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.btn_add.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btn_add.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_add.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.btn_add.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - this.btn_add.HoverForeColor = System.Drawing.Color.White; - this.btn_add.Location = new System.Drawing.Point(155, 65); - this.btn_add.Margin = new System.Windows.Forms.Padding(0); - this.btn_add.Name = "btn_add"; - this.btn_add.PressBackColor = System.Drawing.Color.DarkBlue; - this.btn_add.PressForeColor = System.Drawing.Color.White; - this.btn_add.Radius = 5; - this.btn_add.Size = new System.Drawing.Size(111, 26); - this.btn_add.TabIndex = 14; - this.btn_add.Text = "添加"; - this.btn_add.UseVisualStyleBackColor = true; - this.btn_add.Click += new System.EventHandler(this.btn_add_Click); - // - // benDelete - // - this.benDelete.EnterBackColor = System.Drawing.Color.Blue; - this.benDelete.EnterForeColor = System.Drawing.Color.White; - this.benDelete.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.benDelete.FlatAppearance.BorderSize = 0; - this.benDelete.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.benDelete.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.benDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.benDelete.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.benDelete.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(0)))), ((int)(((byte)(18))))); - this.benDelete.HoverForeColor = System.Drawing.Color.White; - this.benDelete.Location = new System.Drawing.Point(27, 65); - this.benDelete.Margin = new System.Windows.Forms.Padding(0); - this.benDelete.Name = "benDelete"; - this.benDelete.PressBackColor = System.Drawing.Color.DarkBlue; - this.benDelete.PressForeColor = System.Drawing.Color.White; - this.benDelete.Radius = 5; - this.benDelete.Size = new System.Drawing.Size(111, 26); - this.benDelete.TabIndex = 13; - this.benDelete.Text = "删除"; - this.benDelete.UseVisualStyleBackColor = true; - this.benDelete.Click += new System.EventHandler(this.benDelete_Click); - // // panelControl // this.panelControl.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelControl.BackgroundImage"))); @@ -201,30 +153,6 @@ this.panelControl.Size = new System.Drawing.Size(288, 136); this.panelControl.TabIndex = 3; // - // btnStart - // - this.btnStart.EnterBackColor = System.Drawing.Color.Blue; - this.btnStart.EnterForeColor = System.Drawing.Color.White; - this.btnStart.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.btnStart.FlatAppearance.BorderSize = 0; - this.btnStart.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.btnStart.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnStart.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.btnStart.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - this.btnStart.HoverForeColor = System.Drawing.Color.White; - this.btnStart.Location = new System.Drawing.Point(88, 65); - this.btnStart.Margin = new System.Windows.Forms.Padding(0); - this.btnStart.Name = "btnStart"; - this.btnStart.PressBackColor = System.Drawing.Color.DarkBlue; - this.btnStart.PressForeColor = System.Drawing.Color.White; - this.btnStart.Radius = 5; - this.btnStart.Size = new System.Drawing.Size(111, 26); - this.btnStart.TabIndex = 11; - this.btnStart.Text = "启动连续检定"; - this.btnStart.UseVisualStyleBackColor = true; - this.btnStart.Click += new System.EventHandler(this.btnStart_Click); - // // labelControl // this.labelControl.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); @@ -434,6 +362,78 @@ this.labelCounter.Text = "计数器参数设置"; this.labelCounter.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // + // btn_add + // + this.btn_add.EnterBackColor = System.Drawing.Color.Blue; + this.btn_add.EnterForeColor = System.Drawing.Color.White; + this.btn_add.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btn_add.FlatAppearance.BorderSize = 0; + this.btn_add.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btn_add.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btn_add.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btn_add.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.btn_add.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btn_add.HoverForeColor = System.Drawing.Color.White; + this.btn_add.Location = new System.Drawing.Point(155, 65); + this.btn_add.Margin = new System.Windows.Forms.Padding(0); + this.btn_add.Name = "btn_add"; + this.btn_add.PressBackColor = System.Drawing.Color.DarkBlue; + this.btn_add.PressForeColor = System.Drawing.Color.White; + this.btn_add.Radius = 5; + this.btn_add.Size = new System.Drawing.Size(111, 26); + this.btn_add.TabIndex = 14; + this.btn_add.Text = "添加"; + this.btn_add.UseVisualStyleBackColor = true; + this.btn_add.Click += new System.EventHandler(this.btn_add_Click); + // + // benDelete + // + this.benDelete.EnterBackColor = System.Drawing.Color.Blue; + this.benDelete.EnterForeColor = System.Drawing.Color.White; + this.benDelete.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.benDelete.FlatAppearance.BorderSize = 0; + this.benDelete.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.benDelete.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.benDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.benDelete.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.benDelete.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(0)))), ((int)(((byte)(18))))); + this.benDelete.HoverForeColor = System.Drawing.Color.White; + this.benDelete.Location = new System.Drawing.Point(27, 65); + this.benDelete.Margin = new System.Windows.Forms.Padding(0); + this.benDelete.Name = "benDelete"; + this.benDelete.PressBackColor = System.Drawing.Color.DarkBlue; + this.benDelete.PressForeColor = System.Drawing.Color.White; + this.benDelete.Radius = 5; + this.benDelete.Size = new System.Drawing.Size(111, 26); + this.benDelete.TabIndex = 13; + this.benDelete.Text = "删除"; + this.benDelete.UseVisualStyleBackColor = true; + this.benDelete.Click += new System.EventHandler(this.benDelete_Click); + // + // btnStart + // + this.btnStart.EnterBackColor = System.Drawing.Color.Blue; + this.btnStart.EnterForeColor = System.Drawing.Color.White; + this.btnStart.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnStart.FlatAppearance.BorderSize = 0; + this.btnStart.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnStart.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnStart.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.btnStart.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btnStart.HoverForeColor = System.Drawing.Color.White; + this.btnStart.Location = new System.Drawing.Point(88, 65); + this.btnStart.Margin = new System.Windows.Forms.Padding(0); + this.btnStart.Name = "btnStart"; + this.btnStart.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnStart.PressForeColor = System.Drawing.Color.White; + this.btnStart.Radius = 5; + this.btnStart.Size = new System.Drawing.Size(111, 26); + this.btnStart.TabIndex = 11; + this.btnStart.Text = "启动连续检定"; + this.btnStart.UseVisualStyleBackColor = true; + this.btnStart.Click += new System.EventHandler(this.btnStart_Click); + // // CounterCtrlForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 85bbd68..d767cb7 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -62,7 +62,36 @@ public CounterCtrlForm() { InitializeComponent(); + + InitTableCounter(); + LoadCounterDetecInitList(); + InitCounterItems(); + /*List list = deviceService.getAllCounter(); + + comboBox_counters.DataSource = list; + comboBox_counters.DisplayMember = "DevName"; + comboBox_counters.ValueMember = "Id"; + + comboBox_detecModel.SelectedIndex = 0; + + if (list != null && list.Count > 0) + { + string[] ids = gPIBService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + string[] ips = tcpService.getId(); + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0].Split(':')[2]; + } + }*/ + } + + public void InitCounterItems() + { List list = deviceService.getAllCounter(); comboBox_counters.DataSource = list; @@ -71,9 +100,6 @@ comboBox_detecModel.SelectedIndex = 0; - InitTableCounter(); - LoadCounterDetecInitList(); - if (list != null && list.Count > 0) { string[] ids = gPIBService.getId(); @@ -224,6 +250,8 @@ table_counterDetecInit.Columns.Add("initId", Type.GetType("System.Int32")); table_counterDetecInit.Columns.Add("counterDataId", Type.GetType("System.Int64")); + if (comboBox_counters.SelectedItem == null) return; + if (((DeviceDto)comboBox_counters.SelectedItem).DevName != "") { List list = deviceService.search(((DeviceDto)comboBox_counters.SelectedItem).DevName, "", "", "", "", ""); @@ -304,7 +332,7 @@ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); - + if (tcpService.getId() != null && tcpService.getId().Length > 0) { text_counterIp.Text = tcpService.getId()[0].Split(':')[2]; @@ -537,7 +565,6 @@ MessageBox.Show("请输入信号源地址!"); return; } - dataGridView_CounterResult.ReadOnly = true; diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index b224bc1..ac9e466 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -167,7 +167,7 @@ string sQry = "SELECT * FROM r_device where active = " + 0; if (devName != "" && devName != null) - sQry += " and DEV_NAME like '%" + devName + "%'"; + sQry += " and DEV_NAME = '" + devName + "'"; if (devCode != "" && devCode != null) sQry += " and DEV_CODE like '%" + devCode + "%'"; if (devModel != "" && devModel != null) diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs index 8d74572..3696a17 100644 --- a/RbFreqStandMeasure/RbFreqStdMeas.cs +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -573,7 +573,7 @@ break; case 3: // 频率计数器范围 - CounterCtrlForm counterForm = new CounterCtrlForm(); + CounterCtrlForm counterForm = CounterCtrlForm.GetInstance(); counterForm.Show(); panelMain.Controls.Add(counterForm); break; diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index e81d805..b3005b4 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 4800a1b..96c0863 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.Designer.cs @@ -36,10 +36,7 @@ this.dataGridView_CounterResult = new System.Windows.Forms.DataGridView(); this.panelMedian = new System.Windows.Forms.Panel(); this.labelMedian = new System.Windows.Forms.Label(); - this.btn_add = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); - this.benDelete = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panelControl = new System.Windows.Forms.Panel(); - this.btnStart = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.labelControl = new System.Windows.Forms.Label(); this.panelSource = new System.Windows.Forms.Panel(); this.text_signal = new DevComponents.DotNetBar.Controls.TextBoxX(); @@ -59,6 +56,9 @@ this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelCounter = new System.Windows.Forms.Label(); + this.btn_add = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.benDelete = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.btnStart = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView_CounterResult)).BeginInit(); this.panelMedian.SuspendLayout(); @@ -142,54 +142,6 @@ this.labelMedian.Text = "结果编辑"; this.labelMedian.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // btn_add - // - this.btn_add.EnterBackColor = System.Drawing.Color.Blue; - this.btn_add.EnterForeColor = System.Drawing.Color.White; - this.btn_add.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.btn_add.FlatAppearance.BorderSize = 0; - this.btn_add.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.btn_add.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btn_add.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_add.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.btn_add.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - this.btn_add.HoverForeColor = System.Drawing.Color.White; - this.btn_add.Location = new System.Drawing.Point(155, 65); - this.btn_add.Margin = new System.Windows.Forms.Padding(0); - this.btn_add.Name = "btn_add"; - this.btn_add.PressBackColor = System.Drawing.Color.DarkBlue; - this.btn_add.PressForeColor = System.Drawing.Color.White; - this.btn_add.Radius = 5; - this.btn_add.Size = new System.Drawing.Size(111, 26); - this.btn_add.TabIndex = 14; - this.btn_add.Text = "添加"; - this.btn_add.UseVisualStyleBackColor = true; - this.btn_add.Click += new System.EventHandler(this.btn_add_Click); - // - // benDelete - // - this.benDelete.EnterBackColor = System.Drawing.Color.Blue; - this.benDelete.EnterForeColor = System.Drawing.Color.White; - this.benDelete.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.benDelete.FlatAppearance.BorderSize = 0; - this.benDelete.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.benDelete.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.benDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.benDelete.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.benDelete.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(0)))), ((int)(((byte)(18))))); - this.benDelete.HoverForeColor = System.Drawing.Color.White; - this.benDelete.Location = new System.Drawing.Point(27, 65); - this.benDelete.Margin = new System.Windows.Forms.Padding(0); - this.benDelete.Name = "benDelete"; - this.benDelete.PressBackColor = System.Drawing.Color.DarkBlue; - this.benDelete.PressForeColor = System.Drawing.Color.White; - this.benDelete.Radius = 5; - this.benDelete.Size = new System.Drawing.Size(111, 26); - this.benDelete.TabIndex = 13; - this.benDelete.Text = "删除"; - this.benDelete.UseVisualStyleBackColor = true; - this.benDelete.Click += new System.EventHandler(this.benDelete_Click); - // // panelControl // this.panelControl.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelControl.BackgroundImage"))); @@ -201,30 +153,6 @@ this.panelControl.Size = new System.Drawing.Size(288, 136); this.panelControl.TabIndex = 3; // - // btnStart - // - this.btnStart.EnterBackColor = System.Drawing.Color.Blue; - this.btnStart.EnterForeColor = System.Drawing.Color.White; - this.btnStart.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.btnStart.FlatAppearance.BorderSize = 0; - this.btnStart.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.btnStart.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnStart.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - this.btnStart.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); - this.btnStart.HoverForeColor = System.Drawing.Color.White; - this.btnStart.Location = new System.Drawing.Point(88, 65); - this.btnStart.Margin = new System.Windows.Forms.Padding(0); - this.btnStart.Name = "btnStart"; - this.btnStart.PressBackColor = System.Drawing.Color.DarkBlue; - this.btnStart.PressForeColor = System.Drawing.Color.White; - this.btnStart.Radius = 5; - this.btnStart.Size = new System.Drawing.Size(111, 26); - this.btnStart.TabIndex = 11; - this.btnStart.Text = "启动连续检定"; - this.btnStart.UseVisualStyleBackColor = true; - this.btnStart.Click += new System.EventHandler(this.btnStart_Click); - // // labelControl // this.labelControl.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); @@ -434,6 +362,78 @@ this.labelCounter.Text = "计数器参数设置"; this.labelCounter.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // + // btn_add + // + this.btn_add.EnterBackColor = System.Drawing.Color.Blue; + this.btn_add.EnterForeColor = System.Drawing.Color.White; + this.btn_add.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btn_add.FlatAppearance.BorderSize = 0; + this.btn_add.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btn_add.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btn_add.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btn_add.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.btn_add.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btn_add.HoverForeColor = System.Drawing.Color.White; + this.btn_add.Location = new System.Drawing.Point(155, 65); + this.btn_add.Margin = new System.Windows.Forms.Padding(0); + this.btn_add.Name = "btn_add"; + this.btn_add.PressBackColor = System.Drawing.Color.DarkBlue; + this.btn_add.PressForeColor = System.Drawing.Color.White; + this.btn_add.Radius = 5; + this.btn_add.Size = new System.Drawing.Size(111, 26); + this.btn_add.TabIndex = 14; + this.btn_add.Text = "添加"; + this.btn_add.UseVisualStyleBackColor = true; + this.btn_add.Click += new System.EventHandler(this.btn_add_Click); + // + // benDelete + // + this.benDelete.EnterBackColor = System.Drawing.Color.Blue; + this.benDelete.EnterForeColor = System.Drawing.Color.White; + this.benDelete.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.benDelete.FlatAppearance.BorderSize = 0; + this.benDelete.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.benDelete.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.benDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.benDelete.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.benDelete.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(0)))), ((int)(((byte)(18))))); + this.benDelete.HoverForeColor = System.Drawing.Color.White; + this.benDelete.Location = new System.Drawing.Point(27, 65); + this.benDelete.Margin = new System.Windows.Forms.Padding(0); + this.benDelete.Name = "benDelete"; + this.benDelete.PressBackColor = System.Drawing.Color.DarkBlue; + this.benDelete.PressForeColor = System.Drawing.Color.White; + this.benDelete.Radius = 5; + this.benDelete.Size = new System.Drawing.Size(111, 26); + this.benDelete.TabIndex = 13; + this.benDelete.Text = "删除"; + this.benDelete.UseVisualStyleBackColor = true; + this.benDelete.Click += new System.EventHandler(this.benDelete_Click); + // + // btnStart + // + this.btnStart.EnterBackColor = System.Drawing.Color.Blue; + this.btnStart.EnterForeColor = System.Drawing.Color.White; + this.btnStart.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.btnStart.FlatAppearance.BorderSize = 0; + this.btnStart.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; + this.btnStart.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; + this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnStart.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.btnStart.HoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(86)))), ((int)(((byte)(163)))), ((int)(((byte)(242))))); + this.btnStart.HoverForeColor = System.Drawing.Color.White; + this.btnStart.Location = new System.Drawing.Point(88, 65); + this.btnStart.Margin = new System.Windows.Forms.Padding(0); + this.btnStart.Name = "btnStart"; + this.btnStart.PressBackColor = System.Drawing.Color.DarkBlue; + this.btnStart.PressForeColor = System.Drawing.Color.White; + this.btnStart.Radius = 5; + this.btnStart.Size = new System.Drawing.Size(111, 26); + this.btnStart.TabIndex = 11; + this.btnStart.Text = "启动连续检定"; + this.btnStart.UseVisualStyleBackColor = true; + this.btnStart.Click += new System.EventHandler(this.btnStart_Click); + // // CounterCtrlForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index 85bbd68..d767cb7 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -62,7 +62,36 @@ public CounterCtrlForm() { InitializeComponent(); + + InitTableCounter(); + LoadCounterDetecInitList(); + InitCounterItems(); + /*List list = deviceService.getAllCounter(); + + comboBox_counters.DataSource = list; + comboBox_counters.DisplayMember = "DevName"; + comboBox_counters.ValueMember = "Id"; + + comboBox_detecModel.SelectedIndex = 0; + + if (list != null && list.Count > 0) + { + string[] ids = gPIBService.getId(); + if (ids != null && ids.Length > 0) + { + text_signal.Text = ids[0]; + } + string[] ips = tcpService.getId(); + if (ips != null && ips.Length > 0) + { + text_counterIp.Text = ips[0].Split(':')[2]; + } + }*/ + } + + public void InitCounterItems() + { List list = deviceService.getAllCounter(); comboBox_counters.DataSource = list; @@ -71,9 +100,6 @@ comboBox_detecModel.SelectedIndex = 0; - InitTableCounter(); - LoadCounterDetecInitList(); - if (list != null && list.Count > 0) { string[] ids = gPIBService.getId(); @@ -224,6 +250,8 @@ table_counterDetecInit.Columns.Add("initId", Type.GetType("System.Int32")); table_counterDetecInit.Columns.Add("counterDataId", Type.GetType("System.Int64")); + if (comboBox_counters.SelectedItem == null) return; + if (((DeviceDto)comboBox_counters.SelectedItem).DevName != "") { List list = deviceService.search(((DeviceDto)comboBox_counters.SelectedItem).DevName, "", "", "", "", ""); @@ -304,7 +332,7 @@ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); - + if (tcpService.getId() != null && tcpService.getId().Length > 0) { text_counterIp.Text = tcpService.getId()[0].Split(':')[2]; @@ -537,7 +565,6 @@ MessageBox.Show("请输入信号源地址!"); return; } - dataGridView_CounterResult.ReadOnly = true; diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index 6abc5b0..9652052 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -1,4 +1,5 @@ -using Casic.Birmm.RbFreqStandMeasure.home; +using Casic.Birmm.RbFreqStandMeasure.counter; +using Casic.Birmm.RbFreqStandMeasure.home; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service; using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Service.Impl; @@ -233,15 +234,15 @@ } } - - if (labelTitle.Text.Equals("添加")) - { + { statusId = "1"; if(needDetec) statusId = "2"; deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo, statusId); LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "添加"+ deviceId); + CounterCtrlForm.GetInstance().InitCounterItems(); + if (deviceId == -1) { LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "添加仪器[" + devName + "]失败");