Skip to content
GitLab
Explore
Sign in
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
6042d45c
Commit
6042d45c
authored
5 years ago
by
Jan Reher
Browse files
Options
Downloads
Patches
Plain Diff
Changed TestXmlStructure.cxx to output a structure for unit assignment
to module
parent
cc311d87
No related branches found
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
+44
-5
44 additions, 5 deletions
testxmlstructure.cxx
with
44 additions
and
5 deletions
testxmlstructure.cxx
+
44
−
5
View file @
6042d45c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
#include
<iostream>
#include
<iostream>
#include
<QtCore/QString>
#include
<QtCore/QString>
#include
<Q
t
Xml/QXmlStreamWriter
>
#include
<Q
XML/QXmlStreamWriter>
// For Compilation: Q
Xml/QXmlStreamWriter
#include
"productiondatabaseclient.h"
#include
"productiondatabaseclient.h"
ProductionDatabase
::
ProductionDatabaseClient
*
proddbclient
;
ProductionDatabase
::
ProductionDatabaseClient
*
proddbclient
;
...
@@ -11,13 +11,20 @@ void initialize();
...
@@ -11,13 +11,20 @@ void initialize();
void
screeningInfo
();
void
screeningInfo
();
void
assignApds
(
std
::
string
redSerial
,
std
::
string
blueSerial
);
void
assignApds
(
std
::
string
redSerial
,
std
::
string
blueSerial
);
void
assignUnit
(
std
::
string
detectorSerial
,
std
::
string
crystalSerial
,
std
::
string
barcode
);
void
assignUnit
(
std
::
string
detectorSerial
,
std
::
string
crystalSerial
,
std
::
string
barcode
);
void
assignToModule
(
std
::
vector
<
uint
>
barcodes
,
std
::
string
moduleSN
);
int
main
()
{
int
main
()
{
initialize
();
initialize
();
assignApds
(
"0607004597"
,
"0607004598"
);
std
::
vector
<
uint
>
barcodes
;
assignApds
(
"0607004600"
,
"0607004601"
);
barcodes
.
push_back
(
1309009619
);
assignUnit
(
"0607004598/0607004597"
,
"790"
,
"1309009220"
);
barcodes
.
push_back
(
1309009602
);
assignUnit
(
"0607004601/0607004600"
,
"790"
,
"1309009237"
);
barcodes
.
push_back
(
1309009633
);
barcodes
.
push_back
(
1309009664
);
barcodes
.
push_back
(
1309009657
);
barcodes
.
push_back
(
1309009696
);
barcodes
.
push_back
(
1309009640
);
barcodes
.
push_back
(
1309009626
);
assignToModule
(
barcodes
,
"29012015-9"
);
return
0
;
return
0
;
}
}
...
@@ -28,6 +35,38 @@ void initialize() {
...
@@ -28,6 +35,38 @@ void initialize() {
proddbclient
->
checkConnectivityAndCredentials
();
proddbclient
->
checkConnectivityAndCredentials
();
}
}
void
assignToModule
(
std
::
vector
<
uint
>
barcodes
,
std
::
string
moduleSN
)
{
QString
buffer
;
QXmlStreamWriter
xml
(
&
buffer
);
xml
.
setAutoFormatting
(
true
);
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
]
));
xml
.
writeEndDocument
();
std
::
string
xmlRequest
=
buffer
.
toStdString
();
std
::
cerr
<<
xmlRequest
<<
std
::
endl
;
//proddbclient->postXmlRequest("",xmlRequest);
}
void
assignUnit
(
std
::
string
detectorSerial
,
std
::
string
crystalSerial
,
std
::
string
barcode
)
{
void
assignUnit
(
std
::
string
detectorSerial
,
std
::
string
crystalSerial
,
std
::
string
barcode
)
{
QString
buffer
;
QString
buffer
;
QXmlStreamWriter
xml
(
&
buffer
);
QXmlStreamWriter
xml
(
&
buffer
);
...
...
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