#11042 octave: Adjustments for updated API in version 7

Minor adjustments in data access for octave version 7. Previously used and verified version is octave 4.
This commit is contained in:
Magne Sjaastad 2024-01-11 08:27:04 +01:00
parent d065c8e1e0
commit 3f3ced5af0
4 changed files with 22 additions and 5 deletions

View File

@ -63,7 +63,12 @@ void getActiveCellInfo(int32NDArray& activeCellInfo, const QString &hostName, qu
return;
}
qint32* internalMatrixData = (qint32*)activeCellInfo.fortran_vec()->mex_get_data();
#if OCTAVE_MAJOR_VERSION > 6
auto internalMatrixData = (qint32*)activeCellInfo.fortran_vec();
#else
auto internalMatrixData = (qint32*)activeCellInfo.fortran_vec()->mex_get_data();
#endif
QStringList errorMessages;
if (!RiaSocketDataTransfer::readBlockDataFromSocket(&socket, (char*)(internalMatrixData), columnCount * byteCountForOneTimestep, errorMessages))
{

View File

@ -63,7 +63,12 @@ void getSelectedCells(int32NDArray& selectedCellInfo, const QString &hostName, q
return;
}
qint32* internalMatrixData = (qint32*)selectedCellInfo.fortran_vec()->mex_get_data();
#if OCTAVE_MAJOR_VERSION > 6
auto internalMatrixData = (qint32*)selectedCellInfo.fortran_vec();
#else
auto internalMatrixData = (qint32*)selectedCellInfo.fortran_vec()->mex_get_data();
#endif
QStringList errorMessages;
if (!RiaSocketDataTransfer::readBlockDataFromSocket(&socket, (char*)(internalMatrixData), columnCount * byteCountForOneTimestep, errorMessages))
{

View File

@ -54,7 +54,11 @@ void setEclipseProperty(const Matrix& propertyFrames, const QString &hostName, q
socketStream << (qint64)(timeStepCount);
socketStream << (qint64)timeStepByteCount;
const double* internalData = propertyFrames.fortran_vec();
#if OCTAVE_MAJOR_VERSION > 6
auto internalData = propertyFrames.data();
#else
auto internalData = propertyFrames.fortran_vec();
#endif
QStringList errorMessages;
if (!RiaSocketDataTransfer::writeBlockDataToSocket(&socket, (const char *)internalData, timeStepByteCount*timeStepCount, errorMessages))
@ -135,7 +139,6 @@ DEFUN_DLD (riSetActiveCellProperty, args, nargout,
Matrix propertyFrames = args(0).matrix_value();
dim_vector mxDims = propertyFrames.dims();
if (mxDims.length() != 2)
{

View File

@ -71,7 +71,11 @@ void setEclipseProperty(const NDArray& propertyFrames, const QString &hostName,
socketStream << (qint64)(timeStepCount);
socketStream << (qint64)singleTimeStepByteCount;
const double* internalData = propertyFrames.fortran_vec();
#if OCTAVE_MAJOR_VERSION > 6
auto internalData = propertyFrames.data();
#else
auto internalData = propertyFrames.fortran_vec();
#endif
QStringList errorMessages;
if (!RiaSocketDataTransfer::writeBlockDataToSocket(&socket, (const char *)internalData, timeStepCount*singleTimeStepByteCount, errorMessages))