Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Room" /> class.
        /// </summary>
        /// <param name="faces">Faces that together form the closed volume of a room. (required).</param>
        /// <param name="properties">Extension properties for particular simulation engines (Radiance, EnergyPlus). (required).</param>
        /// <param name="indoorShades">Shades assigned to the interior side of this object (eg. partitions, tables)..</param>
        /// <param name="outdoorShades">Shades assigned to the exterior side of this object (eg. trees, landscaping)..</param>
        /// <param name="multiplier">An integer noting how many times this Room is repeated. Multipliers are used to speed up the calculation when similar Rooms are repeated more than once. Essentially, a given simulation with the Room is run once and then the result is mutliplied by the multiplier. (default to 1).</param>
        /// <param name="excludeFloorArea">A boolean for whether the Room floor area contributes to Models it is a part of. Note that this will not affect the floor_area property of this Room itself but it will ensure the Room floor area is excluded from any calculations when the Room is part of a Model, including EUI calculations. (default to false).</param>
        /// <param name="story">Text string for the story identifier to which this Room belongs. Rooms sharing the same story identifier are considered part of the same story in a Model. Note that this property has no character restrictions..</param>
        /// <param name="identifier">Text string for a unique object ID. This identifier remains constant as the object is mutated, copied, and serialized to different formats (eg. dict, idf, rad). This identifier is also used to reference the object across a Model. It must be &lt; 100 characters and not contain any spaces or special characters. (required).</param>
        /// <param name="displayName">Display name of the object with no character restrictions..</param>
        /// <param name="userData">Optional dictionary of user data associated with the object.All keys and values of this dictionary should be of a standard data type to ensure correct serialization of the object (eg. str, float, int, list)..</param>
        public Room
        (
            string identifier, List <Face> faces, RoomPropertiesAbridged properties,                                                                                                                                      // Required parameters
            string displayName = default, Object userData = default, List <Shade> indoorShades = default, List <Shade> outdoorShades = default, int multiplier = 1, bool excludeFloorArea = false, string story = default // Optional parameters
        ) : base(identifier: identifier, displayName: displayName, userData: userData)                                                                                                                                    // BaseClass
        {
            // to ensure "faces" is required (not null)
            this.Faces = faces ?? throw new ArgumentNullException("faces is a required property for Room and cannot be null");
            // to ensure "properties" is required (not null)
            this.Properties       = properties ?? throw new ArgumentNullException("properties is a required property for Room and cannot be null");
            this.IndoorShades     = indoorShades;
            this.OutdoorShades    = outdoorShades;
            this.Multiplier       = multiplier;
            this.ExcludeFloorArea = excludeFloorArea;
            this.Story            = story;

            // Set non-required readonly properties with defaultValue
            this.Type = "Room";

            // check if object is valid, only check for inherited class
            if (this.GetType() == typeof(Room))
            {
                this.IsValid(throwException: true);
            }
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Room" /> class.
        /// </summary>
        /// <param name="name">Name of the object used in all simulation engines. Must not contain spaces and use only letters, digits and underscores/dashes. It cannot be longer than 100 characters. (required).</param>
        /// <param name="faces">Faces that together form the closed volume of a room. (required).</param>
        /// <param name="properties">Extension properties for particular simulation engines (Radiance, EnergyPlus). (required).</param>
        /// <param name="displayName">Display name of the object with no restrictions..</param>
        /// <param name="type">type (default to &quot;Room&quot;).</param>
        /// <param name="indoorShades">Shades assigned to the interior side of this object (eg. partitions, tables)..</param>
        /// <param name="outdoorShades">Shades assigned to the exterior side of this object (eg. trees, landscaping)..</param>
        /// <param name="multiplier">An integer noting how many times this Room is repeated. Multipliers are used to speed up the calculation when similar Rooms are repeated more than once. Essentially, a given simulation with the Room is run once and then the result is mutliplied by the multiplier. (default to 1).</param>
        public Room(string name, List <Face> faces, RoomPropertiesAbridged properties, string displayName = default, string type = "Room", List <Shade> indoorShades = default, List <Shade> outdoorShades = default, int multiplier = 1)
        {
            // to ensure "name" is required (not null)
            if (name == null)
            {
                throw new InvalidDataException("name is a required property for Room and cannot be null");
            }
            else
            {
                this.Name = name;
            }

            // to ensure "faces" is required (not null)
            if (faces == null)
            {
                throw new InvalidDataException("faces is a required property for Room and cannot be null");
            }
            else
            {
                this.Faces = faces;
            }

            // to ensure "properties" is required (not null)
            if (properties == null)
            {
                throw new InvalidDataException("properties is a required property for Room and cannot be null");
            }
            else
            {
                this.Properties = properties;
            }

            this.DisplayName = displayName;
            // use default value if no "type" provided
            if (type == null)
            {
                this.Type = "Room";
            }
            else
            {
                this.Type = type;
            }
            this.IndoorShades  = indoorShades;
            this.OutdoorShades = outdoorShades;
            // use default value if no "multiplier" provided
            if (multiplier == null)
            {
                this.Multiplier = 1;
            }
            else
            {
                this.Multiplier = multiplier;
            }
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Room" /> class.
        /// </summary>
        /// <param name="faces">Faces that together form the closed volume of a room. (required).</param>
        /// <param name="properties">Extension properties for particular simulation engines (Radiance, EnergyPlus). (required).</param>
        /// <param name="indoorShades">Shades assigned to the interior side of this object (eg. partitions, tables)..</param>
        /// <param name="outdoorShades">Shades assigned to the exterior side of this object (eg. trees, landscaping)..</param>
        /// <param name="multiplier">An integer noting how many times this Room is repeated. Multipliers are used to speed up the calculation when similar Rooms are repeated more than once. Essentially, a given simulation with the Room is run once and then the result is mutliplied by the multiplier. (default to 1).</param>
        /// <param name="story">Text string for the story identifier to which this Room belongs. Rooms sharing the same story identifier are considered part of the same story in a Model..</param>
        /// <param name="identifier">Text string for a unique object ID. This identifier remains constant as the object is mutated, copied, and serialized to different formats (eg. dict, idf, rad). This identifier is also used to reference the object across a Model. It must be &lt; 100 characters and not contain any spaces or special characters. (required).</param>
        /// <param name="displayName">Display name of the object with no character restrictions..</param>
        /// <param name="userData">Optional dictionary of user data associated with the object.All keys and values of this dictionary should be of a standard data type to ensure correct serialization of the object (eg. str, float, int, list)..</param>
        public Room
        (
            string identifier, List <Face> faces, RoomPropertiesAbridged properties,                                                                                                       // Required parameters
            string displayName = default, Object userData = default, List <Shade> indoorShades = default, List <Shade> outdoorShades = default, int multiplier = 1, string story = default // Optional parameters
        ) : base(identifier: identifier, displayName: displayName, userData: userData)                                                                                                     // BaseClass
        {
            // to ensure "faces" is required (not null)
            this.Faces = faces ?? throw new ArgumentNullException("faces is a required property for Room and cannot be null");
            // to ensure "properties" is required (not null)
            this.Properties    = properties ?? throw new ArgumentNullException("properties is a required property for Room and cannot be null");
            this.IndoorShades  = indoorShades;
            this.OutdoorShades = outdoorShades;
            this.Multiplier    = multiplier;
            this.Story         = story;

            // Set non-required readonly properties with defaultValue
            this.Type = "Room";
        }