Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DetectorSoftware
pcosdk
Commits
a4d8be7b
Commit
a4d8be7b
authored
Sep 18, 2019
by
Yuelong Yu
Browse files
changed get camera method and do error check on each step
parent
69cd30f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
apiloader/PcoAPILoader.cpp
View file @
a4d8be7b
...
...
@@ -43,30 +43,36 @@ namespace PcoNS
SLLoaderNS
::
SharedLibLoader
<
PcoInterfaces
>
pco_loader
;
std
::
string
libpath
=
lib_path
+
"/"
;
if
(
det_type
==
0
)
//clhs
libpath
+=
libname_pcoclhs
;
if
(
det_type
==
1
)
//me4
libpath
+=
libname_pcome4
;
if
(
!
(
pco_loader
.
OpenLib
(
libpath
)))
{
cerr
<<
"Error opening :"
<<
libpath
<<
"det type : "
<<
det_type
<<
endl
;
return
nullptr
;
}
if
(
!
(
pco
=
pco_loader
.
GetInstance
()))
{
//try pco clhs then
std
::
string
libpcoclhs
=
lib_path
+
"/"
+
libname_pcoclhs
;
if
((
pco_loader
.
OpenLib
(
libpcoclhs
))
&&
(
pco
=
pco_loader
.
GetInstance
())
&&
(
pco
->
OpenCamera
()
==
0
))
return
pco
;
else
pco_loader
.
CloseLib
();
}
cerr
<<
"Error on get instance"
<<
endl
;
pco_loader
.
CloseLib
();
return
nullptr
;
}
if
(
det_type
==
1
)
if
(
!
(
pco
->
OpenCamera
()
==
0
)
)
{
// try pcome4 first
std
::
string
libpcome4
=
lib_path
+
"/"
+
libname_pcome4
;
if
((
pco_loader
.
OpenLib
(
libpcome4
))
&&
(
pco
=
pco_loader
.
GetInstance
())
&&
(
pco
->
OpenCamera
()
==
0
))
return
pco
;
else
pco_loader
.
CloseLib
();
cerr
<<
"Error on open camera"
<<
endl
;
pco_loader
.
CloseLib
();
return
nullptr
;
}
return
nullptr
;
return
pco
;
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment