src/model/ScheduleFile.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #ifndef MODEL_SCHEDULEFILE_HPP | ||
| 7 | #define MODEL_SCHEDULEFILE_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ScheduleInterval.hpp" | ||
| 11 | #include "../utilities/filetypes/CSVFile.hpp" | ||
| 12 | |||
| 13 | #include "../utilities/core/Deprecated.hpp" | ||
| 14 | |||
| 15 | namespace openstudio { | ||
| 16 | |||
| 17 | namespace model { | ||
| 18 | |||
| 19 | class ScheduleTypeLimits; | ||
| 20 | class ExternalFile; | ||
| 21 | |||
| 22 | namespace detail { | ||
| 23 | |||
| 24 | class ScheduleFile_Impl; | ||
| 25 | |||
| 26 | } // namespace detail | ||
| 27 | |||
| 28 | /** ScheduleFile is a ScheduleInterval that wraps the OpenStudio IDD object 'OS:Schedule:File'. */ | ||
| 29 | class MODEL_API ScheduleFile : public ScheduleInterval | ||
| 30 | { | ||
| 31 | public: | ||
| 32 | /** @name Constructors and Destructors */ | ||
| 33 | //@{ | ||
| 34 | |||
| 35 | ScheduleFile(const ExternalFile& externalfile, int column = 1, int rowsToSkip = 0); | ||
| 36 | |||
| 37 | ScheduleFile(const Model& model, const openstudio::path& filePath, int column = 1, int rowsToSkip = 0); | ||
| 38 | |||
| 39 | 145 | virtual ~ScheduleFile() override = default; | |
| 40 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 41 | 27 | ScheduleFile(const ScheduleFile& other) = default; | |
| 42 | 50 | ScheduleFile(ScheduleFile&& other) = default; | |
| 43 | ✗ | ScheduleFile& operator=(const ScheduleFile&) = default; | |
| 44 | ✗ | ScheduleFile& operator=(ScheduleFile&&) = default; | |
| 45 | |||
| 46 | //@} | ||
| 47 | |||
| 48 | static IddObjectType iddObjectType(); | ||
| 49 | |||
| 50 | static std::vector<std::string> columnSeparatorValues(); | ||
| 51 | static std::vector<std::string> minutesperItemValues(); | ||
| 52 | |||
| 53 | /** @name Getters */ | ||
| 54 | //@{ | ||
| 55 | |||
| 56 | boost::optional<ScheduleTypeLimits> scheduleTypeLimits() const; | ||
| 57 | |||
| 58 | ExternalFile externalFile() const; | ||
| 59 | |||
| 60 | int columnNumber() const; | ||
| 61 | |||
| 62 | int rowstoSkipatTop() const; | ||
| 63 | |||
| 64 | // This should be returning `int` as it has a default | ||
| 65 | boost::optional<int> numberofHoursofData() const; | ||
| 66 | |||
| 67 | bool isNumberofHoursofDataDefaulted() const; | ||
| 68 | |||
| 69 | std::string columnSeparator() const; | ||
| 70 | |||
| 71 | bool isColumnSeparatorDefaulted() const; | ||
| 72 | |||
| 73 | bool interpolatetoTimestep() const; | ||
| 74 | |||
| 75 | bool isInterpolatetoTimestepDefaulted() const; | ||
| 76 | |||
| 77 | // This should be returning `int` instead of boost::optional<std::string>... | ||
| 78 | boost::optional<std::string> minutesperItem() const; | ||
| 79 | |||
| 80 | bool isMinutesperItemDefaulted() const; | ||
| 81 | |||
| 82 | bool adjustScheduleforDaylightSavings() const; | ||
| 83 | |||
| 84 | bool isAdjustScheduleforDaylightSavingsDefaulted() const; | ||
| 85 | |||
| 86 | /* FIXME! openstudio::TimeSeries timeSeries(unsigned columnIndex) const;*/ | ||
| 87 | |||
| 88 | boost::optional<CSVFile> csvFile() const; | ||
| 89 | |||
| 90 | bool translateFileWithRelativePath() const; | ||
| 91 | |||
| 92 | bool isTranslateFileWithRelativePathDefaulted() const; | ||
| 93 | |||
| 94 | //@} | ||
| 95 | /** @name Setters */ | ||
| 96 | //@{ | ||
| 97 | |||
| 98 | bool setScheduleTypeLimits(const ScheduleTypeLimits& scheduleTypeLimits); | ||
| 99 | |||
| 100 | bool resetScheduleTypeLimits(); | ||
| 101 | |||
| 102 | bool setColumnNumber(int columnNumber); | ||
| 103 | |||
| 104 | bool setRowstoSkipatTop(int rowstoSkipatTop); | ||
| 105 | |||
| 106 | bool setNumberofHoursofData(int numberofHours); | ||
| 107 | |||
| 108 | bool setColumnSeparator(const std::string& columnSeparator); | ||
| 109 | |||
| 110 | void resetColumnSeparator(); | ||
| 111 | |||
| 112 | bool setInterpolatetoTimestep(bool interpolatetoTimestep); | ||
| 113 | |||
| 114 | void resetInterpolatetoTimestep(); | ||
| 115 | |||
| 116 | OS_DEPRECATED(3, 2, 0) bool setMinutesperItem(const std::string& minutesperItem); | ||
| 117 | |||
| 118 | bool setMinutesperItem(int minutesperItem); | ||
| 119 | |||
| 120 | void resetMinutesperItem(); | ||
| 121 | |||
| 122 | bool setAdjustScheduleforDaylightSavings(bool adjustScheduleforDaylightSavings); | ||
| 123 | |||
| 124 | void resetAdjustScheduleforDaylightSavings(); | ||
| 125 | |||
| 126 | /* FIXME! unsigned addTimeSeries(const openstudio::TimeSeries& timeSeries); */ | ||
| 127 | |||
| 128 | bool setTranslateFileWithRelativePath(bool translateFileWithRelativePath); | ||
| 129 | |||
| 130 | void resetTranslateFileWithRelativePath(); | ||
| 131 | |||
| 132 | //@} | ||
| 133 | /** @name Other */ | ||
| 134 | //@{ | ||
| 135 | |||
| 136 | // Depending on the value of 'Translate File With Relative Path', returns an absolute or a relative path | ||
| 137 | openstudio::path translatedFilePath() const; | ||
| 138 | |||
| 139 | //@} | ||
| 140 | protected: | ||
| 141 | /// @cond | ||
| 142 | using ImplType = detail::ScheduleFile_Impl; | ||
| 143 | |||
| 144 | explicit ScheduleFile(std::shared_ptr<detail::ScheduleFile_Impl> impl); | ||
| 145 | |||
| 146 | friend class Model; | ||
| 147 | friend class IdfObject; | ||
| 148 | friend class openstudio::detail::IdfObject_Impl; | ||
| 149 | /// @endcond | ||
| 150 | private: | ||
| 151 | − | REGISTER_LOGGER("openstudio.model.ScheduleFile"); | |
| 152 | }; | ||
| 153 | |||
| 154 | /** \relates ScheduleFile*/ | ||
| 155 | using OptionalScheduleFile = boost::optional<ScheduleFile>; | ||
| 156 | |||
| 157 | /** \relates ScheduleFile*/ | ||
| 158 | using ScheduleFileVector = std::vector<ScheduleFile>; | ||
| 159 | |||
| 160 | } // namespace model | ||
| 161 | } // namespace openstudio | ||
| 162 | |||
| 163 | #endif // MODEL_SCHEDULEFILE_HPP | ||
| 164 |