Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
vite
Commits
875f106b
Commit
875f106b
authored
Jun 09, 2009
by
Mathieu Faverge
Browse files
Choose StateType in statistics
parent
dd9eb993
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/interface/stats_viewer.ui
View file @
875f106b
...
...
@@ -63,6 +63,13 @@
<property name="fieldGrowthPolicy" >
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Start time</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="_start_time_widget" />
</item>
...
...
@@ -102,13 +109,17 @@
</item>
</widget>
</item>
<item row="
0
" column="0" >
<widget class="QLabel" name="label" >
<item row="
3
" column="0" >
<widget class="QLabel" name="label
_3
" >
<property name="text" >
<string>Sta
rt tim
e</string>
<string>Sta
tes Typ
e</string>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QComboBox" name="_kind_of_state_box" >
</widget>
</item>
</layout>
</item>
<item row="2" column="1" >
...
...
src/statistics/Stats_window.cpp
View file @
875f106b
...
...
@@ -67,7 +67,21 @@ void Stats_window::set_filename(string filename){
void
Stats_window
::
set_trace
(
Trace
*
trace
)
{
const
list
<
StateType
*>
*
states_types_list
;
list
<
StateType
*>::
const_iterator
it
;
list
<
StateType
*>::
const_iterator
end
;
_trace
=
trace
;
states_types_list
=
_trace
->
get_state_types
();
end
=
states_types_list
->
end
();
for
(
it
=
states_types_list
->
begin
();
it
!=
end
;
it
++
){
string
name
=
(
*
it
)
->
get_name
().
to_string
();
QString
temp
(
QString
::
fromStdString
(
name
));
_kind_of_state_box
->
addItem
(
temp
);
}
}
...
...
@@ -91,7 +105,23 @@ void Stats_window::init_window() {
}
void
Stats_window
::
set_selected_nodes
(){
void
Stats_window
::
set_selected_nodes
(
string
kind_of_state
){
const
list
<
StateType
*>
*
states_types_list
;
list
<
StateType
*>::
const_iterator
itstat
;
list
<
StateType
*>::
const_iterator
endstat
;
const
ContainerType
*
kind_of_container
=
NULL
;
states_types_list
=
_trace
->
get_state_types
();
endstat
=
states_types_list
->
end
();
for
(
itstat
=
states_types_list
->
begin
();
itstat
!=
endstat
;
itstat
++
){
if
((
*
itstat
)
->
get_name
().
to_string
()
==
kind_of_state
){
kind_of_container
=
(
*
itstat
)
->
get_container_type
();
continue
;
}
}
// We delete the previous selected containers
if
(
!
_selected_containers
.
empty
())
{
_selected_containers
.
clear
();
...
...
@@ -102,7 +132,9 @@ void Stats_window::set_selected_nodes(){
QTreeWidgetItemIterator
it
(
_nodes_selected
);
while
(
*
it
)
{
if
((
*
it
)
->
checkState
(
0
)
==
Qt
::
Checked
){
_selected_containers
.
push_back
(
_trace
->
search_container
((
*
it
)
->
text
(
0
).
toStdString
()));
Container
*
cont
=
_trace
->
search_container
((
*
it
)
->
text
(
0
).
toStdString
());
if
(
cont
->
get_type
()
==
kind_of_container
)
_selected_containers
.
push_back
(
cont
);
}
it
++
;
}
...
...
@@ -117,9 +149,10 @@ void Stats_window::set_selected_nodes(){
void
Stats_window
::
on_reload_button_clicked
()
{
int
kind_of_diagram
=
_kind_of_diagram_box
->
currentIndex
();
int
kind_of_diagram
=
_kind_of_diagram_box
->
currentIndex
();
QString
kind_of_state
=
_kind_of_state_box
->
currentText
();
set_selected_nodes
();
set_selected_nodes
(
kind_of_state
.
toStdString
()
);
if
(
_selected_containers
.
empty
())
{
*
Message
::
get_instance
()
<<
"You must select at least one container to view the stats"
<<
Message
::
ende
;
...
...
@@ -156,9 +189,10 @@ void Stats_window::on_reload_button_clicked() {
}
void
Stats_window
::
on_export_button_clicked
(){
int
kind_of_diagram
=
_kind_of_diagram_box
->
currentIndex
();
int
kind_of_diagram
=
_kind_of_diagram_box
->
currentIndex
();
QString
kind_of_state
=
_kind_of_state_box
->
currentText
();
set_selected_nodes
();
set_selected_nodes
(
kind_of_state
.
toStdString
()
);
if
(
_selected_containers
.
empty
())
{
*
Message
::
get_instance
()
<<
"You must select at least one container to export the stats"
<<
Message
::
ende
;
...
...
src/statistics/Stats_window.hpp
View file @
875f106b
...
...
@@ -10,6 +10,7 @@ class Stats_window;
#include <iostream>
#include "../trace/Trace.hpp"
#include "../trace/Container.hpp"
#include "../trace/ContainerType.hpp"
#include "Statistic.hpp"
#include <QGLWidget>
#include <map>
...
...
@@ -112,7 +113,7 @@ private:
/*!
* \brief Fill the vector of selected containers depending on the ones chosen in the tree widget
*/
void
set_selected_nodes
();
void
set_selected_nodes
(
std
::
string
);
private
slots
:
void
on_reload_button_clicked
();
...
...
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