@@ -81,16 +81,23 @@ void SpecFile::load_cnf_using_reader( CAMInputOutput::CAMIO &reader )
81
81
meas->title_ = sampleid;
82
82
if ( sampleid.size () )
83
83
meas->remarks_ .push_back ( " Sample ID: " + sampleid );
84
- }catch ( std::exception &e )
84
+ }catch ( std::exception & )
85
85
{
86
86
// Will get here if no sample title
87
87
}
88
88
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
+
94
101
meas->sample_number_ = 1 ;
95
102
96
103
// set the energy calibration
@@ -193,7 +200,7 @@ void SpecFile::load_cnf_using_reader( CAMInputOutput::CAMIO &reader )
193
200
{
194
201
result.activity_ = activity;
195
202
result.nuclide_ = cam_results[i].Name ;
196
- result.real_time_ = real_time ;
203
+ result.real_time_ = meas-> real_time_ ;
197
204
result.detector_ = det_name;
198
205
199
206
new_det_ana->results_ .push_back (result);
@@ -241,7 +248,7 @@ bool SpecFile::load_from_cnf( std::istream &input )
241
248
cleanup_after_load ();
242
249
}catch ( std::exception &e )
243
250
{
244
- cerr << " Failed CNF: " << e.what () << endl;
251
+ // cerr << "Failed CNF: " << e.what() << endl;
245
252
input.clear ();
246
253
// input.seekg( orig_pos, ios::beg );
247
254
0 commit comments