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

Contains a line related error (stored in the import result). More...

Public Types

enum  Type {
  none = 0 , columnDoesNotContainValidNumber = 1 , duplicateQ = 2 , wrongQOrder = 3 ,
  RGreaterOne = 4 , RLessZero = 5
}
 

Public Member Functions

 ErrorDefinition (Type t, double d)
 
 ErrorDefinition (Type t=none, int d=0)
 
QString toString () const
 Human readable error text. More...
 

Public Attributes

std::variant< int, double > data
 Additional data; meaning depends on the error type (see implementation of toString() for more information) More...
 
Type type
 

Detailed Description

Contains a line related error (stored in the import result).

Used for showing line related errors in the import data table.

Definition at line 80 of file QREDataLoader.h.

Member Enumeration Documentation

◆ Type

Enumerator
none 
columnDoesNotContainValidNumber 
duplicateQ 
wrongQOrder 
RGreaterOne 
RLessZero 

Definition at line 82 of file QREDataLoader.h.

Constructor & Destructor Documentation

◆ ErrorDefinition() [1/2]

QREDataLoader::ErrorDefinition::ErrorDefinition ( Type  t = none,
int  d = 0 
)

Definition at line 730 of file QREDataLoader.cpp.

730 : type(t), data(d) {}
std::variant< int, double > data
Additional data; meaning depends on the error type (see implementation of toString() for more informa...
Definition: QREDataLoader.h:98

◆ ErrorDefinition() [2/2]

QREDataLoader::ErrorDefinition::ErrorDefinition ( Type  t,
double  d 
)

Definition at line 731 of file QREDataLoader.cpp.

731 : type(t), data(d) {}

Member Function Documentation

◆ toString()

QString QREDataLoader::ErrorDefinition::toString ( ) const

Human readable error text.

Definition at line 733 of file QREDataLoader.cpp.

734 {
735  switch (type) {
737  return QString("Raw column %1 does not contain a valid number - line is discarded")
738  .arg(std::get<int>(data));
739 
740  case duplicateQ:
741  return QString("The value %1 for Q is duplicate - line is discarded")
742  .arg(std::get<double>(data));
743 
744  case wrongQOrder:
745  return QString("Q coordinates must be sorted in ascending order - line is discarded");
746 
747  case RGreaterOne:
748  return QString("The value %1 for R is greater than 1.0 - line is discarded")
749  .arg(std::get<double>(data));
750 
751  case RLessZero:
752  return QString("The value %1 for R is less than 0 - line is discarded")
753  .arg(std::get<double>(data));
754  }
755 
756  return "Unspecified error";
757 }

Member Data Documentation

◆ data

std::variant<int, double> QREDataLoader::ErrorDefinition::data

Additional data; meaning depends on the error type (see implementation of toString() for more information)

Definition at line 98 of file QREDataLoader.h.

◆ type

Type QREDataLoader::ErrorDefinition::type

Definition at line 97 of file QREDataLoader.h.


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