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

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 108 of file QREDataLoader.h.

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...
 

Member Function Documentation

◆ addError() [1/2]

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

Definition at line 645 of file QREDataLoader.cpp.

646 {
647  calculationErrors[line] = ErrorDefinition(type, data);
648 }
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 640 of file QREDataLoader.cpp.

641 {
642  calculationErrors[line] = ErrorDefinition(type, data);
643 }

Referenced by QREDataLoader::calculateFromParseResult().

◆ clear()

void QREDataLoader::ImportResult::clear ( )

Definition at line 617 of file QREDataLoader.cpp.

618 {
619  lines.clear();
620  rawValues.clear();
621  qValues.clear();
622  rValues.clear();
623  eValues.clear();
625  maxColumnCount = 0;
626  calculationErrors.clear();
627  error.clear();
628  importSettings.columnDefinitions.clear(); // sufficient
629 }
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:75

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 631 of file QREDataLoader.cpp.

632 {
633  qValues.clear();
634  rValues.clear();
635  eValues.clear();
636  calculationErrors.clear();
638 }

Referenced by QREDataLoader::calculateFromParseResult().

◆ errorText()

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

Definition at line 650 of file QREDataLoader.cpp.

651 {
652  auto error = calculationErrors.value(line, ErrorDefinition());
653  return error.type == ErrorDefinition::none ? QString() : error.toString();
654 }
QString toString(const QModelIndex &index)
Provides string representation of index data.

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: