mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Updated riGetCurrentCase with case type
p4#: 21619
This commit is contained in:
@@ -292,22 +292,20 @@ void RiaSocketServer::readCommandFromOctave()
|
||||
{
|
||||
qint64 caseId = -1;
|
||||
QString caseName;
|
||||
qint64 caseType = -1;
|
||||
QString caseType;
|
||||
qint64 caseGroupId = -1;
|
||||
|
||||
if (reservoir)
|
||||
{
|
||||
caseId = reservoir->caseId();
|
||||
caseName = reservoir->caseUserDescription();
|
||||
caseType = -1;
|
||||
|
||||
if (reservoir->parentGridCaseGroup())
|
||||
{
|
||||
caseGroupId = reservoir->parentGridCaseGroup()->groupId();
|
||||
}
|
||||
caseInfo(reservoir, caseGroupId, caseType);
|
||||
}
|
||||
|
||||
quint64 byteCount = 3*sizeof(qint64) + caseName.size()*sizeof(QChar);
|
||||
quint64 byteCount = 2*sizeof(qint64);
|
||||
byteCount += caseName.size()*sizeof(QChar);
|
||||
byteCount += caseType.size()*sizeof(QChar);
|
||||
|
||||
socketStream << byteCount;
|
||||
|
||||
@@ -449,34 +447,9 @@ void RiaSocketServer::readCommandFromOctave()
|
||||
{
|
||||
RimCase* rimCase = cases[i];
|
||||
|
||||
qint64 caseGroupId;
|
||||
QString caseType;
|
||||
qint64 caseGroupId = -1;
|
||||
|
||||
RimCaseCollection* caseCollection = rimCase->parentCaseCollection();
|
||||
if (caseCollection)
|
||||
{
|
||||
caseGroupId = caseCollection->parentCaseGroup()->groupId;
|
||||
|
||||
if (RimIdenticalGridCaseGroup::isStatisticsCaseCollection(caseCollection))
|
||||
{
|
||||
caseType = "StatisticsCase";
|
||||
}
|
||||
else
|
||||
{
|
||||
caseType = "SourceCase";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dynamic_cast<RimInputCase*>(rimCase))
|
||||
{
|
||||
caseType = "InputCase";
|
||||
}
|
||||
else
|
||||
{
|
||||
caseType = "ResultCase";
|
||||
}
|
||||
}
|
||||
caseInfo(rimCase, caseGroupId, caseType);
|
||||
|
||||
caseIds.push_back(rimCase->caseId);
|
||||
caseNames.push_back(rimCase->caseUserDescription);
|
||||
@@ -934,3 +907,39 @@ void RiaSocketServer::calculateMatrixModelActiveCellInfo(RimCase* reservoirCase,
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSocketServer::caseInfo(RimCase* rimCase, qint64& caseGroupId, QString& caseType)
|
||||
{
|
||||
CVF_ASSERT(rimCase);
|
||||
|
||||
RimCaseCollection* caseCollection = rimCase->parentCaseCollection();
|
||||
if (caseCollection)
|
||||
{
|
||||
caseGroupId = caseCollection->parentCaseGroup()->groupId;
|
||||
|
||||
if (RimIdenticalGridCaseGroup::isStatisticsCaseCollection(caseCollection))
|
||||
{
|
||||
caseType = "StatisticsCase";
|
||||
}
|
||||
else
|
||||
{
|
||||
caseType = "SourceCase";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
caseGroupId = -1;
|
||||
|
||||
if (dynamic_cast<RimInputCase*>(rimCase))
|
||||
{
|
||||
caseType = "InputCase";
|
||||
}
|
||||
else
|
||||
{
|
||||
caseType = "ResultCase";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ private:
|
||||
std::vector<qint32>& hostCellJ,
|
||||
std::vector<qint32>& hostCellK);
|
||||
|
||||
void caseInfo(RimCase* rimCase, qint64& caseGroupId, QString& caseType);
|
||||
|
||||
|
||||
private:
|
||||
QTcpServer* m_tcpServer;
|
||||
|
||||
Reference in New Issue
Block a user