Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SimulatedMotor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Tango devices
Simulators
SimulatedMotor
Commits
12068b3b
Commit
12068b3b
authored
May 20, 2011
by
Arafat Nourredine
Browse files
Options
Downloads
Patches
Plain Diff
mantis #19247
parent
a64a73a4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
pom.xml
+5
-5
5 additions, 5 deletions
pom.xml
src/AxisSimulatorTask.cpp
+5
-4
5 additions, 4 deletions
src/AxisSimulatorTask.cpp
src/AxisSimulatorTask.h
+4
-1
4 additions, 1 deletion
src/AxisSimulatorTask.h
src/SimulatedMotor.cpp
+8
-5
8 additions, 5 deletions
src/SimulatedMotor.cpp
with
22 additions
and
15 deletions
pom.xml
+
5
−
5
View file @
12068b3b
...
...
@@ -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>
YAT
4Tango
-${aol}-${library}-${mode}
</artifactId>
</dependency>
<dependency>
<groupId>
fr.soleil.lib
</groupId>
<artifactId>
YAT
4Tango
-${aol}-${library}-${mode}
</artifactId>
<artifactId>
YAT-${aol}-${library}-${mode}
</artifactId>
</dependency>
</dependencies>
...
...
This diff is collapsed.
Click to expand it.
src/AxisSimulatorTask.cpp
+
5
−
4
View file @
12068b3b
...
...
@@ -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
::
Auto
Mutex
<>
guard
(
this
->
m
_lock
);
yat
::
Mutex
Lock
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
::
Auto
Mutex
<>
guard
(
this
->
m
_lock
);
yat
::
Mutex
Lock
scoped_lock
(
_my
_lock
);
Tango
::
DevString
argout
=
this
->
_sStatusMessage
;
return
argout
;
}
...
...
This diff is collapsed.
Click to expand it.
src/AxisSimulatorTask.h
+
4
−
1
View file @
12068b3b
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/SimulatedMotor.cpp
+
8
−
5
View file @
12068b3b
static
const
char
*
RcsId
=
"$Header: /users/chaize/newsvn/cvsroot/Motion/Axis/SimulatedDevice/SimulatedMotor/src/SimulatedMotor.cpp,v 1.1
0
20
09
-0
9
-2
4 12:15:43
anoureddine Exp $"
;
static
const
char
*
RcsId
=
"$Header: /users/chaize/newsvn/cvsroot/Motion/Axis/SimulatedDevice/SimulatedMotor/src/SimulatedMotor.cpp,v 1.1
1
20
11
-0
5
-2
0 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.1
0
$
// $Revision: 1.1
1
$
//
// $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
//--------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment