Skip to content
Snippets Groups Projects
Commit b7421696 authored by Sonia Minolli's avatar Sonia Minolli
Browse files

Sleep time negative value bug fixed (TANGODEVIC-1805)

parent ff3e6617
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@
<groupId>fr.soleil.device</groupId>
<artifactId>Spectrometer-${aol}-${mode}</artifactId>
<version>1.2.3-SNAPSHOT</version>
<version>1.3.0-SNAPSHOT</version>
<packaging>nar</packaging>
......@@ -51,7 +51,7 @@
<dependency>
<groupId>com.oceanoptics.lib</groupId>
<artifactId>OMNIDRIVER-${aol}-static-release</artifactId>
<version>1.66.2</version>
<version>2.46.0</version>
</dependency>
</dependencies>
</profile>
......
......@@ -418,11 +418,19 @@ void SpectrometerTask::periodic_job_i()
{
yat::Time expected_next( m_start_time );
expected_next.add_sec( m_acq_count * m_period_sec );
std::size_t sleep_time = expected_next.raw_value() - yat::CurrentTime().raw_value();
int64 current_date = yat::CurrentTime().raw_value();
if (expected_next.raw_value() > current_date)
{
std::size_t sleep_time = expected_next.raw_value() - current_date;
DEBUG_STREAM << "Sleep time (micro_secs): " << sleep_time << std::endl;
sleep_usec( sleep_time );
}
else
{
WARN_STREAM << "Device overruns: no waiting delay before next acquisition!" << std::endl;
}
}
else
{
m_start_time.set_current();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment