src/isomodel/EpwData.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 ISOMODEL_EPWDATA_HPP | ||
| 7 | #define ISOMODEL_EPWDATA_HPP | ||
| 8 | |||
| 9 | #include <iostream> | ||
| 10 | #include <fstream> | ||
| 11 | #include <string> | ||
| 12 | #include <vector> | ||
| 13 | #include <sstream> | ||
| 14 | #include "TimeFrame.hpp" | ||
| 15 | #include "../utilities/core/Path.hpp" | ||
| 16 | #include "../utilities/data/Matrix.hpp" | ||
| 17 | #include "../utilities/data/Vector.hpp" | ||
| 18 | |||
| 19 | namespace openstudio { | ||
| 20 | namespace isomodel { | ||
| 21 | |||
| 22 | constexpr int DBT = 0; | ||
| 23 | constexpr int DPT = 1; | ||
| 24 | constexpr int RH = 2; | ||
| 25 | constexpr int EGH = 3; | ||
| 26 | constexpr int EB = 4; | ||
| 27 | constexpr int ED = 5; | ||
| 28 | constexpr int WSPD = 6; | ||
| 29 | |||
| 30 | class EpwData | ||
| 31 | { | ||
| 32 | public: | ||
| 33 | EpwData(const openstudio::path& t_path); | ||
| 34 | |||
| 35 | std::string location() const { | ||
| 36 | return m_location; | ||
| 37 | } | ||
| 38 | std::string stationid() const { | ||
| 39 | return m_stationid; | ||
| 40 | } | ||
| 41 | 3 | int timezone() const { | |
| 42 | 3 | return m_timezone; | |
| 43 | } | ||
| 44 | 3 | double latitude() const { | |
| 45 | 3 | return m_latitude; | |
| 46 | } | ||
| 47 | 3 | double longitude() const { | |
| 48 | 3 | return m_longitude; | |
| 49 | } | ||
| 50 | 6 | const std::vector<std::vector<double>>& data() const { | |
| 51 | 6 | return m_data; | |
| 52 | } | ||
| 53 | |||
| 54 | std::string toISOData() const; | ||
| 55 | void toISOData(Matrix& _msolar, Matrix& _mhdbt, Matrix& _mhEgh, Vector& _mEgh, Vector& _mdbt, Vector& _mwind) const; | ||
| 56 | |||
| 57 | protected: | ||
| 58 | void loadData(const openstudio::path& t_path); | ||
| 59 | void parseHeader(const std::string& line); | ||
| 60 | void parseData(const std::string& line, size_t row); | ||
| 61 | std::string m_location, m_stationid; | ||
| 62 | int m_timezone; | ||
| 63 | double m_latitude, m_longitude; | ||
| 64 | std::vector<std::vector<double>> m_data; | ||
| 65 | }; | ||
| 66 | |||
| 67 | } // namespace isomodel | ||
| 68 | } // namespace openstudio | ||
| 69 | |||
| 70 | #endif // ISOMODEL_EPWDATA_HPP | ||
| 71 |