Пример #1
0
        private bool EvaluateValueCondition(IPersistIfcEntity input, string propertyName, object value, Tokens condition)
        {
            //try to get attribute
            var attr = GetAttributeValue(propertyName, input);
            var prop = attr as IfcValue;
            if (propertyName.ToLower() == "entitylabel")
                prop = new IfcInteger(Math.Abs((int)attr));

            //try to get property if attribute doesn't exist
            if (prop == null)
             prop = GetPropertyValue(propertyName, input);

            return EvaluateValue(prop, value, condition);
        }
Пример #2
0
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
         case 1:
         case 2:
         case 3:
             base.IfcParse(propIndex, value);
             break;
         case 4:
             _Width = value.IntegerVal;
             break;
         case 5:
             _Height = value.IntegerVal;
             break;
         case 6:
             _ColourComponents = value.IntegerVal;
             break;
         case 7:
             _Pixel.Add(value.HexadecimalVal);
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
         case 1:
         case 2:
         case 3:
         case 4:
         case 5:
             base.IfcParse(propIndex, value);
             break;
         case 6:
             _electricCurrentType =
                 (IfcElectricCurrentEnum) Enum.Parse(typeof (IfcElectricCurrentEnum), value.EnumVal, true);
             break;
         case 7:
             _inputVoltage = value.RealVal;
             break;
         case 8:
             _inputFrequency = value.RealVal;
             break;
         case 9:
             _fullLoadCurrent = value.RealVal;
             break;
         case 10:
             _minimumCircuitCurrent = value.RealVal;
             break;
         case 11:
             _maximumPowerInput = value.RealVal;
             break;
         case 12:
             _ratedPowerInput = value.RealVal;
             break;
         case 13:
             _inputPhase = value.IntegerVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }