mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#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:
parent
d065c8e1e0
commit
3f3ced5af0
@ -63,7 +63,12 @@ void getActiveCellInfo(int32NDArray& activeCellInfo, const QString &hostName, qu
|
|||||||
return;
|
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;
|
QStringList errorMessages;
|
||||||
if (!RiaSocketDataTransfer::readBlockDataFromSocket(&socket, (char*)(internalMatrixData), columnCount * byteCountForOneTimestep, errorMessages))
|
if (!RiaSocketDataTransfer::readBlockDataFromSocket(&socket, (char*)(internalMatrixData), columnCount * byteCountForOneTimestep, errorMessages))
|
||||||
{
|
{
|
||||||
|
@ -63,7 +63,12 @@ void getSelectedCells(int32NDArray& selectedCellInfo, const QString &hostName, q
|
|||||||
return;
|
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;
|
QStringList errorMessages;
|
||||||
if (!RiaSocketDataTransfer::readBlockDataFromSocket(&socket, (char*)(internalMatrixData), columnCount * byteCountForOneTimestep, errorMessages))
|
if (!RiaSocketDataTransfer::readBlockDataFromSocket(&socket, (char*)(internalMatrixData), columnCount * byteCountForOneTimestep, errorMessages))
|
||||||
{
|
{
|
||||||
|
@ -54,7 +54,11 @@ void setEclipseProperty(const Matrix& propertyFrames, const QString &hostName, q
|
|||||||
socketStream << (qint64)(timeStepCount);
|
socketStream << (qint64)(timeStepCount);
|
||||||
socketStream << (qint64)timeStepByteCount;
|
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;
|
QStringList errorMessages;
|
||||||
if (!RiaSocketDataTransfer::writeBlockDataToSocket(&socket, (const char *)internalData, timeStepByteCount*timeStepCount, 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();
|
Matrix propertyFrames = args(0).matrix_value();
|
||||||
|
|
||||||
|
|
||||||
dim_vector mxDims = propertyFrames.dims();
|
dim_vector mxDims = propertyFrames.dims();
|
||||||
if (mxDims.length() != 2)
|
if (mxDims.length() != 2)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,11 @@ void setEclipseProperty(const NDArray& propertyFrames, const QString &hostName,
|
|||||||
socketStream << (qint64)(timeStepCount);
|
socketStream << (qint64)(timeStepCount);
|
||||||
socketStream << (qint64)singleTimeStepByteCount;
|
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;
|
QStringList errorMessages;
|
||||||
if (!RiaSocketDataTransfer::writeBlockDataToSocket(&socket, (const char *)internalData, timeStepCount*singleTimeStepByteCount, errorMessages))
|
if (!RiaSocketDataTransfer::writeBlockDataToSocket(&socket, (const char *)internalData, timeStepCount*singleTimeStepByteCount, errorMessages))
|
||||||
|
Loading…
Reference in New Issue
Block a user