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

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

Public Types

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

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
 

Member Enumeration Documentation

◆ Type

Enumerator
none 
columnDoesNotContainValidNumber 
duplicateQ 
RGreaterOne 
RLessZero 

Definition at line 86 of file QREDataLoader.h.

Constructor & Destructor Documentation

◆ ErrorDefinition() [1/2]

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

Definition at line 725 of file QREDataLoader.cpp.

726  : type(t)
727  , data(d)
728 {
729 }
std::variant< int, double > data
Additional data; meaning depends on the error type (see implementation of toString() for more informa...

◆ ErrorDefinition() [2/2]

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

Definition at line 730 of file QREDataLoader.cpp.

731  : type(t)
732  , data(d)
733 {
734 }

Member Function Documentation

◆ toString()

QString QREDataLoader::ErrorDefinition::toString ( ) const

Human readable error text.

Definition at line 736 of file QREDataLoader.cpp.

737 {
738  switch (type) {
740  return QString("Raw column %1 does not contain a valid number - line is discarded")
741  .arg(std::get<int>(data));
742 
743  case duplicateQ:
744  return QString("The value %1 for Q is duplicate - line is discarded")
745  .arg(std::get<double>(data));
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  default:
756  return "Unspecified error";
757  }
758 }

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

◆ type

Type QREDataLoader::ErrorDefinition::type

Definition at line 100 of file QREDataLoader.h.


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