Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
FemtoCurrentAmplifier
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
FemtoCurrentAmplifier
Commits
384b2b14
Commit
384b2b14
authored
Feb 15, 2011
by
Alain BUTEAU
Browse files
Options
Downloads
Patches
Plain Diff
MANTIS 17565
parent
ec9a9737
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
pom.xml
+2
-2
2 additions, 2 deletions
pom.xml
src/FemtoCurrentAmplifier.cpp
+93
-34
93 additions, 34 deletions
src/FemtoCurrentAmplifier.cpp
src/FemtoCurrentAmplifier.h
+9
-9
9 additions, 9 deletions
src/FemtoCurrentAmplifier.h
src/TangoClassID.txt
+11
-0
11 additions, 0 deletions
src/TangoClassID.txt
with
115 additions
and
45 deletions
pom.xml
+
2
−
2
View file @
384b2b14
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
</parent>
</parent>
<groupId>
fr.soleil.device
</groupId>
<groupId>
fr.soleil.device
</groupId>
<artifactId>
FemtoCurrentAmplifier-${aol}-${mode}
</artifactId>
<artifactId>
FemtoCurrentAmplifier-${aol}-${mode}
</artifactId>
<version>
1.3.
5
</version>
<version>
1.3.
6
</version>
<packaging>
nar
</packaging>
<packaging>
nar
</packaging>
<name>
FemtoCurrentAmplifier
</name>
<name>
FemtoCurrentAmplifier
</name>
<!-- use for the name of executable -->
<!-- use for the name of executable -->
...
...
This diff is collapsed.
Click to expand it.
src/FemtoCurrentAmplifier.cpp
+
93
−
34
View file @
384b2b14
static
const
char
*
RcsId
=
"$Header: /users/chaize/newsvn/cvsroot/Instrumentation/Femto/src/FemtoCurrentAmplifier.cpp,v 1.1
6
201
0
-0
3-26 09:22:44 vince_soleil
Exp $"
;
static
const
char
*
RcsId
=
"$Header: /users/chaize/newsvn/cvsroot/Instrumentation/Femto/src/FemtoCurrentAmplifier.cpp,v 1.1
7
201
1
-0
2-15 12:14:28 buteau
Exp $"
;
//+=============================================================================
//+=============================================================================
//
//
// file : FemtoCurrentAmplifier.cpp
// file : FemtoCurrentAmplifier.cpp
...
@@ -11,9 +11,9 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
...
@@ -11,9 +11,9 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
//
//
// project : TANGO Device Server
// project : TANGO Device Server
//
//
// $Author:
vince_soleil
$
// $Author:
buteau
$
//
//
// $Revision: 1.1
6
$
// $Revision: 1.1
7
$
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
//
//
...
@@ -50,27 +50,35 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
...
@@ -50,27 +50,35 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
#include
<tango.h>
#include
<tango.h>
#include
<FemtoCurrentAmplifier.h>
#include
<FemtoCurrentAmplifier.h>
#include
<FemtoCurrentAmplifierClass.h>
#include
<FemtoCurrentAmplifierClass.h>
#include
<PogoHelper.h>
#include
<
helpers/
PogoHelper.h>
namespace
FemtoCurrentAmplifier_ns
namespace
FemtoCurrentAmplifier_ns
{
{
const
int
MAX_GAIN_INDEX_FEMTO_100
=
6
;
const
int
MAX_GAIN_INDEX_FEMTO_200
=
7
;
const
int
MAX_GAIN_INDEX_FEMTO_300
=
10
;
string
FemtoCurrentAmplifier
::
femto_100_LN_gains
[
6
]
=
{
string
FemtoCurrentAmplifier
::
femto_100_LN_gains
[
MAX_GAIN_INDEX_FEMTO_100
]
=
{
"10^2"
,
"10^3"
,
"10^4"
,
"10^5"
,
"10^6"
,
"10^7"
"10^2"
,
"10^3"
,
"10^4"
,
"10^5"
,
"10^6"
,
"10^7"
};
};
string
FemtoCurrentAmplifier
::
femto_100_HS_gains
[
6
]
=
{
string
FemtoCurrentAmplifier
::
femto_100_HS_gains
[
MAX_GAIN_INDEX_FEMTO_100
]
=
{
"10^3"
,
"10^4"
,
"10^5"
,
"10^6"
,
"10^7"
,
"10^8"
"10^3"
,
"10^4"
,
"10^5"
,
"10^6"
,
"10^7"
,
"10^8"
};
};
string
FemtoCurrentAmplifier
::
femto_200_LN_gains
[
7
]
=
{
string
FemtoCurrentAmplifier
::
femto_200_LN_gains
[
MAX_GAIN_INDEX_FEMTO_200
]
=
{
"10^3"
,
"10^4"
,
"10^5"
,
"10^6"
,
"10^7"
,
"10^8"
,
"10^9"
"10^3"
,
"10^4"
,
"10^5"
,
"10^6"
,
"10^7"
,
"10^8"
,
"10^9"
};
};
string
FemtoCurrentAmplifier
::
femto_200_HS_gains
[
7
]
=
{
string
FemtoCurrentAmplifier
::
femto_200_HS_gains
[
MAX_GAIN_INDEX_FEMTO_200
]
=
{
"10^5"
,
"10^6"
,
"10^7"
,
"10^8"
,
"10^9"
,
"10^10"
,
"10^11"
"10^5"
,
"10^6"
,
"10^7"
,
"10^8"
,
"10^9"
,
"10^10"
,
"10^11"
};
};
string
FemtoCurrentAmplifier
::
femto_300_gains
[
MAX_GAIN_INDEX_FEMTO_300
]
=
{
"10^4"
,
"10^5"
,
"10^6"
,
"10^7"
,
"10^8"
,
"10^9"
,
"10^10"
,
"10^11"
,
"10^12"
,
"10^13"
};
//+----------------------------------------------------------------------------
//+----------------------------------------------------------------------------
//
//
...
@@ -160,21 +168,28 @@ namespace FemtoCurrentAmplifier_ns
...
@@ -160,21 +168,28 @@ namespace FemtoCurrentAmplifier_ns
creates_dio_proxy
();
creates_dio_proxy
();
if
(
femtoType
==
1
)
if
(
femtoType
==
1
)
MAX_GAIN_INDEX
=
5
;
MAX_GAIN_INDEX
=
MAX_GAIN_INDEX_FEMTO_100
-
1
;
else
else
MAX_GAIN_INDEX
=
6
;
{
if
(
femtoType
==
2
)
MAX_GAIN_INDEX
=
MAX_GAIN_INDEX_FEMTO_200
-
1
;
else
// femto 300 (femtotype=3)
MAX_GAIN_INDEX
=
MAX_GAIN_INDEX_FEMTO_300
-
1
;
}
mutex
=
new
omni_mutex
();
mutex
=
new
omni_mutex
();
//- Force gain mode to LN
//- Force gain mode to LN
if
(
femtoType
!=
3
)
{
Tango
::
WAttribute
&
attr1
=
dev_attr
->
get_w_attr_by_name
(
"gainMode"
);
Tango
::
WAttribute
&
attr1
=
dev_attr
->
get_w_attr_by_name
(
"gainMode"
);
attr1
.
set_write_value
(
true
);
attr1
.
set_write_value
(
true
);
write_gainMode
(
attr1
);
write_gainMode
(
attr1
);
}
Tango
::
WAttribute
&
attr2
=
dev_attr
->
get_w_attr_by_name
(
"gain"
);
Tango
::
WAttribute
&
attr2
=
dev_attr
->
get_w_attr_by_name
(
"gain"
);
string
mem_value
=
attr2
.
get_mem_value
();
string
mem_value
=
attr2
.
get_mem_value
();
attr_gain_write
=
XString
<
Tango
::
DevShort
>::
convertFromString
(
mem_value
);
attr_gain_write
=
XString
<
Tango
::
DevShort
>::
convertFromString
(
mem_value
);
//string &get_mem_value() {return mem_value;}
}
}
catch
(
Tango
::
DevFailed
&
e
)
catch
(
Tango
::
DevFailed
&
e
)
...
@@ -446,7 +461,7 @@ void FemtoCurrentAmplifier::write_upperBWLimit(Tango::WAttribute &attr)
...
@@ -446,7 +461,7 @@ void FemtoCurrentAmplifier::write_upperBWLimit(Tango::WAttribute &attr)
}
}
}
}
}
}
else
else
// Femto 200 et Femto 300
attr
.
set_quality
(
Tango
::
ATTR_INVALID
);
attr
.
set_quality
(
Tango
::
ATTR_INVALID
);
}
}
...
@@ -462,8 +477,7 @@ void FemtoCurrentAmplifier::read_gain(Tango::Attribute &attr)
...
@@ -462,8 +477,7 @@ void FemtoCurrentAmplifier::read_gain(Tango::Attribute &attr)
{
{
DEBUG_STREAM
<<
"FemtoCurrentAmplifier::read_gain(Tango::Attribute &attr) entering... "
<<
endl
;
DEBUG_STREAM
<<
"FemtoCurrentAmplifier::read_gain(Tango::Attribute &attr) entering... "
<<
endl
;
//- Have to do that only for the init of the device as it is a memorized attr.
//- Nothing has to be written here because it's a WRITE ONLY attribute
attr
.
set_value
(
&
attr_gain_write
);
}
}
//+----------------------------------------------------------------------------
//+----------------------------------------------------------------------------
...
@@ -479,17 +493,17 @@ void FemtoCurrentAmplifier::write_gain(Tango::WAttribute &attr)
...
@@ -479,17 +493,17 @@ void FemtoCurrentAmplifier::write_gain(Tango::WAttribute &attr)
attr
.
get_write_value
(
attr_gain_write
);
attr
.
get_write_value
(
attr_gain_write
);
if
((
attr_gain_write
>
MAX_GAIN_INDEX
)
||
(
attr_gain_write
<
0
))
if
(
attr_gain_write
>
MAX_GAIN_INDEX
)
{
attr_gain_write
=
MAX_GAIN_INDEX
;
Tango
::
Except
::
throw_exception
((
const
char
*
)
"DATA_OUT_OF_RANGE"
,
(
const
char
*
)
"Gain value out of range: value is valid between 0 and 6 (or 0 and 5 for a 100)"
,
if
(
attr_gain_write
<
0
)
(
const
char
*
)
"FemtoCurrentAmplifier::write_gain"
);
attr_gain_write
=
0
;
}
else
Tango
::
WAttribute
&
watt
=
dev_attr
->
get_w_attr_by_name
(
"gain"
);
{
watt
.
set_write_value
(
attr_gain_write
);
this
->
set_gain_on_dio_board
(
attr_gain_write
);
this
->
set_gain_on_dio_board
(
attr_gain_write
);
}
}
}
//+----------------------------------------------------------------------------
//+----------------------------------------------------------------------------
//
//
...
@@ -516,6 +530,13 @@ void FemtoCurrentAmplifier::write_coupling(Tango::WAttribute &attr)
...
@@ -516,6 +530,13 @@ void FemtoCurrentAmplifier::write_coupling(Tango::WAttribute &attr)
{
{
DEBUG_STREAM
<<
"FemtoCurrentAmplifier::write_coupling(Tango::WAttribute &attr) entering... "
<<
endl
;
DEBUG_STREAM
<<
"FemtoCurrentAmplifier::write_coupling(Tango::WAttribute &attr) entering... "
<<
endl
;
if
(
femtoType
==
3
)
// Femto300 does not not manage coupling (or AC/DC)
{
Tango
::
Except
::
throw_exception
((
const
char
*
)
"DATA_OUT_OF_RANGE"
,
(
const
char
*
)
"Coupling is not supported for FEMTO300 )"
,
(
const
char
*
)
"FemtoCurrentAmplifier::write_gain"
);
}
// Set coupling for FEMTO100 and Femto200
attr
.
get_write_value
(
attr_coupling_write
);
attr
.
get_write_value
(
attr_coupling_write
);
//- AC
//- AC
...
@@ -560,6 +581,14 @@ void FemtoCurrentAmplifier::write_gainMode(Tango::WAttribute &attr)
...
@@ -560,6 +581,14 @@ void FemtoCurrentAmplifier::write_gainMode(Tango::WAttribute &attr)
{
{
DEBUG_STREAM
<<
"FemtoCurrentAmplifier::write_gainMode(Tango::WAttribute &attr) entering... "
<<
endl
;
DEBUG_STREAM
<<
"FemtoCurrentAmplifier::write_gainMode(Tango::WAttribute &attr) entering... "
<<
endl
;
if
(
femtoType
==
3
)
// Femto300 does not not support gain mode (aka Low Noise /High speed )
{
Tango
::
Except
::
throw_exception
((
const
char
*
)
"DATA_OUT_OF_RANGE"
,
(
const
char
*
)
"GainMode is not supported for FEMTO300 )"
,
(
const
char
*
)
"FemtoCurrentAmplifier::write_gain"
);
}
// Set gain mode for FEMTO100 and Femto200
attr
.
get_write_value
(
attr_gainMode_write
);
attr
.
get_write_value
(
attr_gainMode_write
);
//- High Speed
//- High Speed
...
@@ -657,7 +686,7 @@ void FemtoCurrentAmplifier::read_gainSelected(Tango::Attribute &attr)
...
@@ -657,7 +686,7 @@ void FemtoCurrentAmplifier::read_gainSelected(Tango::Attribute &attr)
* method: FemtoCurrentAmplifier::increase_gain
* method: FemtoCurrentAmplifier::increase_gain
*
*
* description: method to execute "IncreaseGain"
* description: method to execute "IncreaseGain"
* Increase the Gain (max =
6
).
* Increase the Gain (max =
MAX_GAIN_INDEX
).
*
*
*
*
*/
*/
...
@@ -715,10 +744,10 @@ void FemtoCurrentAmplifier::decrease_gain()
...
@@ -715,10 +744,10 @@ void FemtoCurrentAmplifier::decrease_gain()
void
FemtoCurrentAmplifier
::
set_gain_on_dio_board
(
short
gain_value
)
void
FemtoCurrentAmplifier
::
set_gain_on_dio_board
(
short
gain_value
)
{
{
//- Check if valid value
//- Check if valid value
if
((
gain_value
<
0
)
||
(
gain_value
>
6
))
if
((
gain_value
<
0
)
||
(
gain_value
>
MAX_GAIN_INDEX
))
{
{
Tango
::
Except
::
throw_exception
((
const
char
*
)
"DATA_OUT_OF_RANGE"
,
Tango
::
Except
::
throw_exception
((
const
char
*
)
"DATA_OUT_OF_RANGE"
,
(
const
char
*
)
"Gain value out of range: value is valid between 0 and 6
(
or 0 and 5 for a 100
)
"
,
(
const
char
*
)
"Gain value out of range: value is valid between 0 and
5 for a FEMTO100, 0 and
6
f
or
a FEMTO200,
0 and 5 for a 100
, 0-9 for a FEMTO300
"
,
(
const
char
*
)
"FemtoCurrentAmplifier::set_gain_on_dio_board"
);
(
const
char
*
)
"FemtoCurrentAmplifier::set_gain_on_dio_board"
);
}
}
...
@@ -744,7 +773,7 @@ void FemtoCurrentAmplifier::set_gain_on_dio_board(short gain_value)
...
@@ -744,7 +773,7 @@ void FemtoCurrentAmplifier::set_gain_on_dio_board(short gain_value)
//------ MidSB -------------------------------
//------ MidSB -------------------------------
//- Reset MidSB
//- Reset MidSB
if
((
gain_value
==
0
)
||
(
gain_value
==
1
)
||
(
gain_value
==
4
)
||
(
gain_value
==
5
))
if
((
gain_value
==
0
)
||
(
gain_value
==
1
)
||
(
gain_value
==
4
)
||
(
gain_value
==
5
)
||
(
gain_value
==
8
)
||
(
gain_value
==
9
)
)
{
{
_DEV_TRY
(
dio_board_proxy
->
command_in
(
"ResetLine"
,
midSBGainLine
.
c_str
()),
_DEV_TRY
(
dio_board_proxy
->
command_in
(
"ResetLine"
,
midSBGainLine
.
c_str
()),
"dio_board_proxy->command_inout(ResetLine,midSBGainLine.c_str())"
,
"dio_board_proxy->command_inout(ResetLine,midSBGainLine.c_str())"
,
...
@@ -765,7 +794,7 @@ void FemtoCurrentAmplifier::set_gain_on_dio_board(short gain_value)
...
@@ -765,7 +794,7 @@ void FemtoCurrentAmplifier::set_gain_on_dio_board(short gain_value)
//------ MSB -------------------------------
//------ MSB -------------------------------
//- Reset MSB
//- Reset MSB
if
(
gain_value
<
4
)
if
(
(
gain_value
<
4
)
||
(
gain_value
>
7
))
{
{
_DEV_TRY
(
dio_board_proxy
->
command_in
(
"ResetLine"
,
mSBGainLine
.
c_str
()),
_DEV_TRY
(
dio_board_proxy
->
command_in
(
"ResetLine"
,
mSBGainLine
.
c_str
()),
"dio_board_proxy->command_inout(ResetLine,mSBGainLine.c_str())"
,
"dio_board_proxy->command_inout(ResetLine,mSBGainLine.c_str())"
,
...
@@ -783,6 +812,29 @@ void FemtoCurrentAmplifier::set_gain_on_dio_board(short gain_value)
...
@@ -783,6 +812,29 @@ void FemtoCurrentAmplifier::set_gain_on_dio_board(short gain_value)
//msb = 1;
//msb = 1;
}
}
//
// For femto300 only
if
(
femtoType
==
3
)
// Femto300 gain is controled via the Pin13 used for AC/DC for Femto100 and Femto200)
// See cabling documentation of ECA group on MERIDIAN
{
if
(
gain_value
<
8
)
{
_DEV_TRY
(
dio_board_proxy
->
command_in
(
"ResetLine"
,
couplingLine
.
c_str
()),
"dio_board_proxy->command_inout(ResetLine,couplingLine.c_str())"
,
"FemtoCurrentAmplifier::set_gain_on_dio_board"
);
//coupling line - Pin13 = 0;
}
//- Set coupling line - Pin13
else
{
_DEV_TRY
(
dio_board_proxy
->
command_in
(
"SetLine"
,
couplingLine
.
c_str
()),
"dio_board_proxy->command_inout(SetLine,couplingLine.c_str())"
,
"FemtoCurrentAmplifier::set_gain_on_dio_board"
);
//coupling line - Pin13 = 1;
}
}
// end femto300
}
}
//+------------------------------------------------------------------
//+------------------------------------------------------------------
...
@@ -797,6 +849,13 @@ string FemtoCurrentAmplifier::get_gain_on_dio_board()
...
@@ -797,6 +849,13 @@ string FemtoCurrentAmplifier::get_gain_on_dio_board()
{
{
string
local_read_gain
;
string
local_read_gain
;
// For FEMTO 300, gain mode is disabled
if
(
femtoType
==
3
)
{
local_read_gain
=
femto_300_gains
[
attr_gain_write
];
}
else
{
//- High Speed
//- High Speed
if
(
attr_gainMode_write
==
false
)
if
(
attr_gainMode_write
==
false
)
{
{
...
@@ -814,7 +873,7 @@ string FemtoCurrentAmplifier::get_gain_on_dio_board()
...
@@ -814,7 +873,7 @@ string FemtoCurrentAmplifier::get_gain_on_dio_board()
else
else
local_read_gain
=
femto_100_LN_gains
[
attr_gain_write
];
local_read_gain
=
femto_100_LN_gains
[
attr_gain_write
];
}
}
}
return
local_read_gain
;
return
local_read_gain
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/FemtoCurrentAmplifier.h
+
9
−
9
View file @
384b2b14
...
@@ -6,9 +6,9 @@
...
@@ -6,9 +6,9 @@
//
//
// project : Femto Low-Noise Current Amplifier
// project : Femto Low-Noise Current Amplifier
//
//
// $Author:
vince_soleil
$
// $Author:
buteau
$
//
//
// $Revision: 1.1
2
$
// $Revision: 1.1
3
$
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
//
//
...
@@ -27,21 +27,21 @@
...
@@ -27,21 +27,21 @@
#define _FEMTOCURRENTAMPLIFIER_H
#define _FEMTOCURRENTAMPLIFIER_H
#include
<tango.h>
#include
<tango.h>
#include
<TangoExceptionsHelper.h>
#include
<
helpers/
TangoExceptionsHelper.h>
#include
<DeviceProxyHelper.h>
#include
<
helpers/
DeviceProxyHelper.h>
#include
<Xstring.h>
#include
<
helpers/
Xstring.h>
//using namespace Tango;
//using namespace Tango;
/**
/**
* @author $Author:
vince_soleil
$
* @author $Author:
buteau
$
* @version $Revision: 1.1
2
$
* @version $Revision: 1.1
3
$
*/
*/
// Add your own constants definitions here.
// Add your own constants definitions here.
//-----------------------------------------------
//-----------------------------------------------
const
int
MAX_STRING_LENGTH
=
10
;
const
int
MAX_STRING_LENGTH
=
32
;
namespace
FemtoCurrentAmplifier_ns
namespace
FemtoCurrentAmplifier_ns
...
@@ -337,7 +337,7 @@ protected :
...
@@ -337,7 +337,7 @@ protected :
static
string
femto_200_LN_gains
[
7
];
static
string
femto_200_LN_gains
[
7
];
static
string
femto_200_HS_gains
[
7
];
static
string
femto_200_HS_gains
[
7
];
static
string
femto_300_gains
[
10
];
short
MAX_GAIN_INDEX
;
short
MAX_GAIN_INDEX
;
bool
dio_proxy_not_yet_created
;
bool
dio_proxy_not_yet_created
;
...
...
This diff is collapsed.
Click to expand it.
src/TangoClassID.txt
0 → 100644
+
11
−
0
View file @
384b2b14
/**
* Device Class Identification:
*
* Class Name : FemtoCurrentAmplifier
* Contact : langlois@synchrotron-soleil.fr
* Class Family : Acquisition
* Platform : All Platforms
* Bus : Not Applicable
* Manufacturer : none
* Reference :
*/
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