runTicksCtrl.cpp
00001
00002
00003
00004
00005
00006
00007 #include "runCtrl.h"
00008 #include "timeUtils.h"
00009
00010
00011 void RunCtrl::initTicksInfo(void) {
00012 pre_module_msec = getModuleRawTicks();
00013 adjustOwnTicks(0);
00014 }
00015
00016
00017 unsigned long RunCtrl::getHostTicks(void) {
00018 return VXV::GetTicks();
00019 }
00020
00021
00022 void RunCtrl::beginTimeAdjust(void) {
00023 }
00024
00025
00026 void RunCtrl::endTimeAdjust(void) {
00027 }
00028
00029
00030 unsigned long RunCtrl::getModuleRawTicks(void) {
00031 unsigned long module_msec = 0;
00032
00033 if (recvModuleMsec(&module_msec) < 0) {
00034 throw RunCtrl_Exception("Transmit fail: in recvModuleMsec()");
00035 }
00036 return updateTicksDiff(module_msec);
00037 }
00038
00039
00040 unsigned long RunCtrl::updateTicksDiff(unsigned long ticks) {
00041 total_msec += ticks - pre_module_msec;
00042 pre_module_msec = ticks;
00043
00044 return total_msec;
00045 }
00046