Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Apd Toolbox
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Jan Reher
Apd Toolbox
Commits
a4850214
Commit
a4850214
authored
4 years ago
by
Jan Reher
Browse files
Options
Downloads
Patches
Plain Diff
Testing TestXmlStructure
parent
428ea06d
No related branches found
Branches containing commit
No related tags found
2 merge requests
!4
Many proven updates being brought into stable branch.
,
!3
Commented in the lines in apdUnitCreator.cpp that do the actual database
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testxmlstructure.cxx
+21
-16
21 additions, 16 deletions
testxmlstructure.cxx
with
21 additions
and
16 deletions
testxmlstructure.cxx
+
21
−
16
View file @
a4850214
...
...
@@ -16,6 +16,14 @@ void assignToModule(std::vector<uint> barcodes, std::string moduleSN);
int
main
()
{
initialize
();
std
::
vector
<
uint
>
barcodes
;
barcodes
.
push_back
(
0
);
barcodes
.
push_back
(
0
);
barcodes
.
push_back
(
0
);
barcodes
.
push_back
(
0
);
barcodes
.
push_back
(
0
);
barcodes
.
push_back
(
0
);
barcodes
.
push_back
(
0
);
barcodes
.
push_back
(
0
);
barcodes
.
push_back
(
1309009619
);
barcodes
.
push_back
(
1309009602
);
barcodes
.
push_back
(
1309009633
);
...
...
@@ -36,6 +44,10 @@ void initialize() {
}
void
assignToModule
(
std
::
vector
<
uint
>
barcodes
,
std
::
string
moduleSN
)
{
if
(
barcodes
.
size
()
!=
16
)
{
throw
"Vector with barcodes must contain exactly 16 elements!"
;
}
QString
buffer
;
QXmlStreamWriter
xml
(
&
buffer
);
...
...
@@ -43,22 +55,15 @@ void assignToModule(std::vector<uint> barcodes, std::string moduleSN) {
xml
.
writeStartDocument
(
QString
::
fromUtf8
(
"1.0"
)
);
xml
.
writeStartElement
(
QString
::
fromUtf8
(
"productiondb"
)
)
;
xml
.
writeTextElement
(
"moduleSN"
,
QString
::
fromStdString
(
moduleSN
));
xml
.
writeEmptyElement
(
"Slot0"
);
xml
.
writeEmptyElement
(
"Slot1"
);
xml
.
writeEmptyElement
(
"Slot2"
);
xml
.
writeEmptyElement
(
"Slot3"
);
xml
.
writeEmptyElement
(
"Slot4"
);
xml
.
writeEmptyElement
(
"Slot5"
);
xml
.
writeEmptyElement
(
"Slot6"
);
xml
.
writeEmptyElement
(
"Slot7"
);
xml
.
writeTextElement
(
"Slot8"
,
QString
::
number
(
barcodes
[
0
]));
xml
.
writeTextElement
(
"Slot9"
,
QString
::
number
(
barcodes
[
1
]
));
xml
.
writeTextElement
(
"SlotA"
,
QString
::
number
(
barcodes
[
2
]
));
xml
.
writeTextElement
(
"SlotB"
,
QString
::
number
(
barcodes
[
3
]
));
xml
.
writeTextElement
(
"SlotC"
,
QString
::
number
(
barcodes
[
4
]
));
xml
.
writeTextElement
(
"SlotD"
,
QString
::
number
(
barcodes
[
5
]
));
xml
.
writeTextElement
(
"SlotE"
,
QString
::
number
(
barcodes
[
6
]
));
xml
.
writeTextElement
(
"SlotF"
,
QString
::
number
(
barcodes
[
7
]
));
for
(
size_t
i
=
0
;
i
<
16
;
i
++
)
{
std
::
string
entryname
=
std
::
string
(
"Slot"
)
+
std
::
to_string
(
i
);
if
(
barcodes
[
i
]
==
0
)
xml
.
writeEmptyElement
(
QString
::
fromStdString
(
entryname
));
else
xml
.
writeTextElement
(
QString
::
fromStdString
(
entryname
),
QString
::
number
(
barcodes
[
i
]));
}
xml
.
writeEndDocument
();
std
::
string
xmlRequest
=
buffer
.
toStdString
();
...
...
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