#ifndef ENVIRONMENTALCONTROLDEVICE_HPP_INCLUDED
#define ENVIRONMENTALCONTROLDEVICE_HPP_INCLUDED

#include <iostream>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include <NBO/NBO/AnnotationRef.h>
#include <NBO/NBO/CO2ControlMethod_Type.h>
#include <NBO/NBO/Denomination_Type.h>
#include <NBO/NBO/EnvironmentalControlMethod_Type.h>
#include <NBO/NBO/EnvironmentalStandCompatibility_Type.h>
#include <NBO/NBO/HumidityControlMethod_Type.h>
#include <NBO/NBO/LSID_Type.h>
#include <NBO/NBO/ManufacturerSpec_Type.h>
#include <NBO/NBO/UnitsTemperature_Type.h>
#include <NBO/NBO/ENBOType.h>
#include <NBO/NBOGlobal.h>
#include <NBO/Shared/Base/NBOBaseClass.h>


namespace Inscoper::NBO {

/*!
* \brief Represents the XML element EnvironmentalControlDevice.
*
* This element describes an Environmental Control Device available for this Instrument to maintain a controlled Imaging Environment during Imaging Environment.
*/
class NBO_EXPORT EnvironmentalControlDevice : public ManufacturerSpec_Type {

public:
	
	EnvironmentalControlDevice();
	~EnvironmentalControlDevice();

	/*!
	* \brief Cast a NBOBaseClass to a EnvironmentalControlDevice.
	*
	* \param base The base class to cast
	* \return The casted element, or nullptr if the cast fails
	*/
	static std::shared_ptr<EnvironmentalControlDevice> fromBase(NBOBaseClassPtr base);

	/*!
	* \brief Returns the class type name.
	*
	* \return The class type name
	*/
	std::string getTypeName() const override;

	/*!
	* \brief Returns the XML element name corresponding to this class.
	*
	* \return The XML element name
	*/
	std::string getXMLName() const override;

	/*!
	* \brief Returns the NBO Type corresponding to this class.
	*
	* \return The NBO Type value
	*/
	ENBOType getNBOType() const override;

	/*!
	* \brief Returns a list of all classes derived from this class.
	*
	* \return The list of derived classes
	*/
	std::vector<NBOBaseClassPtr> getChildren() const override;

	/*!
	* \brief Returns a list of all child elements contained in this class.
	*
	* \return The list of child classes
	*/
	std::vector<NBOBaseClassPtr> getSubElements() const override;

	/*!
	* \brief Populates this object from a JSON file.
	*
	* \param path The path to the JSON file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromJsonFile(const std::string& path, bool validate = true);

	/*!
	* \brief Populates this object from a JSON string.
	*
	* \param json_string The JSON content as a string
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromJsonString(const std::string& json_string, bool validate = true);

	/*!
	* \brief Populates this object from a XML file.
	*
	* \param path The path to the XML file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromXmlFile(const std::string& path, bool validate = true);

	/*!
	* \brief Populates this object from a XML string.
	*
	* \param xml_string The XML content as a string
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromXmlString(const std::string& xml_string, bool validate = true);

	/*!
	* \brief Serializes this object to an XML file.
	*
	* \param filename The path to the output XML file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void toXmlFile(const std::string& filename, bool validate = true) const;

	/*!
	* \brief Serializes this object to an XML string.
	*
	* \param validate If true, validates constraints on value. Default is true.
	* \return A string containing the XML representation of this object
	*/
	std::string toXmlString(bool validate = true) const;

	/*!
	* \brief Sets the value of the ID attribute.
	*
	* A Unique Identifier for this component.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setID(const Inscoper::NBO::LSID_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the ID attribute.
	*
	* A Unique Identifier for this component.
	*
	* \return The value of the attribute
	*/
	LSID_TypePtr getID() const;

	/*!
	* \brief Resets the ID attribute to an unset state.
	*
	* A Unique Identifier for this component.
	*/
	void resetID();

	/*!
	* \brief Checks whether the optional ID attribute is present.
	*
	* A Unique Identifier for this component.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasID() const;

	/*!
	* \brief Sets the value of the Name attribute.
	*
	* A User-defined Name for this component.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setName(const Inscoper::NBO::Denomination_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the Name attribute.
	*
	* A User-defined Name for this component.
	*
	* \return The value of the attribute
	*/
	Denomination_TypePtr getName() const;

