ALFCustomInstrumentModel.h 3.2 KB
Newer Older
1
2
3
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2014 ISIS Rutherford Appleton Laboratory UKRI,
4
5
//   NScD Oak Ridge National Laboratory, European Spallation Source,
//   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#pragma once
8

9
#include "DllConfig.h"
10
#include "MantidAPI/CompositeFunction.h"
Anthony Lim's avatar
Anthony Lim committed
11
#include "MantidAPI/FunctionFactory.h"
12
#include "MantidQtWidgets/InstrumentView/BaseCustomInstrumentModel.h"
13

14
#include <map>
15
#include <memory>
16
17
18
19
20
#include <string>

namespace MantidQt {
namespace CustomInterfaces {

Samuel Jones's avatar
Samuel Jones committed
21
class MANTIDQT_DIRECT_DLL IALFCustomInstrumentModel : public virtual MantidWidgets::IBaseCustomInstrumentModel {
22
23

public:
Anthony Lim's avatar
Anthony Lim committed
24
  IALFCustomInstrumentModel() {}
25
  virtual ~IALFCustomInstrumentModel(){};
26
  // virtual so we can patch them later
27
28
29
30
31
32
33
34
35
36
37
  virtual void loadAlg(const std::string &name) = 0;
  virtual void transformData() = 0;
  virtual std::map<std::string, bool> isDataValid() = 0;
  virtual void storeSingleTube(const std::string &name) = 0;
  virtual void averageTube() = 0;
  virtual bool hasTubeBeenExtracted(const std::string &name) = 0;
  virtual bool extractTubeCondition(std::map<std::string, bool> tabBools) = 0;
  virtual bool averageTubeCondition(std::map<std::string, bool> tabBools) = 0;
  virtual void extractSingleTube() = 0;
  virtual std::string WSName() = 0;
  virtual Mantid::API::CompositeFunction_sptr getDefaultFunction() = 0;
38
39
};

40
class DLLExport ALFCustomInstrumentModel : public IALFCustomInstrumentModel {
41

42
public:
43
  ALFCustomInstrumentModel();
44
  virtual ~ALFCustomInstrumentModel() = default;
45
  // virtual so we can patch them later
46
47
  virtual void loadAlg(const std::string &name) override;
  virtual void transformData() override;
48
49
50
51
52
  std::pair<int, std::string> loadData(const std::string &name) override final;
  std::map<std::string, bool> isDataValid() override;
  void storeSingleTube(const std::string &name) override;
  void averageTube() override;
  bool hasTubeBeenExtracted(const std::string &name) override;
53
54
  bool extractTubeCondition(std::map<std::string, bool> tabBools) override;
  bool averageTubeCondition(std::map<std::string, bool> tabBools) override;
55
56
57
  void extractSingleTube() override;
  std::string WSName() override;
  Mantid::API::CompositeFunction_sptr getDefaultFunction() override;
58

59
60
61
62
63
64
  void loadEmptyInstrument() override { m_base->loadEmptyInstrument(); };
  void setCurrentRun(int &run) override { m_base->setCurrentRun(run); };
  int getCurrentRun() override { return m_base->getCurrentRun(); };
  void rename() override { m_base->rename(); };
  void remove() override { m_base->remove(); };
  std::string dataFileName() override { return m_base->dataFileName(); };
65
  int currentRun() override { return m_base->currentRun(); };
66
  bool isErrorCode(const int run) override { return m_base->isErrorCode(run); };
Samuel Jones's avatar
Samuel Jones committed
67
  const std::string getInstrument() override { return m_base->getInstrument(); };
68
69
70
  const std::string getTmpName() override { return m_base->getTmpName(); };
  const std::string getWSName() override { return m_base->getWSName(); };

71
72
private:
  int m_numberOfTubesInAverage;
73
  std::unique_ptr<MantidWidgets::BaseCustomInstrumentModel> m_base;
74
};
75

76
} // namespace CustomInterfaces
77
} // namespace MantidQt