TestState.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of ArmarX.
3
*
4
* Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5
*
6
* ArmarX is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation.
9
*
10
* ArmarX is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*
18
* @package RobotAPI::StatechartProfilesTestGroup
19
* @author Valerij Wittenbeck ( valerij dot wittenbeck at student dot kit dot edu )
20
* @date 2015
21
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22
* GNU General Public License
23
*/
24
25
#include "
TestState.h
"
26
27
using namespace
armarx
;
28
using namespace
StatechartProfilesTestGroup;
29
30
// DO NOT EDIT NEXT LINE
31
TestState::SubClassRegistry
TestState::Registry
(TestState::GetName(), &
TestState::CreateInstance
);
32
33
34
35
TestState::TestState
(
const
XMLStateConstructorParams
& stateData) :
36
XMLStateTemplate
<
TestState
>(stateData), TestStateGeneratedBase<
TestState
>(stateData)
37
{
38
}
39
40
void
TestState::onEnter
()
41
{
42
std::string emptyString = in.getEmptyStringTest();
43
std::string TestParam1 = in.getTestParam1();
44
std::string TestParam2 = in.getTestParam2();
45
std::string TestParam3 = in.getTestParam3();
46
47
ARMARX_IMPORTANT
<<
"TestParam1: "
<< TestParam1;
48
ARMARX_IMPORTANT
<<
"TestParam2: "
<< TestParam2;
49
ARMARX_IMPORTANT
<<
"TestParam3: "
<< TestParam3;
50
51
ARMARX_CHECK_EXPRESSION
(emptyString ==
""
) <<
"EmptyStringTest is not empty."
;
52
ARMARX_CHECK_EXPRESSION
(TestParam1 ==
"OnlyRootSet"
);
53
ARMARX_CHECK_EXPRESSION
(TestParam2 ==
"Armar3BaseSet"
);
54
ARMARX_CHECK_EXPRESSION
(TestParam3 ==
"Armar3aSet"
|| TestParam3 ==
"Armar3SimulationSet"
);
55
ARMARX_IMPORTANT
<<
"All tests passed."
;
56
}
57
58
void
TestState::run
()
59
{
60
// put your user code for the execution-phase here
61
// runs in seperate thread, thus can do complex operations
62
// should check constantly whether isRunningTaskStopped() returns true
63
64
// uncomment this if you need a continous run function. Make sure to use sleep or use blocking wait to reduce cpu load.
65
// while (!isRunningTaskStopped()) // stop run function if returning true
66
// {
67
// // do your calculations
68
// }
69
70
}
71
72
void
TestState::onBreak
()
73
{
74
// put your user code for the breaking point here
75
// execution time should be short (<100ms)
76
}
77
78
void
TestState::onExit
()
79
{
80
// put your user code for the exit point here
81
// execution time should be short (<100ms)
82
83
}
84
85
86
// DO NOT EDIT NEXT FUNCTION
87
XMLStateFactoryBasePtr
TestState::CreateInstance
(
XMLStateConstructorParams
stateData)
88
{
89
return
XMLStateFactoryBasePtr
(
new
TestState
(stateData));
90
}
91
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition:
Logging.h:183
armarx::StatechartProfilesTestGroup::TestState::run
void run() override
Definition:
TestState.cpp:58
armarx::StatechartProfilesTestGroup::TestState::onEnter
void onEnter() override
Definition:
TestState.cpp:40
armarx::XMLStateConstructorParams
Definition:
XMLState.h:50
IceInternal::Handle
Definition:
forward_declarations.h:8
armarx::StatechartProfilesTestGroup::TestState
Definition:
TestState.h:31
armarx::XMLStateTemplate
Class for legacy to stay compatible with old statecharts.
Definition:
XMLState.h:137
TestState.h
armarx::XMLStateFactoryBasePtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition:
XMLState.h:65
armarx::StatechartProfilesTestGroup::TestState::onExit
void onExit() override
Definition:
TestState.cpp:78
ARMARX_CHECK_EXPRESSION
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
Definition:
ExpressionException.h:73
armarx::StatechartProfilesTestGroup::TestState::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition:
TestState.cpp:87
armarx::StatechartProfilesTestGroup::TestState::Registry
static SubClassRegistry Registry
Definition:
TestState.h:45
armarx::StatechartProfilesTestGroup::TestState::TestState
TestState(const XMLStateConstructorParams &stateData)
Definition:
TestState.cpp:35
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition:
ArmarXTimeserver.cpp:28
armarx::StatechartProfilesTestGroup::TestState::onBreak
void onBreak() override
Definition:
TestState.cpp:72
RobotAPI
statecharts
StatechartProfilesTestGroup
TestState.cpp
Generated on Sat Oct 12 2024 09:14:12 for armarx_documentation by
1.8.17