Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Raptor Engineering Public Development
dsview
Commits
adc2365e
Commit
adc2365e
authored
May 07, 2015
by
DreamSourceLab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix stack decoder create issue
parent
f34c8b10
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
22 deletions
+37
-22
DSView/pv/view/decodetrace.cpp
DSView/pv/view/decodetrace.cpp
+28
-20
DSView/pv/view/decodetrace.h
DSView/pv/view/decodetrace.h
+4
-0
DSView/pv/view/viewport.cpp
DSView/pv/view/viewport.cpp
+5
-2
No files found.
DSView/pv/view/decodetrace.cpp
View file @
adc2365e
...
...
@@ -120,7 +120,9 @@ DecodeTrace::DecodeTrace(pv::SigSession &session,
decoder_stack
->
stack
().
front
()
->
decoder
()
->
name
),
index
,
Trace
::
DS_DECODER
),
_session
(
session
),
_decoder_stack
(
decoder_stack
),
_show_hide_mapper
(
this
)
_show_hide_mapper
(
this
),
_popup_form
(
NULL
),
_popup
()
{
assert
(
_decoder_stack
);
...
...
@@ -297,21 +299,11 @@ void DecodeTrace::paint_fore(QPainter &p, int left, int right)
bool
DecodeTrace
::
create_popup
()
{
// Clear the layout
// Transfer the layout and the child widgets to a temporary widget
// which then goes out of scope destroying the layout and all the child
// widgets.
//if (_popup_form)
// QWidget().setLayout(_popup_form);
int
ret
=
false
;
QDialog
popup
;
QFormLayout
popup_form
;
popup
.
setLayout
(
&
popup_form
);
populate_popup_form
(
&
popup
,
&
popup_form
);
_popup
=
new
QDialog
();
create_popup_form
();
if
(
QDialog
::
Accepted
==
popup
.
exec
())
if
(
QDialog
::
Accepted
==
_popup
->
exec
())
{
BOOST_FOREACH
(
shared_ptr
<
data
::
decode
::
Decoder
>
dec
,
_decoder_stack
->
stack
())
...
...
@@ -321,12 +313,28 @@ bool DecodeTrace::create_popup()
ret
=
true
;
}
}
return
ret
;
}
else
return
false
;
_popup
=
NULL
;
_popup_form
=
NULL
;
return
ret
;
}
void
DecodeTrace
::
create_popup_form
()
{
// Clear the layout
// Transfer the layout and the child widgets to a temporary widget
// which then goes out of scope destroying the layout and all the child
// widgets.
if
(
_popup_form
)
QWidget
().
setLayout
(
_popup_form
);
_popup_form
=
new
QFormLayout
(
_popup
);
_popup
->
setLayout
(
_popup_form
);
populate_popup_form
(
_popup
,
_popup_form
);
}
void
DecodeTrace
::
populate_popup_form
(
QWidget
*
parent
,
QFormLayout
*
form
)
{
...
...
@@ -368,8 +376,8 @@ void DecodeTrace::populate_popup_form(QWidget *parent, QFormLayout *form)
new
pv
::
widgets
::
DecoderMenu
(
parent
);
connect
(
decoder_menu
,
SIGNAL
(
decoder_selected
(
srd_decoder
*
)),
this
,
SLOT
(
on_stack_decoder
(
srd_decoder
*
)));
connect
(
decoder_menu
,
SIGNAL
(
selected
()),
parent
,
SLOT
(
accept
()));
//
connect(decoder_menu, SIGNAL(selected()),
//
parent, SLOT(accept()));
QPushButton
*
const
stack_button
=
new
QPushButton
(
tr
(
"Stack Decoder"
),
parent
);
...
...
@@ -769,7 +777,7 @@ void DecodeTrace::on_stack_decoder(srd_decoder *decoder)
new
data
::
decode
::
Decoder
(
decoder
)));
//_decoder_stack->begin_decode();
create_popup
();
create_popup
_form
();
}
void
DecodeTrace
::
on_show_hide_decoder
(
int
index
)
...
...
DSView/pv/view/decodetrace.h
View file @
adc2365e
...
...
@@ -128,6 +128,8 @@ protected:
void
paint_type_options
(
QPainter
&
p
,
int
right
,
bool
hover
,
int
action
);
private:
void
create_popup_form
();
void
populate_popup_form
(
QWidget
*
parent
,
QFormLayout
*
form
);
void
draw_annotation
(
const
pv
::
data
::
decode
::
Annotation
&
a
,
QPainter
&
p
,
...
...
@@ -196,6 +198,8 @@ private:
std
::
vector
<
QString
>
_cur_row_headings
;
QSignalMapper
_show_hide_mapper
;
QFormLayout
*
_popup_form
;
QDialog
*
_popup
;
};
}
// namespace view
...
...
DSView/pv/view/viewport.cpp
View file @
adc2365e
...
...
@@ -308,7 +308,10 @@ void Viewport::paintProgress(QPainter &p)
(
status
.
captured_cnt1
<<
8
)
+
(
status
.
captured_cnt2
<<
16
)
+
(
status
.
captured_cnt3
<<
24
));
captured_progress
=
captured_cnt
*
100.0
/
_total_sample_len
;
if
(
triggred
)
captured_progress
=
(
_total_sample_len
-
captured_cnt
)
*
100.0
/
_total_sample_len
;
else
captured_progress
=
captured_cnt
*
100.0
/
_total_sample_len
;
p
.
setPen
(
Trace
::
dsLightBlue
);
...
...
@@ -320,7 +323,7 @@ void Viewport::paintProgress(QPainter &p)
if
(
triggred
)
p
.
drawText
(
status_rect
,
Qt
::
AlignCenter
|
Qt
::
AlignVCenter
,
"Triggered! "
+
QString
::
number
(
1
-
captured_progress
)
+
"% Captured"
);
"Triggered! "
+
QString
::
number
(
captured_progress
)
+
"% Captured"
);
else
p
.
drawText
(
status_rect
,
Qt
::
AlignCenter
|
Qt
::
AlignVCenter
,
...
...
Write
Preview
Markdown
is supported
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