Exemplo n.º 1
0
        public long lngGetInstrumentSerialSetting(string strData_Acquisition_Computer_IP, out com.digitalwave.iCare.ValueObject.clsLIS_Equip_ConfigVO[] objConfig_List)
        {
            string strSQL = c_strGetInstrumentSerialSetting + "   and lower(d.dataacquisitioncomputerip_chr) = lower(?)";

            objConfig_List = null;

            long lngRes = 0;

            try
            {
                System.Data.DataTable objDT_LIS_Instrument_Info = null;
                IDataParameter[]      objDPArr = null;
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                objHRPSvc.CreateDatabaseParameter(1, out objDPArr);
                objDPArr[0].DbType = DbType.String;
                objDPArr[0].Value  = strData_Acquisition_Computer_IP;

                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref objDT_LIS_Instrument_Info, objDPArr);
                objHRPSvc.Dispose();

                if (lngRes > 0)
                {
                    int intRowCount = objDT_LIS_Instrument_Info.Rows.Count;
                    if (intRowCount > 0)
                    {
                        objConfig_List = new com.digitalwave.iCare.ValueObject.clsLIS_Equip_ConfigVO[intRowCount];
                        clsLIS_Equip_ConfigVO objTemp = null;
                        System.Data.DataRow   objRow  = null;
                        for (int i = 0; i < intRowCount; i++)
                        {
                            objRow  = objDT_LIS_Instrument_Info.Rows[i];
                            objTemp = new clsLIS_Equip_ConfigVO();

                            if (objRow["DEVICEID_CHR"] != System.DBNull.Value)
                            {
                                objTemp.strLIS_Instrument_ID = objRow["DEVICEID_CHR"].ToString().Trim();
                            }

                            if (objRow["DEVICENAME_VCHR"] != System.DBNull.Value)
                            {
                                objTemp.strLIS_Instrument_Name = objRow["DEVICENAME_VCHR"].ToString().Trim();
                            }

                            if (objRow["DEVICE_MODEL_DESC_VCHR"] != System.DBNull.Value)
                            {
                                objTemp.strLIS_Instrument_Model = objRow["DEVICE_MODEL_DESC_VCHR"].ToString().Trim();
                            }

                            if (objRow["COMNO_CHR"] != System.DBNull.Value)
                            {
                                objTemp.strCOM_No = objRow["COMNO_CHR"].ToString().Trim();
                            }

                            if (objRow["BAULRATE_CHR"] != System.DBNull.Value)
                            {
                                objTemp.strBaud_Rate = objRow["BAULRATE_CHR"].ToString().Trim();
                            }

                            if (objRow["DATABIT_CHR"] != System.DBNull.Value)
                            {
                                objTemp.strData_Bit = objRow["DATABIT_CHR"].ToString().Trim();
                            }

                            if (objRow["STOPBIT_CHR"] != System.DBNull.Value)
                            {
                                objTemp.strStop_Bit = objRow["STOPBIT_CHR"].ToString().Trim();
                            }

                            if (objRow["PARITY_CHR"] != System.DBNull.Value)
                            {
                                objTemp.strParity = objRow["PARITY_CHR"].ToString().Trim();
                            }

                            if (objRow["FLOWCONTROL_CHR"] != System.DBNull.Value)
                            {
                                objTemp.strFlow_Control = objRow["FLOWCONTROL_CHR"].ToString().Trim();
                            }

                            if (objRow["RECEIVEBUFFER_CHR"] != System.DBNull.Value)
                            {
                                objTemp.strReceive_Buffer = objRow["RECEIVEBUFFER_CHR"].ToString().Trim();
                            }

                            if (objRow["SENDBUFFER_CHR"] != System.DBNull.Value)
                            {
                                objTemp.strSend_Buffer = objRow["SENDBUFFER_CHR"].ToString().Trim();
                            }

                            if (objRow["SENDCOMMAND_CHR"] != System.DBNull.Value)
                            {
                                objTemp.strSend_Command = objRow["SENDCOMMAND_CHR"].ToString();
                            }

                            if (objRow["SENDCOMMANDINTERNAL_CHR"] != System.DBNull.Value)
                            {
                                objTemp.strSend_Command_Internal = objRow["SENDCOMMANDINTERNAL_CHR"].ToString().Trim();
                            }

                            if (objRow["DATAANALYSISDLL_VCHR"] != System.DBNull.Value)
                            {
                                objTemp.strData_Analysis_DLL = objRow["DATAANALYSISDLL_VCHR"].ToString().Trim();
                            }

                            if (objRow["DATAANALYSISNAMESPACE_VCHR"] != System.DBNull.Value)
                            {
                                objTemp.strData_Analysis_Namespace = objRow["DATAANALYSISNAMESPACE_VCHR"].ToString().Trim();
                            }

                            if (objRow["DATAACQUISITIONCOMPUTERIP_CHR"] != System.DBNull.Value)
                            {
                                objTemp.strData_Acquisition_Computer_IP = objRow["DATAACQUISITIONCOMPUTERIP_CHR"].ToString().Trim();
                            }

                            objTemp.strLIS_Instrument_NO = objRow["device_code_chr"].ToString().Trim();

                            objConfig_List[i] = objTemp;
                        }
                    }
                }
            }
            catch (System.Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogDetailError(objEx, true);
            }
            return(lngRes);
        }
