Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
graphicsframework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
graphicsframework
Commits
bd1a1900
Commit
bd1a1900
authored
16 years ago
by
Oliver Bock
Browse files
Options
Downloads
Patches
Plain Diff
S5R3 engine's clock now shows localtime
parent
fe4bccc4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/starsphere/StarsphereRadio.cpp
+4
-4
4 additions, 4 deletions
src/starsphere/StarsphereRadio.cpp
src/starsphere/StarsphereS5R3.cpp
+11
-14
11 additions, 14 deletions
src/starsphere/StarsphereS5R3.cpp
with
15 additions
and
18 deletions
src/starsphere/StarsphereRadio.cpp
+
4
−
4
View file @
bd1a1900
...
@@ -158,10 +158,10 @@ void StarsphereRadio::refreshBOINCInformation()
...
@@ -158,10 +158,10 @@ void StarsphereRadio::refreshBOINCInformation()
buffer
.
str
(
""
);
buffer
.
str
(
""
);
// show WU's total CPU time (previously accumulated + current session)
// show WU's total CPU time (previously accumulated + current session)
const
double
time
=
m_BoincAdapter
.
wuCPUTimeSpent
()
+
m_EinsteinAdapter
.
wuCPUTime
();
const
double
time
CPU
=
m_BoincAdapter
.
wuCPUTimeSpent
()
+
m_EinsteinAdapter
.
wuCPUTime
();
const
int
hrs
=
time
/
3600
;
const
int
hrs
=
time
CPU
/
3600
;
const
int
min
=
fmod
(
time
,
3600
)
/
60
;
const
int
min
=
fmod
(
time
CPU
,
3600
)
/
60
;
const
int
sec
=
fmod
(
time
,
60
);
const
int
sec
=
fmod
(
time
CPU
,
60
);
buffer
<<
"WU CPU Time: "
<<
right
<<
setw
(
2
)
<<
hrs
<<
":"
buffer
<<
"WU CPU Time: "
<<
right
<<
setw
(
2
)
<<
hrs
<<
":"
<<
right
<<
setw
(
2
)
<<
min
<<
":"
<<
right
<<
setw
(
2
)
<<
min
<<
":"
...
...
This diff is collapsed.
Click to expand it.
src/starsphere/StarsphereS5R3.cpp
+
11
−
14
View file @
bd1a1900
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#include
"StarsphereS5R3.h"
#include
"StarsphereS5R3.h"
#include
<time.h>
StarsphereS5R3
::
StarsphereS5R3
()
:
StarsphereS5R3
::
StarsphereS5R3
()
:
Starsphere
(
EinsteinS5R3Adapter
::
SharedMemoryIdentifier
),
Starsphere
(
EinsteinS5R3Adapter
::
SharedMemoryIdentifier
),
m_EinsteinAdapter
(
&
m_BoincAdapter
)
m_EinsteinAdapter
(
&
m_BoincAdapter
)
...
@@ -98,10 +100,10 @@ void StarsphereS5R3::refreshBOINCInformation()
...
@@ -98,10 +100,10 @@ void StarsphereS5R3::refreshBOINCInformation()
m_WUPercentDone
=
buffer
.
str
();
m_WUPercentDone
=
buffer
.
str
();
// show WU's total CPU time (previously accumulated + current session)
// show WU's total CPU time (previously accumulated + current session)
double
time
=
m_BoincAdapter
.
wuCPUTimeSpent
()
+
m_EinsteinAdapter
.
wuCPUTime
();
double
time
CPU
=
m_BoincAdapter
.
wuCPUTimeSpent
()
+
m_EinsteinAdapter
.
wuCPUTime
();
int
hrs
=
time
/
3600
;
int
hrs
=
time
CPU
/
3600
;
int
min
=
fmod
(
time
,
3600
)
/
60
;
int
min
=
fmod
(
time
CPU
,
3600
)
/
60
;
int
sec
=
fmod
(
time
,
60
);
int
sec
=
fmod
(
time
CPU
,
60
);
buffer
.
str
(
""
);
buffer
.
str
(
""
);
buffer
<<
"CPU Time: "
<<
right
<<
setw
(
2
)
<<
hrs
<<
":"
buffer
<<
"CPU Time: "
<<
right
<<
setw
(
2
)
<<
hrs
<<
":"
...
@@ -111,17 +113,12 @@ void StarsphereS5R3::refreshBOINCInformation()
...
@@ -111,17 +113,12 @@ void StarsphereS5R3::refreshBOINCInformation()
m_WUCPUTime
=
buffer
.
str
();
m_WUCPUTime
=
buffer
.
str
();
// update current time string (clock)
// update current time string (clock)
time
=
dtime
()
-
dday
();
char
cBuffer
[
10
]
=
{
0
};
hrs
=
time
/
3600
;
time_t
timeNow
=
time
(
0
);
min
=
fmod
(
time
,
3600
)
/
60
;
struct
tm
*
timeLocal
=
localtime
(
&
timeNow
);
sec
=
fmod
(
time
,
60
);
strftime
(
cBuffer
,
sizeof
(
cBuffer
)
-
1
,
"%H:%M:%S"
,
timeLocal
);
buffer
.
str
(
""
);
buffer
<<
right
<<
setw
(
2
)
<<
hrs
<<
":"
<<
right
<<
setw
(
2
)
<<
min
<<
":"
<<
right
<<
setw
(
2
)
<<
sec
<<
ends
;
m_CurrentTime
=
buffer
.
str
(
);
m_CurrentTime
=
string
(
cBuffer
);
}
}
void
StarsphereS5R3
::
renderSearchInformation
()
void
StarsphereS5R3
::
renderSearchInformation
()
...
...
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