3Depict
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Macros | Enumerations | Functions | Variables
APTFileIO.cpp File Reference
#include "APTFileIO.h"
#include "ionhit.h"
#include "../../common/stringFuncs.h"
#include "../../common/basics.h"
#include "../../common/translation.h"
#include <cstring>
#include <new>
Include dependency graph for APTFileIO.cpp:

Macros

#define USE_SEEKING_LIMITLOAD
 

Enumerations

enum  {
  TEXT_ERR_OPEN =1, TEXT_ERR_ONLY_HEADER, TEXT_ERR_REOPEN, TEXT_ERR_READ_CONTENTS,
  TEXT_ERR_FORMAT, TEXT_ERR_ALLOC_FAIL, TEXT_ERR_ENUM_END
}
 
enum  {
  LAWATAP_ATO_OPEN_FAIL =1, LAWATAP_ATO_EMPTY_FAIL, LAWATAP_ATO_SIZE_ERR, LAWATAP_ATO_VERSIONCHECK_ERR,
  LAWATAP_ATO_MEM_ERR, LAWATAP_ATO_BAD_ENDIAN_DETECT, LAWATAP_ATO_ENUM_END
}
 
enum  { TAPSIM_ERR_FILE_FORMAT_FAIL, TAPSIM_ERR_FILE_OPEN_FAIL, TAPSIM_ERR_ABORTED }
 

Functions

unsigned int LimitLoadPosFile (unsigned int inputnumcols, unsigned int outputnumcols, const unsigned int index[], vector< IonHit > &posIons, const char *posFile, size_t limitCount, unsigned int &progress, ATOMIC_BOOL &wantAbort, bool strongSampling)
 
unsigned int GenericLoadFloatFile (unsigned int inputnumcols, unsigned int outputnumcols, const unsigned int index[], vector< IonHit > &posIons, const char *posFile, unsigned int &progress, ATOMIC_BOOL &wantAbort)
 Load a pos file directly into a single ion list. More...
 
unsigned int limitLoadTextFile (unsigned int maxCols, vector< vector< float > > &data, const char *textFile, const char *delim, const size_t limitCount, unsigned int &progress, ATOMIC_BOOL &wantAbort, bool strongRandom)
 
unsigned int LoadATOFile (const char *fileName, vector< IonHit > &ions, unsigned int &progress, ATOMIC_BOOL &wantAbort, unsigned int forceEndian)
 
unsigned int loadTapsimBinFile (const char *fileName, unsigned int &progress, ATOMIC_BOOL &wantAbort, vector< IonHit > &posIons)
 

Variables

const size_t PROGRESS_REDUCE =5000
 
const char * TEXT_LOAD_ERR_STRINGS []
 
const char * POS_ERR_STRINGS []
 
const char * ION_TEXT_ERR_STRINGS []
 
const char * LAWATAP_ATO_ERR_STRINGS []
 
const char * TAPSIM_ERR_STRINGS []
 

Macro Definition Documentation

◆ USE_SEEKING_LIMITLOAD

#define USE_SEEKING_LIMITLOAD

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TEXT_ERR_OPEN 
TEXT_ERR_ONLY_HEADER 
TEXT_ERR_REOPEN 
TEXT_ERR_READ_CONTENTS 
TEXT_ERR_FORMAT 
TEXT_ERR_ALLOC_FAIL 
TEXT_ERR_ENUM_END 

◆ anonymous enum

anonymous enum
Enumerator
LAWATAP_ATO_OPEN_FAIL 
LAWATAP_ATO_EMPTY_FAIL 
LAWATAP_ATO_SIZE_ERR 
LAWATAP_ATO_VERSIONCHECK_ERR 
LAWATAP_ATO_MEM_ERR 
LAWATAP_ATO_BAD_ENDIAN_DETECT 
LAWATAP_ATO_ENUM_END 

◆ anonymous enum

anonymous enum
Enumerator
TAPSIM_ERR_FILE_FORMAT_FAIL 
TAPSIM_ERR_FILE_OPEN_FAIL 
TAPSIM_ERR_ABORTED 

Function Documentation

◆ GenericLoadFloatFile()

unsigned int GenericLoadFloatFile ( unsigned int  inputnumcols,
unsigned int  outputnumcols,
const unsigned int  index[],
vector< IonHit > &  posIons,
const char *  posFile,
unsigned int &  progress,
ATOMIC_BOOL wantAbort 
)

Load a pos file directly into a single ion list.

Pos files are fixed record size files, with data stored as 4byte big endian floating point. (IEEE 574?). Data is stored as x,y,z,mass/charge. Load a pos file into a T of IonHits

