internal IfcPropertySingleValue(IfcPropertySingleValue q) : base(q) { mNominalValue = q.mNominalValue; mUnit = q.mUnit; }
internal static IfcPropertySingleValue Parse(string str) { IfcPropertySingleValue p = new IfcPropertySingleValue(); int pos = 0; p.parseString(str, ref pos); string s = ParserSTEP.StripField(str, ref pos);// arrFields[ipos++]; p.mNominalValue = ParserIfc.parseValue(s); if (p.mNominalValue == null) p.mVal = s; p.mUnit = ParserSTEP.StripLink(str, ref pos); //ParserSTEP.ParseSTPLink(arrFields[ipos++]); return p; }
internal List <ValidationResult> validatePropertySetTemplate(IfcPropertySetTemplate propertySetTemplate) { List <ValidationResult> result = new List <ValidationResult>(); if (propertySetTemplate.IsApplicable(this)) { IfcPropertySet pset = FindPropertySet(propertySetTemplate.Name) as IfcPropertySet; if (pset == null) { result.Add(new ValidationResult("Missing Property Set " + propertySetTemplate.Name)); } else { foreach (var propertyTemplate in propertySetTemplate.HasPropertyTemplates.Values) { IfcSimplePropertyTemplate simplePropertyTemplate = propertyTemplate as IfcSimplePropertyTemplate; if (simplePropertyTemplate != null) { if (simplePropertyTemplate.TemplateType == IfcSimplePropertyTemplateTypeEnum.P_SINGLEVALUE) { IfcPropertySingleValue property = pset.FindProperty(propertyTemplate.Name) as IfcPropertySingleValue; if (property == null) { result.Add(new ValidationResult("Missing Property " + propertySetTemplate.Name + " : " + propertyTemplate.Name)); } else { IfcValue value = property.NominalValue; if (value == null) { result.Add(new ValidationResult("Missing Property Value " + propertySetTemplate.Name + " : " + propertyTemplate.Name)); } else { string valueString = value.ValueString; if (string.IsNullOrEmpty(valueString)) { result.Add(new ValidationResult("Missing Property Value " + propertySetTemplate.Name + " : " + propertyTemplate.Name)); } else { string primary = simplePropertyTemplate.PrimaryMeasureType; if (!string.IsNullOrEmpty(primary)) { string valueClass = value.StepClassName; if (string.Compare(valueClass, primary, true) != 0) { result.Add(new ValidationResult(" Unexpected value type " + valueClass + " for " + propertySetTemplate.Name + " : " + propertyTemplate.Name)); } } } } } } else { result.Add(new ValidationResult("!!! Unhandled PropertyTemplate " + propertyTemplate.ToString())); } } else { result.Add(new ValidationResult("!!! Unhandled PropertyTemplate " + propertyTemplate.ToString())); } } } } return(result); }