CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxAcquisitionService.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXACQUSITIONSERVICE_H
13 #define CXACQUSITIONSERVICE_H
14 
15 #include "org_custusx_acquisition_Export.h"
16 
17 #include <QObject>
18 #include <vector>
19 #include <boost/shared_ptr.hpp>
20 class QDomNode;
21 
22 #define AcquisitionService_iid "cx::AcquisitionService"
23 
24 namespace cx
25 {
26 
27 typedef boost::shared_ptr<class AcquisitionService> AcquisitionServicePtr;
28 typedef boost::shared_ptr<class RecordSession> RecordSessionPtr;
29 
36 class org_custusx_acquisition_EXPORT AcquisitionService : public QObject
37 {
38  Q_OBJECT
39 public:
40  virtual ~AcquisitionService() {}
41 
42  enum TYPE
43  {
45  tUS,
46  tCOUNT
47  };
48  typedef QFlags<TYPE> TYPES;
49 // Q_DECLARE_FLAGS( TYPES, TYPE);
50 
51  enum STATE
52  {
53  sRUNNING = 0,
54  sPOST_PROCESSING = 1,
55  sNOT_RUNNING = 2
56  };
57 
58  // Core interface
59 
60  virtual bool isNull() = 0;
61  static AcquisitionServicePtr getNullObject();
62 
63  virtual RecordSessionPtr getLatestSession() = 0;
64  virtual std::vector<RecordSessionPtr> getSessions() = 0;
65 
66  virtual bool isReady(TYPES context) const = 0;
67  virtual QString getInfoText(TYPES context) const = 0;
68  virtual STATE getState() const = 0;
69 // virtual void toggleRecord(TYPES context, QString category);
70  virtual void startRecord(TYPES context, QString category, RecordSessionPtr session = RecordSessionPtr()) = 0;
71  virtual void stopRecord() = 0;
72  virtual void cancelRecord() = 0;
73  virtual void startPostProcessing() = 0;
74  virtual void stopPostProcessing() = 0;
75 
76  virtual int getNumberOfSavingThreads() const = 0;
77 
78  // Extented interface
79 
80  RecordSessionPtr getSession(QString uid);
81 
82 signals:
83  void started();
84  void cancelled();
85  void stateChanged();
86  void usReadinessChanged();
87  void acquisitionStopped();
88 
89  void recordedSessionsChanged();
90 
91  // From USAcquisition
92  void acquisitionDataReady();
93  void saveDataCompleted(QString mhdFilename);
94 };
95 
96 } // cx
98 
99 #endif // CXACQUSITIONSERVICE_H
Acqusition services abstract interface.
#define AcquisitionService_iid
boost::shared_ptr< class AcquisitionService > AcquisitionServicePtr
boost::shared_ptr< class RecordSession > RecordSessionPtr
Namespace for all CustusX production code.