BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
AutomaticDataLoader1DResultModel.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/DataLoaders/AutomaticDataLoader1DResultModel.cpp
6 //! @brief Implements class AutomaticDataLoader1DResultModel
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2021
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
18 
20  : m_item(item)
21 {
22 }
23 
25 {
26  return false;
27 }
28 
30 {
32  if (!data)
33  return 0;
34 
35  return int(data->getAllocatedSize());
36 }
37 
39 {
40  return false;
41 }
42 
44 {
45  switch (column) {
46  case 0:
47  return "Q [1/nm]";
48  case 1:
49  return "R";
50  }
51  return QString();
52 }
53 
55 {
56  return (type == ColumnType::processed) ? 2 : 0;
57 }
58 
59 QString AutomaticDataLoader1DResultModel::cellText(ColumnType type, int row, int col) const
60 {
61  if (col < 0 || row < 0 || row >= rowCount() || type != ColumnType::processed)
62  return QString();
63 
65 
66  if (col == 0)
67  return QString::number(data->getAxisValue(row, 0));
68 
69  if (col == 1)
70  return QString::number(data->operator[](row));
71 
72  return QString();
73 }
Defines class AutomaticDataLoader1DResultModel.
Defines class RealDataItem.
Defines class SpecularDataItem.
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
virtual QString cellText(ColumnType type, int row, int col) const override
The text of the given cell.
virtual int rowCount() const override
The row count of the result table.
virtual bool rowHasError(int row) const override
Returns whether the row given in the index contains errors. Row counting starts with 0.
virtual int columnCount(ColumnType type) const override
The number of existing columns related to the given column type.
virtual QString headerTextOfCalculatedColumn(int column) const override
Return the table header text for the given column.
virtual bool rowIsSkipped(int row) const override
Returns whether the row given in the index is a skipped row. Row counting starts with 0.
OutputData< double > * getOutputData()
Definition: DataItem.h:36
The RealDataItem class represents intensity data imported from file and intended for fitting.
Definition: RealDataItem.h:35
SpecularDataItem * specularDataItem()