summaryrefslogtreecommitdiff
path: root/src/fuel-stop-advisor/fuel-stop-advisor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fuel-stop-advisor/fuel-stop-advisor.cpp')
-rw-r--r--src/fuel-stop-advisor/fuel-stop-advisor.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/fuel-stop-advisor/fuel-stop-advisor.cpp b/src/fuel-stop-advisor/fuel-stop-advisor.cpp
index 0a41286..60e244e 100644
--- a/src/fuel-stop-advisor/fuel-stop-advisor.cpp
+++ b/src/fuel-stop-advisor/fuel-stop-advisor.cpp
@@ -350,7 +350,7 @@ class FuelStopAdvisor
return distance/1000+(remaining > 0 ? remaining:0);
}
- void update_data()
+ void updateData()
{
tripComputerInput_t tripComputerInput;
DBus::Variant variant;
@@ -506,10 +506,18 @@ static gboolean
update_data(gpointer user_data)
{
FuelStopAdvisor *tc=(FuelStopAdvisor *)user_data;
- tc->update_data();
+ tc->updateData();
return TRUE;
}
+static gboolean
+update_enhanced_distance(gpointer user_data)
+{
+ FuelStopAdvisor *tc=(FuelStopAdvisor *)user_data;
+ tc->updateEnhancedDistance();
+ return TRUE;
+}
+
int main(int argc, char **argv)
{
loop=g_main_loop_new(NULL, false);
@@ -521,5 +529,6 @@ int main(int argc, char **argv)
server=new FuelStopAdvisor(*conn);
g_timeout_add(CTripComputer::SAMPLING_TIME*CTripComputer::CONVERT_SECOND_IN_MILLISECOND, update_data, server);
- g_main_loop_run(loop);
+ g_timeout_add(CTripComputer::TANK_DISTANCE_REFRESH_TIME*CTripComputer::CONVERT_SECOND_IN_MILLISECOND, update_enhanced_distance, server);
+ g_main_loop_run(loop);
}