Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxCustusXWorkflowStates.cpp
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 
13 #include "cxStateService.h"
14 #include "cxSettings.h"
15 #include "cxTrackingService.h"
16 #include "cxTool.h"
17 #include "cxVideoService.h"
18 #include "cxPatientModelService.h"
19 #include "cxLogger.h"
20 #include "cxCoreServices.h"
21 
22 namespace cx
23 {
24 
25 // --------------------------------------------------------
26 // --------------------------------------------------------
27 
29  WorkflowState(parent, "NavigationUid", "Navigation", services)
30 {
31  connect(mServices->patient().get(), SIGNAL(patientChanged()), this, SLOT(canEnterSlot()));
32 }
33 
35 {
37  this->autoStartHardware();
38 }
39 
41 {
42  return mServices->patient()->isPatientValid();
43 }
44 
45 // --------------------------------------------------------
46 // --------------------------------------------------------
47 
48 // --------------------------------------------------------
49 // --------------------------------------------------------
50 
52  WorkflowState(parent, "RegistrationUid", "Registration", services)
53 {
54  connect(mServices->patient().get(), SIGNAL(patientChanged()), this, SLOT(canEnterSlot()));
55 }
56 ;
57 
59 {
60 // We need to perform patient orientation prior to
61 // running and us acq. Thus we need access to the reg mode.
62  return mServices->patient()->isPatientValid();
63 }
64 ;
65 
66 // --------------------------------------------------------
67 // --------------------------------------------------------
68 
69 // --------------------------------------------------------
70 // --------------------------------------------------------
71 
73  WorkflowState(parent, "PreOpPlanningUid", "Preoperative Planning", services)
74 {
75  connect(mServices->patient().get(), SIGNAL(dataAddedOrRemoved()), this, SLOT(canEnterSlot()));
76 }
77 
79 {
80  return !mServices->patient()->getDatas().empty();
81 }
82 
83 // --------------------------------------------------------
84 // --------------------------------------------------------
85 
86 // --------------------------------------------------------
87 // --------------------------------------------------------
88 
90  WorkflowState(parent, "IntraOpImagingUid", "Intraoperative Imaging", services)
91 {
92  connect(mServices->patient().get(), SIGNAL(patientChanged()), this, SLOT(canEnterSlot()));
93 }
94 
96 {
98  this->autoStartHardware();
99 }
100 
102 {
103  return mServices->patient()->isPatientValid();
104 }
105 
106 // --------------------------------------------------------
107 // --------------------------------------------------------
108 
109 // --------------------------------------------------------
110 // --------------------------------------------------------
111 
113  WorkflowState(parent, "PostOpControllUid", "Postoperative Control", services)
114 {
115  connect(mServices->patient().get(), SIGNAL(dataAddedOrRemoved()), this, SLOT(canEnterSlot()));
116 }
117 
119 {
120  return !mServices->patient()->getDatas().empty();
121 }
122 
123 }
124 
virtual void onEntry(QEvent *event)
PreOpPlanningWorkflowState(QState *parent, CoreServicesPtr services)
CoreServicesPtr mServices
virtual bool canEnter() const
virtual void onEntry(QEvent *event)
RegistrationWorkflowState(QState *parent, CoreServicesPtr services)
PostOpControllWorkflowState(QState *parent, CoreServicesPtr services)
virtual void onEntry(QEvent *event)
State in a WorkflowStateMachine.
IntraOpImagingWorkflowState(QState *parent, CoreServicesPtr services)
boost::shared_ptr< class CoreServices > CoreServicesPtr
Definition: cxCameraStyle.h:37
NavigationWorkflowState(QState *parent, CoreServicesPtr services)
Namespace for all CustusX production code.