Skip to content

Commit

Permalink
Add methods for defaulted and reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-robertson committed Oct 27, 2023
1 parent c4d2572 commit 6451066
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/model/ScheduleFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ namespace model {
return openstudio::istringEqual(value.get(), "Yes");
}

bool ScheduleFile_Impl::isTranslateFileNameDefaulted() const {
return isEmpty(OS_Schedule_FileFields::TranslateFileName);
}

/* FIXME!
openstudio::TimeSeries ScheduleFile_Impl::timeSeries(unsigned columnIndex) const
{
Expand Down Expand Up @@ -393,6 +397,11 @@ namespace model {
return result;
}

void ScheduleFile_Impl::resetTranslateFileName() {
const bool result = setString(OS_Schedule_FileFields::TranslateFileName, "");
OS_ASSERT(result);
}

} // namespace detail

ScheduleFile::ScheduleFile(const ExternalFile& externalfile, int column, int rowsToSkip)
Expand Down Expand Up @@ -498,6 +507,10 @@ namespace model {
return getImpl<detail::ScheduleFile_Impl>()->translateFileName();
}

bool ScheduleFile::isTranslateFileNameDefaulted() const {
return getImpl<detail::ScheduleFile_Impl>()->isTranslateFileNameDefaulted();
}

/* FIXME!
openstudio::TimeSeries ScheduleFile::timeSeries(unsigned columnIndex) const {
return getImpl<detail::ScheduleFile_Impl>()->timeSeries(columnIndex);
Expand Down Expand Up @@ -576,6 +589,10 @@ unsigned ScheduleFile::addTimeSeries(const openstudio::TimeSeries& timeSeries) {
return getImpl<detail::ScheduleFile_Impl>()->setTranslateFileName(translateFileName);
}

void ScheduleFile::resetTranslateFileName() {
getImpl<detail::ScheduleFile_Impl>()->resetTranslateFileName();
}

/// @cond
ScheduleFile::ScheduleFile(std::shared_ptr<detail::ScheduleFile_Impl> impl) : ScheduleInterval(std::move(impl)) {}
/// @endcond
Expand Down
4 changes: 4 additions & 0 deletions src/model/ScheduleFile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ namespace model {

bool translateFileName() const;

bool isTranslateFileNameDefaulted() const;

//@}
/** @name Setters */
//@{
Expand Down Expand Up @@ -124,6 +126,8 @@ namespace model {

bool setTranslateFileName(bool translateFileName);

void resetTranslateFileName();

//@}
/** @name Other */
//@{
Expand Down
4 changes: 4 additions & 0 deletions src/model/ScheduleFile_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ namespace model {

bool translateFileName() const;

bool isTranslateFileNameDefaulted() const;

//@}
/** @name Setters */
//@{
Expand Down Expand Up @@ -125,6 +127,8 @@ namespace model {

bool setTranslateFileName(bool translateFileName);

void resetTranslateFileName();

//@}
/** @name Other */
//@{
Expand Down

0 comments on commit 6451066

Please sign in to comment.