	/*!
	* \brief Resets the Name attribute to an unset state.
	*
	* A User-defined Name for this component.
	*/
	void resetName();

	/*!
	* \brief Checks whether the optional Name attribute is present.
	*
	* A User-defined Name for this component.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasName() const;

	/*!
	* \brief Sets the value of the TemperatureControl attribute.
	*
	* This field captures whether this Environmental Control Device provides Temperature control and what type of control it provides. If no Temperature control is provided please enter "None".
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTemperatureControl(const Inscoper::NBO::EnvironmentalControlMethod_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the TemperatureControl attribute.
	*
	* This field captures whether this Environmental Control Device provides Temperature control and what type of control it provides. If no Temperature control is provided please enter "None".
	*
	* \return The value of the attribute
	*/
	EnvironmentalControlMethod_TypePtr getTemperatureControl() const;

	/*!
	* \brief Resets the TemperatureControl attribute to an unset state.
	*
	* This field captures whether this Environmental Control Device provides Temperature control and what type of control it provides. If no Temperature control is provided please enter "None".
	*/
	void resetTemperatureControl();

	/*!
	* \brief Checks whether the optional TemperatureControl attribute is present.
	*
	* This field captures whether this Environmental Control Device provides Temperature control and what type of control it provides. If no Temperature control is provided please enter "None".
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasTemperatureControl() const;

	/*!
	* \brief Sets the value of the HumidityControl attribute.
	*
	* This field captures whether this Environmental Control Device provides Humidity control and what type of control it provides. If no Humidity control is provided please enter None.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setHumidityControl(const Inscoper::NBO::HumidityControlMethod_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the HumidityControl attribute.
	*
	* This field captures whether this Environmental Control Device provides Humidity control and what type of control it provides. If no Humidity control is provided please enter None.
	*
	* \return The value of the attribute
	*/
	HumidityControlMethod_TypePtr getHumidityControl() const;

	/*!
	* \brief Resets the HumidityControl attribute to an unset state.
	*
	* This field captures whether this Environmental Control Device provides Humidity control and what type of control it provides. If no Humidity control is provided please enter None.
	*/
	void resetHumidityControl();

	/*!
	* \brief Checks whether the optional HumidityControl attribute is present.
	*
	* This field captures whether this Environmental Control Device provides Humidity control and what type of control it provides. If no Humidity control is provided please enter None.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasHumidityControl() const;

	/*!
	* \brief Sets the value of the CO2Control attribute.
	*
	* This field captures whether this Environmental Control Device provides CO2 control and what type of control it provides. If no CO2 control is provided please enter None.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setCO2Control(const Inscoper::NBO::CO2ControlMethod_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the CO2Control attribute.
	*
	* This field captures whether this Environmental Control Device provides CO2 control and what type of control it provides. If no CO2 control is provided please enter None.
	*
	* \return The value of the attribute
	*/
	CO2ControlMethod_TypePtr getCO2Control() const;

	/*!
	* \brief Resets the CO2Control attribute to an unset state.
	*
	* This field captures whether this Environmental Control Device provides CO2 control and what type of control it provides. If no CO2 control is provided please enter None.
	*/
	void resetCO2Control();

	/*!
	* \brief Checks whether the optional CO2Control attribute is present.
	*
	* This field captures whether this Environmental Control Device provides CO2 control and what type of control it provides. If no CO2 control is provided please enter None.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasCO2Control() const;

	/*!
	* \brief Sets the value of the O2Control attribute.
	*
	* This field captures whether (True) or not (False) this Environmental Control Device provides vibration control.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setO2Control(const bool& value, bool validate = true);

	/*!
	* \brief Returns the value of the O2Control attribute.
	*
	* This field captures whether (True) or not (False) this Environmental Control Device provides vibration control.
	*
	* \return The value of the attribute
	*/
	bool getO2Control() const;

	/*!
	* \brief Resets the O2Control attribute to an unset state.
	*
	* This field captures whether (True) or not (False) this Environmental Control Device provides vibration control.
	*/
	void resetO2Control();

