Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
vite
Commits
6d215d54
Commit
6d215d54
authored
1 year ago
by
ORDRONNEAU Camille
Browse files
Options
Downloads
Patches
Plain Diff
Merge selection_information with selection_information_new_tab
parent
3581e7ef
No related branches found
No related tags found
No related merge requests found
Pipeline
#985699
passed
1 year ago
Stage: pre
Stage: build
Stage: analyze
Stage: validate
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/interface/Interface_graphic.cpp
+10
-26
10 additions, 26 deletions
src/interface/Interface_graphic.cpp
src/interface/Interface_graphic.hpp
+1
-6
1 addition, 6 deletions
src/interface/Interface_graphic.hpp
src/trace/DrawTrace.cpp
+8
-12
8 additions, 12 deletions
src/trace/DrawTrace.cpp
with
19 additions
and
44 deletions
src/interface/Interface_graphic.cpp
+
10
−
26
View file @
6d215d54
...
...
@@ -327,32 +327,16 @@ void Interface_graphic::selection_information_show() const {
_ui_select_info_window
->
show
();
/* show select_info_window */
}
void
Interface_graphic
::
selection_information_new_tab
(
const
string
&
s
)
const
{
QWidget
*
tab
=
new
QWidget
(
_ui_info_selection_tabs
);
_ui_info_selection_tabs
->
addTab
(
tab
,
QString
::
fromStdString
(
s
));
}
void
Interface_graphic
::
selection_information
(
const
string
&
s
)
const
{
const
int
tab_count
=
_ui_info_selection_tabs
->
count
();
if
(
tab_count
)
{
QString
buf
=
QString
::
fromStdString
(
s
);
QVBoxLayout
*
layout
=
new
QVBoxLayout
(
_ui_info_selection_tabs
->
widget
(
tab_count
-
1
));
/*Make the text box resize when window is resized*/
QTextEdit
*
text_widget
=
new
QTextEdit
();
text_widget
->
setReadOnly
(
true
);
text_widget
->
setTextInteractionFlags
(
Qt
::
TextSelectableByMouse
|
Qt
::
TextSelectableByKeyboard
);
text_widget
->
insertHtml
(
QStringLiteral
(
"<font color='blue'>"
)
+
buf
+
QStringLiteral
(
"</font>"
));
text_widget
->
setSizePolicy
(
QSizePolicy
::
Maximum
,
QSizePolicy
::
Maximum
);
text_widget
->
moveCursor
(
QTextCursor
::
Start
);
/* Insert the new text on the begin */
layout
->
addWidget
(
text_widget
);
layout
->
setEnabled
(
true
);
layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
}
void
Interface_graphic
::
selection_information
(
const
std
::
string
&
tab_name
,
const
string
&
content
)
const
{
// Create and setup the tab
QTextEdit
*
text_widget
=
new
QTextEdit
(
_ui_info_selection_tabs
);
text_widget
->
setReadOnly
(
true
);
text_widget
->
setTextInteractionFlags
(
Qt
::
TextSelectableByMouse
|
Qt
::
TextSelectableByKeyboard
);
// Fill the text content and add the tab to the window
text_widget
->
insertHtml
(
QStringLiteral
(
"<font color='blue'>"
)
+
QString
::
fromStdString
(
content
)
+
QStringLiteral
(
"</font>"
));
text_widget
->
moveCursor
(
QTextCursor
::
Start
);
// Make the text edit scroll to the top
_ui_info_selection_tabs
->
addTab
(
text_widget
,
QString
::
fromStdString
(
tab_name
));
}
/***********************************
...
...
This diff is collapsed.
Click to expand it.
src/interface/Interface_graphic.hpp
+
1
−
6
View file @
6d215d54
...
...
@@ -383,12 +383,7 @@ public:
* \brief The function takes strings and/or numbers then displayed it in the entity informative text area in the info window.
* \param string The string to be displayed.
*/
void
selection_information
(
const
std
::
string
&
string
)
const
;
/*!
* \brief Add a new tab to the select_info_window
*/
void
selection_information_new_tab
(
const
std
::
string
&
)
const
;
void
selection_information
(
const
std
::
string
&
tab_name
,
const
std
::
string
&
content
)
const
;
/***********************************
*
...
...
This diff is collapsed.
Click to expand it.
src/trace/DrawTrace.cpp
+
8
−
12
View file @
6d215d54
...
...
@@ -90,7 +90,7 @@ void print_extra_fields(const std::string &name, const std::map<std::string, Val
}
}
void
display_link_info
(
const
Link
*
link
,
const
Interface_graphic
*
window
)
{
void
display_link_info
(
const
Link
*
link
,
const
Interface_graphic
*
window
,
const
int
&
index
)
{
std
::
stringstream
message_buffer
;
message_buffer
.
str
(
""
);
message_buffer
<<
"<center><strong>Link</strong></center>"
...
...
@@ -103,10 +103,10 @@ void display_link_info(const Link *link, const Interface_graphic *window) {
print_extra_fields
(
"Link"
,
link
->
get_extra_fields
(),
&
message_buffer
);
print_extra_fields
(
"Value"
,
link
->
get_value
()
->
get_extra_fields
(),
&
message_buffer
);
print_extra_fields
(
"Type"
,
link
->
get_type
()
->
get_extra_fields
(),
&
message_buffer
);
window
->
selection_information
(
message_buffer
.
str
());
window
->
selection_information
(
"Link "
+
std
::
to_string
(
index
),
message_buffer
.
str
());
}
void
display_event_info
(
const
Event
*
event
,
const
Interface_graphic
*
window
)
{
void
display_event_info
(
const
Event
*
event
,
const
Interface_graphic
*
window
,
const
int
&
index
)
{
std
::
stringstream
message_buffer
;
message_buffer
.
str
(
""
);
message_buffer
<<
"<center><strong>Event</strong></center>"
...
...
@@ -117,7 +117,7 @@ void display_event_info(const Event *event, const Interface_graphic *window) {
print_extra_fields
(
"Event"
,
event
->
get_extra_fields
(),
&
message_buffer
);
print_extra_fields
(
"Value"
,
event
->
get_value
()
->
get_extra_fields
(),
&
message_buffer
);
print_extra_fields
(
"Type"
,
event
->
get_type
()
->
get_extra_fields
(),
&
message_buffer
);
window
->
selection_information
(
message_buffer
.
str
());
window
->
selection_information
(
"Event "
+
std
::
to_string
(
index
),
message_buffer
.
str
());
}
void
display_state_info
(
const
State
*
state
,
const
Interface_graphic
*
window
)
{
std
::
stringstream
message_buffer
;
...
...
@@ -131,7 +131,7 @@ void display_state_info(const State *state, const Interface_graphic *window) {
print_extra_fields
(
"State"
,
state
->
get_extra_fields
(),
&
message_buffer
);
print_extra_fields
(
"Value"
,
state
->
get_value
()
->
get_extra_fields
(),
&
message_buffer
);
print_extra_fields
(
"Type"
,
state
->
get_type
()
->
get_extra_fields
(),
&
message_buffer
);
window
->
selection_information
(
message_buffer
.
str
());
window
->
selection_information
(
"State"
,
message_buffer
.
str
());
}
void
display_variable_info
(
const
Variable
*
variable
,
const
double
&
x
,
const
Interface_graphic
*
window
)
{
std
::
stringstream
message_buffer
;
...
...
@@ -144,7 +144,7 @@ void display_variable_info(const Variable *variable, const double &x, const Inte
<<
"<strong>Min:</strong> "
<<
variable
->
get_min
().
get_value
()
<<
"<br />"
<<
"<strong>Max:</strong> "
<<
variable
->
get_max
().
get_value
()
<<
"<br />"
;
print_extra_fields
(
"Type"
,
variable
->
get_type
()
->
get_extra_fields
(),
&
message_buffer
);
window
->
selection_information
(
message_buffer
.
str
());
window
->
selection_information
(
"Variable"
,
message_buffer
.
str
());
}
void
DrawTrace
::
fill_link_list
(
const
Container
*
container
,
const
Element_pos
&
x
,
const
Element_pos
&
y
,
const
Element_pos
&
accuracy
,
Link
::
Vector
*
link_list
)
{
...
...
@@ -255,8 +255,7 @@ void DrawTrace::display_information(const Interface_graphic *window, const Trace
fill_link_list
(
root_containers
->
front
(),
x
,
y
,
d
,
&
link_list
);
int
i
=
1
;
for
(
auto
const
&
link
:
link_list
)
{
window
->
selection_information_new_tab
(
"Link"
+
std
::
to_string
(
i
));
display_link_info
(
link
,
window
);
display_link_info
(
link
,
window
,
i
);
i
++
;
}
}
...
...
@@ -272,14 +271,12 @@ void DrawTrace::display_information(const Interface_graphic *window, const Trace
fill_event_list
(
container
->
get_events
()
->
get_root
(),
x
,
d
,
&
event_list
);
int
i
=
1
;
for
(
auto
const
&
event
:
event_list
)
{
window
->
selection_information_new_tab
(
"Event"
+
std
::
to_string
(
i
));
display_event_info
(
event
,
window
);
display_event_info
(
event
,
window
,
i
);
i
++
;
}
}
}
if
((
state
=
find_state
(
container
,
x
)))
{
window
->
selection_information_new_tab
(
"State"
);
display_state_info
(
state
,
window
);
}
}
...
...
@@ -298,7 +295,6 @@ void DrawTrace::display_information(const Interface_graphic *window, const Trace
}
if
(
i
!=
variable_map
->
end
())
{
variable
=
(
*
i
).
second
;
window
->
selection_information_new_tab
(
"Variable"
);
display_variable_info
(
variable
,
x
,
window
);
}
}
...
...
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