new ProjectData()
Creates a new shared component store.
Members
-
:Map
componentMap
-
A map of all the shared components and constructions in the project model.
Components include all the various component type classes and constructions, indexed by universally unique identifier (UUID).
Type
- Map
-
:Map
materialMap
-
A map of all of the materials used in the project model.
Materials can be shared by multiple constructions, so need to be stored in their own separate map.
Type
- Map
-
:Map
profileMap
-
A map of all of the daily profiles used in the project model.
Daly profiles can be shared by multiple schedules, so need to be stored in their own separate map.
Type
- Map
-
:Map
scheduleMap
-
A map of all of the schedules used in the project model.
Schedules can be shared by multiple spaces, appliances and/or equipment, so need to be stored in their own separate map.
Type
- Map
-
:Map
supplierMap
-
A map of all the shared suppliers in the project model.
Suppliers are all the various type classes and constructions, indexed by universally unique identifier (UUID).
Type
- Map
Methods
-
addComponent(component)
-
Registers a component so that it can be stored and shared within the project.
Parameters:
Name Type Description componentBIM.Component | object A component instance.
Throws:
-
Throws an error if the instance is not a valid component.
- Type
- Error
Returns:
Returns this instance to support method chaining.
- Type
- BIM.ProjectData
-
-
addDaySchedule(day_schedule)
-
Registers a day schedule so that it can be stored and shared within the project.
Parameters:
Name Type Description day_schedulePD.DaySchedule | object A day schedule profile instance.
Throws:
-
Throws an error if the instance is not a valid profile.
- Type
- Error
Returns:
Returns this instance to support method chaining.
- Type
- BIM.ProjectData
-
-
addItem(item)
-
Adds a new shared supplier, component, material, schedule or profile to the project.
Parameters:
Name Type Description itemPD.Base A new item instance to share.
Returns:
Returns true if the item was successfully added.
- Type
- boolean
-
addMaterial(material)
-
Registers a material so that it can be stored and shared within the project.
Parameters:
Name Type Description materialBIM.Material | object A material instance.
Throws:
-
Throws an error if the instance is not a valid material.
- Type
- Error
Returns:
Returns this instance to support method chaining.
- Type
- BIM.ProjectData
-
-
addSchedule(schedule)
-
Registers a schedule so that it can be stored and shared within the project.
Parameters:
Name Type Description schedulePD.Schedule | object A schedule instance.
Throws:
-
Throws an error if the instance is not a valid schedule.
- Type
- Error
Returns:
Returns this instance to support method chaining.
- Type
- BIM.ProjectData
-
-
addSupplier(supplier)
-
Registers a supplier so that it can be stored and shared within the project.
Parameters:
Name Type Description supplierBIM.Supplier | object A supplier instance.
Throws:
-
Throws an error if the instance is not a valid supplier.
- Type
- Error
Returns:
Returns this instance to support method chaining.
- Type
- BIM.ProjectData
-
-
clear()
-
Clears everything from the store so it can be reused.
Returns:
Returns this instance to support method chaining.
- Type
- BIM.ProjectData
-
findCompatibleComponents(entity)
-
Retrieves all registered component instances compatible with the given object.
This method simply iterates through the shared component list and calls the
isCompatibleWith()method on each one to check the given entity.Parameters:
Name Type Description entityBIM.Entity The entity to match components with.
Returns:
Returns an array of matching component instances.
- Type
- Array.<BIM.Component>
-
findComponentsByType(type)
-
Retrieves all registered component instances of the given type.
Parameters:
Name Type Description typenumber The component type as an integer value.
Returns:
Returns an array of matching component instances.
- Type
- Array.<BIM.Component>
-
findDayScheduleByName(search)
-
Retrieves all profile instances with the given name.
This method simply iterates through the shared profile list and checks the name of each one.
Parameters:
Name Type Description searchstring The search string.
Returns:
Returns an array of matching profile instances.
- Type
- Array.<PD.DaySchedule>
-
findMaterialByName(search)
-
Retrieves all material instances with the given name.
This method simply iterates through the shared material list and checks the name of each one.
Parameters:
Name Type Description searchstring The search string.
Returns:
Returns an array of matching material instances.
- Type
- Array.<BIM.Material>
-
findScheduleByName(search)
-
Retrieves all schedule instances with the given name.
This method simply iterates through the shared schedule list and checks the name of each one.
Parameters:
Name Type Description searchstring The search string.
Returns:
Returns an array of matching schedule instances.
- Type
- Array.<PD.Schedule>
-
findSupplierByName(search)
-
Retrieves all supplier instances with the given name.
This method simply iterates through the shared supplier list and checks the name of each one.
Parameters:
Name Type Description searchstring The search string.
Returns:
Returns an array of matching supplier instances.
- Type
- Array
-
fromJSON(data)
-
Safely copy properties from a source object.
See the
PD.Base#fromJSONmethod for more details.Parameters:
Name Type Description dataobject The source object containing data to copy.
Returns:
Returns this instance to support method chaining.
- Type
- BIM.ProjectData
-
getComponentByUUID(uuid)
-
Retrieves a shared component instance given a unique id.
Parameters:
Name Type Description uuidstring The unique identifier of a shared component.
Returns:
Returns the component instance, or null if not found.
- Type
- BIM.Component | null
-
getDayScheduleByUUID(uuid)
-
Retrieves a shared profile instance given a unique id.
Parameters:
Name Type Description uuidstring The unique identifier of a shared profile.
Returns:
Returns the profile instance, or null if not found.
- Type
- PD.DaySchedule | null
-
getMaterialByUUID(uuid)
-
Retrieves a shared material instance given a unique id.
Parameters:
Name Type Description uuidstring The unique identifier of a shared material.
Returns:
Returns the material instance, or null if not found.
- Type
- BIM.Material | null
-
getOrCreateComponent(config)
-
Retrieves or creates/adds a shared component instance based on configuration.
If a shared component with a matching
uuidis found in the list, that is returned. If the given argument is a validBIM.Component, it is added to the list and returned. Otherwise, a new component is created based on the given configuration, added to the list and returned. This last case means that the given configuration object must be the results of parsing JSON data and must have a validclassNameproperty.If the given configuration is null or invalid, the method returns null.
Parameters:
Name Type Description configBIM.Component | object A component instance or component configuration.
Returns:
Returns the component instance, or null if not found.
- Type
- BIM.Component | null
-
getOrCreateDaySchedule(config)
-
Retrieves or creates/adds a shared profile instance based on configuration.
If a shared profile with a matching
uuidis found in the list, that is returned. If the given argument is a validPD.DaySchedule, it is added to the list and returned. Otherwise, a new profile is created based on the given configuration, added to the list and returned.If the given configuration is null or invalid, the method returns null.
Parameters:
Name Type Description configPD.DaySchedule | object A profile instance or profile configuration.
Returns:
Returns the profile instance, or null if not found.
- Type
- PD.DaySchedule | null
-
getOrCreateMaterial(config)
-
Retrieves or creates/adds a shared material instance based on configuration.
If a shared material with a matching
uuidis found in the list, that is returned. If the given argument is a validBIM.Material, it is added to the list and returned. Otherwise, a new material is created based on the given configuration, added to the list and returned.If the given configuration is null or invalid, the method returns null.
Parameters:
Name Type Description configBIM.Material | object A material instance or material configuration.
Returns:
Returns the material instance, or null if not found.
- Type
- BIM.Material | null
-
getOrCreateSchedule(config)
-
Retrieves or creates/adds a shared schedule instance based on configuration.
If a shared schedule with a matching
uuidis found in the list, that is returned. If the given argument is a validPD.Schedule, it is added to the list and returned. Otherwise, a new schedule is created based on the given configuration, added to the list and returned.If the given configuration is null or invalid, the method returns null.
Parameters:
Name Type Description configPD.Schedule | object A schedule instance or schedule configuration.
Returns:
Returns the schedule instance, or null if not found.
- Type
- PD.Schedule | null
-
getOrCreateSupplier(config)
-
Retrieves or creates/adds a shared supplier instance based on configuration.
If a shared supplier with a matching
uuidis found in the list, that is returned. If the given argument is a validBIM.Supplier, it is added to the list and returned. Otherwise, a new supplier is created based on the given configuration, added to the list and returned.If the given configuration is null or invalid, the method returns null.
Parameters:
Name Type Description configBIM.Supplier | object A supplier instance or supplier configuration.
Returns:
Returns the supplier instance, or null if not found.
- Type
- BIM.Supplier | null
-
getScheduleByUUID(uuid)
-
Retrieves a shared schedule instance given a unique id.
Parameters:
Name Type Description uuidstring The unique identifier of a shared schedule.
Returns:
Returns the schedule instance, or null if not found.
- Type
- PD.Schedule | null
-
getSupplierByUUID(uuid)
-
Retrieves a shared supplier instance given a unique id.
Parameters:
Name Type Description uuidstring The unique identifier of a shared supplier.
Returns:
Returns the supplier instance, or null if not found.
- Type
- BIM.Supplier | null
-
removeComponent(component)
-
Removes a shared component from the project.
Parameters:
Name Type Description componentBIM.Component A shared component instance.
Returns:
Returns true if the component was successfully deleted.
- Type
- boolean
-
removeDaySchedule(profile)
-
Removes a shared profile from the project.
Parameters:
Name Type Description profilePD.DaySchedule A shared profile instance.
Returns:
Returns true if the profile was successfully deleted.
- Type
- boolean
-
removeItem(item)
-
Removes a shared supplier, component, material, schedule or profile from the project.
Parameters:
Name Type Description itemPD.Base A shared item instance.
Returns:
Returns true if the item was successfully deleted.
- Type
- boolean
-
removeMaterial(material)
-
Removes a shared material from the project.
Parameters:
Name Type Description materialBIM.Material A shared material instance.
Returns:
Returns true if the material was successfully deleted.
- Type
- boolean
-
removeSchedule(schedule)
-
Removes a shared schedule from the project.
Parameters:
Name Type Description schedulePD.Schedule A shared schedule instance.
Returns:
Returns true if the schedule was successfully deleted.
- Type
- boolean
-
removeSupplier(supplier)
-
Removes a shared supplier from the project.
Parameters:
Name Type Description supplierBIM.Supplier A shared supplier instance.
Returns:
Returns true if the supplier was successfully deleted.
- Type
- boolean
-
toJSON( [data])
-
Converts the object instance to a simple POJO for JSON storage.
This method is used to copy, store and save the data for ths object, so the returned object must have all the properties required be able to rebuild this instance in its entirety when passed to the class constructor.
See the
PD.Base#toJSONmethod for more details.Parameters:
Name Type Argument Description dataobject <optional>
An optional parent object to append this data to.
Returns:
Returns a JSON object.
- Type
- object