From 2213bab996f05187e0d1049527acd3f0f60faf10 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 7 Jan 2019 12:46:42 +0100 Subject: [PATCH] #3930 Octave : Fix includes and replace deprecated functions --- OctavePlugin/riGetActiveCellProperty.cpp | 4 ++-- OctavePlugin/riGetDynamicNNCValues.cpp | 4 ++-- OctavePlugin/riGetGridProperty.cpp | 4 ++-- OctavePlugin/riGetGridPropertyForSelectedCells.cpp | 4 ++-- OctavePlugin/riGetWellStatus.cpp | 4 ++-- OctavePlugin/riSetActiveCellProperty.cpp | 8 ++++---- OctavePlugin/riSetGridProperty.cpp | 8 ++++---- OctavePlugin/riSetNNCProperty.cpp | 8 ++++---- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/OctavePlugin/riGetActiveCellProperty.cpp b/OctavePlugin/riGetActiveCellProperty.cpp index 7c2551aad4..9e14ed0a4c 100644 --- a/OctavePlugin/riGetActiveCellProperty.cpp +++ b/OctavePlugin/riGetActiveCellProperty.cpp @@ -27,11 +27,11 @@ void getActiveCellProperty(Matrix& propertyFrames, const QString &serverName, qu QString command; command += "GetActiveCellProperty " + QString::number(caseId) + " " + propertyName + " " + porosityModel; - for (int i = 0; i < requestedTimeSteps.length(); ++i) + for (int i = 0; i < requestedTimeSteps.numel(); ++i) { if (i == 0) command += " "; command += QString::number(static_cast(requestedTimeSteps.elem(i)) - 1); // To make the index 0-based - if (i != requestedTimeSteps.length() -1) command += " "; + if (i != requestedTimeSteps.numel() -1) command += " "; } QByteArray cmdBytes = command.toLatin1(); diff --git a/OctavePlugin/riGetDynamicNNCValues.cpp b/OctavePlugin/riGetDynamicNNCValues.cpp index 15e6e2893e..42c3f12d0d 100644 --- a/OctavePlugin/riGetDynamicNNCValues.cpp +++ b/OctavePlugin/riGetDynamicNNCValues.cpp @@ -26,11 +26,11 @@ void getDynamicNNCValues(Matrix& propertyFrames, const QString &serverName, quin QString command; command += "GetDynamicNNCValues " + QString::number(caseId) + " " + propertyName; - for (int i = 0; i < requestedTimeSteps.length(); ++i) + for (int i = 0; i < requestedTimeSteps.numel(); ++i) { if (i == 0) command += " "; command += QString::number(static_cast(requestedTimeSteps.elem(i)) - 1); // To make the index 0-based - if (i != requestedTimeSteps.length() -1) command += " "; + if (i != requestedTimeSteps.numel() -1) command += " "; } QByteArray cmdBytes = command.toLatin1(); diff --git a/OctavePlugin/riGetGridProperty.cpp b/OctavePlugin/riGetGridProperty.cpp index 7b5db5ed40..6fd9477938 100644 --- a/OctavePlugin/riGetGridProperty.cpp +++ b/OctavePlugin/riGetGridProperty.cpp @@ -27,11 +27,11 @@ void getGridProperty(NDArray& propertyFrames, const QString &serverName, quint16 QString command; command += "GetGridProperty " + QString::number(caseId) + " " + QString::number(gridIdx) + " " + propertyName + " " + porosityModel; - for (qint64 i = 0; i < requestedTimeSteps.length(); ++i) + for (qint64 i = 0; i < requestedTimeSteps.numel(); ++i) { if (i == 0) command += " "; command += QString::number(static_cast(requestedTimeSteps.elem(i)) - 1); // To make the index 0-based - if (i != requestedTimeSteps.length() -1) command += " "; + if (i != requestedTimeSteps.numel() -1) command += " "; } QByteArray cmdBytes = command.toLatin1(); diff --git a/OctavePlugin/riGetGridPropertyForSelectedCells.cpp b/OctavePlugin/riGetGridPropertyForSelectedCells.cpp index 7d23ea399c..b5efd29933 100644 --- a/OctavePlugin/riGetGridPropertyForSelectedCells.cpp +++ b/OctavePlugin/riGetGridPropertyForSelectedCells.cpp @@ -27,11 +27,11 @@ void getGridPropertyForSelectedCells(Matrix& propertyFrames, const QString &serv QString command; command += "GetGridPropertyForSelectedCells " + QString::number(caseId) + " " + propertyName + " " + porosityModel; - for (int i = 0; i < requestedTimeSteps.length(); ++i) + for (int i = 0; i < requestedTimeSteps.numel(); ++i) { if (i == 0) command += " "; command += QString::number(static_cast(requestedTimeSteps.elem(i)) - 1); // To make the index 0-based - if (i != requestedTimeSteps.length() - 1) command += " "; + if (i != requestedTimeSteps.numel() - 1) command += " "; } QByteArray cmdBytes = command.toLatin1(); diff --git a/OctavePlugin/riGetWellStatus.cpp b/OctavePlugin/riGetWellStatus.cpp index 6c10b23a70..af3f7c6c08 100644 --- a/OctavePlugin/riGetWellStatus.cpp +++ b/OctavePlugin/riGetWellStatus.cpp @@ -24,11 +24,11 @@ void getWellStatus(std::vector& wellTypes, std::vector& wellStatus QString command; command += QString("GetWellStatus") + " " + QString::number(caseId) + " " + wellName; - for (int i = 0; i < requestedTimeSteps.length(); ++i) + for (int i = 0; i < requestedTimeSteps.numel(); ++i) { if (i == 0) command += " "; command += QString::number(static_cast(requestedTimeSteps.elem(i)) - 1); // To make the index 0-based - if (i != requestedTimeSteps.length() -1) command += " "; + if (i != requestedTimeSteps.numel() -1) command += " "; } QByteArray cmdBytes = command.toLatin1(); diff --git a/OctavePlugin/riSetActiveCellProperty.cpp b/OctavePlugin/riSetActiveCellProperty.cpp index 9306796c00..8dcfe90936 100644 --- a/OctavePlugin/riSetActiveCellProperty.cpp +++ b/OctavePlugin/riSetActiveCellProperty.cpp @@ -31,11 +31,11 @@ void setEclipseProperty(const Matrix& propertyFrames, const QString &hostName, q QString command; command += "SetActiveCellProperty " + QString::number(caseId) + " " + propertyName + " " + porosityModel; - for (int i = 0; i < requestedTimeSteps.length(); ++i) + for (int i = 0; i < requestedTimeSteps.numel(); ++i) { if (i == 0) command += " "; command += QString::number(static_cast(requestedTimeSteps.elem(i)) - 1); // To make the index 0-based - if (i != requestedTimeSteps.length() -1) command += " "; + if (i != requestedTimeSteps.numel() -1) command += " "; } QByteArray cmdBytes = command.toLatin1(); @@ -205,11 +205,11 @@ DEFUN_DLD (riSetActiveCellProperty, args, nargout, if (argIndices[3] >= 0) requestedTimeSteps = args(argIndices[3]).int32_array_value(); if (argIndices[4] >= 0) porosityModel = args(argIndices[4]).string_value(); - if (requestedTimeSteps.length()) + if (requestedTimeSteps.numel()) { int timeStepCount = mxDims.elem(1); - if (requestedTimeSteps.length() != timeStepCount) + if (requestedTimeSteps.numel() != timeStepCount) { error("riSetActiveCellProperty: The number of timesteps in the input matrix must match the number of timesteps in the TimeStepIndices array."); print_usage(); diff --git a/OctavePlugin/riSetGridProperty.cpp b/OctavePlugin/riSetGridProperty.cpp index f3959a4250..6b8a259ec7 100644 --- a/OctavePlugin/riSetGridProperty.cpp +++ b/OctavePlugin/riSetGridProperty.cpp @@ -30,11 +30,11 @@ void setEclipseProperty(const NDArray& propertyFrames, const QString &hostName, QString command = QString("SetGridProperty %1 %2 %3 %4").arg(caseId).arg(gridIndex).arg(propertyName).arg(porosityModel); - for (int i = 0; i < timeStepIndices.length(); ++i) + for (int i = 0; i < timeStepIndices.numel(); ++i) { if (i == 0) command += " "; command += QString::number(static_cast(timeStepIndices.elem(i)) - 1); // To make the index 0-based - if (i != timeStepIndices.length() -1) command += " "; + if (i != timeStepIndices.numel() -1) command += " "; } QByteArray cmdBytes = command.toLatin1(); @@ -237,7 +237,7 @@ DEFUN_DLD (riSetGridProperty, args, nargout, if (argIndices[4] >= 0) timeStepIndices = args(argIndices[4]).int32_array_value(); if (argIndices[5] >= 0) porosityModel = args(argIndices[5]).string_value(); - if (timeStepIndices.length() > 1) + if (timeStepIndices.numel() > 1) { if (mxDims.length() == 3) { @@ -247,7 +247,7 @@ DEFUN_DLD (riSetGridProperty, args, nargout, } int timeStepCount = mxDims.elem(3); - if (timeStepIndices.length() != timeStepCount) + if (timeStepIndices.numel() != timeStepCount) { error("riSetGridProperty: The number of time steps in the input matrix must match the number of time steps in the TimeStepIndices array."); print_usage(); diff --git a/OctavePlugin/riSetNNCProperty.cpp b/OctavePlugin/riSetNNCProperty.cpp index 5ed338db69..5647e92486 100644 --- a/OctavePlugin/riSetNNCProperty.cpp +++ b/OctavePlugin/riSetNNCProperty.cpp @@ -31,11 +31,11 @@ void setNNCProperty(const Matrix& propertyFrames, const QString &hostName, quint QString command; command += "SetNNCProperty " + QString::number(caseId) + " " + propertyName; - for (int i = 0; i < requestedTimeSteps.length(); ++i) + for (int i = 0; i < requestedTimeSteps.numel(); ++i) { if (i == 0) command += " "; command += QString::number(static_cast(requestedTimeSteps.elem(i)) - 1); // To make the index 0-based - if (i != requestedTimeSteps.length() -1) command += " "; + if (i != requestedTimeSteps.numel() -1) command += " "; } QByteArray cmdBytes = command.toLatin1(); @@ -182,11 +182,11 @@ DEFUN_DLD (riSetNNCProperty, args, nargout, if (argIndices[2] >= 0) propertyName = args(argIndices[2]).char_matrix_value().row_as_string(0); if (argIndices[3] >= 0) requestedTimeSteps = args(argIndices[3]).int32_array_value(); - if (requestedTimeSteps.length()) + if (requestedTimeSteps.numel()) { int timeStepCount = mxDims.elem(1); - if (requestedTimeSteps.length() != timeStepCount) + if (requestedTimeSteps.numel() != timeStepCount) { error("riSetNNCProperty: The number of time steps in the input matrix must match the number of time steps in the TimeStepIndices array."); print_usage();