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
89d5e0dd
Commit
89d5e0dd
authored
5 years ago
by
Jan Reher
Browse files
Options
Downloads
Patches
Plain Diff
Minor changes
parent
d3a5a1de
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.cxx
+21
-5
21 additions, 5 deletions
main.cxx
with
21 additions
and
5 deletions
main.cxx
+
21
−
5
View file @
89d5e0dd
#include
<fstream>
#include
<iostream>
#include
<iomanip>
#include
<string>
#include
<vector>
#include
<fstream>
#include
<productiondatabaseclient.h>
#include
<boost/program_options.hpp>
...
...
@@ -20,11 +24,10 @@ int main(int argc, char* argv[])
{
ProductionDatabaseClient
*
proddb
=
new
ProductionDatabaseClient
();
if
(
debug
)
cout
<<
"Intitializing apdBatchSetter with version "
<<
proddb
->
getVersion
()
<<
" of the database access libraries."
<<
endl
<<
endl
;
readArguments
(
argc
,
argv
);
if
(
debug
)
cout
<<
"Trying to set Batch number "
<<
batchNo
<<
"for ADPs from serial file "
<<
fileName
<<
endl
;
if
(
debug
)
cout
<<
"Intitialized apdBatchSetter with version "
<<
proddb
->
getVersion
()
<<
" of the database access libraries."
<<
endl
<<
endl
<<
"Now trying to set Batch number "
<<
batchNo
<<
" for ADPs from serial file "
<<
fileName
<<
endl
;
vector
<
string
>
apdSerials
;
int
nAPDs
=
0
;
...
...
@@ -55,7 +58,9 @@ int main(int argc, char* argv[])
proddb
->
assignBatchNumberToAPDs
(
apdSerials
,
batchNo
,
irradiatedAPDs
);
cout
<<
"
\n
Successfully assigned Batch "
<<
batchNo
<<
" to APDs from serial file "
<<
fileName
<<
"!
\n\n
Thank you for using apdBatchSetter :)"
<<
endl
<<
endl
;
cout
<<
"
\n
Successfully assigned Batch "
<<
batchNo
<<
" to APDs from serial file "
<<
fileName
;
if
(
irradiatedAPDs
)
cout
<<
" (after irradiation)"
;
cout
<<
"!
\n\n
Thank you for using apdBatchSetter :)"
<<
endl
<<
endl
;
return
(
-
apdSerials
.
empty
());
}
...
...
@@ -92,6 +97,7 @@ void readArguments(int m_argc, char* m_argv[]) {
string
temp
=
""
;
cout
<<
"Have these APDs been irradiated? (yes / no)"
<<
endl
;
cin
>>
temp
;
cout
<<
endl
;
if
(
temp
==
"yes"
||
temp
==
"y"
)
{
irradiatedAPDs
=
true
;
}
...
...
@@ -109,11 +115,21 @@ void readArguments(int m_argc, char* m_argv[]) {
cout
<<
"Which Batch do these APDs belong to?"
<<
endl
;
try
{
cin
>>
batchNo
;
cout
<<
endl
;
}
catch
(...)
{
batchNo
=
0
;
}
if
(
batchNo
<=
0
)
{
cerr
<<
"Invalid batch number!"
<<
endl
;
exit
(
-
1
);
}
if
(
batchNo
<
1000
&&
irradiatedAPDs
)
{
cerr
<<
"Batches with irradiated APDs should have batch numbers greater than 10000!"
<<
endl
;
exit
(
-
1
);
}
if
(
batchNo
>=
1000
&&
!
irradiatedAPDs
)
{
cerr
<<
"Batches with batch numbers greather than 10000 have been irradiated!"
<<
endl
;
exit
(
-
1
);
}
}
if
(
vm
.
count
(
"fileName"
))
{
...
...
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