diff --git a/src/libcode/vx_tc_util/diag_file.cc b/src/libcode/vx_tc_util/diag_file.cc index e7d501dd99..d98d14125a 100644 --- a/src/libcode/vx_tc_util/diag_file.cc +++ b/src/libcode/vx_tc_util/diag_file.cc @@ -157,6 +157,15 @@ DiagFile & DiagFile::operator=(const DiagFile &) { void DiagFile::init_from_scratch() { + clear(); + + return; +} + +//////////////////////////////////////////////////////////////////////// + +void DiagFile::clear() { + // Initialize values FileType = DiagFileType_None; StormId.clear(); @@ -181,16 +190,19 @@ void DiagFile::init_from_scratch() { void DiagFile::set_technique(const StringArray &sa) { - Technique = sa; + for(int i=0; i " << "the number of \"" << cs << "\" diagnostic values (" << data.n() << ") does not match the expected number (" - << NTime << ")!\n\n"; + << NTime << "): " << path << "\n\n"; exit(1); } // Store the name and values @@ -346,12 +362,15 @@ void DiagFile::read_lsdiag(const ConcatString &path, const StringArray &model_na NumArray data; const UserFunc_1Arg *fx_ptr = 0; + // Initialize + clear(); + // Store the file type FileType = LSDiagFileType; // Store user-specified model names or the default one if(model_names.n() > 0) set_technique(model_names); - else Technique.add(default_lsdiag_technique); + else add_technique(default_lsdiag_technique); // Open the file open(path.c_str()); @@ -368,7 +387,7 @@ void DiagFile::read_lsdiag(const ConcatString &path, const StringArray &model_na // Check for the expected number of items if(dl.n_items() != 9 || strncasecmp(dl[8], "HEAD", strlen("HEAD") != 0)) { mlog << Error << "\nDiagFile::open_lsdiag() -> " - << "unexpected header line in file: " << path << "\n\n"; + << "unexpected header line: " << path << "\n\n"; exit(1); } diff --git a/src/libcode/vx_tc_util/diag_file.h b/src/libcode/vx_tc_util/diag_file.h index d3785f9d69..02b47a9bc0 100644 --- a/src/libcode/vx_tc_util/diag_file.h +++ b/src/libcode/vx_tc_util/diag_file.h @@ -86,11 +86,14 @@ class DiagFile : public LineDataFile { DiagFile(); ~DiagFile(); + void clear(); + // // set stuff // void set_technique(const StringArray &); + void add_technique(const std::string &); // // get stuff