Exemplo n.º 2
0
 private void ConstructDeviceVO(System.Data.DataRow objRow, ref com.digitalwave.iCare.ValueObject.clsLIS_Equip_ConfigVO objDeviceVO)
 {
 }
Exemplo n.º 3
0
        /// <summary>
        /// 选择设备后将设备设定信息与窗体中的控件绑定	yongchao.li添加注释  2012-01-19
        /// </summary>
        /// <param name="frmLIS_Controller"></param>

        public void SelectInstrument2(com.digitalwave.iCare.gui.LIS_Data_Acquisition_Controller.frmLIS_Data_Acquisition_Controller frmLIS_Controller)
        {
            com.digitalwave.iCare.ValueObject.clsLIS_Equip_ConfigVO objEquip_ConfigVO = (clsLIS_Equip_ConfigVO)frmLIS_Controller.m_cboInstrument.SelectedItem;
            if (objEquip_ConfigVO != null)
            {
                frmLIS_Controller.m_txtBaudRate.Text = objEquip_ConfigVO.strBaud_Rate;
                frmLIS_Controller.m_txtComNum.Text   = objEquip_ConfigVO.strCOM_No;
                frmLIS_Controller.m_txtDataBit.Text  = objEquip_ConfigVO.strData_Bit;
                switch (objEquip_ConfigVO.strFlow_Control)
                {
                case "0":
                    frmLIS_Controller.m_txtFlowControl.Text = "None";
                    break;

                case "1":
                    frmLIS_Controller.m_txtFlowControl.Text = "Software";
                    break;

                case "2":
                    frmLIS_Controller.m_txtFlowControl.Text = "Hardware";
                    break;
                }

                switch (objEquip_ConfigVO.strParity)
                {
                case "0":
                    frmLIS_Controller.m_txtParity.Text = "None";
                    break;

                case "1":
                    frmLIS_Controller.m_txtParity.Text = "Even";
                    break;

                case "2":
                    frmLIS_Controller.m_txtParity.Text = "Odd";
                    break;

                case "3":
                    frmLIS_Controller.m_txtParity.Text = "Mark";
                    break;

                case "4":
                    frmLIS_Controller.m_txtParity.Text = "Space";
                    break;
                }
                frmLIS_Controller.m_txtReceiveBuffer.Text = objEquip_ConfigVO.strReceive_Buffer;
                frmLIS_Controller.m_txtSendBuffer.Text    = objEquip_ConfigVO.strSend_Buffer;
                frmLIS_Controller.m_txtStopBit.Text       = objEquip_ConfigVO.strStop_Bit;
            }


            else
            {
                frmLIS_Controller.m_txtBaudRate.Text      = "";
                frmLIS_Controller.m_txtComNum.Text        = "";
                frmLIS_Controller.m_txtDataBit.Text       = "";
                frmLIS_Controller.m_txtFlowControl.Text   = "";
                frmLIS_Controller.m_txtParity.Text        = "";
                frmLIS_Controller.m_txtReceiveBuffer.Text = "";
                frmLIS_Controller.m_txtSendBuffer.Text    = "";
                frmLIS_Controller.m_txtStopBit.Text       = "";
            }
        }