NorMIT-nav  18.04-rc6
An IGT application
cxAcquisitionData.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 CXACQUISITIONDATA_H_
13 #define CXACQUISITIONDATA_H_
14 
15 #include "org_custusx_acquisition_Export.h"
16 
17 #include <QObject>
18 class QDomNode;
19 #include <vector>
20 #include "cxRecordSession.h"
21 #include "cxAcquisitionService.h"
22 
23 
24 namespace cx
25 {
26 typedef boost::shared_ptr<class UsReconstructionService> UsReconstructionServicePtr;
27 typedef boost::shared_ptr<class VisServices> VisServicesPtr;
28 
41 class org_custusx_acquisition_EXPORT AcquisitionData : public QObject
42 {
43  Q_OBJECT
44 
45 public:
47  AcquisitionData(VisServicesPtr services, UsReconstructionServicePtr reconstructer);
48  virtual ~AcquisitionData();
49 
50  void addRecordSession(RecordSessionPtr session);
51  void removeRecordSession(RecordSessionPtr session);
52  std::vector<RecordSessionPtr> getRecordSessions();
53  RecordSessionPtr getRecordSession(QString uid);
54 // QString getNewUid();
55  int getNewSessionId();
56 
57  VisServicesPtr getServices() { return mServices; }
58  UsReconstructionServicePtr getReconstructer() { return mReconstructer; }
59 
60  //Interface for saving/loading
61  void addXml(QDomNode& dataNode);
62  void parseXml(QDomNode& dataNode);
63 
64  void clear();
65 signals:
66  void recordedSessionsChanged();
67 
68 private:
69  std::vector<RecordSessionPtr> mRecordSessions;
70 
71  // referenced plugins:
72  VisServicesPtr mServices;
73  UsReconstructionServicePtr mReconstructer;
74 };
75 typedef boost::shared_ptr<AcquisitionData> AcquisitionDataPtr;
76 
77 
78 
82 class org_custusx_acquisition_EXPORT Acquisition : public QObject
83 {
84  Q_OBJECT
85 
86 public:
87  Acquisition(AcquisitionDataPtr pluginData, QObject* parent = 0);
88  virtual ~Acquisition();
89 
90  bool isReady(AcquisitionService::TYPES) const;
91  QString getInfoText(AcquisitionService::TYPES) const;
92 
96  void startRecord(AcquisitionService::TYPES context, QString category, RecordSessionPtr session);
100  void stopRecord();
104  void cancelRecord();
108  void startPostProcessing();
112  void stopPostProcessing();
113 
119  RecordSessionPtr getLatestSession() { return mLatestSession; }
122  AcquisitionService::STATE getState() const { return mCurrentState; }
123  AcquisitionDataPtr getPluginData() { return mPluginData; }
124  AcquisitionService::TYPES getCurrentContext() const { return mCurrentContext; }
125 
126 signals:
129  void stateChanged();
132  void started();
136  void acquisitionStopped();
140  void cancelled();
144  void readinessChanged();
145 
146 private:
147  RecordSessionPtr mLatestSession;
148  void setState(AcquisitionService::STATE newState);
149  AcquisitionService::STATE mCurrentState;
150  AcquisitionService::TYPES mCurrentContext;
151  AcquisitionDataPtr mPluginData;
152 
153  bool mReady;
154  QString mInfoText;
155 
156  void setReady(bool val, QString text);
157  void checkIfReadySlot();
158  VisServicesPtr getServices();
159 };
160 typedef boost::shared_ptr<Acquisition> AcquisitionPtr;
161 
162 
166 }
167 
168 #endif /* CXACQUISITIONDATA_H_ */
boost::shared_ptr< class UsReconstructionService > UsReconstructionServicePtr
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
VisServicesPtr getServices()
boost::shared_ptr< class Acquisition > AcquisitionPtr
RecordSessionPtr getLatestSession()
boost::shared_ptr< class AcquisitionData > AcquisitionDataPtr
AcquisitionService::TYPES getCurrentContext() const
boost::shared_ptr< class RecordSession > RecordSessionPtr
AcquisitionService::STATE getState() const
UsReconstructionServicePtr getReconstructer()
AcquisitionDataPtr getPluginData()
Namespace for all CustusX production code.