	/*!
	* \brief Checks whether the O2Control attribute is present.
	*
	* This field captures whether (True) or not (False) this Environmental Control Device provides vibration control.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasO2Control() const;

	/*!
	* \brief Sets the value of the VibrationControl attribute.
	*
	* This field captures whether (True) or not (False) this Environmental Control Device provides O2 control.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setVibrationControl(const bool& value, bool validate = true);

	/*!
	* \brief Returns the value of the VibrationControl attribute.
	*
	* This field captures whether (True) or not (False) this Environmental Control Device provides O2 control.
	*
	* \return The value of the attribute
	*/
	bool getVibrationControl() const;

	/*!
	* \brief Resets the VibrationControl attribute to an unset state.
	*
	* This field captures whether (True) or not (False) this Environmental Control Device provides O2 control.
	*/
	void resetVibrationControl();

	/*!
	* \brief Checks whether the VibrationControl attribute is present.
	*
	* This field captures whether (True) or not (False) this Environmental Control Device provides O2 control.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasVibrationControl() const;

	/*!
	* \brief Sets the value of the StandCompatibility attribute.
	*
	* This field captures what Microscope Stand type this Environmental Control Chamber is compatible with.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setStandCompatibility(const Inscoper::NBO::EnvironmentalStandCompatibility_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the StandCompatibility attribute.
	*
	* This field captures what Microscope Stand type this Environmental Control Chamber is compatible with.
	*
	* \return The value of the attribute
	*/
	EnvironmentalStandCompatibility_TypePtr getStandCompatibility() const;

	/*!
	* \brief Resets the StandCompatibility attribute to an unset state.
	*
	* This field captures what Microscope Stand type this Environmental Control Chamber is compatible with.
	*/
	void resetStandCompatibility();

	/*!
	* \brief Checks whether the optional StandCompatibility attribute is present.
	*
	* This field captures what Microscope Stand type this Environmental Control Chamber is compatible with.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasStandCompatibility() const;

	/*!
	* \brief Sets the value of the Perfusion attribute.
	*
	* This field caputers whether (True) or not (False) this Environmental Control Device supports sample Perfusion.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setPerfusion(const bool& value, bool validate = true);

	/*!
	* \brief Returns the value of the Perfusion attribute.
	*
	* This field caputers whether (True) or not (False) this Environmental Control Device supports sample Perfusion.
	*
	* \return The value of the attribute
	*/
	bool getPerfusion() const;

	/*!
	* \brief Resets the Perfusion attribute to an unset state.
	*
	* This field caputers whether (True) or not (False) this Environmental Control Device supports sample Perfusion.
	*/
	void resetPerfusion();

	/*!
	* \brief Checks whether the Perfusion attribute is present.
	*
	* This field caputers whether (True) or not (False) this Environmental Control Device supports sample Perfusion.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasPerfusion() const;

	/*!
	* \brief Sets the value of the LidMaterial attribute.
	*
	* In case this Environmental Control Device consists of a Sample Holder Chamber, this field captures the Material that constitutes the Lid of the Chamber.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setLidMaterial(const std::string& value, bool validate = true);

	/*!
	* \brief Returns the value of the LidMaterial attribute.
	*
	* In case this Environmental Control Device consists of a Sample Holder Chamber, this field captures the Material that constitutes the Lid of the Chamber.
	*
	* \return The value of the attribute
	*/
	std::string getLidMaterial() const;

	/*!
	* \brief Resets the LidMaterial attribute to an unset state.
	*
	* In case this Environmental Control Device consists of a Sample Holder Chamber, this field captures the Material that constitutes the Lid of the Chamber.
	*/
	void resetLidMaterial();

	/*!
	* \brief Checks whether the LidMaterial attribute is present.
	*
	* In case this Environmental Control Device consists of a Sample Holder Chamber, this field captures the Material that constitutes the Lid of the Chamber.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasLidMaterial() const;

	/*!
	* \brief Returns the allowed values for this attribut.
	*
	* In case this Environmental Control Device consists of a Sample Holder Chamber, this field captures the Material that constitutes the Lid of the Chamber.
	*
	* \return The list of allowed values
	*/
	static const std::set<std::string>& getLidMaterialAllowedValues();

