Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
i2MassChroQ
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
PAPPSO
i2MassChroQ
Commits
b4a659e5
Commit
b4a659e5
authored
7 years ago
by
Olivier Langella
Browse files
Options
Downloads
Patches
Plain Diff
emit message on time base
parent
2dc2a133
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/utils/workmonitor.cpp
+7
-4
7 additions, 4 deletions
src/utils/workmonitor.cpp
src/utils/workmonitor.h
+3
-1
3 additions, 1 deletion
src/utils/workmonitor.h
with
10 additions
and
5 deletions
src/utils/workmonitor.cpp
+
7
−
4
View file @
b4a659e5
...
...
@@ -32,14 +32,17 @@
#include
<QDebug>
void
WorkMonitor
::
message
(
const
QString
&
message
)
{
emit
workerMessage
(
message
);
if
(
_time
.
elapsed
()
>
_timer_duration
)
{
_time
.
currentTime
();
emit
workerMessage
(
message
);
}
}
void
WorkMonitor
::
message
(
const
QString
&
message
,
int
value
)
{
qDebug
()
<<
"WorkMonitor::message "
<<
value
<<
" "
<<
_max_value
<<
" "
<<
(
value
/
_max_value
)
*
100
;
int
percent
=
((
float
)
value
/
(
float
)
_max_value
)
*
(
float
)
100
;
if
(
percent
!=
_percent
)
{
_
percent
=
percent
;
emit
workerMessage
(
message
,
percent
);
if
(
_time
.
elapsed
()
>
_timer_duration
)
{
_
time
.
restart
()
;
emit
workerMessage
(
message
,
percent
);
}
}
void
WorkMonitor
::
setProgressMaximumValue
(
int
max_value
)
{
...
...
This diff is collapsed.
Click to expand it.
src/utils/workmonitor.h
+
3
−
1
View file @
b4a659e5
...
...
@@ -32,6 +32,7 @@
#define WORKMONITOR_H
#include
<QObject>
#include
<QTime>
class
WorkMonitorInterface
{
...
...
@@ -54,8 +55,9 @@ public:
void
workerMessage
(
QString
message
,
int
value
);
private
:
QTime
_time
;
int
_max_value
=
100
;
int
_
percent
=
0
;
int
_
timer_duration
=
50
0
;
};
#endif // WORKMONITOR_H
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