Skip to content

Commit

Permalink
Per #1694, add VarInfo::magic_str_attr() to construct a field summary…
Browse files Browse the repository at this point in the history
… string from the name_attr() and level_attr() functions.
  • Loading branch information
JohnHalleyGotway committed Mar 4, 2021
1 parent 23dc482 commit 9c9c54c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions met/src/libcode/vx_data2d/var_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,19 @@ void VarInfo::set_magic(const ConcatString &nstr, const ConcatString &lstr) {

///////////////////////////////////////////////////////////////////////////////

ConcatString VarInfo::magic_str_attr() const {
ConcatString mstr(name_attr());
ConcatString lstr(level_attr());

// Format as {name}/{level} or {name}{level}
if(lstr.nonempty() && lstr[0] != '(') mstr << "/";
mstr << lstr;

return(mstr);
}

///////////////////////////////////////////////////////////////////////////////

void VarInfo::set_dict(Dictionary &dict) {
ThreshArray ta;
NumArray na;
Expand Down
1 change: 1 addition & 0 deletions met/src/libcode/vx_data2d/var_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ class VarInfo

RegridInfo regrid() const;

ConcatString magic_str_attr() const;
ConcatString name_attr() const;
ConcatString units_attr() const;
ConcatString level_attr() const;
Expand Down

0 comments on commit 9c9c54c

Please sign in to comment.