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
ff28a1e0
Commit
ff28a1e0
authored
Jul 29, 2008
by
Alain BUTEAU
Browse files
Options
Downloads
Patches
Plain Diff
Pb MANTIS 9936
parent
565bdf7e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/CYBERSTARx1000.cpp
+28
-18
28 additions, 18 deletions
src/CYBERSTARx1000.cpp
src/CYBERSTARx1000.h
+9
-6
9 additions, 6 deletions
src/CYBERSTARx1000.h
src/CYBERSTARx1000Class.cpp
+9
-6
9 additions, 6 deletions
src/CYBERSTARx1000Class.cpp
with
46 additions
and
30 deletions
src/CYBERSTARx1000.cpp
+
28
−
18
View file @
ff28a1e0
static
const
char
*
RcsId
=
"$Header: /users/chaize/newsvn/cvsroot/Instrumentation/CYBERSTAR/src/CYBERSTARx1000.cpp,v 1.2
1
2008-0
3-03 16:50:37 sebleport
Exp $"
;
static
const
char
*
RcsId
=
"$Header: /users/chaize/newsvn/cvsroot/Instrumentation/CYBERSTAR/src/CYBERSTARx1000.cpp,v 1.2
2
2008-0
7-29 17:13:39 buteau
Exp $"
;
//+=============================================================================
//
// file : CYBERSTARx1000.cpp
...
...
@@ -11,11 +11,14 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
//
// project : TANGO Device Server
//
// $Author:
sebleport
$
// $Author:
buteau
$
//
// $Revision: 1.2
1
$
// $Revision: 1.2
2
$
//
// $Log: not supported by cvs2svn $
// Revision 1.21 2008/03/03 16:50:37 sebleport
// - read part of windowWidth and windowCenterPosition attributes added
//
// Revision 1.20 2008/02/28 11:35:00 buteau
// - tests DIFFABS du 28/08
//
...
...
@@ -109,7 +112,7 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
#include
<CYBERSTARx1000.h>
#include
<CYBERSTARx1000Class.h>
const
double
SCA_UPPER_THRESHOLD_MAX
=
10.0
;
// in volts
const
double
SCA_LOWER_THRESHOLD_MIN
=
0.0
;
// in volts
const
double
PEAKING_TIME_VALUE1
=
300.0
;
//possible values for peaking time are 300, 500, 1000 and 3000 ns
const
double
PEAKING_TIME_VALUE2
=
500.0
;
...
...
@@ -118,7 +121,7 @@ const double PEAKING_TIME_VALUE4= 3000.0;
const
double
MAX_THRESHOLD_SIZE
=
10.0
;
//dont move threshold by more than x Volts otherwise instrument doesnt apply voltages
const
double
SLEEPING_TIME_BETWEEN_THRESHOLD_INCREMENTS
=
00000000
;
// After last tests it seems that it is useless to wait
const
double
ERROR_MARGIN_In_VOLTS
=
0.01
;
// rounded errors between set and read points due to electronic rounding value to 3.1%f format
const
double
ERROR_MARGIN_In_VOLTS
=
0.0
2
1
;
// rounded errors between set and read points due to electronic rounding value to 3.1%f format
namespace
CYBERSTARx1000_ns
{
...
...
@@ -234,13 +237,13 @@ namespace CYBERSTARx1000_ns
//------------------------------------------------------------------
serialProxyName
=
""
;
tolerance
=
-
1
;
maxThreshold
=
-
1
;
// Read device properties from database.(Automatic code generation)
//------------------------------------------------------------------
Tango
::
DbData
dev_prop
;
dev_prop
.
push_back
(
Tango
::
DbDatum
(
"SerialProxyName"
));
dev_prop
.
push_back
(
Tango
::
DbDatum
(
"
Tolerance
"
));
dev_prop
.
push_back
(
Tango
::
DbDatum
(
"
MaxThreshold
"
));
// Call database and extract values
//--------------------------------------------
...
...
@@ -260,14 +263,14 @@ namespace CYBERSTARx1000_ns
// And try to extract SerialProxyName value from database
if
(
dev_prop
[
i
].
is_empty
()
==
false
)
dev_prop
[
i
]
>>
serialProxyName
;
// Try to initialize
Tolerance
from class property
// Try to initialize
MaxThreshold
from class property
cl_prop
=
ds_class
->
get_class_property
(
dev_prop
[
++
i
].
name
);
if
(
cl_prop
.
is_empty
()
==
false
)
cl_prop
>>
tolerance
;
// Try to initialize
Tolerance
from default device value
if
(
cl_prop
.
is_empty
()
==
false
)
cl_prop
>>
maxThreshold
;
// Try to initialize
MaxThreshold
from default device value
def_prop
=
ds_class
->
get_default_device_property
(
dev_prop
[
i
].
name
);
if
(
def_prop
.
is_empty
()
==
false
)
def_prop
>>
tolerance
;
// And try to extract
Tolerance
value from database
if
(
dev_prop
[
i
].
is_empty
()
==
false
)
dev_prop
[
i
]
>>
tolerance
;
if
(
def_prop
.
is_empty
()
==
false
)
def_prop
>>
maxThreshold
;
// And try to extract
MaxThreshold
value from database
if
(
dev_prop
[
i
].
is_empty
()
==
false
)
dev_prop
[
i
]
>>
maxThreshold
;
...
...
@@ -282,11 +285,11 @@ namespace CYBERSTARx1000_ns
(
const
char
*
)
"CYBERSTARx1000::get_device_property()"
);
}
if
(
tolerance
==
-
1
)
if
(
maxThreshold
==
-
1
)
{
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"TANGO_CONFIGURATION_ERROR"
,
(
const
char
*
)
"
tolerance
property = -1 (default value)"
,
(
const
char
*
)
"
MaxThreshold
property = -1 (default value)"
,
(
const
char
*
)
"CYBERSTARx1000::get_device_property()"
);
}
}
...
...
@@ -981,12 +984,12 @@ namespace CYBERSTARx1000_ns
attr_scaLowerThreshold_write
=
attr_windowCenterPosition_write
-
attr_windowWidth_write
/
2
;
// check upper and lower values before writing on hardware
if
(
attr_scaUpperThreshold_write
<=
SCA_UPPER_THRESHOLD_MAX
&&
attr_scaLowerThreshold_write
>=
SCA_LOWER_THRESHOLD_MIN
)
if
(
attr_scaUpperThreshold_write
<=
maxThreshold
&&
attr_scaLowerThreshold_write
>=
SCA_LOWER_THRESHOLD_MIN
)
{
update_lower
(
attr_scaLowerThreshold_write
);
update_upper
(
attr_scaUpperThreshold_write
);
//ATTENTION : Absurd behaviour of the Cyberstar . We must reapply vol
a
tges on lower threshold again !!
//ATTENTION : Absurd behaviour of the Cyberstar . We must reapply volt
a
ges on lower threshold again !!
// DONT suppress following line event if it seems stupid
update_lower
(
attr_scaLowerThreshold_write
);
...
...
@@ -1030,6 +1033,13 @@ namespace CYBERSTARx1000_ns
read_upper
();
read_lower
();
/*
cout << "****" << endl;
cout << "attr_scaUpperThreshold_write=" << attr_scaUpperThreshold_write << endl;
cout << "attr_scaUpperThreshold_read=" << (*attr_scaUpperThreshold_read) <<endl;
cout << "attr_scaLowerThreshold_write=" << attr_scaLowerThreshold_write << endl;
cout << "attr_scaLowerThreshold_read=" << (*attr_scaLowerThreshold_read) << endl;
*/
// value read on the hardware is troncated so test must take into account small difference between read and setpoint
if
(
(
fabs
(
attr_scaUpperThreshold_write
-
(
*
attr_scaUpperThreshold_read
))
>
ERROR_MARGIN_In_VOLTS
)
||
(
fabs
(
attr_scaLowerThreshold_write
-
(
*
attr_scaLowerThreshold_read
))
>
ERROR_MARGIN_In_VOLTS
)
)
...
...
This diff is collapsed.
Click to expand it.
src/CYBERSTARx1000.h
+
9
−
6
View file @
ff28a1e0
...
...
@@ -6,11 +6,14 @@
//
// project : CYBERSTARx1000
//
// $Author:
sebleport
$
// $Author:
buteau
$
//
// $Revision: 1.1
5
$
// $Revision: 1.1
6
$
//
// $Log: not supported by cvs2svn $
// Revision 1.15 2008/03/03 16:50:37 sebleport
// - read part of windowWidth and windowCenterPosition attributes added
//
// Revision 1.14 2008/02/27 17:35:31 buteau
// - tests DIFFABS du 27/08
//
...
...
@@ -81,8 +84,8 @@
//using namespace Tango;
/**
* @author $Author:
sebleport
$
* @version $Revision: 1.1
5
$
* @author $Author:
buteau
$
* @version $Revision: 1.1
6
$
*/
// Add your own constants definitions here.
...
...
@@ -163,9 +166,9 @@ namespace CYBERSTARx1000_ns
*/
string
serialProxyName
;
/**
*
tolerance percentage of Lower and U
pper threshold attribute
values
*
Maximum voltage for u
pper threshold attribute
*/
Tango
::
DevFloat
tolerance
;
Tango
::
DevFloat
maxThreshold
;
//@}
/**@name Constructors
...
...
This diff is collapsed.
Click to expand it.
src/CYBERSTARx1000Class.cpp
+
9
−
6
View file @
ff28a1e0
static
const
char
*
RcsId
=
"$Header: /users/chaize/newsvn/cvsroot/Instrumentation/CYBERSTAR/src/CYBERSTARx1000Class.cpp,v 1.1
0
2008-0
2
-2
7
1
1:32:25
buteau Exp $"
;
static
const
char
*
RcsId
=
"$Header: /users/chaize/newsvn/cvsroot/Instrumentation/CYBERSTAR/src/CYBERSTARx1000Class.cpp,v 1.1
1
2008-0
7
-2
9
1
7:13:39
buteau Exp $"
;
static
const
char
*
TagName
=
"$Name: not supported by cvs2svn $"
;
static
const
char
*
HttpServer
=
"http://www.esrf.fr/computing/cs/tango/tango_doc/ds_doc/"
;
//+=============================================================================
...
...
@@ -14,9 +14,12 @@ static const char *HttpServer= "http://www.esrf.fr/computing/cs/tango/tango_doc/
//
// $Author: buteau $
//
// $Revision: 1.1
0
$
// $Revision: 1.1
1
$
//
// $Log: not supported by cvs2svn $
// Revision 1.10 2008/02/27 11:32:25 buteau
// - tests DIFFABS du 27/08
//
// Revision 1.9 2008/02/26 17:56:58 buteau
// - code a relire
//
...
...
@@ -420,11 +423,11 @@ void CYBERSTARx1000Class::set_default_property()
else
add_wiz_dev_prop
(
prop_name
,
prop_desc
);
prop_name
=
"
Tolerance
"
;
prop_desc
=
"
tolerance percentage of Lower and
Upper threshold
attribute values
"
;
prop_def
=
"
95
"
;
prop_name
=
"
MaxThreshold
"
;
prop_desc
=
"
Maximum voltage for
Upper threshold "
;
prop_def
=
""
;
vect_data
.
clear
();
vect_data
.
push_back
(
"
95
"
);
vect_data
.
push_back
(
""
);
if
(
prop_def
.
length
()
>
0
)
{
Tango
::
DbDatum
data
(
prop_name
);
...
...
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