From bf190b6d2243e1f3af3332f290f63ae8be4119a3 Mon Sep 17 00:00:00 2001 From: Phil Ahrenkiel Date: Mon, 20 Nov 2023 09:08:15 -0700 Subject: [PATCH] Separate version control. --- src/CMakeLists.txt | 1 + src/HPWH.cc | 11 ----------- src/HPWHversion.cc | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 src/HPWHversion.cc diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b1de19e1..115a45f2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -18,6 +18,7 @@ set(headers ) set(source + HPWHversion.cc HPWH.cc HPWHHeatSources.cc HPWHHeatingLogics.cc diff --git a/src/HPWH.cc b/src/HPWH.cc index 3a709c34..6e2ead4e 100644 --- a/src/HPWH.cc +++ b/src/HPWH.cc @@ -167,9 +167,6 @@ void HPWH::setMinutesPerStep(const double minutesPerStep_in) hoursPerStep = minutesPerStep / 60.0; }; -//ugh, this should be in the header -const std::string HPWH::version_maint = HPWHVRSN_META; - // public HPWH functions HPWH::HPWH(): messageCallback(NULL),messageCallbackContextPtr(NULL),hpwhVerbosity(VRB_silent) { @@ -269,14 +266,6 @@ HPWH & HPWH::operator=(const HPWH &hpwh) { HPWH::~HPWH() { } -string HPWH::getVersion() { - std::stringstream version; - - version << version_major << '.' << version_minor << '.' << version_patch << version_maint; - - return version.str(); -} - int HPWH::runOneStep(double drawVolume_L, double tankAmbientT_C,double heatSourceAmbientT_C, DRMODES DRstatus, diff --git a/src/HPWHversion.cc b/src/HPWHversion.cc new file mode 100644 index 00000000..7bba6197 --- /dev/null +++ b/src/HPWHversion.cc @@ -0,0 +1,17 @@ +/* +* Version control +*/ + +#include "HPWHVersion.hh" +#include "HPWH.hh" + +//ugh, this should be in the header +const std::string HPWH::version_maint = HPWHVRSN_META; + +std::string HPWH::getVersion() { + std::stringstream version; + + version << version_major << '.' << version_minor << '.' << version_patch << version_maint; + + return version.str(); +}