From f09b61697768ac49e65f1f7a6e5dd0a32eaa2d68 Mon Sep 17 00:00:00 2001 From: Arturs Bekasovs Date: Wed, 29 Jan 2014 16:56:22 +0000 Subject: [PATCH] Refs #8570. Add support for multiple vector column type loading. --- .../Framework/DataHandling/src/LoadNexusProcessed.cpp | 10 +++++++--- Code/Mantid/Framework/DataObjects/src/VectorColumn.cpp | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp b/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp index 2931ab5e2afb..6c7d3a54aba2 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp @@ -574,10 +574,14 @@ API::Workspace_sptr LoadNexusProcessed::loadTableEntry(NXEntry & entry) } } } - else if ( info.type == NX_INT32 ) // A vector_int column - { - loadVectorColumn(nx_tw, str, workspace, "vector_int"); + #define IF_VECTOR_COLUMN(Type, ColumnTypeName, NexusType) \ + else if ( info.type == NexusType ) \ + { \ + loadVectorColumn(nx_tw, str, workspace, #ColumnTypeName); \ } + IF_VECTOR_COLUMN(int, vector_int, NX_INT32) + IF_VECTOR_COLUMN(double, vector_double, NX_FLOAT64) + } columnNumber++; diff --git a/Code/Mantid/Framework/DataObjects/src/VectorColumn.cpp b/Code/Mantid/Framework/DataObjects/src/VectorColumn.cpp index 2da2dc397556..451f22bb32b5 100644 --- a/Code/Mantid/Framework/DataObjects/src/VectorColumn.cpp +++ b/Code/Mantid/Framework/DataObjects/src/VectorColumn.cpp @@ -11,6 +11,7 @@ namespace DataObjects // IMPORTANT: When you do add new column types, please update the following places as well: // - ARRAY_TYPES in ITableWorkspace.cpp, so that column is exported to Python properly // - IF_VECTOR_COLUMN in NexusFileIO.cpp, so that column is save to Nexus file properly + // - IF_VECTOR_COLUMN in LoadNexusProcessed.cpp, so that column can be loaded from Nexus file DECLARE_VECTORCOLUMN(int, vector_int) DECLARE_VECTORCOLUMN(double, vector_double)