Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mvBlueFOX3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Show more breadcrumbs
labrobotica
drivers
mvBlueFOX3
Commits
b2cad024
Commit
b2cad024
authored
8 years ago
by
Angel Santamaria-Navarro
Browse files
Options
Downloads
Patches
Plain Diff
minor modifications. after verif. with ros and opencv
parent
c950bff4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mvbluefox3.cpp
+36
-18
36 additions, 18 deletions
src/mvbluefox3.cpp
with
36 additions
and
18 deletions
src/mvbluefox3.cpp
+
36
−
18
View file @
b2cad024
...
...
@@ -18,22 +18,33 @@ namespace CMvbluefox3 {
CMvbluefox3
::
CMvbluefox3
(
const
std
::
string
&
serial
)
{
if
(
this
->
devMgr_
.
getDeviceBySerial
(
serial
)
==
0
)
throw
CmvBlueFOX3Exception
(
_HERE_
,
"No device found! Unable to continue. "
+
AvailableDevices
());
if
(
!
serial
.
empty
()
)
{
std
::
cout
<<
"[mvBlueFOX3]: Trying to open device with serial: "
<<
serial
<<
std
::
endl
;
// create an interface to the found device
this
->
device_
=
this
->
devMgr_
[
0
];
if
(
this
->
devMgr_
.
getDeviceBySerial
(
serial
)
==
0
)
{
throw
CmvBlueFOX3Exception
(
_HERE_
,
"No device found! Unable to continue. "
+
AvailableDevices
());
}
else
{
// create an interface to the found device
this
->
device_
=
this
->
devMgr_
[
0
];
// Initialize other vars
this
->
timeout_ms_
=
-
1
;
this
->
depth_
=
8
;
this
->
bytes_per_pixel_
=
1
;
// Initialize other vars
this
->
timeout_ms_
=
-
1
;
this
->
depth_
=
8
;
this
->
bytes_per_pixel_
=
1
;
// displayPropertyData(this->device_->defaultRequestCount);
// WriteProperty(this->device_->defaultRequestCount,1);
// displayPropertyData(this->device_->defaultRequestCount);
// WriteProperty(this->device_->defaultRequestCount,1);
// open device
OpenDevice
(
serial
);
// open device
OpenDevice
(
serial
);
}
}
else
throw
CmvBlueFOX3Exception
(
_HERE_
,
"Device cannot be found because serial number is not specified."
);
}
CMvbluefox3
::~
CMvbluefox3
()
...
...
@@ -57,16 +68,23 @@ CMvbluefox3::~CMvbluefox3()
std
::
string
CMvbluefox3
::
AvailableDevices
(
SUPPORTED_DEVICE_CHECK
pSupportedDeviceCheckFn
)
const
{
std
::
ostringstream
devices
;
devices
<<
"
[mvBlueFOX3]:
Available device(s):
\n
"
;
devices
<<
"Available device(s): "
;
const
unsigned
int
devCnt
=
this
->
devMgr_
.
deviceCount
();
for
(
unsigned
int
i
=
0
;
i
<
devCnt
;
i
++
)
if
(
devCnt
==
0
)
{
devices
<<
"0."
;
}
else
{
Device
*
pDev
=
this
->
devMgr_
[
i
];
if
(
pDev
)
for
(
unsigned
int
i
=
0
;
i
<
devCnt
;
i
++
)
{
if
(
!
pSupportedDeviceCheckFn
||
pSupportedDeviceCheckFn
(
pDev
)
)
Device
*
pDev
=
this
->
devMgr_
[
i
];
if
(
pDev
)
{
devices
<<
" - "
<<
pDev
->
product
.
read
()
<<
": "
<<
pDev
->
serial
.
read
();
if
(
!
pSupportedDeviceCheckFn
||
pSupportedDeviceCheckFn
(
pDev
)
)
{
devices
<<
"
\n
- "
<<
pDev
->
product
.
read
()
<<
": "
<<
pDev
->
serial
.
read
();
}
}
}
}
...
...
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