Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vimba
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
kr69sugu
vimba
Commits
b94a5984
Commit
b94a5984
authored
1 year ago
by
am0ebe
Browse files
Options
Downloads
Patches
Plain Diff
cam: add timer member. fix double stoprecord error (when user cancels recording)
parent
c8c605fc
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cam.cpp
+8
-2
8 additions, 2 deletions
src/cam.cpp
src/cam.h
+2
-0
2 additions, 0 deletions
src/cam.h
src/core.cpp
+1
-1
1 addition, 1 deletion
src/core.cpp
with
11 additions
and
3 deletions
src/cam.cpp
+
8
−
2
View file @
b94a5984
...
...
@@ -22,8 +22,11 @@ _id(""),
_state
(
closed
),
_frames
(
FramePtrVector
(
threadsPerCam
())),
_payloadSize
(
0LL
),
_pixelFormat
(
""
)
_pixelFormat
(
""
),
_timer
(
new
QTimer
(
this
))
{
_timer
->
setSingleShot
(
true
);
connect
(
_timer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
stopRecording
()));
name
();
}
...
...
@@ -143,7 +146,7 @@ void Cam::startRecording(seconds dur)
// Convert to milliseconds
auto
dur_ms
=
duration_cast
<
milliseconds
>
(
dur
).
count
();
QT
imer
::
singleShot
(
dur_ms
,
this
,
SLOT
(
stopRecording
())
);
_t
imer
->
start
(
dur_ms
);
}
void
Cam
::
startRecording
(
minutes
dur
)
...
...
@@ -151,6 +154,7 @@ void Cam::startRecording(minutes dur)
// Convert to seconds
auto
dur_s
=
duration_cast
<
seconds
>
(
dur
);
startRecording
(
dur_s
);
}
/* Does:
...
...
@@ -161,6 +165,8 @@ void Cam::startRecording(minutes dur)
*/
void
Cam
::
stopRecording
()
{
_timer
->
stop
();
FeaturePtr
pFeature
;
try
{
...
...
This diff is collapsed.
Click to expand it.
src/cam.h
+
2
−
0
View file @
b94a5984
...
...
@@ -19,6 +19,7 @@ using VmbCPP::FramePtrVector;
using
std
::
chrono
::
minutes
;
using
std
::
chrono
::
seconds
;
class
QTimer
;
class
Cam
;
using
CamPtr
=
std
::
shared_ptr
<
Cam
>
;
using
CamPtrVector
=
std
::
vector
<
CamPtr
>
;
...
...
@@ -65,5 +66,6 @@ private:
FramePtrVector
_frames
;
VmbInt64_t
_payloadSize
;
std
::
string
_pixelFormat
;
QTimer
*
_timer
;
};
This diff is collapsed.
Click to expand it.
src/core.cpp
+
1
−
1
View file @
b94a5984
...
...
@@ -25,7 +25,7 @@ Core::Core() : IPrinter(),
_apiStarted
(
false
),
_sys
(
VmbSystem
::
GetInstance
()
),
// create and get Vimba singleton
_cameras
(
CamPtrVector
()
),
_recDuration
(
6s
)
//default
_recDuration
(
1
6s
)
//default
{
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
init
()));
//delayed init to allow connections to be established -> print/error signals!
}
...
...
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