Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ArmarXGui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
ArmarXGui
Commits
64da7945
Commit
64da7945
authored
8 years ago
by
Mirko Wächter
Browse files
Options
Downloads
Patches
Plain Diff
fixed state xml reader test
parent
cf2347c8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
data/ArmarXGui/Teststate.xml
+54
-0
54 additions, 0 deletions
data/ArmarXGui/Teststate.xml
source/ArmarXGui/gui-plugins/StatechartEditorPlugin/test/XmlReaderTest.cpp
+5
-56
5 additions, 56 deletions
...gui-plugins/StatechartEditorPlugin/test/XmlReaderTest.cpp
with
59 additions
and
56 deletions
data/ArmarXGui/Teststate.xml
0 → 100644
+
54
−
0
View file @
64da7945
<?xml version="1.0" encoding="utf-8"?>
<State
version=
"1.0"
name=
"RootStateName"
uuid=
"09F54A1A-3A29-4560-B20C-299069288823"
width=
"500"
height=
"456"
>
<Description>
Test description
Line 2
</Description>
<InputParameters>
<Parameter
name=
"InputParameter1Name"
type=
"string"
optional=
"no"
>
<Description>
Input Parameter 1 Description
</Description>
<DefaultValue
value=
'{"type":"::armarx::SingleVariantBase","variant":{"typeName":"::armarx::StringVariantData","value":"DefaultValue"}}'
/>
</Parameter><Parameter
name=
"InputParameter2Name"
type=
"float"
optional=
"yes"
>
<DefaultValue
value=
'{"type":"::armarx::SingleVariantBase","variant":{"typeName":"::armarx::FloatVariantData","value":13.36999988555908}}'
/>
</Parameter>
</InputParameters>
<OutputParameters>
<Parameter
name=
"OutputParameter1Name"
type=
"string"
optional=
"yes"
/>
</OutputParameters>
<LocalParameters>
<Parameter
name=
"LocalParameter1Name"
type=
"int"
optional=
"no"
>
<DefaultValue
value=
'{"type":"::armarx::SingleVariantBase","variant":{"typeName":"::armarx::IntVariantData","value":1}}'
/>
<DefaultValue
profile=
"TestProfileA"
value=
'{"type":"::armarx::SingleVariantBase","variant":{"typeName":"::armarx::IntVariantData","value":2}}'
/>
</Parameter>
</LocalParameters>
<Substates>
<EndState
name=
"EndSubstateName"
event=
"Success"
left=
"160"
top=
"150"
boundingSquareSize=
"50"
/>
<LocalState
name=
"LocalSubstateName"
refuuid=
"CF3662A8-9234-46BD-82C1-856344108823"
left=
"160"
top=
"150"
boundingSquareSize=
"50"
/>
<RemoteState
name=
"RemoteSubstateName"
refuuid=
"148C7D1D-1DB4-4A67-893F-D22D36A88823"
proxyName=
"RemoteSubstateProxyName"
left=
"160"
top=
"150"
boundingSquareSize=
"50"
/>
</Substates>
<Events>
<Event
name=
"Success"
>
<Description>
Event Description
</Description>
</Event>
<Event
name=
"Failure"
/>
</Events>
<StartState
substateName=
"LocalSubstateName"
>
<ParameterMappings>
<ParameterMapping
sourceType=
"Parent"
from=
"StartParameterMapping1SourceKey"
to=
"StartParameterMapping1DestinationKey"
/>
<ParameterMapping
sourceType=
"Output"
from=
"StartParameterMapping2SourceKey"
to=
"StartParameterMapping2DestinationKey"
/>
</ParameterMappings>
</StartState>
<Transitions>
<Transition
from=
"LocalSubstateName"
to=
"RemoteSubstateName"
eventName=
"Transition1EventName"
>
<ParameterMappings>
<ParameterMapping
sourceType=
"Event"
from=
"Transition1ParameterMappingSourceKey"
to=
"Transition1ParameterMappingDestinationKey"
/>
</ParameterMappings>
<SupportPoints>
<SupportPoint
posX=
"12"
posY=
"34"
/>
<SupportPoint
posX=
"56"
posY=
"78"
/>
</SupportPoints>
</Transition>
<Transition
from=
"RemoteSubstateName"
to=
"EndSubstateName"
eventName=
"Transition2EventName"
>
<ParameterMappings/>
<SupportPoints/>
</Transition>
</Transitions>
</State>
This diff is collapsed.
Click to expand it.
source/ArmarXGui/gui-plugins/StatechartEditorPlugin/test/XmlReaderTest.cpp
+
5
−
56
View file @
64da7945
...
...
@@ -32,6 +32,7 @@
#include
"../../StatechartViewerPlugin/model/stateinstance/RemoteState.h"
#include
<ArmarXCore/core/ArmarXManager.h>
#include
<ArmarXCore/core/system/cmake/CMakePackageFinder.h>
#include
<ArmarXCore/observers/variant/VariantContainer.h>
...
...
@@ -46,62 +47,10 @@ BOOST_AUTO_TEST_CASE(testParseXml)
armarx
::
ArmarXManager
::
RegisterKnownObjectFactoriesWithIce
(
ic
);
//at this point, maybe just read from a file?..
QString
xmlInput
=
R"xml(<?xml version="1.0" encoding="utf-8"?>
<State version="1.0" name="RootStateName" uuid="09F54A1A-3A29-4560-B20C-299069288823" width="500" height="456">
<Description>Test description
Line 2</Description>
<InputParameters>
<Parameter name="InputParameter1Name" type="string" optional="no">
<Description>Input Parameter 1 Description</Description>
<DefaultValue value='{"type":"::armarx::SingleVariantBase","variant":{"typeName":"::armarx::StringVariantData","value":"DefaultValue"}}'/>
</Parameter><Parameter name="InputParameter2Name" type="float" optional="yes">
<DefaultValue value='{"type":"::armarx::SingleVariantBase","variant":{"typeName":"::armarx::FloatVariantData","value":13.36999988555908}}'/>
</Parameter>
</InputParameters>
<OutputParameters>
<Parameter name="OutputParameter1Name" type="string" optional="yes"/>
</OutputParameters>
<LocalParameters>
<Parameter name="LocalParameter1Name" type="int" optional="no">
<DefaultValue value='{"type":"::armarx::SingleVariantBase","variant":{"typeName":"::armarx::IntVariantData","value":1}}'/>
<DefaultValue profile="TestProfileA" value='{"type":"::armarx::SingleVariantBase","variant":{"typeName":"::armarx::IntVariantData","value":2}}'/>
</Parameter>
</LocalParameters>
<Substates>
<EndState name="EndSubstateName" event="Success" left="160" top="150" boundingSquareSize="50"/>
<LocalState name="LocalSubstateName" refuuid="CF3662A8-9234-46BD-82C1-856344108823" left="160" top="150" boundingSquareSize="50"/>
<RemoteState name="RemoteSubstateName" refuuid="148C7D1D-1DB4-4A67-893F-D22D36A88823" proxyName="RemoteSubstateProxyName" left="160" top="150" boundingSquareSize="50"/>
</Substates>
<Events>
<Event name="Success">
<Description>Event Description</Description>
</Event>
<Event name="Failure"/>
</Events>
<StartState substateName="LocalSubstateName">
<ParameterMappings>
<ParameterMapping sourceType="Parent" from="StartParameterMapping1SourceKey" to="StartParameterMapping1DestinationKey"/>
<ParameterMapping sourceType="Output" from="StartParameterMapping2SourceKey" to="StartParameterMapping2DestinationKey"/>
</ParameterMappings>
</StartState>
<Transitions>
<Transition from="LocalSubstateName" to="RemoteSubstateName" eventName="Transition1EventName">
<ParameterMappings>
<ParameterMapping sourceType="Event" from="Transition1ParameterMappingSourceKey" to="Transition1ParameterMappingDestinationKey"/>
</ParameterMappings>
<SupportPoints>
<SupportPoint posX="12" posY="34"/>
<SupportPoint posX="56" posY="78"/>
</SupportPoints>
</Transition>
<Transition from="RemoteSubstateName" to="EndSubstateName" eventName="Transition2EventName">
<ParameterMappings/>
<SupportPoints/>
</Transition>
</Transitions>
</State>)xml"
;
armarx
::
CMakePackageFinder
finder
(
"ArmarXGui"
);
armarx
::
ArmarXDataPath
::
addDataPaths
(
finder
.
getDataDir
());
QString
xmlInput
=
armarx
::
RapidXmlReader
::
ReadFileContents
(
"ArmarXGui/Teststate.xml"
).
c_str
();
XmlReader
xmlReader
(
ic
);
xmlReader
.
parseXml
(
xmlInput
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment