mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Test for ijk dimention match before reading data
Whitespace fixup p4#: 21749
This commit is contained in:
parent
3b05c59b55
commit
408795c0fc
@ -51,7 +51,6 @@ public:
|
|||||||
|
|
||||||
virtual bool interpretCommand(RiaSocketServer* server, const QList<QByteArray>& args, QDataStream& socketStream)
|
virtual bool interpretCommand(RiaSocketServer* server, const QList<QByteArray>& args, QDataStream& socketStream)
|
||||||
{
|
{
|
||||||
|
|
||||||
RimCase* rimCase = RiaSocketTools::findCaseFromArgs(server, args);
|
RimCase* rimCase = RiaSocketTools::findCaseFromArgs(server, args);
|
||||||
|
|
||||||
QString propertyName = args[2];
|
QString propertyName = args[2];
|
||||||
@ -703,7 +702,15 @@ public:
|
|||||||
m_porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS;
|
m_porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the requested data, Or create a set if we are setting data and it is not found
|
RigGridBase* grid = rimCase->reservoirData()->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));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Read header
|
||||||
if (server->currentClient()->bytesAvailable() < (int)sizeof(quint64)*5) return true;
|
if (server->currentClient()->bytesAvailable() < (int)sizeof(quint64)*5) return true;
|
||||||
|
|
||||||
quint64 cellCountI = 0;
|
quint64 cellCountI = 0;
|
||||||
@ -713,9 +720,22 @@ public:
|
|||||||
socketStream >> cellCountJ;
|
socketStream >> cellCountJ;
|
||||||
socketStream >> cellCountK;
|
socketStream >> cellCountK;
|
||||||
|
|
||||||
|
if (grid->cellCountI() != cellCountI ||
|
||||||
|
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));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
socketStream >> m_timeStepCountToRead;
|
socketStream >> m_timeStepCountToRead;
|
||||||
socketStream >> m_bytesPerTimeStepToRead;
|
socketStream >> m_bytesPerTimeStepToRead;
|
||||||
|
|
||||||
|
if (m_timeStepCountToRead == 0 || m_bytesPerTimeStepToRead == 0)
|
||||||
|
{
|
||||||
|
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
||||||
|
RiaSocketServer::tr("Zero data to read for ") + ":\"" + m_currentReservoir->caseUserDescription() + "\"\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T;
|
size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T;
|
||||||
@ -831,9 +851,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have not read the header and there are data enough: Read it.
|
|
||||||
// Do nothing if we have not enough data
|
// Do nothing if we have not enough data
|
||||||
|
|
||||||
if (m_timeStepCountToRead == 0 || m_bytesPerTimeStepToRead == 0)
|
if (m_timeStepCountToRead == 0 || m_bytesPerTimeStepToRead == 0)
|
||||||
{
|
{
|
||||||
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
|
||||||
|
Loading…
Reference in New Issue
Block a user