diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index c8a9d0e..3e2be8c 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -71,6 +71,7 @@ this.label12 = new System.Windows.Forms.Label(); this.btnCancelSetChannel = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -82,6 +83,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitChannel); this.panel1.Controls.Add(this.label3); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -762,6 +764,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(337, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevChannelDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -784,6 +798,7 @@ this.Load += new System.EventHandler(this.SetDevChannelDlg_Load); this.Shown += new System.EventHandler(this.SetDevChannelDlg_Shown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -841,5 +856,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index c8a9d0e..3e2be8c 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -71,6 +71,7 @@ this.label12 = new System.Windows.Forms.Label(); this.btnCancelSetChannel = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -82,6 +83,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitChannel); this.panel1.Controls.Add(this.label3); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -762,6 +764,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(337, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevChannelDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -784,6 +798,7 @@ this.Load += new System.EventHandler(this.SetDevChannelDlg_Load); this.Shown += new System.EventHandler(this.SetDevChannelDlg_Shown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -841,5 +856,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index a1d96fe..75c2c90 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -171,11 +171,16 @@ return; } + label_tip.Text = "正在从通道[" + textBox_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { MessageBox.Show("请连接仪器到通道[" + textBox_channelNo.Text + "]!"); + label_tip.Text = ""; + return; } + label_tip.Text = ""; string startTime = timePicker_startTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = timePicker_endTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); @@ -324,10 +329,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index c8a9d0e..3e2be8c 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -71,6 +71,7 @@ this.label12 = new System.Windows.Forms.Label(); this.btnCancelSetChannel = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -82,6 +83,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitChannel); this.panel1.Controls.Add(this.label3); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -762,6 +764,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(337, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevChannelDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -784,6 +798,7 @@ this.Load += new System.EventHandler(this.SetDevChannelDlg_Load); this.Shown += new System.EventHandler(this.SetDevChannelDlg_Shown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -841,5 +856,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index a1d96fe..75c2c90 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -171,11 +171,16 @@ return; } + label_tip.Text = "正在从通道[" + textBox_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { MessageBox.Show("请连接仪器到通道[" + textBox_channelNo.Text + "]!"); + label_tip.Text = ""; + return; } + label_tip.Text = ""; string startTime = timePicker_startTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = timePicker_endTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); @@ -324,10 +329,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 473850d..e758634 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -73,6 +73,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -84,6 +85,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.label11); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -742,6 +744,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(331, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevTestDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -764,6 +778,7 @@ this.Name = "SetDevTestDlg"; this.Text = "设置仪器检测项目"; this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); @@ -821,5 +836,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index c8a9d0e..3e2be8c 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -71,6 +71,7 @@ this.label12 = new System.Windows.Forms.Label(); this.btnCancelSetChannel = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -82,6 +83,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitChannel); this.panel1.Controls.Add(this.label3); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -762,6 +764,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(337, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevChannelDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -784,6 +798,7 @@ this.Load += new System.EventHandler(this.SetDevChannelDlg_Load); this.Shown += new System.EventHandler(this.SetDevChannelDlg_Shown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -841,5 +856,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index a1d96fe..75c2c90 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -171,11 +171,16 @@ return; } + label_tip.Text = "正在从通道[" + textBox_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { MessageBox.Show("请连接仪器到通道[" + textBox_channelNo.Text + "]!"); + label_tip.Text = ""; + return; } + label_tip.Text = ""; string startTime = timePicker_startTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = timePicker_endTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); @@ -324,10 +329,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 473850d..e758634 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -73,6 +73,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -84,6 +85,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.label11); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -742,6 +744,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(331, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevTestDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -764,6 +778,7 @@ this.Name = "SetDevTestDlg"; this.Text = "设置仪器检测项目"; this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); @@ -821,5 +836,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 6e9d272..3096e4a 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -55,7 +55,7 @@ timePicker_startTime.Value = DateTime.Now; timePicker_startTime.MinDate = DateTime.Now; getEndTime(); - timePicker_startTime.MinDate = DateTime.Now.AddMinutes(5); + // 设置双缓冲 SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); @@ -125,14 +125,18 @@ MessageBox.Show("无法打开串口" + portName + ",添加检测失败!"); return; } - + + label_tip.Text = "正在从通道[" + text_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; + MessageBox.Show("请连接仪器到通道[" + text_channelNo.Text + "]!"); return; } - + label_tip.Text = ""; //开始检测 string stability = "-3"; @@ -285,10 +289,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index c8a9d0e..3e2be8c 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -71,6 +71,7 @@ this.label12 = new System.Windows.Forms.Label(); this.btnCancelSetChannel = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -82,6 +83,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitChannel); this.panel1.Controls.Add(this.label3); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -762,6 +764,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(337, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevChannelDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -784,6 +798,7 @@ this.Load += new System.EventHandler(this.SetDevChannelDlg_Load); this.Shown += new System.EventHandler(this.SetDevChannelDlg_Shown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -841,5 +856,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index a1d96fe..75c2c90 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -171,11 +171,16 @@ return; } + label_tip.Text = "正在从通道[" + textBox_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { MessageBox.Show("请连接仪器到通道[" + textBox_channelNo.Text + "]!"); + label_tip.Text = ""; + return; } + label_tip.Text = ""; string startTime = timePicker_startTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = timePicker_endTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); @@ -324,10 +329,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 473850d..e758634 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -73,6 +73,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -84,6 +85,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.label11); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -742,6 +744,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(331, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevTestDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -764,6 +778,7 @@ this.Name = "SetDevTestDlg"; this.Text = "设置仪器检测项目"; this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); @@ -821,5 +836,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 6e9d272..3096e4a 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -55,7 +55,7 @@ timePicker_startTime.Value = DateTime.Now; timePicker_startTime.MinDate = DateTime.Now; getEndTime(); - timePicker_startTime.MinDate = DateTime.Now.AddMinutes(5); + // 设置双缓冲 SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); @@ -125,14 +125,18 @@ MessageBox.Show("无法打开串口" + portName + ",添加检测失败!"); return; } - + + label_tip.Text = "正在从通道[" + text_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; + MessageBox.Show("请连接仪器到通道[" + text_channelNo.Text + "]!"); return; } - + label_tip.Text = ""; //开始检测 string stability = "-3"; @@ -285,10 +289,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 35c7a60..519f9c8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -81,6 +81,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -105,6 +106,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.labelTitle); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -852,6 +854,18 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(238, 5); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 352; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -872,6 +886,7 @@ this.Shown += new System.EventHandler(this.AddDevDlg_Shown); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); this.groupBox1.ResumeLayout(false); @@ -938,5 +953,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index c8a9d0e..3e2be8c 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -71,6 +71,7 @@ this.label12 = new System.Windows.Forms.Label(); this.btnCancelSetChannel = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -82,6 +83,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitChannel); this.panel1.Controls.Add(this.label3); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -762,6 +764,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(337, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevChannelDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -784,6 +798,7 @@ this.Load += new System.EventHandler(this.SetDevChannelDlg_Load); this.Shown += new System.EventHandler(this.SetDevChannelDlg_Shown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -841,5 +856,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index a1d96fe..75c2c90 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -171,11 +171,16 @@ return; } + label_tip.Text = "正在从通道[" + textBox_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { MessageBox.Show("请连接仪器到通道[" + textBox_channelNo.Text + "]!"); + label_tip.Text = ""; + return; } + label_tip.Text = ""; string startTime = timePicker_startTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = timePicker_endTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); @@ -324,10 +329,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 473850d..e758634 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -73,6 +73,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -84,6 +85,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.label11); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -742,6 +744,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(331, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevTestDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -764,6 +778,7 @@ this.Name = "SetDevTestDlg"; this.Text = "设置仪器检测项目"; this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); @@ -821,5 +836,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 6e9d272..3096e4a 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -55,7 +55,7 @@ timePicker_startTime.Value = DateTime.Now; timePicker_startTime.MinDate = DateTime.Now; getEndTime(); - timePicker_startTime.MinDate = DateTime.Now.AddMinutes(5); + // 设置双缓冲 SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); @@ -125,14 +125,18 @@ MessageBox.Show("无法打开串口" + portName + ",添加检测失败!"); return; } - + + label_tip.Text = "正在从通道[" + text_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; + MessageBox.Show("请连接仪器到通道[" + text_channelNo.Text + "]!"); return; } - + label_tip.Text = ""; //开始检测 string stability = "-3"; @@ -285,10 +289,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 35c7a60..519f9c8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -81,6 +81,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -105,6 +106,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.labelTitle); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -852,6 +854,18 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(238, 5); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 352; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -872,6 +886,7 @@ this.Shown += new System.EventHandler(this.AddDevDlg_Shown); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); this.groupBox1.ResumeLayout(false); @@ -938,5 +953,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index 9652052..8655a91 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -222,11 +222,14 @@ try { + label_tip.Text = "正在从通道[" + channelNo + "]获取数据,请稍侯......"; if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; MessageBox.Show("请连接仪器到通道[" + channelNo + "]!"); return; } + label_tip.Text = ""; } catch (Exception exc) { @@ -241,7 +244,7 @@ deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo, statusId); LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "添加"+ deviceId); - CounterCtrlForm.GetInstance().InitCounterItems(); + CounterCtrlForm.GetInstance().addCounterItems(); if (deviceId == -1) { @@ -252,10 +255,10 @@ } } else if (labelTitle.Text.Equals("修改")) - { + { if (needDetec) statusId = "2"; devService.update(deviceId, devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo,statusId); - + CounterCtrlForm.GetInstance().addCounterItems(); } @@ -443,10 +446,10 @@ { if (checkBox_stability.Checked) { - if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = picker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index c8a9d0e..3e2be8c 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -71,6 +71,7 @@ this.label12 = new System.Windows.Forms.Label(); this.btnCancelSetChannel = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -82,6 +83,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitChannel); this.panel1.Controls.Add(this.label3); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -762,6 +764,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(337, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevChannelDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -784,6 +798,7 @@ this.Load += new System.EventHandler(this.SetDevChannelDlg_Load); this.Shown += new System.EventHandler(this.SetDevChannelDlg_Shown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -841,5 +856,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index a1d96fe..75c2c90 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -171,11 +171,16 @@ return; } + label_tip.Text = "正在从通道[" + textBox_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { MessageBox.Show("请连接仪器到通道[" + textBox_channelNo.Text + "]!"); + label_tip.Text = ""; + return; } + label_tip.Text = ""; string startTime = timePicker_startTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = timePicker_endTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); @@ -324,10 +329,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 473850d..e758634 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -73,6 +73,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -84,6 +85,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.label11); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -742,6 +744,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(331, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevTestDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -764,6 +778,7 @@ this.Name = "SetDevTestDlg"; this.Text = "设置仪器检测项目"; this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); @@ -821,5 +836,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 6e9d272..3096e4a 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -55,7 +55,7 @@ timePicker_startTime.Value = DateTime.Now; timePicker_startTime.MinDate = DateTime.Now; getEndTime(); - timePicker_startTime.MinDate = DateTime.Now.AddMinutes(5); + // 设置双缓冲 SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); @@ -125,14 +125,18 @@ MessageBox.Show("无法打开串口" + portName + ",添加检测失败!"); return; } - + + label_tip.Text = "正在从通道[" + text_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; + MessageBox.Show("请连接仪器到通道[" + text_channelNo.Text + "]!"); return; } - + label_tip.Text = ""; //开始检测 string stability = "-3"; @@ -285,10 +289,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 35c7a60..519f9c8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -81,6 +81,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -105,6 +106,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.labelTitle); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -852,6 +854,18 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(238, 5); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 352; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -872,6 +886,7 @@ this.Shown += new System.EventHandler(this.AddDevDlg_Shown); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); this.groupBox1.ResumeLayout(false); @@ -938,5 +953,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index 9652052..8655a91 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -222,11 +222,14 @@ try { + label_tip.Text = "正在从通道[" + channelNo + "]获取数据,请稍侯......"; if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; MessageBox.Show("请连接仪器到通道[" + channelNo + "]!"); return; } + label_tip.Text = ""; } catch (Exception exc) { @@ -241,7 +244,7 @@ deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo, statusId); LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "添加"+ deviceId); - CounterCtrlForm.GetInstance().InitCounterItems(); + CounterCtrlForm.GetInstance().addCounterItems(); if (deviceId == -1) { @@ -252,10 +255,10 @@ } } else if (labelTitle.Text.Equals("修改")) - { + { if (needDetec) statusId = "2"; devService.update(deviceId, devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo,statusId); - + CounterCtrlForm.GetInstance().addCounterItems(); } @@ -443,10 +446,10 @@ { if (checkBox_stability.Checked) { - if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = picker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/ExportDlg.Designer.cs b/RbFreqStandMeasure/info/ExportDlg.Designer.cs index 422bc37..5b60ccb 100644 --- a/RbFreqStandMeasure/info/ExportDlg.Designer.cs +++ b/RbFreqStandMeasure/info/ExportDlg.Designer.cs @@ -29,8 +29,8 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.btnExitDev = new System.Windows.Forms.Button(); this.labelTitle = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); @@ -87,7 +87,7 @@ this.label_devType.BackColor = System.Drawing.Color.Transparent; this.label_devType.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_devType.ForeColor = System.Drawing.SystemColors.GrayText; - this.label_devType.Location = new System.Drawing.Point(340, 47); + this.label_devType.Location = new System.Drawing.Point(340, 49); this.label_devType.Margin = new System.Windows.Forms.Padding(0); this.label_devType.Name = "label_devType"; this.label_devType.Size = new System.Drawing.Size(142, 27); @@ -99,7 +99,7 @@ this.label_devName.BackColor = System.Drawing.Color.Transparent; this.label_devName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_devName.ForeColor = System.Drawing.SystemColors.GrayText; - this.label_devName.Location = new System.Drawing.Point(123, 47); + this.label_devName.Location = new System.Drawing.Point(123, 49); this.label_devName.Margin = new System.Windows.Forms.Padding(0); this.label_devName.Name = "label_devName"; this.label_devName.Size = new System.Drawing.Size(113, 27); @@ -189,14 +189,14 @@ this.dataGridView_times.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.dataGridView_times.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.dataGridView_times.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_times.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_times.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dataGridView_times.ColumnHeadersHeight = 28; this.dataGridView_times.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.dataGridView_times.GridColor = System.Drawing.Color.White; @@ -204,13 +204,13 @@ this.dataGridView_times.Name = "dataGridView_times"; this.dataGridView_times.RowHeadersVisible = false; this.dataGridView_times.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.LightGray; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.dataGridView_times.RowsDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.LightGray; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.dataGridView_times.RowsDefaultCellStyle = dataGridViewCellStyle2; this.dataGridView_times.RowTemplate.Height = 23; this.dataGridView_times.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.dataGridView_times.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index c8a9d0e..3e2be8c 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -71,6 +71,7 @@ this.label12 = new System.Windows.Forms.Label(); this.btnCancelSetChannel = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -82,6 +83,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitChannel); this.panel1.Controls.Add(this.label3); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -762,6 +764,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(337, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevChannelDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -784,6 +798,7 @@ this.Load += new System.EventHandler(this.SetDevChannelDlg_Load); this.Shown += new System.EventHandler(this.SetDevChannelDlg_Shown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -841,5 +856,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index a1d96fe..75c2c90 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -171,11 +171,16 @@ return; } + label_tip.Text = "正在从通道[" + textBox_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { MessageBox.Show("请连接仪器到通道[" + textBox_channelNo.Text + "]!"); + label_tip.Text = ""; + return; } + label_tip.Text = ""; string startTime = timePicker_startTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = timePicker_endTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); @@ -324,10 +329,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 473850d..e758634 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -73,6 +73,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -84,6 +85,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.label11); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -742,6 +744,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(331, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevTestDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -764,6 +778,7 @@ this.Name = "SetDevTestDlg"; this.Text = "设置仪器检测项目"; this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); @@ -821,5 +836,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 6e9d272..3096e4a 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -55,7 +55,7 @@ timePicker_startTime.Value = DateTime.Now; timePicker_startTime.MinDate = DateTime.Now; getEndTime(); - timePicker_startTime.MinDate = DateTime.Now.AddMinutes(5); + // 设置双缓冲 SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); @@ -125,14 +125,18 @@ MessageBox.Show("无法打开串口" + portName + ",添加检测失败!"); return; } - + + label_tip.Text = "正在从通道[" + text_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; + MessageBox.Show("请连接仪器到通道[" + text_channelNo.Text + "]!"); return; } - + label_tip.Text = ""; //开始检测 string stability = "-3"; @@ -285,10 +289,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 35c7a60..519f9c8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -81,6 +81,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -105,6 +106,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.labelTitle); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -852,6 +854,18 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(238, 5); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 352; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -872,6 +886,7 @@ this.Shown += new System.EventHandler(this.AddDevDlg_Shown); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); this.groupBox1.ResumeLayout(false); @@ -938,5 +953,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index 9652052..8655a91 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -222,11 +222,14 @@ try { + label_tip.Text = "正在从通道[" + channelNo + "]获取数据,请稍侯......"; if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; MessageBox.Show("请连接仪器到通道[" + channelNo + "]!"); return; } + label_tip.Text = ""; } catch (Exception exc) { @@ -241,7 +244,7 @@ deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo, statusId); LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "添加"+ deviceId); - CounterCtrlForm.GetInstance().InitCounterItems(); + CounterCtrlForm.GetInstance().addCounterItems(); if (deviceId == -1) { @@ -252,10 +255,10 @@ } } else if (labelTitle.Text.Equals("修改")) - { + { if (needDetec) statusId = "2"; devService.update(deviceId, devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo,statusId); - + CounterCtrlForm.GetInstance().addCounterItems(); } @@ -443,10 +446,10 @@ { if (checkBox_stability.Checked) { - if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = picker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/ExportDlg.Designer.cs b/RbFreqStandMeasure/info/ExportDlg.Designer.cs index 422bc37..5b60ccb 100644 --- a/RbFreqStandMeasure/info/ExportDlg.Designer.cs +++ b/RbFreqStandMeasure/info/ExportDlg.Designer.cs @@ -29,8 +29,8 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.btnExitDev = new System.Windows.Forms.Button(); this.labelTitle = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); @@ -87,7 +87,7 @@ this.label_devType.BackColor = System.Drawing.Color.Transparent; this.label_devType.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_devType.ForeColor = System.Drawing.SystemColors.GrayText; - this.label_devType.Location = new System.Drawing.Point(340, 47); + this.label_devType.Location = new System.Drawing.Point(340, 49); this.label_devType.Margin = new System.Windows.Forms.Padding(0); this.label_devType.Name = "label_devType"; this.label_devType.Size = new System.Drawing.Size(142, 27); @@ -99,7 +99,7 @@ this.label_devName.BackColor = System.Drawing.Color.Transparent; this.label_devName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_devName.ForeColor = System.Drawing.SystemColors.GrayText; - this.label_devName.Location = new System.Drawing.Point(123, 47); + this.label_devName.Location = new System.Drawing.Point(123, 49); this.label_devName.Margin = new System.Windows.Forms.Padding(0); this.label_devName.Name = "label_devName"; this.label_devName.Size = new System.Drawing.Size(113, 27); @@ -189,14 +189,14 @@ this.dataGridView_times.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.dataGridView_times.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.dataGridView_times.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_times.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_times.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dataGridView_times.ColumnHeadersHeight = 28; this.dataGridView_times.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.dataGridView_times.GridColor = System.Drawing.Color.White; @@ -204,13 +204,13 @@ this.dataGridView_times.Name = "dataGridView_times"; this.dataGridView_times.RowHeadersVisible = false; this.dataGridView_times.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.LightGray; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.dataGridView_times.RowsDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.LightGray; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.dataGridView_times.RowsDefaultCellStyle = dataGridViewCellStyle2; this.dataGridView_times.RowTemplate.Height = 23; this.dataGridView_times.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.dataGridView_times.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 3b13488..38137b8 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -1,4 +1,5 @@ -using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.counter; +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; @@ -582,6 +583,7 @@ deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[9].Value)); MessageBox.Show("删除成功", "提示"); LoadDevList(condition); + CounterCtrlForm.GetInstance().addCounterItems(); } } diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index c8a9d0e..3e2be8c 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -71,6 +71,7 @@ this.label12 = new System.Windows.Forms.Label(); this.btnCancelSetChannel = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -82,6 +83,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitChannel); this.panel1.Controls.Add(this.label3); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -762,6 +764,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(337, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevChannelDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -784,6 +798,7 @@ this.Load += new System.EventHandler(this.SetDevChannelDlg_Load); this.Shown += new System.EventHandler(this.SetDevChannelDlg_Shown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -841,5 +856,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index a1d96fe..75c2c90 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -171,11 +171,16 @@ return; } + label_tip.Text = "正在从通道[" + textBox_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { MessageBox.Show("请连接仪器到通道[" + textBox_channelNo.Text + "]!"); + label_tip.Text = ""; + return; } + label_tip.Text = ""; string startTime = timePicker_startTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = timePicker_endTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); @@ -324,10 +329,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 473850d..e758634 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -73,6 +73,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -84,6 +85,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.label11); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -742,6 +744,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(331, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevTestDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -764,6 +778,7 @@ this.Name = "SetDevTestDlg"; this.Text = "设置仪器检测项目"; this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); @@ -821,5 +836,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 6e9d272..3096e4a 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -55,7 +55,7 @@ timePicker_startTime.Value = DateTime.Now; timePicker_startTime.MinDate = DateTime.Now; getEndTime(); - timePicker_startTime.MinDate = DateTime.Now.AddMinutes(5); + // 设置双缓冲 SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); @@ -125,14 +125,18 @@ MessageBox.Show("无法打开串口" + portName + ",添加检测失败!"); return; } - + + label_tip.Text = "正在从通道[" + text_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; + MessageBox.Show("请连接仪器到通道[" + text_channelNo.Text + "]!"); return; } - + label_tip.Text = ""; //开始检测 string stability = "-3"; @@ -285,10 +289,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 35c7a60..519f9c8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -81,6 +81,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -105,6 +106,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.labelTitle); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -852,6 +854,18 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(238, 5); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 352; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -872,6 +886,7 @@ this.Shown += new System.EventHandler(this.AddDevDlg_Shown); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); this.groupBox1.ResumeLayout(false); @@ -938,5 +953,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index 9652052..8655a91 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -222,11 +222,14 @@ try { + label_tip.Text = "正在从通道[" + channelNo + "]获取数据,请稍侯......"; if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; MessageBox.Show("请连接仪器到通道[" + channelNo + "]!"); return; } + label_tip.Text = ""; } catch (Exception exc) { @@ -241,7 +244,7 @@ deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo, statusId); LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "添加"+ deviceId); - CounterCtrlForm.GetInstance().InitCounterItems(); + CounterCtrlForm.GetInstance().addCounterItems(); if (deviceId == -1) { @@ -252,10 +255,10 @@ } } else if (labelTitle.Text.Equals("修改")) - { + { if (needDetec) statusId = "2"; devService.update(deviceId, devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo,statusId); - + CounterCtrlForm.GetInstance().addCounterItems(); } @@ -443,10 +446,10 @@ { if (checkBox_stability.Checked) { - if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = picker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/ExportDlg.Designer.cs b/RbFreqStandMeasure/info/ExportDlg.Designer.cs index 422bc37..5b60ccb 100644 --- a/RbFreqStandMeasure/info/ExportDlg.Designer.cs +++ b/RbFreqStandMeasure/info/ExportDlg.Designer.cs @@ -29,8 +29,8 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.btnExitDev = new System.Windows.Forms.Button(); this.labelTitle = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); @@ -87,7 +87,7 @@ this.label_devType.BackColor = System.Drawing.Color.Transparent; this.label_devType.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_devType.ForeColor = System.Drawing.SystemColors.GrayText; - this.label_devType.Location = new System.Drawing.Point(340, 47); + this.label_devType.Location = new System.Drawing.Point(340, 49); this.label_devType.Margin = new System.Windows.Forms.Padding(0); this.label_devType.Name = "label_devType"; this.label_devType.Size = new System.Drawing.Size(142, 27); @@ -99,7 +99,7 @@ this.label_devName.BackColor = System.Drawing.Color.Transparent; this.label_devName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_devName.ForeColor = System.Drawing.SystemColors.GrayText; - this.label_devName.Location = new System.Drawing.Point(123, 47); + this.label_devName.Location = new System.Drawing.Point(123, 49); this.label_devName.Margin = new System.Windows.Forms.Padding(0); this.label_devName.Name = "label_devName"; this.label_devName.Size = new System.Drawing.Size(113, 27); @@ -189,14 +189,14 @@ this.dataGridView_times.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.dataGridView_times.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.dataGridView_times.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_times.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_times.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dataGridView_times.ColumnHeadersHeight = 28; this.dataGridView_times.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.dataGridView_times.GridColor = System.Drawing.Color.White; @@ -204,13 +204,13 @@ this.dataGridView_times.Name = "dataGridView_times"; this.dataGridView_times.RowHeadersVisible = false; this.dataGridView_times.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.LightGray; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.dataGridView_times.RowsDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.LightGray; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.dataGridView_times.RowsDefaultCellStyle = dataGridViewCellStyle2; this.dataGridView_times.RowTemplate.Height = 23; this.dataGridView_times.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.dataGridView_times.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 3b13488..38137b8 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -1,4 +1,5 @@ -using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.counter; +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; @@ -582,6 +583,7 @@ deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[9].Value)); MessageBox.Show("删除成功", "提示"); LoadDevList(condition); + CounterCtrlForm.GetInstance().addCounterItems(); } } diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs index 16d378a..23e4572 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs @@ -522,6 +522,6 @@ public System.Windows.Forms.Label label_clockStatus; public System.Windows.Forms.Label label_chnTotal; public System.Windows.Forms.Label label_usaTotal; - private System.Windows.Forms.Timer timer1; + public System.Windows.Forms.Timer timer1; } } diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index c8a9d0e..3e2be8c 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -71,6 +71,7 @@ this.label12 = new System.Windows.Forms.Label(); this.btnCancelSetChannel = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -82,6 +83,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitChannel); this.panel1.Controls.Add(this.label3); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -762,6 +764,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(337, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevChannelDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -784,6 +798,7 @@ this.Load += new System.EventHandler(this.SetDevChannelDlg_Load); this.Shown += new System.EventHandler(this.SetDevChannelDlg_Shown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -841,5 +856,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index a1d96fe..75c2c90 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -171,11 +171,16 @@ return; } + label_tip.Text = "正在从通道[" + textBox_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { MessageBox.Show("请连接仪器到通道[" + textBox_channelNo.Text + "]!"); + label_tip.Text = ""; + return; } + label_tip.Text = ""; string startTime = timePicker_startTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = timePicker_endTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); @@ -324,10 +329,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 473850d..e758634 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -73,6 +73,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -84,6 +85,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.label11); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -742,6 +744,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(331, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevTestDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -764,6 +778,7 @@ this.Name = "SetDevTestDlg"; this.Text = "设置仪器检测项目"; this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); @@ -821,5 +836,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 6e9d272..3096e4a 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -55,7 +55,7 @@ timePicker_startTime.Value = DateTime.Now; timePicker_startTime.MinDate = DateTime.Now; getEndTime(); - timePicker_startTime.MinDate = DateTime.Now.AddMinutes(5); + // 设置双缓冲 SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); @@ -125,14 +125,18 @@ MessageBox.Show("无法打开串口" + portName + ",添加检测失败!"); return; } - + + label_tip.Text = "正在从通道[" + text_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; + MessageBox.Show("请连接仪器到通道[" + text_channelNo.Text + "]!"); return; } - + label_tip.Text = ""; //开始检测 string stability = "-3"; @@ -285,10 +289,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 35c7a60..519f9c8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -81,6 +81,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -105,6 +106,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.labelTitle); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -852,6 +854,18 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(238, 5); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 352; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -872,6 +886,7 @@ this.Shown += new System.EventHandler(this.AddDevDlg_Shown); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); this.groupBox1.ResumeLayout(false); @@ -938,5 +953,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index 9652052..8655a91 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -222,11 +222,14 @@ try { + label_tip.Text = "正在从通道[" + channelNo + "]获取数据,请稍侯......"; if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; MessageBox.Show("请连接仪器到通道[" + channelNo + "]!"); return; } + label_tip.Text = ""; } catch (Exception exc) { @@ -241,7 +244,7 @@ deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo, statusId); LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "添加"+ deviceId); - CounterCtrlForm.GetInstance().InitCounterItems(); + CounterCtrlForm.GetInstance().addCounterItems(); if (deviceId == -1) { @@ -252,10 +255,10 @@ } } else if (labelTitle.Text.Equals("修改")) - { + { if (needDetec) statusId = "2"; devService.update(deviceId, devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo,statusId); - + CounterCtrlForm.GetInstance().addCounterItems(); } @@ -443,10 +446,10 @@ { if (checkBox_stability.Checked) { - if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = picker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/ExportDlg.Designer.cs b/RbFreqStandMeasure/info/ExportDlg.Designer.cs index 422bc37..5b60ccb 100644 --- a/RbFreqStandMeasure/info/ExportDlg.Designer.cs +++ b/RbFreqStandMeasure/info/ExportDlg.Designer.cs @@ -29,8 +29,8 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.btnExitDev = new System.Windows.Forms.Button(); this.labelTitle = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); @@ -87,7 +87,7 @@ this.label_devType.BackColor = System.Drawing.Color.Transparent; this.label_devType.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_devType.ForeColor = System.Drawing.SystemColors.GrayText; - this.label_devType.Location = new System.Drawing.Point(340, 47); + this.label_devType.Location = new System.Drawing.Point(340, 49); this.label_devType.Margin = new System.Windows.Forms.Padding(0); this.label_devType.Name = "label_devType"; this.label_devType.Size = new System.Drawing.Size(142, 27); @@ -99,7 +99,7 @@ this.label_devName.BackColor = System.Drawing.Color.Transparent; this.label_devName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_devName.ForeColor = System.Drawing.SystemColors.GrayText; - this.label_devName.Location = new System.Drawing.Point(123, 47); + this.label_devName.Location = new System.Drawing.Point(123, 49); this.label_devName.Margin = new System.Windows.Forms.Padding(0); this.label_devName.Name = "label_devName"; this.label_devName.Size = new System.Drawing.Size(113, 27); @@ -189,14 +189,14 @@ this.dataGridView_times.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.dataGridView_times.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.dataGridView_times.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_times.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_times.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dataGridView_times.ColumnHeadersHeight = 28; this.dataGridView_times.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.dataGridView_times.GridColor = System.Drawing.Color.White; @@ -204,13 +204,13 @@ this.dataGridView_times.Name = "dataGridView_times"; this.dataGridView_times.RowHeadersVisible = false; this.dataGridView_times.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.LightGray; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.dataGridView_times.RowsDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.LightGray; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.dataGridView_times.RowsDefaultCellStyle = dataGridViewCellStyle2; this.dataGridView_times.RowTemplate.Height = 23; this.dataGridView_times.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.dataGridView_times.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 3b13488..38137b8 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -1,4 +1,5 @@ -using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.counter; +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; @@ -582,6 +583,7 @@ deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[9].Value)); MessageBox.Show("删除成功", "提示"); LoadDevList(condition); + CounterCtrlForm.GetInstance().addCounterItems(); } } diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs index 16d378a..23e4572 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs @@ -522,6 +522,6 @@ public System.Windows.Forms.Label label_clockStatus; public System.Windows.Forms.Label label_chnTotal; public System.Windows.Forms.Label label_usaTotal; - private System.Windows.Forms.Timer timer1; + public System.Windows.Forms.Timer timer1; } } diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.cs b/RbFreqStandMeasure/status/StatusCtrlForm.cs index 8a7853d..98876cd 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.cs @@ -34,6 +34,7 @@ public static List bdList = new List(); public static int totalGP = 0; public static int totalBD = 0; + public static int gpCount = 0; public StatusCtrlForm() { InitializeComponent(); @@ -57,10 +58,11 @@ - if (!FreshStatus.isStarted) - { - FreshStatus.startClockFresh(); - } + //if (!FreshStatus.isStarted) + //{ + // // 开始获取原子钟状态的timer + // // FreshStatus.startClockFresh(); + //} new Thread(() => { @@ -126,6 +128,8 @@ { Invoke(new MethodInvoker(delegate () { + //if(receiverStatus.Equals("警告")) + //{ return; } if (bdList.Count > 0) { int bdCount = 0; @@ -156,9 +160,10 @@ } if (bdCount > 0) label_chnTotal.Text = bdCount + ""; } + if (gpList.Count > 0) { - int gpCount = 0; + gpCount = 0; foreach (string gsv in gpList) { string[] arr = gsv.Split(','); @@ -189,7 +194,6 @@ } } )); - } catch (Exception e) @@ -202,6 +206,10 @@ { try { + if (receiverStatus.Equals("警告")) + { + + } if ( bdList.Count > 0 ||gpList.Count > 0) { @@ -268,6 +276,13 @@ int bdMessCount = 0; int gpMessCount = 0; int count = 0; + lock (obj) + { + gpList.Clear(); + bdList.Clear(); + totalGP = 0; + totalBD = 0; + } while (count < 1000) { Thread.Sleep(100); @@ -284,10 +299,8 @@ { lock (obj) { - gpList.Clear(); - bdList.Clear(); - totalGP = 0; - totalBD = 0; + + } int index = -1; bool drawed = false; diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index c8a9d0e..3e2be8c 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -71,6 +71,7 @@ this.label12 = new System.Windows.Forms.Label(); this.btnCancelSetChannel = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -82,6 +83,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitChannel); this.panel1.Controls.Add(this.label3); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -762,6 +764,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(337, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevChannelDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -784,6 +798,7 @@ this.Load += new System.EventHandler(this.SetDevChannelDlg_Load); this.Shown += new System.EventHandler(this.SetDevChannelDlg_Shown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -841,5 +856,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index a1d96fe..75c2c90 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -171,11 +171,16 @@ return; } + label_tip.Text = "正在从通道[" + textBox_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { MessageBox.Show("请连接仪器到通道[" + textBox_channelNo.Text + "]!"); + label_tip.Text = ""; + return; } + label_tip.Text = ""; string startTime = timePicker_startTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = timePicker_endTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); @@ -324,10 +329,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 473850d..e758634 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -73,6 +73,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -84,6 +85,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.label11); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -742,6 +744,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(331, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevTestDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -764,6 +778,7 @@ this.Name = "SetDevTestDlg"; this.Text = "设置仪器检测项目"; this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); @@ -821,5 +836,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 6e9d272..3096e4a 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -55,7 +55,7 @@ timePicker_startTime.Value = DateTime.Now; timePicker_startTime.MinDate = DateTime.Now; getEndTime(); - timePicker_startTime.MinDate = DateTime.Now.AddMinutes(5); + // 设置双缓冲 SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); @@ -125,14 +125,18 @@ MessageBox.Show("无法打开串口" + portName + ",添加检测失败!"); return; } - + + label_tip.Text = "正在从通道[" + text_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; + MessageBox.Show("请连接仪器到通道[" + text_channelNo.Text + "]!"); return; } - + label_tip.Text = ""; //开始检测 string stability = "-3"; @@ -285,10 +289,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 35c7a60..519f9c8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -81,6 +81,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -105,6 +106,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.labelTitle); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -852,6 +854,18 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(238, 5); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 352; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -872,6 +886,7 @@ this.Shown += new System.EventHandler(this.AddDevDlg_Shown); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); this.groupBox1.ResumeLayout(false); @@ -938,5 +953,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index 9652052..8655a91 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -222,11 +222,14 @@ try { + label_tip.Text = "正在从通道[" + channelNo + "]获取数据,请稍侯......"; if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; MessageBox.Show("请连接仪器到通道[" + channelNo + "]!"); return; } + label_tip.Text = ""; } catch (Exception exc) { @@ -241,7 +244,7 @@ deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo, statusId); LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "添加"+ deviceId); - CounterCtrlForm.GetInstance().InitCounterItems(); + CounterCtrlForm.GetInstance().addCounterItems(); if (deviceId == -1) { @@ -252,10 +255,10 @@ } } else if (labelTitle.Text.Equals("修改")) - { + { if (needDetec) statusId = "2"; devService.update(deviceId, devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo,statusId); - + CounterCtrlForm.GetInstance().addCounterItems(); } @@ -443,10 +446,10 @@ { if (checkBox_stability.Checked) { - if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = picker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/ExportDlg.Designer.cs b/RbFreqStandMeasure/info/ExportDlg.Designer.cs index 422bc37..5b60ccb 100644 --- a/RbFreqStandMeasure/info/ExportDlg.Designer.cs +++ b/RbFreqStandMeasure/info/ExportDlg.Designer.cs @@ -29,8 +29,8 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.btnExitDev = new System.Windows.Forms.Button(); this.labelTitle = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); @@ -87,7 +87,7 @@ this.label_devType.BackColor = System.Drawing.Color.Transparent; this.label_devType.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_devType.ForeColor = System.Drawing.SystemColors.GrayText; - this.label_devType.Location = new System.Drawing.Point(340, 47); + this.label_devType.Location = new System.Drawing.Point(340, 49); this.label_devType.Margin = new System.Windows.Forms.Padding(0); this.label_devType.Name = "label_devType"; this.label_devType.Size = new System.Drawing.Size(142, 27); @@ -99,7 +99,7 @@ this.label_devName.BackColor = System.Drawing.Color.Transparent; this.label_devName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_devName.ForeColor = System.Drawing.SystemColors.GrayText; - this.label_devName.Location = new System.Drawing.Point(123, 47); + this.label_devName.Location = new System.Drawing.Point(123, 49); this.label_devName.Margin = new System.Windows.Forms.Padding(0); this.label_devName.Name = "label_devName"; this.label_devName.Size = new System.Drawing.Size(113, 27); @@ -189,14 +189,14 @@ this.dataGridView_times.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.dataGridView_times.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.dataGridView_times.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_times.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_times.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dataGridView_times.ColumnHeadersHeight = 28; this.dataGridView_times.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.dataGridView_times.GridColor = System.Drawing.Color.White; @@ -204,13 +204,13 @@ this.dataGridView_times.Name = "dataGridView_times"; this.dataGridView_times.RowHeadersVisible = false; this.dataGridView_times.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.LightGray; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.dataGridView_times.RowsDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.LightGray; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.dataGridView_times.RowsDefaultCellStyle = dataGridViewCellStyle2; this.dataGridView_times.RowTemplate.Height = 23; this.dataGridView_times.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.dataGridView_times.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 3b13488..38137b8 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -1,4 +1,5 @@ -using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.counter; +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; @@ -582,6 +583,7 @@ deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[9].Value)); MessageBox.Show("删除成功", "提示"); LoadDevList(condition); + CounterCtrlForm.GetInstance().addCounterItems(); } } diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs index 16d378a..23e4572 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs @@ -522,6 +522,6 @@ public System.Windows.Forms.Label label_clockStatus; public System.Windows.Forms.Label label_chnTotal; public System.Windows.Forms.Label label_usaTotal; - private System.Windows.Forms.Timer timer1; + public System.Windows.Forms.Timer timer1; } } diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.cs b/RbFreqStandMeasure/status/StatusCtrlForm.cs index 8a7853d..98876cd 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.cs @@ -34,6 +34,7 @@ public static List bdList = new List(); public static int totalGP = 0; public static int totalBD = 0; + public static int gpCount = 0; public StatusCtrlForm() { InitializeComponent(); @@ -57,10 +58,11 @@ - if (!FreshStatus.isStarted) - { - FreshStatus.startClockFresh(); - } + //if (!FreshStatus.isStarted) + //{ + // // 开始获取原子钟状态的timer + // // FreshStatus.startClockFresh(); + //} new Thread(() => { @@ -126,6 +128,8 @@ { Invoke(new MethodInvoker(delegate () { + //if(receiverStatus.Equals("警告")) + //{ return; } if (bdList.Count > 0) { int bdCount = 0; @@ -156,9 +160,10 @@ } if (bdCount > 0) label_chnTotal.Text = bdCount + ""; } + if (gpList.Count > 0) { - int gpCount = 0; + gpCount = 0; foreach (string gsv in gpList) { string[] arr = gsv.Split(','); @@ -189,7 +194,6 @@ } } )); - } catch (Exception e) @@ -202,6 +206,10 @@ { try { + if (receiverStatus.Equals("警告")) + { + + } if ( bdList.Count > 0 ||gpList.Count > 0) { @@ -268,6 +276,13 @@ int bdMessCount = 0; int gpMessCount = 0; int count = 0; + lock (obj) + { + gpList.Clear(); + bdList.Clear(); + totalGP = 0; + totalBD = 0; + } while (count < 1000) { Thread.Sleep(100); @@ -284,10 +299,8 @@ { lock (obj) { - gpList.Clear(); - bdList.Clear(); - totalGP = 0; - totalBD = 0; + + } int index = -1; bool drawed = false; diff --git a/RbFreqStandMeasure/tools/DetectionHelper.cs b/RbFreqStandMeasure/tools/DetectionHelper.cs index 3faf914..bdece1a 100644 --- a/RbFreqStandMeasure/tools/DetectionHelper.cs +++ b/RbFreqStandMeasure/tools/DetectionHelper.cs @@ -233,8 +233,10 @@ if (!detectionItem.Stability.Equals("-1") && !detectionItem.Accuracy.Equals("-1") && !detectionItem.AgeRate.Equals("-1") && !detectionItem.BootFeature.Equals("-1")) { deviceService.updateStatus(devIdStability, "3", ""); + } HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); + } } @@ -1134,7 +1136,7 @@ if (ConfigHelper.GetAppConfig("deviceType").ToString().Equals("1")) { int count = 0; - while (count < 200) + while (count < 500) { int readLen = port.BytesToRead; @@ -1164,14 +1166,14 @@ } } count++; - Thread.Sleep(100); + Thread.Sleep(20); } } else { int count = 0; - while (count < 200) + while (count < 500) { int readLen = port.BytesToRead; @@ -1200,7 +1202,7 @@ } count++; - Thread.Sleep(100); + Thread.Sleep(20); } } @@ -1235,6 +1237,7 @@ } + //重新检测功能,更新详情的原始数据列表 private void updateView(List result) { try diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs index 5b3deb0..604ba67 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DetectionServiceImpl.cs @@ -106,7 +106,8 @@ } } - string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + //string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId +" and DETECTION_ITEM='" + detectionType + "' and (LOG_TIME BETWEEN '" + startTime + "' and '"+ endTime + "') and DETECTION_ITEM_ID="+detectionItemId+" order by LOG_TIME"; + string sQry = "SELECT * FROM r_detection where DEVICE_ID = " + deviceId + " and DETECTION_ITEM='" + detectionType + "' and DETECTION_ITEM_ID=" + detectionItemId + " order by LOG_TIME"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) { diff --git a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs index ac9e466..df18ac3 100644 --- a/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs +++ b/RbFreqStandMeasure/R_DataBase/Service/Impl/DeviceServiceImpl.cs @@ -529,9 +529,12 @@ } DataTable dt = new DataTable(); //string sQry = "SELECT * FROM r_deviceview where ACTIVE = 0 and STATUSID = 2 " + "and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < END_TIME)"; - string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME,"+ - " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE,"+ - "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('"+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2' and ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' < b.END_TIME))"; + //string sQry = "select a.ID,a.DEV_NAME,a.DEV_CODE,a.DEV_TYPEID,a.DEV_MODEL,a.REG_TIME,a.CUSTOMER_NAME," + + // " a.CUSTOMER_DEV,a.CHANNEL,a.ACTIVE,b.START_TIME,b.END_TIME,a.STATUSID,b.STABILITY,b.ACCURACY,b.BOOT_FEATURE," + + // "b.AGE_RATE,b.ID as DETECTION_ITEM_ID from r_device a join r_detection_item b on (a.ID = b.DEVICE_ID and a.ACTIVE = 0 and a.STATUSID = '2'"; MySqlCommand aCommand = new MySqlCommand(sQry, DbConnectService.mySqlConnect); using (MySqlDataReader aReader = aCommand.ExecuteReader()) diff --git a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe index b3005b4..555286d 100644 --- a/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe +++ b/RbFreqStandMeasure/bin/Debug/RbFreqStandMeasure.exe Binary files differ diff --git a/RbFreqStandMeasure/counter/CounterCtrlForm.cs b/RbFreqStandMeasure/counter/CounterCtrlForm.cs index d767cb7..8e3e4e6 100644 --- a/RbFreqStandMeasure/counter/CounterCtrlForm.cs +++ b/RbFreqStandMeasure/counter/CounterCtrlForm.cs @@ -115,6 +115,14 @@ } } + public void addCounterItems() + { + int index = comboBox_counters.SelectedIndex; + List _list = deviceService.getAllCounter(); + comboBox_counters.DataSource = _list; + //comboBox_counters.SelectedIndex = index; + } + private void InitTableCounter() { dataGridView_CounterResult.DataSource = null; @@ -326,9 +334,12 @@ { comboBox_counters.DroppedDown = true; } - + int selectIndex = -2; private void comboBox_counters_SelectedIndexChanged(object sender, EventArgs e) { + /*if (selectIndex == comboBox_counters.SelectedIndex) + return; + selectIndex = comboBox_counters.SelectedIndex;*/ comboBox_counters.Text = ((DeviceDto)comboBox_counters.SelectedItem).DevName; deviceId = ((DeviceDto)comboBox_counters.SelectedItem).Id; LoadCounterDetecInitList(); diff --git a/RbFreqStandMeasure/home/HomeCtrlForm.cs b/RbFreqStandMeasure/home/HomeCtrlForm.cs index 586334d..19cefce 100644 --- a/RbFreqStandMeasure/home/HomeCtrlForm.cs +++ b/RbFreqStandMeasure/home/HomeCtrlForm.cs @@ -56,8 +56,18 @@ // 跨线程访问控件 CheckForIllegalCrossThreadCalls = false; + StatusCtrlForm statusForm = new StatusCtrlForm(); + if (!FreshStatus.isStarted) + { + // 开始获取原子钟状态的timer + FreshStatus.startClockFresh(); + } + // 开始获取卫星数据 + StatusCtrlForm.statusCtrlForm.timer1.Start(); + lock (obj) { + label_clockStatus.Text = FreshStatus.clockStatus; label_receiverStatus.Text = StatusCtrlForm.receiverStatus; } diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs index c8a9d0e..3e2be8c 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.Designer.cs @@ -71,6 +71,7 @@ this.label12 = new System.Windows.Forms.Label(); this.btnCancelSetChannel = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -82,6 +83,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitChannel); this.panel1.Controls.Add(this.label3); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -762,6 +764,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(337, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevChannelDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -784,6 +798,7 @@ this.Load += new System.EventHandler(this.SetDevChannelDlg_Load); this.Shown += new System.EventHandler(this.SetDevChannelDlg_Shown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -841,5 +856,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevChannelDlg.cs b/RbFreqStandMeasure/home/SetDevChannelDlg.cs index a1d96fe..75c2c90 100644 --- a/RbFreqStandMeasure/home/SetDevChannelDlg.cs +++ b/RbFreqStandMeasure/home/SetDevChannelDlg.cs @@ -171,11 +171,16 @@ return; } + label_tip.Text = "正在从通道[" + textBox_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { MessageBox.Show("请连接仪器到通道[" + textBox_channelNo.Text + "]!"); + label_tip.Text = ""; + return; } + label_tip.Text = ""; string startTime = timePicker_startTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = timePicker_endTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); @@ -324,10 +329,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs index 473850d..e758634 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.Designer.cs @@ -73,6 +73,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -84,6 +85,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.label11); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -742,6 +744,18 @@ this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(331, 6); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 353; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetDevTestDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -764,6 +778,7 @@ this.Name = "SetDevTestDlg"; this.Text = "设置仪器检测项目"; this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); @@ -821,5 +836,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/home/SetDevTestDlg.cs b/RbFreqStandMeasure/home/SetDevTestDlg.cs index 6e9d272..3096e4a 100644 --- a/RbFreqStandMeasure/home/SetDevTestDlg.cs +++ b/RbFreqStandMeasure/home/SetDevTestDlg.cs @@ -55,7 +55,7 @@ timePicker_startTime.Value = DateTime.Now; timePicker_startTime.MinDate = DateTime.Now; getEndTime(); - timePicker_startTime.MinDate = DateTime.Now.AddMinutes(5); + // 设置双缓冲 SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); @@ -125,14 +125,18 @@ MessageBox.Show("无法打开串口" + portName + ",添加检测失败!"); return; } - + + label_tip.Text = "正在从通道[" + text_channelNo.Text + "]获取数据,请稍侯......"; + if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; + MessageBox.Show("请连接仪器到通道[" + text_channelNo.Text + "]!"); return; } - + label_tip.Text = ""; //开始检测 string stability = "-3"; @@ -285,10 +289,10 @@ { if (checkBox_stability.Checked) { - if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox_100s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = timePicker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = timePicker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs index 35c7a60..519f9c8 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.Designer.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.Designer.cs @@ -81,6 +81,7 @@ this.label6 = new System.Windows.Forms.Label(); this.btnSave = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); this.btnCancelSetDev = new Casic.Birmm.RbFreqStandMeasure.RoundButton(); + this.label_tip = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -105,6 +106,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(132)))), ((int)(((byte)(215))))); + this.panel1.Controls.Add(this.label_tip); this.panel1.Controls.Add(this.btnExitDev); this.panel1.Controls.Add(this.labelTitle); this.panel1.Location = new System.Drawing.Point(0, 0); @@ -852,6 +854,18 @@ this.btnCancelSetDev.UseVisualStyleBackColor = true; this.btnCancelSetDev.Click += new System.EventHandler(this.btnAddDevCancel_Click); // + // label_tip + // + this.label_tip.AutoSize = true; + this.label_tip.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); + this.label_tip.ForeColor = System.Drawing.Color.OrangeRed; + this.label_tip.Location = new System.Drawing.Point(238, 5); + this.label_tip.Margin = new System.Windows.Forms.Padding(0); + this.label_tip.Name = "label_tip"; + this.label_tip.Size = new System.Drawing.Size(0, 20); + this.label_tip.TabIndex = 352; + this.label_tip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // AddDevDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -872,6 +886,7 @@ this.Shown += new System.EventHandler(this.AddDevDlg_Shown); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); this.groupBox1.ResumeLayout(false); @@ -938,5 +953,6 @@ private System.Windows.Forms.CheckBox checkBox20s; private System.Windows.Forms.CheckBox checkBox10s; private System.Windows.Forms.CheckBox checkBox1s; + private System.Windows.Forms.Label label_tip; } } \ No newline at end of file diff --git a/RbFreqStandMeasure/info/AddDevDlg.cs b/RbFreqStandMeasure/info/AddDevDlg.cs index 9652052..8655a91 100644 --- a/RbFreqStandMeasure/info/AddDevDlg.cs +++ b/RbFreqStandMeasure/info/AddDevDlg.cs @@ -222,11 +222,14 @@ try { + label_tip.Text = "正在从通道[" + channelNo + "]获取数据,请稍侯......"; if (DetectionHelper.detectionHelper.getFrequencyData(port, true).Equals("")) { + label_tip.Text = ""; MessageBox.Show("请连接仪器到通道[" + channelNo + "]!"); return; } + label_tip.Text = ""; } catch (Exception exc) { @@ -241,7 +244,7 @@ deviceId = devService.add(devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo, statusId); LogHelper.WriteErrorLog(MethodBase.GetCurrentMethod().DeclaringType, "添加"+ deviceId); - CounterCtrlForm.GetInstance().InitCounterItems(); + CounterCtrlForm.GetInstance().addCounterItems(); if (deviceId == -1) { @@ -252,10 +255,10 @@ } } else if (labelTitle.Text.Equals("修改")) - { + { if (needDetec) statusId = "2"; devService.update(deviceId, devName, devCode, devTypeCode, devModel, devCustomComp, devCustomName, channelNo,statusId); - + CounterCtrlForm.GetInstance().addCounterItems(); } @@ -443,10 +446,10 @@ { if (checkBox_stability.Checked) { - if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(1).AddSeconds(30); - else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(1).AddSeconds(30); - else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(1).AddSeconds(30); - else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(1).AddSeconds(30); + if (checkBox100s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 100).AddMinutes(2).AddSeconds(30); + else if (checkBox20s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 20).AddMinutes(2).AddSeconds(30); + else if (checkBox10s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101 * 10).AddMinutes(2).AddSeconds(30); + else if (checkBox1s.Checked) endTimeBySystem = picker_startTime.Value.AddSeconds(101).AddMinutes(2).AddSeconds(30); } else endTimeBySystem = picker_startTime.Value.AddMinutes(1).AddSeconds(30); } diff --git a/RbFreqStandMeasure/info/ExportDlg.Designer.cs b/RbFreqStandMeasure/info/ExportDlg.Designer.cs index 422bc37..5b60ccb 100644 --- a/RbFreqStandMeasure/info/ExportDlg.Designer.cs +++ b/RbFreqStandMeasure/info/ExportDlg.Designer.cs @@ -29,8 +29,8 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.btnExitDev = new System.Windows.Forms.Button(); this.labelTitle = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); @@ -87,7 +87,7 @@ this.label_devType.BackColor = System.Drawing.Color.Transparent; this.label_devType.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_devType.ForeColor = System.Drawing.SystemColors.GrayText; - this.label_devType.Location = new System.Drawing.Point(340, 47); + this.label_devType.Location = new System.Drawing.Point(340, 49); this.label_devType.Margin = new System.Windows.Forms.Padding(0); this.label_devType.Name = "label_devType"; this.label_devType.Size = new System.Drawing.Size(142, 27); @@ -99,7 +99,7 @@ this.label_devName.BackColor = System.Drawing.Color.Transparent; this.label_devName.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); this.label_devName.ForeColor = System.Drawing.SystemColors.GrayText; - this.label_devName.Location = new System.Drawing.Point(123, 47); + this.label_devName.Location = new System.Drawing.Point(123, 49); this.label_devName.Margin = new System.Windows.Forms.Padding(0); this.label_devName.Name = "label_devName"; this.label_devName.Size = new System.Drawing.Size(113, 27); @@ -189,14 +189,14 @@ this.dataGridView_times.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.dataGridView_times.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.dataGridView_times.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_times.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_times.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dataGridView_times.ColumnHeadersHeight = 28; this.dataGridView_times.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.dataGridView_times.GridColor = System.Drawing.Color.White; @@ -204,13 +204,13 @@ this.dataGridView_times.Name = "dataGridView_times"; this.dataGridView_times.RowHeadersVisible = false; this.dataGridView_times.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.LightGray; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.dataGridView_times.RowsDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.LightGray; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.dataGridView_times.RowsDefaultCellStyle = dataGridViewCellStyle2; this.dataGridView_times.RowTemplate.Height = 23; this.dataGridView_times.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.dataGridView_times.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; diff --git a/RbFreqStandMeasure/info/InfoCtrlForm.cs b/RbFreqStandMeasure/info/InfoCtrlForm.cs index 3b13488..38137b8 100644 --- a/RbFreqStandMeasure/info/InfoCtrlForm.cs +++ b/RbFreqStandMeasure/info/InfoCtrlForm.cs @@ -1,4 +1,5 @@ -using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Dto; +using Casic.Birmm.RbFreqStandMeasure.counter; +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; @@ -582,6 +583,7 @@ deviceService.delete(Convert.ToInt64(dataGridView_DevList.Rows[dataGridView_DevList.CurrentRow.Index].Cells[9].Value)); MessageBox.Show("删除成功", "提示"); LoadDevList(condition); + CounterCtrlForm.GetInstance().addCounterItems(); } } diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs index 16d378a..23e4572 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.Designer.cs @@ -522,6 +522,6 @@ public System.Windows.Forms.Label label_clockStatus; public System.Windows.Forms.Label label_chnTotal; public System.Windows.Forms.Label label_usaTotal; - private System.Windows.Forms.Timer timer1; + public System.Windows.Forms.Timer timer1; } } diff --git a/RbFreqStandMeasure/status/StatusCtrlForm.cs b/RbFreqStandMeasure/status/StatusCtrlForm.cs index 8a7853d..98876cd 100644 --- a/RbFreqStandMeasure/status/StatusCtrlForm.cs +++ b/RbFreqStandMeasure/status/StatusCtrlForm.cs @@ -34,6 +34,7 @@ public static List bdList = new List(); public static int totalGP = 0; public static int totalBD = 0; + public static int gpCount = 0; public StatusCtrlForm() { InitializeComponent(); @@ -57,10 +58,11 @@ - if (!FreshStatus.isStarted) - { - FreshStatus.startClockFresh(); - } + //if (!FreshStatus.isStarted) + //{ + // // 开始获取原子钟状态的timer + // // FreshStatus.startClockFresh(); + //} new Thread(() => { @@ -126,6 +128,8 @@ { Invoke(new MethodInvoker(delegate () { + //if(receiverStatus.Equals("警告")) + //{ return; } if (bdList.Count > 0) { int bdCount = 0; @@ -156,9 +160,10 @@ } if (bdCount > 0) label_chnTotal.Text = bdCount + ""; } + if (gpList.Count > 0) { - int gpCount = 0; + gpCount = 0; foreach (string gsv in gpList) { string[] arr = gsv.Split(','); @@ -189,7 +194,6 @@ } } )); - } catch (Exception e) @@ -202,6 +206,10 @@ { try { + if (receiverStatus.Equals("警告")) + { + + } if ( bdList.Count > 0 ||gpList.Count > 0) { @@ -268,6 +276,13 @@ int bdMessCount = 0; int gpMessCount = 0; int count = 0; + lock (obj) + { + gpList.Clear(); + bdList.Clear(); + totalGP = 0; + totalBD = 0; + } while (count < 1000) { Thread.Sleep(100); @@ -284,10 +299,8 @@ { lock (obj) { - gpList.Clear(); - bdList.Clear(); - totalGP = 0; - totalBD = 0; + + } int index = -1; bool drawed = false; diff --git a/RbFreqStandMeasure/tools/DetectionHelper.cs b/RbFreqStandMeasure/tools/DetectionHelper.cs index 3faf914..bdece1a 100644 --- a/RbFreqStandMeasure/tools/DetectionHelper.cs +++ b/RbFreqStandMeasure/tools/DetectionHelper.cs @@ -233,8 +233,10 @@ if (!detectionItem.Stability.Equals("-1") && !detectionItem.Accuracy.Equals("-1") && !detectionItem.AgeRate.Equals("-1") && !detectionItem.BootFeature.Equals("-1")) { deviceService.updateStatus(devIdStability, "3", ""); + } HomeCtrlForm.homeCtrlForm.LoadChannelStatus(); + } } @@ -1134,7 +1136,7 @@ if (ConfigHelper.GetAppConfig("deviceType").ToString().Equals("1")) { int count = 0; - while (count < 200) + while (count < 500) { int readLen = port.BytesToRead; @@ -1164,14 +1166,14 @@ } } count++; - Thread.Sleep(100); + Thread.Sleep(20); } } else { int count = 0; - while (count < 200) + while (count < 500) { int readLen = port.BytesToRead; @@ -1200,7 +1202,7 @@ } count++; - Thread.Sleep(100); + Thread.Sleep(20); } } @@ -1235,6 +1237,7 @@ } + //重新检测功能,更新详情的原始数据列表 private void updateView(List result) { try diff --git a/RbFreqStandMeasure/tools/FreshStatus.cs b/RbFreqStandMeasure/tools/FreshStatus.cs index 6fba4d9..3b77681 100644 --- a/RbFreqStandMeasure/tools/FreshStatus.cs +++ b/RbFreqStandMeasure/tools/FreshStatus.cs @@ -117,6 +117,8 @@ //{ lock (obj) { + //if (StatusCtrlForm.receiverStatus == "警告") clockStatus = "未锁定"; + //else clockStatus = "锁定"; StatusCtrlForm.statusCtrlForm.label_clockStatus.Text = clockStatus; HomeCtrlForm.homeCtrlForm.label_clockStatus.Text = clockStatus; }