Skip to content

Commit

Permalink
Prevent lexical cast error. Refs #8317.
Browse files Browse the repository at this point in the history
- Now I check to see if left (start) or right (end) runs are input. I then infer either side that is not. I use ± 100 as using larger values (e.g. 1k) results in poor performance.
- Increased size of run-range input field.
  • Loading branch information
jawrainey committed Oct 31, 2013
1 parent 01d0f4a commit 8685cf8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
23 changes: 21 additions & 2 deletions Code/Mantid/Framework/ICat/src/CatalogSearch.cpp
Expand Up @@ -143,8 +143,27 @@ namespace Mantid
// Has the user input a runRange?
if (!runRange.empty())
{
params.setRunStart(boost::lexical_cast<double>(runNumbers.at(0)));
params.setRunEnd( boost::lexical_cast<double>(runNumbers.at(1)));
double leftSide, rightSide;
if (!runNumbers.at(0).empty())
{
leftSide = boost::lexical_cast<double>(runNumbers.at(0));
}
else if (runNumbers.at(0).empty() && !runNumbers.at(1).empty())
{
leftSide = boost::lexical_cast<double>(runNumbers.at(1)) - 100;
}

if (!runNumbers.at(1).empty())
{
rightSide = boost::lexical_cast<double>(runNumbers.at(1));
}
else if (runNumbers.at(1).empty() && !runNumbers.at(0).empty())
{
rightSide = boost::lexical_cast<double>(runNumbers.at(0)) + 100;
}

params.setRunStart(leftSide);
params.setRunEnd(rightSide);
}

std::string instrument = getPropertyValue("Instrument");
Expand Down
Expand Up @@ -421,8 +421,11 @@
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="RunRange">
<property name="inputMethodHints">
<set>Qt::ImhDigitsOnly</set>
</property>
<property name="inputMask">
<string>99999-99999; </string>
<string>999999-999999; </string>
</property>
<property name="text">
<string>-</string>
Expand Down

0 comments on commit 8685cf8

Please sign in to comment.