Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Aperture" /> class.
        /// </summary>
        /// <param name="geometry">Planar Face3D for the geometry. (required).</param>
        /// <param name="boundaryCondition">boundaryCondition (required).</param>
        /// <param name="properties">Extension properties for particular simulation engines (Radiance, EnergyPlus). (required).</param>
        /// <param name="isOperable">Boolean to note whether the Aperture can be opened for ventilation. (default to false).</param>
        /// <param name="indoorShades">Shades assigned to the interior side of this object (eg. window sill, light shelf)..</param>
        /// <param name="outdoorShades">Shades assigned to the exterior side of this object (eg. mullions, louvers)..</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 Aperture
        (
            string identifier, Face3D geometry, AnyOf <Outdoors, Surface> boundaryCondition, AperturePropertiesAbridged properties,                                     // Required parameters
            string displayName = default, Object userData = default, bool isOperable = false, List <Shade> indoorShades = default, List <Shade> outdoorShades = default // Optional parameters
        ) : base(identifier: identifier, displayName: displayName, userData: userData)                                                                                  // BaseClass
        {
            // to ensure "geometry" is required (not null)
            this.Geometry = geometry ?? throw new ArgumentNullException("geometry is a required property for Aperture and cannot be null");
            // to ensure "boundaryCondition" is required (not null)
            this.BoundaryCondition = boundaryCondition ?? throw new ArgumentNullException("boundaryCondition is a required property for Aperture and cannot be null");
            // to ensure "properties" is required (not null)
            this.Properties    = properties ?? throw new ArgumentNullException("properties is a required property for Aperture and cannot be null");
            this.IsOperable    = isOperable;
            this.IndoorShades  = indoorShades;
            this.OutdoorShades = outdoorShades;

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

            // check if object is valid, only check for inherited class
            if (this.GetType() == typeof(Aperture))
            {
                this.IsValid(throwException: true);
            }
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Aperture" /> 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="geometry">Planar Face3D for the geometry. (required).</param>
        /// <param name="boundaryCondition">boundaryCondition (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;Aperture&quot;).</param>
        /// <param name="isOperable">Boolean to note whether the Aperture can be opened for ventilation. (default to false).</param>
        /// <param name="indoorShades">Shades assigned to the interior side of this object (eg. window sill, light shelf)..</param>
        /// <param name="outdoorShades">Shades assigned to the exterior side of this object (eg. mullions, louvers)..</param>
        public Aperture(string name, Face3D geometry, AnyOf <Outdoors, Surface> boundaryCondition, AperturePropertiesAbridged properties, string displayName = default, string type = "Aperture", bool isOperable = false, List <Shade> indoorShades = default, List <Shade> outdoorShades = default)
        {
            // to ensure "name" is required (not null)
            if (name == null)
            {
                throw new InvalidDataException("name is a required property for Aperture and cannot be null");
            }
            else
            {
                this.Name = name;
            }

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

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

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

            this.DisplayName = displayName;
            // use default value if no "type" provided
            if (type == null)
            {
                this.Type = "Aperture";
            }
            else
            {
                this.Type = type;
            }
            // use default value if no "isOperable" provided
            if (isOperable == null)
            {
                this.IsOperable = false;
            }
            else
            {
                this.IsOperable = isOperable;
            }
            this.IndoorShades  = indoorShades;
            this.OutdoorShades = outdoorShades;
        }