BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
QREDataLoader::ImportResult Struct Reference

Result of the file import. More...

Collaboration diagram for QREDataLoader::ImportResult:
[legend]

Public Member Functions

void addError (int line, ErrorDefinition::Type type, double data)
 
void addError (int line, ErrorDefinition::Type type, int data=0)
 
void clear ()
 
void clearCalculatedValues ()
 
QString errorText (int line) const
 

Public Attributes

QMap< int, ErrorDefinitioncalculationErrors
 calculation error per line; line is 0-based More...
 
QString error
 error unrelated to lines More...
 
QVector< double > eValues
 index is 0-based line number More...
 
ImportSettings importSettings
 Settings used for the import. More...
 
QVector< QPair< bool, QString > > lines
 bool describes whether line is skipped index is 0-based line number More...
 
int maxColumnCount
 max found columns in raw data More...
 
QVector< double > qValues
 index is 0-based line number More...
 
QVector< QVector< double > > rawValues
 index is 0-based line number More...
 
QVector< double > rValues
 index is 0-based line number More...
 
int validCalculatedLines
 number of valid resulting data rows More...
 

Detailed Description

Result of the file import.

Some of the contained data is only relevant for showing the results in the result table. The usage of vectors which cover also invalid or skipped lines has its reason also in this result showing (to improve presentation performance).

Definition at line 105 of file QREDataLoader.h.

Member Function Documentation

◆ addError() [1/2]

void QREDataLoader::ImportResult::addError ( int  line,
ErrorDefinition::Type  type,
double  data 
)

Definition at line 650 of file QREDataLoader.cpp.

651 {
652  calculationErrors[line] = ErrorDefinition(type, data);
653 }
QMap< int, ErrorDefinition > calculationErrors
calculation error per line; line is 0-based

◆ addError() [2/2]

void QREDataLoader::ImportResult::addError ( int  line,
ErrorDefinition::Type  type,
int  data = 0 
)

Definition at line 645 of file QREDataLoader.cpp.

646 {
647  calculationErrors[line] = ErrorDefinition(type, data);
648 }

Referenced by QREDataLoader::calculateFromParseResult().

◆ clear()

void QREDataLoader::ImportResult::clear ( )

Definition at line 622 of file QREDataLoader.cpp.

623 {
624  lines.clear();
625  rawValues.clear();
626  qValues.clear();
627  rValues.clear();
628  eValues.clear();
630  maxColumnCount = 0;
631  calculationErrors.clear();
632  error.clear();
633  importSettings.columnDefinitions.clear(); // sufficient
634 }
QVector< double > rValues
index is 0-based line number
int maxColumnCount
max found columns in raw data
QString error
error unrelated to lines
int validCalculatedLines
number of valid resulting data rows
QVector< QVector< double > > rawValues
index is 0-based line number
QVector< double > eValues
index is 0-based line number
ImportSettings importSettings
Settings used for the import.
QVector< double > qValues
index is 0-based line number
QVector< QPair< bool, QString > > lines
bool describes whether line is skipped index is 0-based line number
QMap< DataType, ColumnDefinition > columnDefinitions
Definition: QREDataLoader.h:71

References calculationErrors, QREDataLoader::ImportSettings::columnDefinitions, error, eValues, importSettings, lines, maxColumnCount, qValues, rawValues, rValues, and validCalculatedLines.

Referenced by QREDataLoader::deserialize(), and QREDataLoader::parseFileContent().

◆ clearCalculatedValues()

void QREDataLoader::ImportResult::clearCalculatedValues ( )

Definition at line 636 of file QREDataLoader.cpp.

637 {
638  qValues.clear();
639  rValues.clear();
640  eValues.clear();
641  calculationErrors.clear();
643 }

Referenced by QREDataLoader::calculateFromParseResult().

◆ errorText()

QString QREDataLoader::ImportResult::errorText ( int  line) const

Definition at line 655 of file QREDataLoader.cpp.

656 {
657  auto error = calculationErrors.value(line, ErrorDefinition());
658  return error.type == ErrorDefinition::none ? QString() : error.toString();
659 }
std::string toString(PyObject *obj)
Converts PyObject into string, if possible, or throws exception.
Definition: PyUtils.cpp:24

References QREDataLoader::ErrorDefinition::none.

Referenced by QREDataLoaderResultModel::cellText().

Member Data Documentation

◆ calculationErrors

◆ error

QString QREDataLoader::ImportResult::error

◆ eValues

QVector<double> QREDataLoader::ImportResult::eValues

◆ importSettings

ImportSettings QREDataLoader::ImportResult::importSettings

◆ lines

◆ maxColumnCount

int QREDataLoader::ImportResult::maxColumnCount

◆ qValues

QVector<double> QREDataLoader::ImportResult::qValues

◆ rawValues

QVector<QVector<double> > QREDataLoader::ImportResult::rawValues

◆ rValues

QVector<double> QREDataLoader::ImportResult::rValues

◆ validCalculatedLines

int QREDataLoader::ImportResult::validCalculatedLines

The documentation for this struct was generated from the following files: