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:
parent
950458455d
commit
f758a8edb2
@ -221,8 +221,6 @@ RiaApplication::RiaApplication(int& argc, char** argv)
|
||||
|
||||
setWindowIcon(QIcon(":/AppLogo48x48.png"));
|
||||
|
||||
m_socketServer = new RiaSocketServer(this);
|
||||
|
||||
#ifdef WIN32
|
||||
m_startupDefaultDirectory = QDir::homePath();
|
||||
#else
|
||||
@ -240,6 +238,8 @@ RiaApplication::RiaApplication(int& argc, char** argv)
|
||||
|
||||
RiaLogging::setLoggerInstance(new RiuMessagePanelLogger(m_mainWindow->messagePanel()));
|
||||
RiaLogging::loggerInstance()->setLevel(RI_LL_DEBUG);
|
||||
|
||||
m_socketServer = new RiaSocketServer(this);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -44,7 +44,6 @@
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
|
||||
#include <QTcpSocket>
|
||||
#include <QErrorMessage>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -148,7 +147,7 @@ public:
|
||||
|
||||
if (timeStepReadError)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetDynamicNNCValues : \n") + RiaSocketServer::tr("An error occurred while interpreting the requested time steps."));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetDynamicNNCValues : \n") + RiaSocketServer::tr("An error occurred while interpreting the requested time steps."));
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -319,7 +318,7 @@ public:
|
||||
if (!(rimCase && rimCase->eclipseCaseData() && rimCase->eclipseCaseData()->mainGrid()))
|
||||
{
|
||||
QString caseId = args[1];
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find case with id %1").arg(caseId));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find case with id %1").arg(caseId));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -347,7 +346,7 @@ public:
|
||||
bool ok = createIJKCellResults(rimCase->results(m_porosityModelEnum), propertyName);
|
||||
if (!ok)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the property named: \"%2\"").arg(propertyName));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the property named: \"%2\"").arg(propertyName));
|
||||
return true;
|
||||
}
|
||||
RigEclipseResultAddress resAddr(QString("%1IJK").arg(propertyName));
|
||||
@ -386,7 +385,7 @@ public:
|
||||
|
||||
if (timeStepReadError)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: riSetNNCProperty : \n") +
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: riSetNNCProperty : \n") +
|
||||
RiaSocketServer::tr("An error occurred while interpreting the requested time steps."));
|
||||
}
|
||||
|
||||
@ -394,7 +393,7 @@ public:
|
||||
|
||||
if (! m_requestedTimesteps.size())
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("No time steps specified"));
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("No time steps specified"));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -466,7 +465,7 @@ public:
|
||||
|
||||
if (connectionCountFromOctave != connectionCount)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
||||
server->showErrorMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
||||
RiaSocketServer::tr("The number of connections in the data coming from octave does not match the case: '%1'\n").arg(m_currentReservoir->caseUserDescription()) +
|
||||
RiaSocketServer::tr(" Octave: %1\n").arg(connectionCountFromOctave) +
|
||||
RiaSocketServer::tr(" %1: Connection count: %2").arg(m_currentReservoir->caseUserDescription()).arg(connectionCount));
|
||||
@ -499,7 +498,7 @@ public:
|
||||
{
|
||||
for (int i = 0; i < errorMessages.size(); i++)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(errorMessages[i]);
|
||||
server->showErrorMessage(errorMessages[i]);
|
||||
}
|
||||
|
||||
currentClient->abort();
|
||||
|
@ -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."));
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "RiaSocketCommand.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
@ -35,7 +36,6 @@
|
||||
#include "cafFactory.h"
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QtWidgets/qerrormessage.h>
|
||||
#include <QtWidgets/qmdisubwindow.h>
|
||||
#else
|
||||
#include <QtGui>
|
||||
@ -56,8 +56,6 @@ RiaSocketServer::RiaSocketServer(QObject* parent)
|
||||
m_currentCommand(nullptr),
|
||||
m_currentCaseId(-1)
|
||||
{
|
||||
m_errorMessageDialog = new QErrorMessage(RiuMainWindow::instance());
|
||||
|
||||
// TCP server setup
|
||||
|
||||
m_tcpServer = new QTcpServer(this);
|
||||
@ -68,17 +66,16 @@ RiaSocketServer::RiaSocketServer(QObject* parent)
|
||||
|
||||
if (!m_tcpServer->listen(QHostAddress::LocalHost, 40001))
|
||||
{
|
||||
if (RiaApplication::instance()->preferences()->showOctaveCommunicationWarning())
|
||||
{
|
||||
m_errorMessageDialog->showMessage("Octave communication disabled :\n"
|
||||
"\n"
|
||||
"This instance of ResInsight could not start the Socket Server enabling octave to get and set data.\n"
|
||||
QString txt;
|
||||
txt = "This instance of ResInsight could not start the Socket Server enabling octave to get and set data.\n "
|
||||
"This is probably because you already have a running ResInsight process.\n"
|
||||
"Octave can only communicate with one ResInsight process at a time, so the Octave\n"
|
||||
"communication in this ResInsight instance will be disabled.\n"
|
||||
"\n"
|
||||
+ tr("The error from the socket system is: %1.").arg(m_tcpServer->errorString()));
|
||||
}
|
||||
"\n" +
|
||||
tr("The error from the socket system is: %1.").arg(m_tcpServer->errorString());
|
||||
|
||||
RiaLogging::error(txt);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -125,7 +122,10 @@ void RiaSocketServer::slotNewClientConnection()
|
||||
|
||||
if (!isFinshed)
|
||||
{
|
||||
m_errorMessageDialog->showMessage(tr("ResInsight SocketServer: \n") + tr("Warning : The command did not finish up correctly at the presence of a new one."));
|
||||
QString txt;
|
||||
txt = "ResInsight SocketServer : The command did not finish up correctly at the presence of a new one.";
|
||||
|
||||
RiaLogging::error(txt);
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,7 +236,10 @@ bool RiaSocketServer::readCommandFromOctave()
|
||||
}
|
||||
else
|
||||
{
|
||||
m_errorMessageDialog->showMessage(tr("ResInsight SocketServer: \n") + tr("Unknown command: %1").arg(args[0].data()));
|
||||
QString txt;
|
||||
txt = QString("ResInsight SocketServer: Unknown command: %1").arg(args[0].data());
|
||||
|
||||
RiaLogging::error(txt);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -254,7 +257,10 @@ void RiaSocketServer::slotCurrentClientDisconnected()
|
||||
|
||||
if (!isFinished)
|
||||
{
|
||||
m_errorMessageDialog->showMessage(tr("ResInsight SocketServer: \n") + tr("Warning : The command was interrupted and did not finish because the connection to octave disconnected."));
|
||||
QString txt;
|
||||
txt = QString("ResInsight SocketServer: The command was interrupted and did not finish because the connection to octave disconnected.");
|
||||
|
||||
RiaLogging::error(txt);
|
||||
}
|
||||
}
|
||||
|
||||
@ -301,6 +307,14 @@ int RiaSocketServer::currentCaseId() const
|
||||
return m_currentCaseId;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSocketServer::showErrorMessage(const QString& message) const
|
||||
{
|
||||
RiaLogging::error(message);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -31,7 +31,6 @@ class QPushButton;
|
||||
class QTcpServer;
|
||||
class QTcpSocket;
|
||||
class QNetworkSession;
|
||||
class QErrorMessage;
|
||||
class QTimer;
|
||||
class RimEclipseCase;
|
||||
class RiaSocketCommand;
|
||||
@ -52,12 +51,13 @@ public:
|
||||
|
||||
unsigned short serverPort();
|
||||
RimEclipseCase* findReservoir(int caseId);
|
||||
QErrorMessage* errorMessageDialog() { return m_errorMessageDialog; }
|
||||
QTcpSocket* currentClient() { return m_currentClient; }
|
||||
|
||||
void setCurrentCaseId(int caseId);
|
||||
int currentCaseId() const;
|
||||
|
||||
void showErrorMessage(const QString& message) const;
|
||||
|
||||
private slots:
|
||||
void slotNewClientConnection();
|
||||
void slotCurrentClientDisconnected();
|
||||
@ -70,7 +70,6 @@ private:
|
||||
|
||||
private:
|
||||
QTcpServer* m_tcpServer;
|
||||
QErrorMessage* m_errorMessageDialog;
|
||||
|
||||
QTcpSocket* m_currentClient;
|
||||
qint64 m_currentCommandSize; ///< The size in bytes of the command we are currently reading.
|
||||
|
@ -41,7 +41,6 @@
|
||||
|
||||
#include "cvfTimer.h"
|
||||
|
||||
#include <QErrorMessage>
|
||||
#include <QTcpSocket>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -61,7 +60,7 @@ RimEclipseCase* RiaSocketTools::findCaseFromArgs(RiaSocketServer* server, const
|
||||
if (rimCase == nullptr)
|
||||
{
|
||||
// TODO: Display error message a different place to avoid socket comm to be halted.
|
||||
//server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the Case with CaseId : \"%1\"").arg(caseId));
|
||||
//server->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the Case with CaseId : \"%1\"").arg(caseId));
|
||||
}
|
||||
|
||||
return rimCase;
|
||||
@ -131,13 +130,13 @@ bool RiaSocketTools::writeBlockData(RiaSocketServer* server, QTcpSocket* socket,
|
||||
{
|
||||
for (int i = 0; i < errorMessages.size(); i++)
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(errorMessages[i]);
|
||||
server->showErrorMessage(errorMessages[i]);
|
||||
}
|
||||
|
||||
// double totalTimeMS = timer.time() * 1000.0;
|
||||
// QString resultInfo = QString("Total time '%1 ms'").arg(totalTimeMS);
|
||||
//
|
||||
// server->errorMessageDialog()->showMessage(resultInfo);
|
||||
// server->showMessage(resultInfo);
|
||||
}
|
||||
|
||||
return writeSucceded;
|
||||
|
@ -30,7 +30,6 @@
|
||||
|
||||
#include "cvfCollection.h"
|
||||
|
||||
#include <QErrorMessage>
|
||||
#include <QTcpSocket>
|
||||
|
||||
|
||||
@ -48,7 +47,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;
|
||||
}
|
||||
@ -102,7 +101,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;
|
||||
}
|
||||
@ -125,7 +124,7 @@ public:
|
||||
|
||||
if (currentWellResult.isNull())
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(
|
||||
server->showErrorMessage(
|
||||
RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the well with name : \"%1\"").arg(wellName));
|
||||
|
||||
return true;
|
||||
@ -161,7 +160,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."));
|
||||
}
|
||||
}
|
||||
@ -241,7 +240,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));
|
||||
|
||||
socketStream << (quint64)0;
|
||||
return true;
|
||||
@ -260,7 +259,7 @@ public:
|
||||
|
||||
if (currentWellResult.isNull())
|
||||
{
|
||||
server->errorMessageDialog()->showMessage(
|
||||
server->showErrorMessage(
|
||||
RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the well with name : \"%1\"").arg(wellName));
|
||||
|
||||
socketStream << (quint64)0;
|
||||
|
Loading…
Reference in New Issue
Block a user