示例#1
0
        private HidPowerPhysicalUnit(string name, string physUnit, string hidUnit, HidPowerPhysicalUnitCode unitCode, int exp, int fieldSize)
        {
            Name         = name;
            PhysicalUnit = physUnit;
            HIDUnit      = hidUnit;
            Code         = unitCode;
            Exponent     = exp;
            FieldSize    = fieldSize;

            var res = units.Where((o) => o.Name == name).FirstOrDefault();

            if (res == null)
            {
                units.Add(this);
            }
        }
示例#2
0
 public static HidPowerPhysicalUnit GetByCode(HidPowerPhysicalUnitCode code)
 {
     return(units.Where((o) => o.Code == code).FirstOrDefault());
 }