Skip to content

Commit

Permalink
Refs #4514. Fix case sensitive issues with the Result Table tab.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Whitley committed Jan 16, 2012
1 parent 16ad145 commit ab6bcb6
Showing 1 changed file with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,29 @@ void MuonAnalysisResultTableTab::populateTables(const QStringList& wsList)
// Get all the workspaces from the fitPropertyBrowser and find out whether they have had fitting done to them.
for (int i(0); i<wsList.size(); ++i)
{
if((Mantid::API::AnalysisDataService::Instance().doesExist(wsList[i].toStdString() + "_parameters"))&&(Mantid::API::AnalysisDataService::Instance().doesExist(wsList[i].toStdString())))
if((Mantid::API::AnalysisDataService::Instance().doesExist(wsList[i].toStdString() + "_Parameters"))&&(Mantid::API::AnalysisDataService::Instance().doesExist(wsList[i].toStdString())))
fittedWsList.append(wsList[i]);
}

// Make sure all params match.
QVector<QString> sameFittedWsList(getWorkspacesWithSameParams(fittedWsList));

// Populate the individual log values and fittings into their respective tables.
populateFittings(sameFittedWsList);
populateLogsAndValues(sameFittedWsList);
if(fittedWsList.size() > 0)
{
// Make sure all params match.
QVector<QString> sameFittedWsList(getWorkspacesWithSameParams(fittedWsList));

// Populate the individual log values and fittings into their respective tables.
populateFittings(sameFittedWsList);
populateLogsAndValues(sameFittedWsList);

QTableWidgetItem* temp = static_cast<QTableWidgetItem*>(m_uiForm.valueTable->item(0,0));
// If there is no item in the first row then there must be no log files found between the two data sets.
if (temp == NULL)
QTableWidgetItem* temp = static_cast<QTableWidgetItem*>(m_uiForm.valueTable->item(0,0));
// If there is no item in the first row then there must be no log files found between the two data sets.
if (temp == NULL)
{
QMessageBox::information(this, "Mantid - Muon Analysis", "There were no common log files found.");
}
}
else
{
QMessageBox::information(this, "Mantid - Muon Analysis", "There were no common log files found.");
QMessageBox::information(this, "Mantid - Muon Analysis", "A fitting must be made on the Data Analysis tab before producing a Results Table.");
}
}

Expand Down Expand Up @@ -329,7 +336,7 @@ void MuonAnalysisResultTableTab::createTable()
for(int i=0; i<wsSelected.size(); ++i)
{
QMap<QString, double> paramsList;
Mantid::API::ITableWorkspace_sptr paramWs = boost::dynamic_pointer_cast<Mantid::API::ITableWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve(wsSelected[i].toStdString() + "_parameters") );
Mantid::API::ITableWorkspace_sptr paramWs = boost::dynamic_pointer_cast<Mantid::API::ITableWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve(wsSelected[i].toStdString() + "_Parameters") );

Mantid::API::TableRow paramRow = paramWs->getFirstRow();

Expand Down Expand Up @@ -451,7 +458,7 @@ QVector<QString> MuonAnalysisResultTableTab::getWorkspacesWithSameParams(const Q
std::vector<std::string> firstParams;

// Find the first parameter table and use this as a comparison for all the other tables.
Mantid::API::ITableWorkspace_sptr paramWs = boost::dynamic_pointer_cast<Mantid::API::ITableWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve(fittedWsList[0].toStdString() + "_parameters") );
Mantid::API::ITableWorkspace_sptr paramWs = boost::dynamic_pointer_cast<Mantid::API::ITableWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve(fittedWsList[0].toStdString() + "_Parameters") );

Mantid::API::TableRow paramRow = paramWs->getFirstRow();
do
Expand All @@ -468,7 +475,7 @@ QVector<QString> MuonAnalysisResultTableTab::getWorkspacesWithSameParams(const Q
for (int i=1; i<fittedWsList.size(); ++i)
{
std::vector<std::string> nextParams;
Mantid::API::ITableWorkspace_sptr paramWs = boost::dynamic_pointer_cast<Mantid::API::ITableWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve(fittedWsList[i].toStdString() + "_parameters") );
Mantid::API::ITableWorkspace_sptr paramWs = boost::dynamic_pointer_cast<Mantid::API::ITableWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve(fittedWsList[i].toStdString() + "_Parameters") );

Mantid::API::TableRow paramRow = paramWs->getFirstRow();
do
Expand Down Expand Up @@ -518,7 +525,7 @@ std::string MuonAnalysisResultTableTab::getFileName()
if (Mantid::API::AnalysisDataService::Instance().doesExist(fileName))
{
int choice = QMessageBox::question(this, tr("MantidPlot - Overwrite Warning"), QString::fromStdString(fileName) +
tr("already exists. Do you want to replace it?"),
tr(" already exists. Do you want to replace it?"),
QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape);
if (choice == QMessageBox::No)
{
Expand Down

0 comments on commit ab6bcb6

Please sign in to comment.