Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: KNMI Innovation weeks 2023 #269

Merged
merged 14 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CCDFDataModel/CCDFVariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern CDF::Variable::CustomMemoryReader customMemoryReaderInstance;
CDF::Variable::CustomMemoryReader customMemoryReaderInstance;
CDF::Variable::CustomMemoryReader *CDF::Variable::CustomMemoryReaderInstance = &customMemoryReaderInstance;

//#define CCDFDATAMODEL_DEBUG
// #define CCDFDATAMODEL_DEBUG
int CDF::Variable::readData(CDFType type) { return readData(type, NULL, NULL, NULL); }

int CDF::Variable::readData(bool applyScaleOffset) { return readData(-1, applyScaleOffset); }
Expand Down Expand Up @@ -250,7 +250,7 @@ int CDF::Variable::readData(CDFType type, size_t *_start, size_t *_count, ptrdif
count[iterativeDimIndex] = 1;
// Read the data!

if (!hasCustomReader) {
if (!_hasCustomReader) {
// TODO NEEDS BETTER CHECKS
if (cdfReaderPointer == NULL) {
CDBError("No CDFReader defined for variable %s", name.c_str());
Expand All @@ -275,7 +275,7 @@ int CDF::Variable::readData(CDFType type, size_t *_start, size_t *_count, ptrdif
tCDFObject->close();
}

if (hasCustomReader) {
if (_hasCustomReader) {
status = customReader->readData(this, _start, count, stride);
}

Expand Down Expand Up @@ -304,7 +304,7 @@ int CDF::Variable::readData(CDFType type, size_t *_start, size_t *_count, ptrdif
#endif
// TODO NEEDS BETTER CHECKS
if (cdfReaderPointer == NULL) {
if (hasCustomReader) {
if (_hasCustomReader) {
if (this->customReader != NULL) {
this->setType(type);
this->customReader->readData(this, _start, _count, _stride);
Expand Down
52 changes: 9 additions & 43 deletions CCDFDataModel/CCDFVariable.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "CCDFTypes.h"
#include "CCDFAttribute.h"
#include "CCDFDimension.h"
//#define CCDFDATAMODEL_DEBUG
// #define CCDFDATAMODEL_DEBUG
#include "CDebugger_H2.h"
namespace CDF {
class Variable {
Expand Down Expand Up @@ -59,7 +59,7 @@ namespace CDF {
std::vector<CDFObjectClass *> cdfObjectList;
void *cdfReaderPointer;
void *parentCDFObject;
bool hasCustomReader;
bool _hasCustomReader;

public:
class CustomReader {
Expand Down Expand Up @@ -89,9 +89,12 @@ namespace CDF {

public:
void setCustomReader(CustomReader *customReader) {
hasCustomReader = true;
_hasCustomReader = true;
this->customReader = customReader;
};
CustomReader *getCustomReader() { return this->customReader; }

bool hasCustomReader() { return _hasCustomReader; }

void setCDFReaderPointer(void *cdfReaderPointer) { this->cdfReaderPointer = cdfReaderPointer; }
void setParentCDFObject(void *parentCDFObject) { this->parentCDFObject = parentCDFObject; }
Expand All @@ -112,7 +115,7 @@ namespace CDF {
return getParentCDFObject();
}
// Return the correct cdfReader According the given dims.
auto iterator = std::find_if(dimensionlinks.begin(), dimensionlinks.end(), [](Dimension *d){ return d->isIterative; });
auto iterator = std::find_if(dimensionlinks.begin(), dimensionlinks.end(), [](Dimension *d) { return d->isIterative; });
if (iterator == dimensionlinks.end()) {
CDBError("Did not find iterative dimension");
throw(CDF_E_ERROR);
Expand Down Expand Up @@ -214,7 +217,7 @@ namespace CDF {
nativeType = CDF_NONE;
cdfReaderPointer = NULL;
parentCDFObject = NULL;
hasCustomReader = false;
_hasCustomReader = false;
_isString = false;
// CDBDebug("Variable");
setName(name);
Expand All @@ -235,7 +238,7 @@ namespace CDF {
nativeType = CDF_NONE;
cdfReaderPointer = NULL;
parentCDFObject = NULL;
hasCustomReader = false;
_hasCustomReader = false;
_isString = false;
}
~Variable() {
Expand Down Expand Up @@ -444,43 +447,6 @@ namespace CDF {
}
return 0;
}

// Returns a new copy of this variable
/*Variable *clone(){
Variable *newVar = new Variable ();








newVar->nativeType = nativeType;
newVar->currentType;
newVar->name;
newVar->orgName;
std::vector<Attribute *> attributes;
std::vector<Dimension *> dimensionlinks;
int id;
size_t currentSize;
void *data;
bool isDimension;

private:
//Currently, aggregation along just 1 dimension is supported.
class CDFObjectClass{
public:
void *cdfObjectPointer;
int dimIndex;
double dimValue;
};
std::vector<CDFObjectClass *> cdfObjectList;
void *cdfReaderPointer;
void *parentCDFObject;
bool hasCustomReader;
return newVar;
}*/
};
} // namespace CDF
#endif
4 changes: 2 additions & 2 deletions adagucserverEC/CAutoConfigure.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "CServerError.h"
#include "CDirReader.h"

//#include "CADAGUC_time.h"
// #include "CADAGUC_time.h"
#include "CCDFDataModel.h"
#include "CCDFNetCDFIO.h"
#include "CCDFHDF5IO.h"
Expand All @@ -41,7 +41,7 @@
#include "CDBFileScanner.h"
#include "CDFObjectStore.h"
#include "CCache.h"
#include "CDataPostProcessor.h"
#include "CDataPostProcessors/CDataPostProcessor.h"

class CAutoConfigure {
private:
Expand Down
Loading