diff --git a/met/src/libcode/vx_tc_util/prob_gen_info.cc b/met/src/libcode/vx_tc_util/prob_gen_info.cc index e292ce897a..77ef2b9007 100644 --- a/met/src/libcode/vx_tc_util/prob_gen_info.cc +++ b/met/src/libcode/vx_tc_util/prob_gen_info.cc @@ -79,6 +79,8 @@ void ProbGenInfo::clear() { GenOrDis.clear(); GenTime = (unixtime) 0; + BestGen = (const GenesisInfo *) 0; + return; } @@ -92,6 +94,7 @@ void ProbGenInfo::dump(ostream &out, int indent_depth) const { out << prefix << "Initials = \"" << Initials.contents() << "\"\n"; out << prefix << "GenOrDis = \"" << GenOrDis.contents() << "\"\n"; out << prefix << "GenTime = " << unix_to_yyyymmdd_hhmmss(GenTime) << "\n"; + out << prefix << "BestGen = " << (BestGen ? "set" : "(nul)") << "\n"; out << flush; @@ -108,7 +111,8 @@ ConcatString ProbGenInfo::serialize() const { << ", ProbGenInfo: " << "Initials = \"" << Initials << "\"" << ", GenOrDis = \"" << GenOrDis << "\"" - << ", GenTime = " << unix_to_yyyymmdd_hhmmss(GenTime) << "\n"; + << ", GenTime = " << unix_to_yyyymmdd_hhmmss(GenTime) + << ", BestGen = " << (BestGen ? "set" : "(nul)") << "\n"; return(s); } @@ -135,6 +139,17 @@ void ProbGenInfo::assign(const ProbGenInfo &p) { GenOrDis = p.GenOrDis; GenTime = p.GenTime; + BestGen = p.BestGen; + + return; +} + +//////////////////////////////////////////////////////////////////////// + +void ProbGenInfo::set_best_gen(const GenesisInfo *bg) { + + BestGen = bg; + return; } @@ -146,14 +161,16 @@ void ProbGenInfo::initialize(const ATCFProbLine &l, double dland) { ProbInfoBase::initialize(l, dland); - Initials = l.get_item(ProbGenInitialsOffset); - GenOrDis = l.get_item(ProbGenOrDisOffset); + Initials = l.get_item(ProbGenInitialsOffset); + GenOrDis = l.get_item(ProbGenOrDisOffset); // Store an empty string as unixtime 0 GenTime = (l.get_item(ProbGenTimeOffset).empty() ? (unixtime) 0 : parse_time(l.get_item(ProbGenTimeOffset).c_str())); + BestGen = (const GenesisInfo *) 0; + return; } diff --git a/met/src/libcode/vx_tc_util/prob_gen_info.h b/met/src/libcode/vx_tc_util/prob_gen_info.h index 49a6534ea1..7ee0d75eb8 100644 --- a/met/src/libcode/vx_tc_util/prob_gen_info.h +++ b/met/src/libcode/vx_tc_util/prob_gen_info.h @@ -38,6 +38,9 @@ class ProbGenInfo : public ProbInfoBase { ConcatString GenOrDis; unixtime GenTime; + // Pointer to the matching BEST genesis event + const GenesisInfo * BestGen; + public: ProbGenInfo(); @@ -55,6 +58,8 @@ class ProbGenInfo : public ProbInfoBase { // set stuff // + void set_best_gen(const GenesisInfo *); + // // get stuff // @@ -62,6 +67,7 @@ class ProbGenInfo : public ProbInfoBase { const ConcatString & initials() const; const ConcatString & gen_or_dis() const; unixtime gen_time() const; + const GenesisInfo * best_gen() const; // // do stuff @@ -83,6 +89,7 @@ class ProbGenInfo : public ProbInfoBase { inline const ConcatString & ProbGenInfo::initials() const { return(Initials); } inline const ConcatString & ProbGenInfo::gen_or_dis() const { return(GenOrDis); } inline unixtime ProbGenInfo::gen_time() const { return(GenTime); } +inline const GenesisInfo * ProbGenInfo::best_gen() const { return(BestGen); } ////////////////////////////////////////////////////////////////////////