Skip to content
Snippets Groups Projects
Commit 12068b3b authored by Arafat Nourredine's avatar Arafat Nourredine
Browse files

mantis #19247

parent a64a73a4
Branches
Tags
No related merge requests found
......@@ -9,7 +9,7 @@
<groupId>fr.soleil.device</groupId>
<artifactId>SimulatedMotor-${aol}-${mode}</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
<packaging>nar</packaging>
<name>SimulatedMotor</name> <!-- use for the name of executable -->
......@@ -61,11 +61,11 @@
<dependencies>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>YAT-${aol}-${library}-${mode}</artifactId>
<artifactId>YAT4Tango-${aol}-${library}-${mode}</artifactId>
</dependency>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>YAT4Tango-${aol}-${library}-${mode}</artifactId>
<artifactId>YAT-${aol}-${library}-${mode}</artifactId>
</dependency>
</dependencies>
......
......@@ -121,12 +121,13 @@ void AxisSimulatorTask::process_message (yat::Message& _msg) throw (Tango::DevFa
//wait the requested time to simulate the speed
while(static_cast<unsigned long>(this->_mChrono.elapsed_msec()-this->_fLastChronoValue)< static_cast<unsigned long>(1000.0/this->_fSpeed))
{
this->sleep(1);//hyper precision sleep(1)->really ~1 ms : this is due to timeBeginPeriod()/timeEndPeriod()
////this->sleep(1);//hyper precision sleep(1)->really ~1 ms : this is due to timeBeginPeriod()/timeEndPeriod()
yat::ThreadingUtilities::sleep(0, 1000000);// sec,nanosec ;
}
DEBUG_STREAM<<"Time elapsed = "<<static_cast<unsigned long>(this->_mChrono.elapsed_msec()-this->_fLastChronoValue)<<" (ms)"<<endl;
{
yat::AutoMutex<> guard(this->m_lock);
yat::MutexLock scoped_lock(_my_lock);
this->_fLastChronoValue = this->_mChrono.elapsed_msec();
this->compute_state();
}
......@@ -578,7 +579,7 @@ Tango::DevState AxisSimulatorTask::get_state (void)
// ============================================================================
Tango::DevString AxisSimulatorTask::get_status (void)
{
yat::AutoMutex<> guard(this->m_lock);
yat::MutexLock scoped_lock(_my_lock);
Tango::DevString argout=this->_sStatusMessage;
return argout;
}
......
......@@ -19,7 +19,7 @@
// DEPENDENCIES
// ============================================================================
#include <tango.h>
#include <yat/Timer.h>
#include <yat/time/Timer.h>
#include <yat/memory/DataBuffer.h>
#include <yat4tango/DeviceTask.h>
......@@ -188,6 +188,9 @@ private:
yat::Timer _mChrono;
double _fLastChronoValue;
/// Mutex's
yat::Mutex _my_lock;
};
} // namespace SimulatedMotor_ns
......
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Motion/Axis/SimulatedDevice/SimulatedMotor/src/SimulatedMotor.cpp,v 1.10 2009-09-24 12:15:43 anoureddine Exp $";
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Motion/Axis/SimulatedDevice/SimulatedMotor/src/SimulatedMotor.cpp,v 1.11 2011-05-20 09:05:06 anoureddine Exp $";
//+=============================================================================
//
// file : SimulatedMotor.cpp
......@@ -13,9 +13,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Motion/Axis/Si
//
// $Author: anoureddine $
//
// $Revision: 1.10 $
// $Revision: 1.11 $
//
// $Log: not supported by cvs2svn $
// Revision 1.10 2009/09/24 12:15:43 anoureddine
// Add pom.xml file
//
// Revision 1.9 2009/08/09 15:00:49 anoureddine
// Memorize in properties the last value of :
// - offset attribute
......@@ -101,8 +104,8 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Motion/Axis/Si
#include <tango.h>
#include <SimulatedMotor.h>
#include <SimulatedMotorClass.h>
#include <PogoHelper.h>
#include "./Xstring.h"
#include <helpers/PogoHelper.h>
#include <helpers/Xstring.h>
namespace SimulatedMotor_ns
{
......@@ -273,7 +276,7 @@ void SimulatedMotor::init_device()
//--------------------------------------------
INFO_STREAM << device_name << " : starting Axis Simulator Task " << endl;
this->dev_task->go();
this->dev_task->priority(yat::Thread::PRIORITY_RT);
////this->dev_task->priority(yat::Thread::PRIORITY_RT);
// everything seems ok -> device started
//--------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment