Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CYBERSTARx1000
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
MeasureInstruments
CYBERSTARx1000
Commits
cb1a424d
Commit
cb1a424d
authored
May 15, 2007
by
Sebastien Leport
Browse files
Options
Downloads
Patches
Plain Diff
- add OS sleep between reading and writing command in write_read() method
- some changes in DevState() method
parent
e0391a70
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/CYBERSTARx1000.cpp
+38
-13
38 additions, 13 deletions
src/CYBERSTARx1000.cpp
src/CYBERSTARx1000.h
+8
-3
8 additions, 3 deletions
src/CYBERSTARx1000.h
with
46 additions
and
16 deletions
src/CYBERSTARx1000.cpp
+
38
−
13
View file @
cb1a424d
static
const
char
*
RcsId
=
"$Header: /users/chaize/newsvn/cvsroot/Instrumentation/CYBERSTAR/src/CYBERSTARx1000.cpp,v 1.1
1
2007-0
4
-1
7
1
0
:0
9:15
sebleport Exp $"
;
static
const
char
*
RcsId
=
"$Header: /users/chaize/newsvn/cvsroot/Instrumentation/CYBERSTAR/src/CYBERSTARx1000.cpp,v 1.1
2
2007-0
5
-1
5
1
3
:0
0:22
sebleport Exp $"
;
//+=============================================================================
//
// file : CYBERSTARx1000.cpp
...
...
@@ -13,9 +13,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
//
// $Author: sebleport $
//
// $Revision: 1.1
1
$
// $Revision: 1.1
2
$
//
// $Log: not supported by cvs2svn $
// Revision 1.11 2007/04/17 10:09:15 sebleport
// further conditions to set the StandBy state
//
// Revision 1.10 2007/04/13 17:25:02 sebleport
// some changes in devstate() due to the interraction with the scan server device
//
...
...
@@ -307,6 +310,8 @@ void CYBERSTARx1000::write_windowCenterPosition(Tango::WAttribute &attr)
{
// high threshold updating
attr_scaUpperThreshold_write
=
attr_windowCenterPosition_write
+
attr_windowWidth_write
/
2
;
// converting
high_level
=
XString
<
double
>::
convertToString
(
attr_scaUpperThreshold_write
);
if
(
attr_scaUpperThreshold_write
<=
10
)
...
...
@@ -732,11 +737,15 @@ void CYBERSTARx1000::write_windowCenterPosition(Tango::WAttribute &attr)
//- send command
mySerial
->
command_inout
(
"DevSerWriteString"
,
cmd_to_send
.
c_str
(),
nb_char_written
);
omni_thread
::
sleep
(
0
,
250000000
);
// in nanoseconds -> 250 ms
mySerial
->
command_inout
(
"DevSerWriteChar"
,
LF
,
nb_char_written
);
//- response expected
if
(
read_required
)
{
omni_thread
::
sleep
(
0
,
250000000
);
// in nanoseconds -> 250 ms
long
readMode
=
2
;
//- SL_LINE : waits for LF (newline set in device Serial)
mySerial
->
command_inout
(
"DevSerReadString"
,
readMode
,
response
);
}
...
...
@@ -965,30 +974,46 @@ Tango::DevState CYBERSTARx1000::dev_state()
this
->
read_scaLowerThreshold
(
low_threshold
);
this
->
read_scaUpperThreshold
(
high_threshold
);
double
borneLowerPlus
=
(
this
->
attr_windowCenterPosition_write
-
this
->
attr_windowWidth_write
/
2
)
*
(
2
-
(
tolerance
/
100
));
double
borneLowerMoins
=
(
this
->
attr_windowCenterPosition_write
-
this
->
attr_windowWidth_write
/
2
)
*
tolerance
/
100
;
double
borneUpperPlus
=
(
this
->
attr_windowCenterPosition_write
+
this
->
attr_windowWidth_write
/
2
)
*
(
2
-
(
tolerance
/
100
));
double
borneUpperMoins
=
(
this
->
attr_windowCenterPosition_write
+
this
->
attr_windowWidth_write
/
2
)
*
tolerance
/
100
;
/*double borneLowerPlus = (this->attr_windowCenterPosition_write - this->attr_windowWidth_write/2) + tolerance ;
double borneLowerMoins = (this->attr_windowCenterPosition_write - this->attr_windowWidth_write/2)- tolerance ;
double borneUpperPlus = (this->attr_windowCenterPosition_write + this->attr_windowWidth_write/2) + tolerance ;
double borneUpperMoins = (this->attr_windowCenterPosition_write + this->attr_windowWidth_write/2)- tolerance ;*/
INFO_STREAM
<<
"borne lower moins = "
<<
XString
<
double
>::
convertToString
(
borneLowerMoins
)
<<
endl
;
INFO_STREAM
<<
"borne lower plus = "
<<
XString
<
double
>::
convertToString
(
borneLowerPlus
)
<<
endl
;
INFO_STREAM
<<
"borne upper moins = "
<<
XString
<
double
>::
convertToString
(
borneUpperMoins
)
<<
endl
;
INFO_STREAM
<<
"borne upper plus = "
<<
XString
<
double
>::
convertToString
(
borneUpperPlus
)
<<
endl
;
INFO_STREAM
<<
" "
<<
endl
;
if
(
mySerial
)
{
if
((
*
this
->
attr_scaLowerThreshold_read
<=
(
this
->
attr_windowCenterPosition_write
-
this
->
attr_windowWidth_write
/
2
)
*
(
2
-
(
tolerance
/
100
))
*
this
->
attr_scaLowerThreshold_read
<=
borneLowerMoins
)
&&
(
*
this
->
attr_scaLowerThreshold_read
>=
(
this
->
attr_windowCenterPosition_write
-
this
->
attr_windowWidth_write
/
2
)
*
tolerance
/
100
||
(
*
this
->
attr_scaLowerThreshold_read
>=
borneLowerPlus
)
&&
(
*
this
->
attr_scaUpperThreshold_read
<=
(
this
->
attr_windowCenterPosition_write
+
this
->
attr_windowWidth_write
/
2
)
*
(
2
-
(
tolerance
/
100
))
||
(
*
this
->
attr_scaUpperThreshold_read
<=
borneUpperMoins
)
&&
(
*
this
->
attr_scaUpperThreshold_read
>=
(
this
->
attr_windowCenterPosition_write
+
this
->
attr_windowWidth_write
/
2
)
*
tolerance
/
100
||
(
*
this
->
attr_scaUpperThreshold_read
>=
borneUpperPlus
))
{
argout
=
Tango
::
STANDBY
;
set_status
(
"
CYBERSTAR is waiting for request
"
);
argout
=
Tango
::
RUNNING
;
set_status
(
"
SCA threshold voltages are changing
"
);
}
else
{
argout
=
Tango
::
RUNNING
;
set_status
(
"
SCA threshold voltages are changing
"
);
argout
=
Tango
::
STANDBY
;
set_status
(
"
CYBERSTAR is waiting for request
"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/CYBERSTARx1000.h
+
8
−
3
View file @
cb1a424d
...
...
@@ -8,9 +8,14 @@
//
// $Author: sebleport $
//
// $Revision: 1.
9
$
// $Revision: 1.
10
$
//
// $Log: not supported by cvs2svn $
// Revision 1.9 2007/04/24 16:22:52 sebleport
// polling attribute set to 10000 ms by default (POGO).
// the concerned attributes are:
// voltage, peakingTime, gain
//
// Revision 1.8 2007/04/13 17:25:02 sebleport
// some changes in devstate() due to the interraction with the scan server device
//
...
...
@@ -56,12 +61,12 @@
#include
"Xstring.h"
#include
<math.h>
#include
"DeviceProxyHelper.h"
#include
"omnithread.h"
//using namespace Tango;
/**
* @author $Author: sebleport $
* @version $Revision: 1.
9
$
* @version $Revision: 1.
10
$
*/
// Add your own constants definitions here.
...
...
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