Move read volumes logic to dataloadermodule and dir-is-read

This commit is contained in:
Jonathan Grangien
2018-06-11 16:19:12 -04:00
committed by Matthias Berg
parent bd334fd201
commit e1775121f7
8 changed files with 86 additions and 50 deletions

View File

@@ -35,9 +35,42 @@ namespace {
constexpr const char* _loggerCat = "DataLoaderModule";
}
namespace {
static const openspace::properties::Property::PropertyInfo ShowInternalVolumesInfo = {
"ShowInternalVolumesTrigger",
"Trigger load volume data files",
"If this property is triggered it will call the function to load and show volume data"
};
static const openspace::properties::Property::PropertyInfo VolumesInfo = {
"Volumes",
"List of volume items stored internally and ready to load",
"This list contains names of volume data files converted from the CDF format"
};
static const openspace::properties::Property::PropertyInfo FieldlinesInfo = {
"Fieldlines",
"List of fieldline items stored internally and ready to load",
"This list contains names of fieldline data files converted from the CDF format"
};
}
namespace openspace {
DataLoaderModule::DataLoaderModule() : OpenSpaceModule(Name) {}
DataLoaderModule::DataLoaderModule()
: OpenSpaceModule(Name)
, _showInternalVolumesTrigger(ShowInternalVolumesInfo)
, _volumeDataItems(VolumesInfo)
{
_showInternalVolumesTrigger.onChange([this](){
// showInternalDataType(DataTypes.volume);
validateDataDirectory();
_loader->createInternalDataItemProperties();
});
addProperty(_volumeDataItems);
addProperty(_showInternalVolumesTrigger);
}
DataLoaderModule::~DataLoaderModule() {}
@@ -56,7 +89,9 @@ void DataLoaderModule::setDataDirectoryRead(bool isRead) {
}
void DataLoaderModule::validateDataDirectory() {
if(!_dataDirectoryIsRead) {
if(_dataDirectoryIsRead == false) {
// TODO: generalize
_reader->readVolumeDataItems();
}
}