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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
graphicsframework
Commits
fe4bccc4
Commit
fe4bccc4
authored
16 years ago
by
Oliver Bock
Browse files
Options
Downloads
Patches
Plain Diff
Added clock to S5R3 engine
* TODO: clock still shows UTC! * Also: removed trailing whitespaces
parent
0f67e5ac
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/starsphere/StarsphereRadio.cpp
+4
-4
4 additions, 4 deletions
src/starsphere/StarsphereRadio.cpp
src/starsphere/StarsphereS5R3.cpp
+27
-7
27 additions, 7 deletions
src/starsphere/StarsphereS5R3.cpp
src/starsphere/StarsphereS5R3.h
+33
-27
33 additions, 27 deletions
src/starsphere/StarsphereS5R3.h
with
64 additions
and
38 deletions
src/starsphere/StarsphereRadio.cpp
+
4
−
4
View file @
fe4bccc4
...
...
@@ -158,10 +158,10 @@ void StarsphereRadio::refreshBOINCInformation()
buffer
.
str
(
""
);
// show WU's total CPU time (previously accumulated + current session)
const
double
cpu
time
=
m_BoincAdapter
.
wuCPUTimeSpent
()
+
m_EinsteinAdapter
.
wuCPUTime
();
const
int
hrs
=
cpu
time
/
3600
;
const
int
min
=
(
cputime
-
hrs
*
3600
)
/
60
;
const
int
sec
=
cputime
-
(
hrs
*
3600
+
min
*
60
);
const
double
time
=
m_BoincAdapter
.
wuCPUTimeSpent
()
+
m_EinsteinAdapter
.
wuCPUTime
();
const
int
hrs
=
time
/
3600
;
const
int
min
=
fmod
(
time
,
3600
)
/
60
;
const
int
sec
=
fmod
(
time
,
60
);
buffer
<<
"WU CPU Time: "
<<
right
<<
setw
(
2
)
<<
hrs
<<
":"
<<
right
<<
setw
(
2
)
<<
min
<<
":"
...
...
This diff is collapsed.
Click to expand it.
src/starsphere/StarsphereS5R3.cpp
+
27
−
7
View file @
fe4bccc4
...
...
@@ -24,6 +24,7 @@ StarsphereS5R3::StarsphereS5R3() :
Starsphere
(
EinsteinS5R3Adapter
::
SharedMemoryIdentifier
),
m_EinsteinAdapter
(
&
m_BoincAdapter
)
{
m_CurrentTime
=
""
;
}
StarsphereS5R3
::~
StarsphereS5R3
()
...
...
@@ -40,6 +41,7 @@ void StarsphereS5R3::initialize(const int width, const int height, const Resourc
// adjust HUD config
m_YOffsetMedium
=
15
;
m_XStartPosRight
=
width
-
125
;
m_XStartPosClock
=
width
-
115
;
m_YStartPosBottom
=
70
;
m_Y1StartPosBottom
=
m_YStartPosBottom
-
m_YOffsetMedium
;
m_Y2StartPosBottom
=
m_Y1StartPosBottom
-
m_YOffsetMedium
;
...
...
@@ -54,6 +56,7 @@ void StarsphereS5R3::resize(const int width, const int height)
// adjust HUD config
m_XStartPosRight
=
width
-
125
;
m_XStartPosClock
=
width
-
115
;
}
void
StarsphereS5R3
::
refreshBOINCInformation
()
...
...
@@ -76,39 +79,56 @@ void StarsphereS5R3::refreshBOINCInformation()
// we've got a new position, update search marker and HUD
m_CurrentRightAscension
=
m_EinsteinAdapter
.
wuSkyPosRightAscension
();
m_RefreshSearchMarker
=
true
;
buffer
.
str
(
""
);
buffer
<<
"Ascension: "
<<
fixed
<<
m_CurrentRightAscension
<<
" deg"
<<
ends
;
m_WUSkyPosRightAscension
=
buffer
.
str
();
buffer
.
str
(
""
);
}
if
(
m_CurrentDeclination
!=
m_EinsteinAdapter
.
wuSkyPosDeclination
())
{
// we've got a new position, update search marker and HUD
m_CurrentDeclination
=
m_EinsteinAdapter
.
wuSkyPosDeclination
();
m_RefreshSearchMarker
=
true
;
buffer
.
str
(
""
);
buffer
<<
"Declination: "
<<
fixed
<<
m_CurrentDeclination
<<
" deg"
<<
ends
;
m_WUSkyPosDeclination
=
buffer
.
str
();
buffer
.
str
(
""
);
}
buffer
.
str
(
""
);
buffer
<<
"Completed: "
<<
fixed
<<
m_EinsteinAdapter
.
wuFractionDone
()
*
100
<<
" %"
<<
ends
;
m_WUPercentDone
=
buffer
.
str
();
buffer
.
str
(
""
);
// show WU's total CPU time (previously accumulated + current session)
const
double
cpu
time
=
m_BoincAdapter
.
wuCPUTimeSpent
()
+
m_EinsteinAdapter
.
wuCPUTime
();
const
int
hrs
=
cpu
time
/
3600
;
const
int
min
=
(
cputime
-
hrs
*
3600
)
/
60
;
const
int
sec
=
cputime
-
(
hrs
*
3600
+
min
*
60
);
double
time
=
m_BoincAdapter
.
wuCPUTimeSpent
()
+
m_EinsteinAdapter
.
wuCPUTime
();
int
hrs
=
time
/
3600
;
int
min
=
fmod
(
time
,
3600
)
/
60
;
int
sec
=
fmod
(
time
,
60
);
buffer
.
str
(
""
);
buffer
<<
"CPU Time: "
<<
right
<<
setw
(
2
)
<<
hrs
<<
":"
<<
right
<<
setw
(
2
)
<<
min
<<
":"
<<
right
<<
setw
(
2
)
<<
sec
<<
ends
;
m_WUCPUTime
=
buffer
.
str
();
// update current time string (clock)
time
=
dtime
()
-
dday
();
hrs
=
time
/
3600
;
min
=
fmod
(
time
,
3600
)
/
60
;
sec
=
fmod
(
time
,
60
);
buffer
.
str
(
""
);
buffer
<<
right
<<
setw
(
2
)
<<
hrs
<<
":"
<<
right
<<
setw
(
2
)
<<
min
<<
":"
<<
right
<<
setw
(
2
)
<<
sec
<<
ends
;
m_CurrentTime
=
buffer
.
str
();
}
void
StarsphereS5R3
::
renderSearchInformation
()
{
// clock
m_FontLogo1
->
draw
(
m_XStartPosClock
,
m_YStartPosTop
,
m_CurrentTime
.
c_str
());
// left info block
m_FontHeader
->
draw
(
m_XStartPosLeft
,
m_YStartPosBottom
,
"BOINC Statistics"
);
m_FontText
->
draw
(
m_XStartPosLeft
,
m_Y1StartPosBottom
,
m_UserName
.
c_str
());
...
...
This diff is collapsed.
Click to expand it.
src/starsphere/StarsphereS5R3.h
+
33
−
27
View file @
fe4bccc4
...
...
@@ -116,12 +116,18 @@ private:
/// Local copy of the current WU's search parameter "CPU Time"
string
m_WUCPUTime
;
/// String representation of the current time
string
m_CurrentTime
;
/// HUD configuration setting (line offset for medium sized font)
GLfloat
m_YOffsetMedium
;
/// HUD configuration setting (horizontal start position for the right part)
GLfloat
m_XStartPosRight
;
/// HUD configuration setting (horizontal start position for the clock display)
GLfloat
m_XStartPosClock
;
/// HUD configuration setting (vertical start postion for the bottom part, header)
GLfloat
m_YStartPosBottom
;
...
...
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