Kaydet (Commit) 7c1686a6 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Some cleanup on Timer.

Use a different name for handler as 'updateTimer' is also used as
a method name within the same class.  Also no need to set the interval
repeatedly & no need to stop the timer when it times out.

Change-Id: I430bc26b945d179c87310eaefd9d94986192841c
üst 3a4f5b47
...@@ -561,7 +561,7 @@ GL3DBarChart::GL3DBarChart( ...@@ -561,7 +561,7 @@ GL3DBarChart::GL3DBarChart(
mbAutoFly = atoi(aAutoFly); mbAutoFly = atoi(aAutoFly);
} }
maTimer.SetTimeout(DATA_UPDATE_TIME); maTimer.SetTimeout(DATA_UPDATE_TIME);
maTimer.SetTimeoutHdl(LINK(this, GL3DBarChart, updateTimer)); maTimer.SetTimeoutHdl(LINK(this, GL3DBarChart, UpdateTimerHdl));
maTimer.Start(); maTimer.Start();
osl_getSystemTime(&maFPSRenderStartTime); osl_getSystemTime(&maFPSRenderStartTime);
osl_getSystemTime(&maFPSRenderEndTime); osl_getSystemTime(&maFPSRenderEndTime);
...@@ -1474,11 +1474,9 @@ void GL3DBarChart::processAutoFly(sal_uInt32 nId, sal_uInt32 nColor) ...@@ -1474,11 +1474,9 @@ void GL3DBarChart::processAutoFly(sal_uInt32 nId, sal_uInt32 nColor)
} }
} }
IMPL_LINK_NOARG(GL3DBarChart, updateTimer) IMPL_LINK_NOARG(GL3DBarChart, UpdateTimerHdl)
{ {
maTimer.Stop();
updateScreenText(); updateScreenText();
maTimer.SetTimeout(DATA_UPDATE_TIME);
maTimer.Start(); maTimer.Start();
return 0; return 0;
} }
......
...@@ -101,7 +101,7 @@ private: ...@@ -101,7 +101,7 @@ private:
void updateScreenText(); void updateScreenText();
void updateRenderFPS(); void updateRenderFPS();
void updateDataUpdateFPS(); void updateDataUpdateFPS();
DECL_LINK(updateTimer, void*); DECL_LINK(UpdateTimerHdl, void*);
int calcTimeInterval(TimeValue &startTime, TimeValue &endTime); int calcTimeInterval(TimeValue &startTime, TimeValue &endTime);
float addScreenTextShape(OUString &nStr, glm::vec2 aLeftOrRightTop, float nTextHeight, bool bLeftTopFlag = true, float addScreenTextShape(OUString &nStr, glm::vec2 aLeftOrRightTop, float nTextHeight, bool bLeftTopFlag = true,
const glm::vec4& rColor = glm::vec4(0.0f, 1.0f, 1.0f, 0.0f), const glm::vec4& rColor = glm::vec4(0.0f, 1.0f, 1.0f, 0.0f),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment