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
TestState::TestState
(
const
XMLStateConstructorParams
& stateData) :
34
XMLStateTemplate
<
TestState
>(stateData), TestStateGeneratedBase<
TestState
>(stateData)
35
{
36
}
37
38
void
39
TestState::onEnter
()
40
{
41
std::string emptyString = in.getEmptyStringTest();
42
std::string TestParam1 = in.getTestParam1();
43
std::string TestParam2 = in.getTestParam2();
44
std::string TestParam3 = in.getTestParam3();
45
46
ARMARX_IMPORTANT
<<
"TestParam1: "
<< TestParam1;
47
ARMARX_IMPORTANT
<<
"TestParam2: "
<< TestParam2;
48
ARMARX_IMPORTANT
<<
"TestParam3: "
<< TestParam3;
49
50
ARMARX_CHECK_EXPRESSION
(emptyString ==
""
) <<
"EmptyStringTest is not empty."
;
51
ARMARX_CHECK_EXPRESSION
(TestParam1 ==
"OnlyRootSet"
);
52
ARMARX_CHECK_EXPRESSION
(TestParam2 ==
"Armar3BaseSet"
);
53
ARMARX_CHECK_EXPRESSION
(TestParam3 ==
"Armar3aSet"
|| TestParam3 ==
"Armar3SimulationSet"
);
54
ARMARX_IMPORTANT
<<
"All tests passed."
;
55
}
56
57
void
58
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
void
72
TestState::onBreak
()
73
{
74
// put your user code for the breaking point here
75
// execution time should be short (<100ms)
76
}
77
78
void
79
TestState::onExit
()
80
{
81
// put your user code for the exit point here
82
// execution time should be short (<100ms)
83
}
84
85
// DO NOT EDIT NEXT FUNCTION
86
XMLStateFactoryBasePtr
87
TestState::CreateInstance
(
XMLStateConstructorParams
stateData)
88
{
89
return
XMLStateFactoryBasePtr
(
new
TestState
(stateData));
90
}
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition:
Logging.h:190
armarx::StatechartProfilesTestGroup::TestState::run
void run() override
Definition:
TestState.cpp:58
armarx::StatechartProfilesTestGroup::TestState::onEnter
void onEnter() override
Definition:
TestState.cpp:39
armarx::XMLStateConstructorParams
Definition:
XMLState.h:49
armarx::XMLStateFactoryBasePtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition:
XMLState.h:64
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:146
TestState.h
armarx::StatechartProfilesTestGroup::TestState::onExit
void onExit() override
Definition:
TestState.cpp:79
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:44
armarx::StatechartProfilesTestGroup::TestState::TestState
TestState(const XMLStateConstructorParams &stateData)
Definition:
TestState.cpp:33
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition:
ArmarXTimeserver.cpp:27
armarx::StatechartProfilesTestGroup::TestState::onBreak
void onBreak() override
Definition:
TestState.cpp:72
RobotAPI
statecharts
StatechartProfilesTestGroup
TestState.cpp
Generated on Sat Mar 29 2025 09:17:32 for armarx_documentation by
1.8.17