Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LidarView-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
LidarView
LidarView-Core
Commits
17df0f4d
Commit
17df0f4d
authored
3 years ago
by
Arnaud Billon
Browse files
Options
Downloads
Patches
Plain Diff
[fix] Rework record state
parent
17435e98
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!296
Ui refinement
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ApplicationComponents/lqStreamRecordReaction.cxx
+34
-24
34 additions, 24 deletions
ApplicationComponents/lqStreamRecordReaction.cxx
with
34 additions
and
24 deletions
ApplicationComponents/lqStreamRecordReaction.cxx
+
34
−
24
View file @
17df0f4d
...
...
@@ -69,7 +69,6 @@ void lqStreamRecordReaction::onTriggered()
{
this
->
StartRecordingReaction
();
}
this
->
isRecording
=
!
this
->
isRecording
;
}
//-----------------------------------------------------------------------------
...
...
@@ -98,13 +97,15 @@ void lqStreamRecordReaction::StartRecordingReaction()
if
(
useAdvancedDialog
)
{
lqStreamRecordDialog
dialog
(
nullptr
,
defaultFileName
);
if
(
dialog
.
exec
())
if
(
dialog
.
exec
()
==
QDialog
::
Rejected
)
{
this
->
parentAction
()
->
setToolTip
(
"Stop Recording Stream Data"
);
this
->
recordingFilename
=
dialog
.
recordingFile
();
QFile
::
copy
(
QString
::
fromStdString
(
interpreter
->
GetCalibrationFileName
()),
dialog
.
calibrationFile
());
// Cancel
return
;
}
// Get User input Filename
this
->
recordingFilename
=
dialog
.
recordingFile
();
QFile
::
copy
(
QString
::
fromStdString
(
interpreter
->
GetCalibrationFileName
()),
dialog
.
calibrationFile
());
}
else
{
...
...
@@ -114,27 +115,34 @@ void lqStreamRecordReaction::StartRecordingReaction()
this
->
recordingFilename
=
QFileDialog
::
getSaveFileName
(
nullptr
,
QString
(
"Record File:"
),
defaultFileName
,
QString
(
"PCAP (*.pcap)"
));
}
if
(
this
->
recordingFilename
!
=
""
)
if
(
this
->
recordingFilename
=
=
""
)
{
// Create common writer Thread
std
::
shared_ptr
<
PacketFileWriter
>
writer
=
std
::
make_shared
<
PacketFileWriter
>
();
// Tell vtkStreams to Start Recording
foreach
(
pqPipelineSource
*
src
,
smmodel
->
findItems
<
pqPipelineSource
*>
())
{
auto
*
stream
=
dynamic_cast
<
vtkStream
*>
(
src
->
getProxy
()
->
GetClientSideObject
());
if
(
!
stream
){
continue
;}
stream
->
StartRecording
(
// Multiple start is okay, it detects it
this
->
recordingFilename
.
toStdString
(),
writer
);
}
this
->
parentAction
()
->
setChecked
(
true
);
std
::
cout
<<
"Recording Filename is empty, aborting."
<<
std
::
endl
;
return
;
}
// Save the path where the pcap is saved
QFileInfo
fileInfo
(
this
->
recordingFilename
);
this
->
Settings
->
setValue
(
"LidarPlugin/RecordReaction/DefaultFolder"
,
fileInfo
.
absolutePath
());
// Create common writer Thread
std
::
shared_ptr
<
PacketFileWriter
>
writer
=
std
::
make_shared
<
PacketFileWriter
>
();
// Tell vtkStreams to Start Recording
foreach
(
pqPipelineSource
*
src
,
smmodel
->
findItems
<
pqPipelineSource
*>
())
{
auto
*
stream
=
dynamic_cast
<
vtkStream
*>
(
src
->
getProxy
()
->
GetClientSideObject
());
if
(
!
stream
){
continue
;}
stream
->
StartRecording
(
// Multiple start is okay, it detects it
this
->
recordingFilename
.
toStdString
(),
writer
);
}
// Update state
this
->
isRecording
=
true
;
this
->
parentAction
()
->
setToolTip
(
"Stop Recording Stream Data"
);
this
->
parentAction
()
->
setChecked
(
true
);
// Save the path where the pcap is saved
QFileInfo
fileInfo
(
this
->
recordingFilename
);
this
->
Settings
->
setValue
(
"LidarPlugin/RecordReaction/DefaultFolder"
,
fileInfo
.
absolutePath
());
}
//-----------------------------------------------------------------------------
...
...
@@ -149,6 +157,8 @@ void lqStreamRecordReaction::StopRecordingReaction()
stream
->
StopRecording
();
}
// Update State
this
->
isRecording
=
false
;
this
->
parentAction
()
->
setToolTip
(
"Start Recording Stream Data"
);
this
->
parentAction
()
->
setChecked
(
false
);
...
...
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