/// <summary> /// Test for empty object /// </summary> /// <returns>bool</returns> public bool IsEmpty() { return(IfcProductFilter.IsEmpty() && IfcTypeObjectFilter.IsEmpty() && IfcAssemblyFilter.IsEmpty() && ZoneFilter.IsEmpty() && TypeFilter.IsEmpty() && SpaceFilter.IsEmpty() && FloorFilter.IsEmpty() && FacilityFilter.IsEmpty() && SpareFilter.IsEmpty() && ComponentFilter.IsEmpty() && CommonFilter.IsEmpty()); }
/// <summary> /// Test Property Set Names against sheets /// </summary> /// <param name="testStr">Name string to test</param> /// <param name="parent">Parent object</param> /// <returns>bool</returns> public bool PSetNameFilterOnSheetName(string testStr, CobieObject parent = null) { bool result = false; if (!string.IsNullOrEmpty(testStr)) { result = CommonFilter.PSetNameFilter(testStr); if (!result) { if (parent == null) { result = false; } else if ((parent is Zone) && (ZoneFilter != null)) { result = ZoneFilter.PSetNameFilter(testStr); } else if ((parent is AssetType) && (TypeFilter != null)) { result = TypeFilter.PSetNameFilter(testStr); } else if ((parent is Space) && (SpaceFilter != null)) { result = SpaceFilter.PSetNameFilter(testStr); } else if ((parent is Floor) && (FloorFilter != null)) { result = FloorFilter.PSetNameFilter(testStr); } else if ((parent is Facility) && (FacilityFilter != null)) { result = FacilityFilter.PSetNameFilter(testStr); } else if ((parent is Spare) && (SpareFilter != null)) { result = SpareFilter.PSetNameFilter(testStr); } else if ((parent is Asset) && (ComponentFilter != null)) { result = ComponentFilter.PSetNameFilter(testStr); } else { result = false; } } } //don't flip property sets as this excludes all the attributes, so we do not see attribute name exclusions as all property sets get excluded //return FlipResult ? !result : result; return(result); }
//TODO: IfcProperty filterining on IfcObjects /// <summary> /// Test property Names against sheets /// </summary> /// <param name="testStr">Name string to test</param> /// <param name="parent">Parent object</param> /// <returns>bool</returns> public bool NameFilterOnParent(string testStr, CobieObject parent = null) { var result = false; if (!string.IsNullOrEmpty(testStr)) { result = CommonFilter.NameFilter(testStr); if (!result) { if (parent == null) { result = false; } else if ((parent is Zone) && (ZoneFilter != null)) { result = ZoneFilter.NameFilter(testStr); } else if ((parent is AssetType) && (TypeFilter != null)) { result = TypeFilter.NameFilter(testStr); } else if ((parent is Space) && (SpaceFilter != null)) { result = SpaceFilter.NameFilter(testStr); } else if ((parent is Floor) && (FloorFilter != null)) { result = FloorFilter.NameFilter(testStr); } else if ((parent is Facility) && (FacilityFilter != null)) { result = FacilityFilter.NameFilter(testStr); } else if ((parent is Spare) && (SpareFilter != null)) { result = SpareFilter.NameFilter(testStr); } else if ((parent is Asset) && (ComponentFilter != null)) { result = ComponentFilter.NameFilter(testStr); } else { result = false; } } } return(FlipResult ? !result : result); }
/// <summary> /// Merge OutPutFilters /// </summary> /// <param name="mergeFilter">OutPutFilters</param> public void Merge(OutPutFilters mergeFilter) { IfcProductFilter.MergeInc(mergeFilter.IfcProductFilter); IfcTypeObjectFilter.MergeInc(mergeFilter.IfcTypeObjectFilter); IfcAssemblyFilter.MergeInc(mergeFilter.IfcAssemblyFilter); ZoneFilter.Merge(mergeFilter.ZoneFilter); TypeFilter.Merge(mergeFilter.TypeFilter); SpaceFilter.Merge(mergeFilter.SpaceFilter); FloorFilter.Merge(mergeFilter.FloorFilter); FacilityFilter.Merge(mergeFilter.FacilityFilter); SpareFilter.Merge(mergeFilter.SpareFilter); ComponentFilter.Merge(mergeFilter.ComponentFilter); CommonFilter.Merge(mergeFilter.CommonFilter); }
/// <summary> /// Clear OutPutFilters /// </summary> public void Clear() { AppliedRoles = 0; IfcProductFilter.Clear(); IfcTypeObjectFilter.Clear(); IfcAssemblyFilter.Clear(); ZoneFilter.Clear(); TypeFilter.Clear(); SpaceFilter.Clear(); FloorFilter.Clear(); FacilityFilter.Clear(); SpareFilter.Clear(); ComponentFilter.Clear(); CommonFilter.Clear(); }
/// <summary> /// Copy the OutPutFilters /// </summary> /// <param name="copyFilter">OutPutFilters to copy </param> public void Copy(OutPutFilters copyFilter) { AppliedRoles = copyFilter.AppliedRoles; IfcProductFilter.Copy(copyFilter.IfcProductFilter); IfcTypeObjectFilter.Copy(copyFilter.IfcTypeObjectFilter); IfcAssemblyFilter.Copy(copyFilter.IfcAssemblyFilter); ZoneFilter.Copy(copyFilter.ZoneFilter); TypeFilter.Copy(copyFilter.TypeFilter); SpaceFilter.Copy(copyFilter.SpaceFilter); FloorFilter.Copy(copyFilter.FloorFilter); FacilityFilter.Copy(copyFilter.FacilityFilter); SpareFilter.Copy(copyFilter.SpareFilter); ComponentFilter.Copy(copyFilter.ComponentFilter); CommonFilter.Copy(copyFilter.CommonFilter); }
/// <summary> /// Ophalen van de lijst van verdiepen, aangeleverd door de API. /// Hierbij wordt gebruik gemaakt van een FloorFilter. /// </summary> /// <returns>Task<List<Floor>></returns> public async Task <List <Floor> > GetFloorList() { List <Floor> result = new List <Floor>(); FloorFilter ff = new FloorFilter(); String pagejson = await AzureMobileClient.DefaultClient.InvokeApiAsync <FloorFilter, string>("/api/FloorSearch", ff, System.Net.Http.HttpMethod.Post, null, System.Threading.CancellationToken.None); List <Floor> page = JsonConvert.DeserializeObject <List <Floor> >(pagejson); result.AddRange(page); while (page.Count == ff.EffectivePageSize) { ff.LastFloor = page[page.Count - 1]; pagejson = await AzureMobileClient.DefaultClient.InvokeApiAsync <FloorFilter, string>("/api/FloorSearch", ff, System.Net.Http.HttpMethod.Post, null, System.Threading.CancellationToken.None); page = JsonConvert.DeserializeObject <List <Floor> >(pagejson); result.AddRange(page); } return(result); }