	/*!
	* \brief Sets the value of the MaxTemperature attribute.
	*
	* This field captures the Maximum Temperature that can be stably maintained by this Environmental Control Device.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setMaxTemperature(const float& value, bool validate = true);

	/*!
	* \brief Returns the value of the MaxTemperature attribute.
	*
	* This field captures the Maximum Temperature that can be stably maintained by this Environmental Control Device.
	*
	* \return The value of the attribute
	*/
	float getMaxTemperature() const;

	/*!
	* \brief Resets the MaxTemperature attribute to an unset state.
	*
	* This field captures the Maximum Temperature that can be stably maintained by this Environmental Control Device.
	*/
	void resetMaxTemperature();

	/*!
	* \brief Checks whether the MaxTemperature attribute is present.
	*
	* This field captures the Maximum Temperature that can be stably maintained by this Environmental Control Device.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasMaxTemperature() const;

	/*!
	* \brief Sets the value of the MaxTemperatureUnit attribute.
	*
	* No description available in the XSD standard.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setMaxTemperatureUnit(const Inscoper::NBO::UnitsTemperature_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the MaxTemperatureUnit attribute.
	*
	* No description available in the XSD standard.
	*
	* \return The value of the attribute
	*/
	UnitsTemperature_TypePtr getMaxTemperatureUnit() const;

	/*!
	* \brief Resets the MaxTemperatureUnit attribute to an unset state.
	*
	* No description available in the XSD standard.
	*/
	void resetMaxTemperatureUnit();

	/*!
	* \brief Checks whether the optional MaxTemperatureUnit attribute is present.
	*
	* No description available in the XSD standard.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasMaxTemperatureUnit() const;

	/*!
	* \brief Sets the value of the MinTemberature attribute.
	*
	* This field captures the Minimum Temperature that can be stably maintained by this Environmental Control Device.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setMinTemberature(const float& value, bool validate = true);

	/*!
	* \brief Returns the value of the MinTemberature attribute.
	*
	* This field captures the Minimum Temperature that can be stably maintained by this Environmental Control Device.
	*
	* \return The value of the attribute
	*/
	float getMinTemberature() const;

	/*!
	* \brief Resets the MinTemberature attribute to an unset state.
	*
	* This field captures the Minimum Temperature that can be stably maintained by this Environmental Control Device.
	*/
	void resetMinTemberature();

	/*!
	* \brief Checks whether the MinTemberature attribute is present.
	*
	* This field captures the Minimum Temperature that can be stably maintained by this Environmental Control Device.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasMinTemberature() const;

	/*!
	* \brief Sets the value of the MinTemperatureUnit attribute.
	*
	* No description available in the XSD standard.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setMinTemperatureUnit(const Inscoper::NBO::UnitsTemperature_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the MinTemperatureUnit attribute.
	*
	* No description available in the XSD standard.
	*
	* \return The value of the attribute
	*/
	UnitsTemperature_TypePtr getMinTemperatureUnit() const;

	/*!
	* \brief Resets the MinTemperatureUnit attribute to an unset state.
	*
	* No description available in the XSD standard.
	*/
	void resetMinTemperatureUnit();

	/*!
	* \brief Checks whether the optional MinTemperatureUnit attribute is present.
	*
	* No description available in the XSD standard.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasMinTemperatureUnit() const;

	/*!
	* \brief Sets the value of the TemperatureAccuracy attribute.
	*
	* This field captures the Temperature control Accuracy provided by this Environmental Control Device.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTemperatureAccuracy(const float& value, bool validate = true);

	/*!
	* \brief Returns the value of the TemperatureAccuracy attribute.
	*
	* This field captures the Temperature control Accuracy provided by this Environmental Control Device.
	*
	* \return The value of the attribute
	*/
	float getTemperatureAccuracy() const;

	/*!
	* \brief Resets the TemperatureAccuracy attribute to an unset state.
	*
	* This field captures the Temperature control Accuracy provided by this Environmental Control Device.
	*/
	void resetTemperatureAccuracy();

