Exemple #1
0
 public EQAEquipment EquipmentInLoops(string EquipmentTagNo)
 {
     if (this.Count > 0)
     {
         EQAEquipment eqp = new EQAEquipment();
         foreach (EQALoop loop in this)
         {
             if ((eqp = loop.Equipments[EquipmentTagNo]) != null)
             {
                 return(eqp);
             }
         }
         return(null);
     }
     return(null);
 }
Exemple #2
0
 public EQAEquipment EquipmentInSubSystems(string EquipmentTagNo)
 {
     if (this.Count > 0)
     {
         EQAEquipment eqp = new EQAEquipment();
         foreach (EQASubSystem subSystem in this)
         {
             if ((eqp = subSystem.Loops.EquipmentInLoops(EquipmentTagNo)) != null)
             {
                 return(eqp);
             }
         }
         return(null);
     }
     return(null);
 }
Exemple #3
0
        /// <summary>
        /// 从Eqp表的数据行生成设备类实例
        /// </summary>
        /// <param name="rowEQAEquipment">Eqp表的数据行</param>
        /// <returns></returns>
        public static EQAEquipment CreateEQAEquipment(DataRow rowEQAEquipment)
        {
            if (rowEQAEquipment == null)
            {
                throw new System.ArgumentNullException("frome function CreateEQAEquipment", "Parameter rowEQAEquipment equals to null");
            }

            EQAEquipment equipment = new EQAEquipment();

            lock (rowEQAEquipment) {
                try {
                    equipment.LoopNo             = (rowEQAEquipment[TblEqp.LOOP_TAGNAME] as string).Trim();
                    equipment.TagNo              = (rowEQAEquipment[TblEqp.TAGNAME] as string).Trim();
                    equipment.Name               = rowEQAEquipment[TblEqp.NAME] as string;
                    equipment.EqpType            = rowEQAEquipment[TblEqp.TYPE] as string;
                    equipment.Quantity           = Convert.ToInt32(rowEQAEquipment[TblEqp.NUM]);
                    equipment.LowerLimit         = rowEQAEquipment[TblEqp.LOW] as string;
                    equipment.UpperLimit         = rowEQAEquipment[TblEqp.HIGH] as string;
                    equipment.Unit               = rowEQAEquipment[TblEqp.UNIT] as string;
                    equipment.InputSignal        = rowEQAEquipment[TblEqp.IN] as string;
                    equipment.OutputSignal       = rowEQAEquipment[TblEqp.OUT] as string;
                    equipment.PowerSupply        = rowEQAEquipment[TblEqp.PS] as string;
                    equipment.Spec1              = rowEQAEquipment[TblEqp.SPEC1] as string;
                    equipment.Spec2              = rowEQAEquipment[TblEqp.SPEC2] as string;
                    equipment.Spec3              = rowEQAEquipment[TblEqp.SPEC3] as string;
                    equipment.Manufacturer       = rowEQAEquipment[TblEqp.MANU] as string;
                    equipment.Remark             = rowEQAEquipment[TblEqp.REMARK] as string;
                    equipment.FixedPlace         = rowEQAEquipment[TblEqp.LOC] as string;
                    equipment.Area               = rowEQAEquipment[TblEqp.AREA] as string;
                    equipment.PlateName          = rowEQAEquipment[TblEqp.PLATENAME] as string;
                    equipment.InstDrawing        = rowEQAEquipment[TblEqp.INSTDWG] as string;
                    equipment.HookupDrawing      = rowEQAEquipment[TblEqp.HOOKUP] as string;
                    equipment.IsEquipment        = !Convert.ToBoolean(rowEQAEquipment[TblEqp.NONEQP]);
                    equipment.IsPoweredByUPS     = Convert.ToBoolean(rowEQAEquipment[TblEqp.UPS]);
                    equipment.PowerSupplyCurrent = Convert.ToInt32(rowEQAEquipment[TblEqp.PS_CURRENT]);
                    equipment.PowerSupplySource  = rowEQAEquipment[TblEqp.PS_SOURCE] as string;
                } catch (System.Data.DataException ex) {
                    MessageBoxWinForm.Info("数据访问错误", ex.Message, "");
                }
            }

            return(equipment);
        }