mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added riGetSelectedCases based on currently selected cases in the main tree view
p4#: 21604
This commit is contained in:
@@ -250,8 +250,9 @@ void RiaSocketServer::readCommandFromOctave()
|
||||
bool isGetGridDim = args[0] == "GetMainGridDimensions"; // GetMainGridDimensions [casename/index]
|
||||
bool isGetCurrentCase = args[0] == "GetCurrentCase";
|
||||
bool isGetCaseGroups = args[0] == "GetCaseGroups";
|
||||
bool isGetSelectedCases = args[0] == "GetSelectedCases";
|
||||
|
||||
if (!(isGetProperty || isSetProperty || isGetCellInfo || isGetGridDim || isGetCurrentCase || isGetCaseGroups))
|
||||
if (!(isGetProperty || isSetProperty || isGetCellInfo || isGetGridDim || isGetCurrentCase || isGetCaseGroups || isGetSelectedCases))
|
||||
{
|
||||
m_errorMessageDialog->showMessage(tr("ResInsight SocketServer: \n") + tr("Unknown command: %1").arg(args[0].data()));
|
||||
terminateCurrentConnection();
|
||||
@@ -357,6 +358,42 @@ void RiaSocketServer::readCommandFromOctave()
|
||||
return;
|
||||
}
|
||||
|
||||
if (isGetSelectedCases)
|
||||
{
|
||||
RiuMainWindow* ruiMainWindow = RiuMainWindow::instance();
|
||||
if (ruiMainWindow)
|
||||
{
|
||||
std::vector<qint64> caseIds;
|
||||
std::vector<QString> caseNames;
|
||||
std::vector<qint64> caseTypes;
|
||||
std::vector<qint64> caseGroupIds;
|
||||
|
||||
ruiMainWindow->selectionInfo(caseIds, caseNames, caseTypes, caseGroupIds);
|
||||
|
||||
quint64 byteCount = sizeof(quint64);
|
||||
quint64 selectionCount = caseIds.size();
|
||||
|
||||
for (size_t i = 0; i < selectionCount; i++)
|
||||
{
|
||||
byteCount += caseNames[i].size() * sizeof(QChar);
|
||||
byteCount += 3*sizeof(qint64);
|
||||
}
|
||||
|
||||
socketStream << byteCount;
|
||||
socketStream << selectionCount;
|
||||
|
||||
for (size_t i = 0; i < selectionCount; i++)
|
||||
{
|
||||
socketStream << caseIds[i];
|
||||
socketStream << caseNames[i];
|
||||
socketStream << caseTypes[i];
|
||||
socketStream << caseGroupIds[i];
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (reservoir == NULL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user