Example #1
0
        //public override string ToString()
        //{
        //    return DCPowerChannelName + ";" + DCPowerDeviceName + ":" + ChannelNoInDevice.ToString();
        //}

        public override bool Equals(object obj)
        {
            DCChannelConfig compareDC = obj as DCChannelConfig;

            if (compareDC != null)
            {
                return(this.LableName == compareDC.LableName);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        /// <summary>
        /// 克隆电源设置
        /// </summary>
        /// <param name="pearentDC"></param>
        /// <returns></returns>
        public static DCChannelConfig Clone(DCChannelConfig pearentDC)
        {
            DCChannelConfig sonDC = new DCChannelConfig();

            sonDC.CanSetPower        = pearentDC.CanSetPower;
            sonDC.ChannelNoInDevice  = pearentDC.ChannelNoInDevice;
            sonDC.ChannelNumber      = pearentDC.ChannelNumber;
            sonDC.ConfiguredDCPower  = pearentDC.ConfiguredDCPower;
            sonDC.DCPowerChannelName = pearentDC.DCPowerChannelName;
            sonDC.DCPowerDeviceName  = pearentDC.DCPowerDeviceName;
            sonDC.InstituteID        = pearentDC.InstituteID;
            sonDC.IsSelect           = pearentDC.IsSelect;
            sonDC.IsSetBatch         = pearentDC.IsSetBatch;
            sonDC.LableName          = pearentDC.LableName;

            return(sonDC);
        }
Example #3
0
        /// <summary>
        /// 恢复默认参数
        /// </summary>
        public void RestoreDefault()
        {
            //电源数量
            int k = 0;

            for (int i = 0; i < DCPowerInstrumentList.Count; i++)
            {
                //电源通道数量
                for (int j = 0; j < DCPowerInstrumentList[i].DCModleNum; j++)
                {
                    k++;
                    DCChannelConfig config = new DCChannelConfig();
                    config.LableName          = string.Format("第{0}路", k);
                    config.DCPowerDeviceName  = DCPowerInstrumentList[i].InstrumentName;
                    config.ChannelNoInDevice  = (uint)(j + 1);
                    config.DCPowerChannelName = string.Format("{0}第{1}路", DCPowerInstrumentList[i].InstrumentName, j + 1);
                    config.InstituteID        = DCPowerInstrumentList[i].IDInInstitute;
                    config.Model             = DCPowerInstrumentList[i].ModelNo;
                    config.ConfiguredDCPower = true;

                    this.DCChannelConfigList.Add(config);
                }
            }
        }
Example #4
0
        public DCPowerBase GetDCPowerBaseByChannelID(int inChannelID, out uint outDCChIDInDevice)
        {
            DCChannelConfig tmpChannelInfo = this.m_DCPowerMapper.GetDCPowerChannelInfoByChannelID(inChannelID);

            if (tmpChannelInfo != null)
            {
                outDCChIDInDevice = tmpChannelInfo.ChannelNoInDevice;
                string DeviceName   = tmpChannelInfo.DCPowerDeviceName;
                string tmpIpAddress = this.m_CurrentInstruments.GetIpAddressByDeviceName(DeviceName);
                if ((tmpIpAddress != "") && (tmpIpAddress != null))
                {
                    return(this.GetDCPowerDeviceByIpAddress(tmpIpAddress));
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                outDCChIDInDevice = 0;
                return(null);
            }
        }