References ASSERT, IonHit::DATA_SIZE, IonHit::hasInf(), IonHit::hasNaN(), POS_ABORT_FAIL, POS_ALLOC_FAIL, POS_EMPTY_FAIL, POS_INF_LOAD_ERROR, POS_NAN_LOAD_ERROR, POS_OPEN_FAIL, POS_READ_FAIL, POS_SIZE_MODULUS_ERR, PROGRESS_REDUCE, and IonHit::setHit().

Referenced by LimitLoadPosFile(), ExternalProgramFilter::refresh(), DataLoadFilter::refresh(), and SpatialAnalysisFilter::refresh().

Here is the caller graph for this function:

◆ LimitLoadPosFile()

unsigned int LimitLoadPosFile ( unsigned int  inputnumcols,
unsigned int  outputnumcols,
const unsigned int  index[],
vector< IonHit > &  posIons,
const char *  posFile,
size_t  limitCount,
unsigned int &  progress,
ATOMIC_BOOL wantAbort,
bool  strongSampling 
)

◆ limitLoadTextFile()

unsigned int limitLoadTextFile ( unsigned int  maxCols,
vector< vector< float > > &  data,
const char *  textFile,
const char *  delim,
const size_t  limitCount,
unsigned int &  progress,
ATOMIC_BOOL wantAbort,
bool  strongRandom 
)

◆ LoadATOFile()

unsigned int LoadATOFile ( const char *  fileName,
vector< IonHit > &  ions,
unsigned int &  progress,
ATOMIC_BOOL wantAbort,
unsigned int  forceEndian 
)

◆ loadTapsimBinFile()

unsigned int loadTapsimBinFile ( const char *  fileName,
unsigned int &  progress,
ATOMIC_BOOL wantAbort,
vector< IonHit > &  posIons 
)

Variable Documentation

◆ ION_TEXT_ERR_STRINGS

const char* ION_TEXT_ERR_STRINGS[]
Initial value:
= { "",
NTRANS("Error opening file"),
NTRANS("No numerical data found"),
NTRANS("Error re-opening file, after first scan"),
NTRANS("Unable to read file contents after open"),
NTRANS("Error interpreting field in file"),
NTRANS("Incorrect number of fields in file"),
NTRANS("Unable to allocate memory to store data"),
}
#define NTRANS(x)
Gettext null-translation macro (mark for translation, but do nothing)
Definition: translation.h:33

◆ LAWATAP_ATO_ERR_STRINGS

const char* LAWATAP_ATO_ERR_STRINGS[]
Initial value:
= { "",
NTRANS("Error opening file"),
NTRANS("File is empty"),
NTRANS("Filesize does not match expected format"),
NTRANS("File version number not <4, as expected"),
NTRANS("Unable to allocate memory to store data"),
}
#define NTRANS(x)
Gettext null-translation macro (mark for translation, but do nothing)
Definition: translation.h:33

Referenced by DataLoadFilter::refresh().

◆ POS_ERR_STRINGS

const char* POS_ERR_STRINGS[]
Initial value:
= { "",
NTRANS("Memory allocation failure on POS load"),
NTRANS("Error opening pos file"),
NTRANS("Pos file empty"),
NTRANS("Pos file size appears to have non-integer number of entries"),
NTRANS("Error reading from pos file (after open)"),
NTRANS("Error - Found NaN in pos file"),
NTRANS("Error - Found Inf in pos file"),
}
#define NTRANS(x)
Gettext null-translation macro (mark for translation, but do nothing)
Definition: translation.h:33

Referenced by DataLoadFilter::refresh().

◆ PROGRESS_REDUCE

const size_t PROGRESS_REDUCE =5000

◆ TAPSIM_ERR_STRINGS

const char* TAPSIM_ERR_STRINGS[]
Initial value:
= {"",
NTRANS("Error interpreting file contents"),
NTRANS("Error opening file"),
NTRANS("Aborted opening file"),
}
#define NTRANS(x)
Gettext null-translation macro (mark for translation, but do nothing)
Definition: translation.h:33

Referenced by DataLoadFilter::refresh().

◆ TEXT_LOAD_ERR_STRINGS

const char* TEXT_LOAD_ERR_STRINGS[]
Initial value:
= { "",
NTRANS("Error opening file"),
NTRANS("Only found header, no data"),
NTRANS("Unable to reopen file after first scan"),
NTRANS("Error whilst reading file contents"),
NTRANS("Unexpected file format"),
NTRANS("Unexpected file format"),
NTRANS("Insufficient memory to continue"),
}
#define NTRANS(x)
Gettext null-translation macro (mark for translation, but do nothing)
Definition: translation.h:33

Referenced by DataLoadFilter::refresh().