NorMIT-nav
22.09
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
12
#include "
cxCustusXWorkflowStates.h
"
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
28
NavigationWorkflowState::NavigationWorkflowState
(QState* parent,
CoreServicesPtr
services) :
29
WorkflowState
(parent,
"NavigationUid"
,
"Navigation"
, services)
30
{
31
connect(
mServices
->patient().get(), SIGNAL(patientChanged()),
this
, SLOT(
canEnterSlot
()));
32
}
33
34
void
NavigationWorkflowState::onEntry
(QEvent * event)
35
{
36
WorkflowState::onEntry
(event);
37
this->
autoStartHardware
();
38
}
39
40
bool
NavigationWorkflowState::canEnter
()
const
41
{
42
return
mServices
->patient()->isPatientValid();
43
}
44
45
// --------------------------------------------------------
46
// --------------------------------------------------------
47
48
// --------------------------------------------------------
49
// --------------------------------------------------------
50
51
RegistrationWorkflowState::RegistrationWorkflowState
(QState* parent,
CoreServicesPtr
services) :
52
WorkflowState
(parent,
"RegistrationUid"
,
"Registration"
, services)
53
{
54
connect(
mServices
->patient().get(), SIGNAL(patientChanged()),
this
, SLOT(
canEnterSlot
()));
55
}
56
;
57
58
bool
RegistrationWorkflowState::canEnter
()
const
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
72
PreOpPlanningWorkflowState::PreOpPlanningWorkflowState
(QState* parent,
CoreServicesPtr
services) :
73
WorkflowState
(parent,
"PreOpPlanningUid"
,
"Preoperative Planning"
, services)
74
{
75
connect(
mServices
->patient().get(), SIGNAL(dataAddedOrRemoved()),
this
, SLOT(
canEnterSlot
()));
76
}
77
78
bool
PreOpPlanningWorkflowState::canEnter
()
const
79
{
80
return
!
mServices
->patient()->getDatas().empty();
81
}
82
83
// --------------------------------------------------------
84
// --------------------------------------------------------
85
86
// --------------------------------------------------------
87
// --------------------------------------------------------
88
89
IntraOpImagingWorkflowState::IntraOpImagingWorkflowState
(QState* parent,
CoreServicesPtr
services) :
90
WorkflowState
(parent,
"IntraOpImagingUid"
,
"Intraoperative Imaging"
, services)
91
{
92
connect(
mServices
->patient().get(), SIGNAL(patientChanged()),
this
, SLOT(
canEnterSlot
()));
93
}
94
95
void
IntraOpImagingWorkflowState::onEntry
(QEvent * event)
96
{
97
WorkflowState::onEntry
(event);
98
this->
autoStartHardware
();
99
}
100
101
bool
IntraOpImagingWorkflowState::canEnter
()
const
102
{
103
return
mServices
->patient()->isPatientValid();
104
}
105
106
// --------------------------------------------------------
107
// --------------------------------------------------------
108
109
// --------------------------------------------------------
110
// --------------------------------------------------------
111
112
PostOpControllWorkflowState::PostOpControllWorkflowState
(QState* parent,
CoreServicesPtr
services) :
113
WorkflowState
(parent,
"PostOpControllUid"
,
"Postoperative Control"
, services)
114
{
115
connect(
mServices
->patient().get(), SIGNAL(dataAddedOrRemoved()),
this
, SLOT(
canEnterSlot
()));
116
}
117
118
bool
PostOpControllWorkflowState::canEnter
()
const
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
CX
source
plugins
org.custusx.core.state
cxCustusXWorkflowStates.cpp
Generated on Tue Sep 13 2022 11:06:13 for NorMIT-nav by
1.8.17