OpenViBE::uint64 representation

About the GUI application to design signal processing pipelines
Post Reply
chantrip
Posts: 42
Joined: Fri Jul 08, 2011 9:32 am

OpenViBE::uint64 representation

Post by chantrip »

Dear Openvibe team

From the code

Code: Select all

uint64 l_ui64CurrentTimeInRepetition=l_ui64CurrentTimeInTrial%(m_ui64RepetitionDuration+m_ui64InterRepetitionDuration);
from file ovpCBoxAlgorithmP300SpellerStimulator.cpp, when I tried to print out the time using cout>>l_ui64CurrentTimeInRepetition, it shows the time in unsigned int 64 bits. Do you know any function that can convert this value into more intuitive sense? i.e. shows in second or milli-second.

Thank you very much

-Jim

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: OpenViBE::uint64 representation

Post by lbonnet »

Hi Jim,

The time in openvibe is coded on 64 bit unsigned integer, fixed point value (32 bits for the seconds; 32 bits for its divisions).
You can tell the log manager to print these values in seconds using the recently introduced time64 type.

Assuming you are in the box implementation (this is a box):

Code: Select all

this->getLogManager() << LogLevel_Info << "Current time in repetition is : " << time64(ui64CurrentTimeInRepetition) << ".\n";
With the default configuration, you will get the time printed in seconds, with 3 digits after the point (eg. "1.234 sec").
This behaviour is controlled by configuration tokens :

Code: Select all

Kernel_ConsoleLogTimeInSecond = True
Kernel_ConsoleLogTimePrecision = 3
For the messages printed in the console.

Hope this helps.

Laurent-
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

chantrip
Posts: 42
Joined: Fri Jul 08, 2011 9:32 am

Re: OpenViBE::uint64 representation

Post by chantrip »

Thank you very much for your answer. That's really helpful :).

-Jim

Post Reply