	/*!
	* \brief Checks whether the TemperatureAccuracy attribute is present.
	*
	* This field captures the Temperature control Accuracy provided by this Environmental Control Device.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasTemperatureAccuracy() const;

	/*!
	* \brief Sets the value of the TemperatureAccuracyUnit attribute.
	*
	* No description available in the XSD standard.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTemperatureAccuracyUnit(const Inscoper::NBO::UnitsTemperature_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the TemperatureAccuracyUnit attribute.
	*
	* No description available in the XSD standard.
	*
	* \return The value of the attribute
	*/
	UnitsTemperature_TypePtr getTemperatureAccuracyUnit() const;

	/*!
	* \brief Resets the TemperatureAccuracyUnit attribute to an unset state.
	*
	* No description available in the XSD standard.
	*/
	void resetTemperatureAccuracyUnit();

	/*!
	* \brief Checks whether the optional TemperatureAccuracyUnit attribute is present.
	*
	* No description available in the XSD standard.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasTemperatureAccuracyUnit() const;

	/*!
	* \brief Sets the value of the TTL attribute.
	*
	* This field captures whether (True) or not (False) this Environmental Control Device can be controlled by a TTL signal.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTTL(const bool& value, bool validate = true);

	/*!
	* \brief Returns the value of the TTL attribute.
	*
	* This field captures whether (True) or not (False) this Environmental Control Device can be controlled by a TTL signal.
	*
	* \return The value of the attribute
	*/
	bool getTTL() const;

	/*!
	* \brief Resets the TTL attribute to an unset state.
	*
	* This field captures whether (True) or not (False) this Environmental Control Device can be controlled by a TTL signal.
	*/
	void resetTTL();

	/*!
	* \brief Checks whether the TTL attribute is present.
	*
	* This field captures whether (True) or not (False) this Environmental Control Device can be controlled by a TTL signal.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasTTL() const;

	/*!
	* \brief Sets the value of the AnnotationRef element.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setAnnotationRef(const Inscoper::NBO::AnnotationRefPtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the AnnotationRef element.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*
	* \return The value of the element
	*/
	Inscoper::NBO::AnnotationRefPtr getAnnotationRef() const;

	/*!
	* \brief Resets the AnnotationRef element to an unset state.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*/
	void resetAnnotationRef();

	/*!
	* \brief Checks whether the optional AnnotationRef element is present.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasAnnotationRef() const;


private:
	class Impl;
	std::unique_ptr<Impl> pImpl;

	LSID_TypePtr ID = nullptr; // Required attribute
	Denomination_TypePtr Name = nullptr; // Optional attribute
	EnvironmentalControlMethod_TypePtr TemperatureControl = nullptr; // Required attribute
	HumidityControlMethod_TypePtr HumidityControl = nullptr; // Required attribute
	CO2ControlMethod_TypePtr CO2Control = nullptr; // Required attribute
    std::optional<bool> O2Control; // Required attribute
    std::optional<bool> VibrationControl; // Optional attribute
	EnvironmentalStandCompatibility_TypePtr StandCompatibility = nullptr; // Required attribute
    std::optional<bool> Perfusion; // Required attribute
    std::optional<std::string> LidMaterial; // Optional attribute
    static const std::set<std::string> LidMaterialAllowedValues;
    std::optional<float> MaxTemperature; // Required attribute
	UnitsTemperature_TypePtr MaxTemperatureUnit = nullptr; // Optional attribute
    std::optional<float> MinTemberature; // Required attribute
	UnitsTemperature_TypePtr MinTemperatureUnit = nullptr; // Optional attribute
    std::optional<float> TemperatureAccuracy; // Optional attribute
	UnitsTemperature_TypePtr TemperatureAccuracyUnit = nullptr; // Optional attribute
    std::optional<bool> TTL; // Optional attribute
    Inscoper::NBO::AnnotationRefPtr AnnotationRef = nullptr;
};

/*! Shared pointer for EnvironmentalControlDevice*/
typedef std::shared_ptr<EnvironmentalControlDevice> EnvironmentalControlDevicePtr;

} // namespace Inscoper::NBO

#endif // ENVIRONMENTALCONTROLDEVICE_HPP_INCLUDED