Skip to content

Commit

Permalink
Re #6421. Catch exception if run start time property is missing.
Browse files Browse the repository at this point in the history
Use absolute times when displaying the log instead.
  • Loading branch information
RussellTaylor committed Jan 24, 2013
1 parent 63ff17e commit ec3573b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp
Expand Up @@ -2421,9 +2421,17 @@ void MantidUI::importNumSeriesLog(const QString &wsName, const QString &logname,

//Get the starting time of the log.
Mantid::Kernel::DateAndTime startTime;
//Toggle to switch between using the real date or the change in seconds.
bool useAbsoluteDate = false;

if (!time_value_map.empty())
{
startTime = ws->run().startTime();
try {
startTime = ws->run().startTime();
} catch (std::runtime_error&) {
// This means the start time is missing, use absolute times instead
useAbsoluteDate = true;
}
}

//Make a unique title, and put in the start time of the log
Expand All @@ -2434,9 +2442,6 @@ void MantidUI::importNumSeriesLog(const QString &wsName, const QString &logname,
t->setReadOnlyColumn(0, true);
t->setReadOnlyColumn(1, true);

//Toggle to switch between using the real date or the change in seconds.
bool useAbsoluteDate = false;

if (useAbsoluteDate)
{
// --------- Date
Expand Down

0 comments on commit ec3573b

Please sign in to comment.