mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4377 Octave : Use RiaLogging for error messages instead of QErrorMessage
This commit is contained in:
@@ -47,8 +47,6 @@
|
||||
#include "RiuProcessMonitor.h"
|
||||
#include "Riu3dSelectionManager.h"
|
||||
|
||||
#include <QErrorMessage>
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -85,7 +83,7 @@ public:
|
||||
|
||||
if (scalarResultFrames == nullptr)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n")
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n")
|
||||
+ RiaSocketServer::tr("Could not find the %1 model property named: \"%2\"").arg(porosityModelName).arg(propertyName));
|
||||
}
|
||||
|
||||
@@ -130,7 +128,7 @@ public:
|
||||
|
||||
if (timeStepReadError)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetActiveCellProperty : \n") + RiaSocketServer::tr("An error occured while interpreting the requested timesteps."));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetActiveCellProperty : \n") + RiaSocketServer::tr("An error occured while interpreting the requested timesteps."));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -228,7 +226,7 @@ public:
|
||||
RimEclipseCase*rimCase = server->findReservoir(caseId);
|
||||
if (rimCase == nullptr)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the case with ID: \"%1\"").arg(caseId));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the case with ID: \"%1\"").arg(caseId));
|
||||
|
||||
// No data available
|
||||
socketStream << (quint64)0 << (quint64)0 << (quint64)0 << (quint64)0 ;
|
||||
@@ -247,7 +245,7 @@ public:
|
||||
|
||||
if (gridIdx < 0 || rimCase->eclipseCaseData()->gridCount() <= (size_t)gridIdx)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage("ResInsight SocketServer: riGetGridProperty : \n"
|
||||
server->showErrorMessage("ResInsight SocketServer: riGetGridProperty : \n"
|
||||
"The gridIndex \"" + QString::number(gridIdx) + "\" does not point to an existing grid." );
|
||||
}
|
||||
else
|
||||
@@ -261,7 +259,7 @@ public:
|
||||
|
||||
if (!isResultsLoaded)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the %1 model property named: \"%2\"").arg(porosityModelName).arg(propertyName));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the %1 model property named: \"%2\"").arg(porosityModelName).arg(propertyName));
|
||||
|
||||
// No data available
|
||||
socketStream << (quint64)0 << (quint64)0 << (quint64)0 << (quint64)0 ;
|
||||
@@ -301,7 +299,7 @@ public:
|
||||
|
||||
if (timeStepReadError)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetGridProperty : \n")
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetGridProperty : \n")
|
||||
+ RiaSocketServer::tr("An error occured while interpreting the requested timesteps."));
|
||||
}
|
||||
|
||||
@@ -432,7 +430,7 @@ public:
|
||||
|
||||
if (scalarResultFrames == nullptr)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the %1 model property named: \"%2\"").arg(porosityModelName).arg(propertyName));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the %1 model property named: \"%2\"").arg(porosityModelName).arg(propertyName));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -481,14 +479,14 @@ public:
|
||||
|
||||
if (timeStepReadError)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetActiveCellProperty : \n") + RiaSocketServer::tr("An error occured while interpreting the requested timesteps."));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetActiveCellProperty : \n") + RiaSocketServer::tr("An error occured while interpreting the requested timesteps."));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (! m_requestedTimesteps.size())
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("No time steps specified").arg(porosityModelName).arg(propertyName));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("No time steps specified").arg(porosityModelName).arg(propertyName));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -536,7 +534,7 @@ public:
|
||||
|
||||
if (cellCountFromOctave != activeCellCountReservoir )
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
||||
RiaSocketServer::tr("The number of cells in the data coming from octave does not match the case") + ":\"" + m_currentReservoir->caseUserDescription() + "\"\n"
|
||||
" Octave: " + QString::number(cellCountFromOctave) + "\n"
|
||||
" " + m_currentReservoir->caseUserDescription() + ": Active cell count: " + QString::number(activeCellCountReservoir) + " Total cell count: " + QString::number(totalCellCount)) ;
|
||||
@@ -600,7 +598,7 @@ public:
|
||||
{
|
||||
for (int i = 0; i < errorMessages.size(); i++)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(errorMessages[i]);
|
||||
server->showErrorMessage(errorMessages[i]);
|
||||
}
|
||||
|
||||
currentClient->abort();
|
||||
@@ -740,7 +738,7 @@ public:
|
||||
RimEclipseCase* rimCase = server->findReservoir(caseId);
|
||||
if (!rimCase)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the case with ID : \"%1\"").arg(caseId));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the case with ID : \"%1\"").arg(caseId));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -757,7 +755,7 @@ public:
|
||||
RigGridBase* grid = rimCase->eclipseCaseData()->grid(m_currentGridIndex);
|
||||
if (!grid)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the grid index : %1").arg(m_currentGridIndex));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the grid index : %1").arg(m_currentGridIndex));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -779,7 +777,7 @@ public:
|
||||
grid->cellCountJ() != cellCountJ ||
|
||||
grid->cellCountK() != cellCountK)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Destination grid size do not match incoming grid size for grid index : %1").arg(m_currentGridIndex));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Destination grid size do not match incoming grid size for grid index : %1").arg(m_currentGridIndex));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -788,7 +786,7 @@ public:
|
||||
|
||||
if (m_timeStepCountToRead == 0 || m_bytesPerTimeStepToRead == 0)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
||||
RiaSocketServer::tr("Zero data to read for ") + ":\"" + m_currentReservoir->caseUserDescription() + "\"\n");
|
||||
|
||||
return true;
|
||||
@@ -816,7 +814,7 @@ public:
|
||||
|
||||
if (scalarResultFrames == nullptr)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the %1 model property named: \"%2\"").arg(porosityModelName).arg(propertyName));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the %1 model property named: \"%2\"").arg(porosityModelName).arg(propertyName));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -852,7 +850,7 @@ public:
|
||||
|
||||
if (timeStepReadError)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetActiveCellProperty : \n") + RiaSocketServer::tr("An error occured while interpreting the requested timesteps."));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetActiveCellProperty : \n") + RiaSocketServer::tr("An error occured while interpreting the requested timesteps."));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -860,7 +858,7 @@ public:
|
||||
|
||||
if (! m_requestedTimesteps.size())
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("No time steps specified").arg(porosityModelName).arg(propertyName));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("No time steps specified").arg(porosityModelName).arg(propertyName));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -893,7 +891,7 @@ public:
|
||||
RigGridBase* grid = m_currentReservoir->eclipseCaseData()->grid(m_currentGridIndex);
|
||||
if (!grid)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
||||
RiaSocketServer::tr("No grid found") + ":\"" + m_currentReservoir->caseUserDescription() + "\"\n");
|
||||
|
||||
m_invalidDataDetected = true;
|
||||
@@ -914,7 +912,7 @@ public:
|
||||
|
||||
if (cellCountFromOctave != grid->cellCount())
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
||||
RiaSocketServer::tr("Mismatch between expected and received data. Expected : %1, Received : %2").arg(grid->cellCount()).arg(cellCountFromOctave));
|
||||
|
||||
m_invalidDataDetected = true;
|
||||
@@ -965,7 +963,7 @@ public:
|
||||
{
|
||||
for (int i = 0; i < errorMessages.size(); i++)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(errorMessages[i]);
|
||||
server->showErrorMessage(errorMessages[i]);
|
||||
}
|
||||
|
||||
currentClient->abort();
|
||||
@@ -1093,7 +1091,7 @@ public:
|
||||
RimEclipseCase* rimCase = server->findReservoir(caseId);
|
||||
if (!rimCase)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the case with ID : \"%1\"").arg(caseId));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the case with ID : \"%1\"").arg(caseId));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1225,7 +1223,7 @@ public:
|
||||
|
||||
if (timeStepReadError)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetGridProperty : \n")
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetGridProperty : \n")
|
||||
+ RiaSocketServer::tr("An error occurred while interpreting the requested time steps."));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user