diff --git a/ApplicationCode/SocketInterface/RiaSocketServer.cpp b/ApplicationCode/SocketInterface/RiaSocketServer.cpp index ad676d6462..6e732b86ec 100644 --- a/ApplicationCode/SocketInterface/RiaSocketServer.cpp +++ b/ApplicationCode/SocketInterface/RiaSocketServer.cpp @@ -57,7 +57,7 @@ RiaSocketServer::RiaSocketServer(QObject* parent) { m_errorMessageDialog->showMessage("Octave communication disabled :\n" "\n" - "This instance of ResInsight could not start the Socket Server enabeling octave to get and set data.\n" + "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" @@ -367,7 +367,8 @@ void RiaSocketServer::readCommandFromOctave() return; } - calculateMatrixModelActiveCellInfo(activeCellInfo[0], + calculateMatrixModelActiveCellInfo(reservoir, + activeCellInfo[0], activeCellInfo[1], activeCellInfo[2], activeCellInfo[3], @@ -618,7 +619,7 @@ void RiaSocketServer::slotReadyRead() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RiaSocketServer::calculateMatrixModelActiveCellInfo(std::vector& gridNumber, std::vector& cellI, std::vector& cellJ, std::vector& cellK, std::vector& parentGridNumber, std::vector& hostCellI, std::vector& hostCellJ, std::vector& hostCellK) +void RiaSocketServer::calculateMatrixModelActiveCellInfo(RimCase* reservoirCase, std::vector& gridNumber, std::vector& cellI, std::vector& cellJ, std::vector& cellK, std::vector& parentGridNumber, std::vector& hostCellI, std::vector& hostCellJ, std::vector& hostCellK) { gridNumber.clear(); cellI.clear(); @@ -629,12 +630,12 @@ void RiaSocketServer::calculateMatrixModelActiveCellInfo(std::vector& gr hostCellJ.clear(); hostCellK.clear(); - if (!m_currentReservoir || !m_currentReservoir->reservoirData() || !m_currentReservoir->reservoirData()->mainGrid()) + if (!reservoirCase || !reservoirCase->reservoirData() || !reservoirCase->reservoirData()->mainGrid()) { return; } - RigActiveCellInfo* actCellInfo = m_currentReservoir->reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); + RigActiveCellInfo* actCellInfo = reservoirCase->reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); size_t numMatrixModelActiveCells = actCellInfo->globalActiveCellCount(); gridNumber.reserve(numMatrixModelActiveCells); @@ -646,7 +647,7 @@ void RiaSocketServer::calculateMatrixModelActiveCellInfo(std::vector& gr hostCellJ.reserve(numMatrixModelActiveCells); hostCellK.reserve(numMatrixModelActiveCells); - const std::vector& globalCells = m_currentReservoir->reservoirData()->mainGrid()->cells(); + const std::vector& globalCells = reservoirCase->reservoirData()->mainGrid()->cells(); for (size_t cIdx = 0; cIdx < globalCells.size(); ++cIdx) { diff --git a/ApplicationCode/SocketInterface/RiaSocketServer.h b/ApplicationCode/SocketInterface/RiaSocketServer.h index 6e19a1bb74..a84519fd86 100644 --- a/ApplicationCode/SocketInterface/RiaSocketServer.h +++ b/ApplicationCode/SocketInterface/RiaSocketServer.h @@ -56,7 +56,8 @@ private: RimCase* findReservoir(const QString &casename); void terminateCurrentConnection(); - void calculateMatrixModelActiveCellInfo(std::vector& gridNumber, + void calculateMatrixModelActiveCellInfo(RimCase* reservoirCase, + std::vector& gridNumber, std::vector& cellI, std::vector& cellJ, std::vector& cellK,