@@ -81,16 +81,23 @@ void SpecFile::load_cnf_using_reader( CAMInputOutput::CAMIO &reader )
8181 meas->title_ = sampleid;
8282 if ( sampleid.size () )
8383 meas->remarks_ .push_back ( " Sample ID: " + sampleid );
84- }catch ( std::exception &e )
84+ }catch ( std::exception & )
8585 {
8686 // Will get here if no sample title
8787 }
8888
89- // get the times
90- meas->start_time_ = reader.GetAquisitionTime ();
91- float real_time = reader.GetRealTime ();
92- meas->real_time_ = real_time;
93- meas->live_time_ = reader.GetLiveTime ();
89+
90+ try
91+ {
92+ // Get the times - they are all in the same datablock, so if one throws, they will all throw.
93+ meas->start_time_ = reader.GetAquisitionTime ();
94+ meas->real_time_ = reader.GetRealTime ();
95+ meas->live_time_ = reader.GetLiveTime ();
96+ }catch ( std::exception &e )
97+ {
98+ // Will get here if no time block
99+ }
100+
94101 meas->sample_number_ = 1 ;
95102
96103 // set the energy calibration
@@ -193,7 +200,7 @@ void SpecFile::load_cnf_using_reader( CAMInputOutput::CAMIO &reader )
193200 {
194201 result.activity_ = activity;
195202 result.nuclide_ = cam_results[i].Name ;
196- result.real_time_ = real_time ;
203+ result.real_time_ = meas-> real_time_ ;
197204 result.detector_ = det_name;
198205
199206 new_det_ana->results_ .push_back (result);
@@ -241,7 +248,7 @@ bool SpecFile::load_from_cnf( std::istream &input )
241248 cleanup_after_load ();
242249 }catch ( std::exception &e )
243250 {
244- cerr << " Failed CNF: " << e.what () << endl;
251+ // cerr << "Failed CNF: " << e.what() << endl;
245252 input.clear ();
246253 // input.seekg( orig_pos, ios::beg );
247254
0 commit comments