///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2024 Equinor ASA // // ResInsight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. // // See the GNU General Public License at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RimSummaryEnsemble.h" #include "Cloud/RiaSumoConnector.h" #include "cafPdmPtrField.h" #include class RimSummarySumoDataSource; //================================================================================================== // // // //================================================================================================== struct ParquetKey { SumoCaseId caseId; QString ensembleId; QString vectorName; bool isSensitivityParameters; auto operator<=>( const ParquetKey& other ) const { return std::tie( caseId, ensembleId, vectorName, isSensitivityParameters ) <=> std::tie( other.caseId, other.ensembleId, other.vectorName, other.isSensitivityParameters ); } }; namespace arrow { class Table; } class RimSummaryEnsembleSumo : public RimSummaryEnsemble { CAF_PDM_HEADER_INIT; public: RimSummaryEnsembleSumo(); void setSumoDataSource( RimSummarySumoDataSource* sumoDataSource ); void loadSummaryData( const RifEclipseSummaryAddress& resultAddress ); std::string unitName( const RifEclipseSummaryAddress& resultAddress ); RiaDefines::EclipseUnitSystem unitSystem() const; std::set allResultAddresses() const; std::pair nameKeys() const override; protected: void onLoadDataAndUpdate() override; private: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void updateResultAddresses(); void clearCachedData(); QByteArray loadParquetData( const ParquetKey& parquetKey ); void distributeDataToRealizations( const RifEclipseSummaryAddress& resultAddress, std::shared_ptr table ); void buildMetaData(); void distributeParametersDataToRealizations( std::shared_ptr table ); static std::shared_ptr readParquetTable( const QByteArray& contents, const QString& messageTag ); private: caf::PdmPtrField m_sumoDataSource; QPointer m_sumoConnector; std::set m_resultAddresses; std::map> m_parquetTable; };