NorMIT-nav  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 
cxLogger.h
cx::NavigationWorkflowState::onEntry
virtual void onEntry(QEvent *event)
Definition: cxCustusXWorkflowStates.cpp:34
cx::RegistrationWorkflowState::RegistrationWorkflowState
RegistrationWorkflowState(QState *parent, CoreServicesPtr services)
Definition: cxCustusXWorkflowStates.cpp:51
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::IntraOpImagingWorkflowState::IntraOpImagingWorkflowState
IntraOpImagingWorkflowState(QState *parent, CoreServicesPtr services)
Definition: cxCustusXWorkflowStates.cpp:89
cx::WorkflowState
State in a WorkflowStateMachine.
Definition: cxWorkflowState.h:42
cx::IntraOpImagingWorkflowState::onEntry
virtual void onEntry(QEvent *event)
Definition: cxCustusXWorkflowStates.cpp:95
cx::PreOpPlanningWorkflowState::canEnter
virtual bool canEnter() const
Definition: cxCustusXWorkflowStates.cpp:78
cx::PreOpPlanningWorkflowState::PreOpPlanningWorkflowState
PreOpPlanningWorkflowState(QState *parent, CoreServicesPtr services)
Definition: cxCustusXWorkflowStates.cpp:72
cx::IntraOpImagingWorkflowState::canEnter
virtual bool canEnter() const
Definition: cxCustusXWorkflowStates.cpp:101
cxCustusXWorkflowStates.h
cx::NavigationWorkflowState::canEnter
virtual bool canEnter() const
Definition: cxCustusXWorkflowStates.cpp:40
cx::NavigationWorkflowState::NavigationWorkflowState
NavigationWorkflowState(QState *parent, CoreServicesPtr services)
Definition: cxCustusXWorkflowStates.cpp:28
cx::PostOpControllWorkflowState::PostOpControllWorkflowState
PostOpControllWorkflowState(QState *parent, CoreServicesPtr services)
Definition: cxCustusXWorkflowStates.cpp:112
cxVideoService.h
cx::CoreServicesPtr
boost::shared_ptr< class CoreServices > CoreServicesPtr
Definition: cxCameraStyle.h:37
cxTool.h
cxPatientModelService.h
cx::RegistrationWorkflowState::canEnter
virtual bool canEnter() const
Definition: cxCustusXWorkflowStates.cpp:58
cxSettings.h
cxStateService.h
cx::WorkflowState::mServices
CoreServicesPtr mServices
Definition: cxWorkflowState.h:85
cx::WorkflowState::autoStartHardware
void autoStartHardware()
Definition: cxWorkflowState.cpp:80
cxCoreServices.h
cx::WorkflowState::canEnterSlot
void canEnterSlot()
Definition: cxWorkflowState.cpp:68
cx::WorkflowState::onEntry
virtual void onEntry(QEvent *event)
Definition: cxWorkflowState.cpp:25
cx::PostOpControllWorkflowState::canEnter
virtual bool canEnter() const
Definition: cxCustusXWorkflowStates.cpp:118
cxTrackingService.h