| 2737 | } |
| 2738 | |
| 2739 | std::vector<EpwDataPoint> EpwFile::data() { |
| 2740 | if (m_data.empty()) { |
| 2741 | if (!openstudio::filesystem::exists(m_path) || !openstudio::filesystem::is_regular_file(m_path)) { |
| 2742 | LOG_AND_THROW("Path '" << m_path << "' is not an EPW file"); |
| 2743 | } |
| 2744 | |
| 2745 | // set checksum |
| 2746 | m_checksum = openstudio::checksum(m_path); |
| 2747 | |
| 2748 | // open file |
| 2749 | std::ifstream ifs(openstudio::toSystemFilename(m_path)); |
| 2750 | |
| 2751 | if (!parse(ifs, true)) { |
| 2752 | ifs.close(); |
| 2753 | LOG(Error, "EpwFile '" << toString(m_path) << "' cannot be processed"); |
| 2754 | } else { |
| 2755 | ifs.close(); |
| 2756 | } |
| 2757 | } |
| 2758 | return m_data; |
| 2759 | } |
| 2760 | |
| 2761 | std::string EpwDesignCondition::titleOfDesignCondition() const { |
| 2762 | return m_titleOfDesignCondition; |