Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Electrometers
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Tango devices
MeasureInstruments
lib
Electrometers
Commits
2d89895c
Commit
2d89895c
authored
12 years ago
by
ELATTAOUI
Browse files
Options
Downloads
Patches
Plain Diff
minor changes.
parent
92705e70
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pom.xml
+1
-1
1 addition, 1 deletion
pom.xml
src/KeithleySCPIProtocol.cpp
+567
-149
567 additions, 149 deletions
src/KeithleySCPIProtocol.cpp
src/TangoGpibLink.cpp
+74
-8
74 additions, 8 deletions
src/TangoGpibLink.cpp
src/TangoSerialLink.cpp
+57
-8
57 additions, 8 deletions
src/TangoSerialLink.cpp
with
699 additions
and
166 deletions
pom.xml
+
1
−
1
View file @
2d89895c
...
...
@@ -8,7 +8,7 @@
</parent>
<groupId>
fr.soleil.lib
</groupId>
<artifactId>
Electrometers-${aol}-${library}-${mode}
</artifactId>
<version>
2.5.
3
</version>
<version>
2.5.
4
</version>
<packaging>
nar
</packaging>
<name>
Electrometers library
</name>
<description>
Electrometers library
</description>
...
...
This diff is collapsed.
Click to expand it.
src/KeithleySCPIProtocol.cpp
+
567
−
149
View file @
2d89895c
This diff is collapsed.
Click to expand it.
src/TangoGpibLink.cpp
+
74
−
8
View file @
2d89895c
...
...
@@ -64,13 +64,21 @@ void TangoGpibLink::create_gpib_proxy (void) throw (Tango::DevFailed)
}
catch
(
Tango
::
DevFailed
&
df
)
{
description
=
"Unable to create proxy on : "
+
_communication_Device_name
;
description
=
"Unable to create proxy on : "
+
_communication_Device_name
+
". Check GPIB device is up !"
;
Tango
::
Except
::
re_throw_exception
(
df
,
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoGpibLink::create_gpib_proxy"
);
}
}
catch
(...)
{
description
=
"Unable to create proxy on : "
+
_communication_Device_name
+
". Check GPIB device is up !"
;
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoGpibLink::create_gpib_proxy"
);
}
}
...
...
@@ -120,16 +128,25 @@ void TangoGpibLink::write (std::string command_to_send) throw (Tango::DevFailed
}
catch
(
Tango
::
DevFailed
&
df
)
{
description
=
"Unable to write command : "
+
command_to_send
;
if
(
cmd
)
delete
[]
cmd
;
description
=
"Unable to write command : "
+
command_to_send
+
". Caught DevFailed."
;
Tango
::
Except
::
re_throw_exception
(
df
,
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoGpibLink::write"
);
}
catch
(...)
{
if
(
cmd
)
delete
[]
cmd
;
description
=
"Unable to write command : "
+
command_to_send
+
". Caught [...]."
;
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoGpibLink::write"
);
}
}
...
...
@@ -156,6 +173,13 @@ std::string TangoGpibLink::read (void) throw (Tango::DevFailed)
(
const
char
*
)
"Unable to perform a read operation"
,
(
const
char
*
)
"TangoGpibLink::read"
);
}
catch
(...)
{
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"COMMUNICATION_ERROR"
,
(
const
char
*
)
"Unable to perform a read operation, caught [...]."
,
(
const
char
*
)
"TangoGpibLink::read"
);
}
return
this
->
response
;
}
...
...
@@ -185,14 +209,25 @@ std::string TangoGpibLink::write_read (std::string command_to_send) throw (Tango
}
catch
(
Tango
::
DevFailed
&
df
)
{
description
=
"Unable to write command : "
+
command_to_send
+
" and read device response."
;
if
(
argin
)
delete
[]
argin
;
description
=
"Unable to write/read command : "
+
command_to_send
+
" and read device response."
;
Tango
::
Except
::
re_throw_exception
(
df
,
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoGpibLink::write_read"
);
}
catch
(...)
{
if
(
argin
)
delete
[]
argin
;
description
=
"Unable to write/read command : "
+
command_to_send
+
" and read device response."
;
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoGpibLink::write_read"
);
}
return
this
->
response
;
}
...
...
@@ -224,6 +259,14 @@ bool TangoGpibLink::SRQLineState (void) throw (Tango::DevFailed)
(
const
char
*
)
"TangoGpibLink::SRQLineState"
);
}
catch
(...)
{
description
=
"Unable to get Gpib SRQ line state."
;
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoGpibLink::SRQLineState"
);
}
return
result
;
}
...
...
@@ -257,6 +300,15 @@ short TangoGpibLink::readStatusByteRegister (void) throw (Tango::DevFailed)
(
const
char
*
)
"TangoGpibLink::readStatusByteRegister"
);
}
catch
(...)
{
description
=
"Unable to get device status byte register."
;
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoGpibLink::readStatusByteRegister"
);
}
return
result
;
}
...
...
@@ -278,12 +330,19 @@ void TangoGpibLink::clear (void) throw (Tango::DevFailed)
catch
(
Tango
::
DevFailed
&
df
)
{
description
=
"Unable send Clear Device command."
;
Tango
::
Except
::
re_throw_exception
(
df
,
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoGpibLink::clear"
);
}
catch
(...)
{
description
=
"Unable send Clear Device command."
;
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoGpibLink::clear"
);
}
}
// ============================================================================
...
...
@@ -304,11 +363,18 @@ void TangoGpibLink::trigger (void) throw (Tango::DevFailed)
catch
(
Tango
::
DevFailed
&
df
)
{
description
=
"Unable send Trigger command."
;
Tango
::
Except
::
re_throw_exception
(
df
,
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoGpibLink::clear"
);
(
const
char
*
)
"TangoGpibLink::trigger"
);
}
catch
(...)
{
description
=
"Unable send Trigger command."
;
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoGpibLink::trigger"
);
}
}
This diff is collapsed.
Click to expand it.
src/TangoSerialLink.cpp
+
57
−
8
View file @
2d89895c
...
...
@@ -18,7 +18,7 @@
#include
<iostream>
#include
"TangoSerialLink.h"
//- Read serial data in mode LINE (i.e SerialLine device wait until EOF is received from instrument
//- Read serial data in mode LINE (i.e SerialLine device wait until EOF is received from instrument
)
static
const
long
MODE_LINE
=
2
;
//- init of the static instance
...
...
@@ -90,22 +90,39 @@ void TangoSerialLink::create_serial_proxy (void) throw (Tango::DevFailed)
try
{
//- try
//this->_serial_proxy = new Tango::DeviceProxyHelper(_communication_Device_name);
this
->
_serial_proxy
=
new
Tango
::
DeviceProxy
(
_communication_Device_name
.
c_str
());
//(*_serial_proxy)->ping();
_is_serial_proxy_created
=
true
;
}
catch
(
Tango
::
DevFailed
&
df
)
{
description
=
"Unable to create proxy on : "
+
_communication_Device_name
;
if
(
this
->
_serial_proxy
)
{
delete
this
->
_serial_proxy
;
this
->
_serial_proxy
=
0
;
}
_is_serial_proxy_created
=
false
;
this
->
_serial_proxy
=
0
;
description
=
"Unable to create proxy on : "
+
_communication_Device_name
;
Tango
::
Except
::
re_throw_exception
(
df
,
(
const
char
*
)
"
COMMUNI
CATION_ERROR"
,
(
const
char
*
)
"
ALLO
CATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoSerialLink::create_serial_proxy"
);
}
catch
(...)
{
if
(
this
->
_serial_proxy
)
{
delete
this
->
_serial_proxy
;
this
->
_serial_proxy
=
0
;
}
_is_serial_proxy_created
=
false
;
description
=
"Unable to write command : "
+
command_to_send
+
"
\n
memory allocation failed."
;
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"ALLOCATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoSerialLink::write"
);
}
}
// ============================================================================
...
...
@@ -127,8 +144,12 @@ void TangoSerialLink::write (std::string command_to_send) throw (Tango::DevFail
}
catch
(
Tango
::
DevFailed
&
df
)
{
if
(
argin
)
{
delete
[]
argin
;
argin
=
0
;
}
description
=
"Unable to write command : "
+
command_to_send
+
+
"
\n
memory allocation failed."
;
Tango
::
Except
::
re_throw_exception
(
df
,
(
const
char
*
)
"ALLOCATION_ERROR"
,
description
.
c_str
(),
...
...
@@ -137,7 +158,6 @@ void TangoSerialLink::write (std::string command_to_send) throw (Tango::DevFail
catch
(...)
{
description
=
"Unable to write command : "
+
command_to_send
+
"
\n
memory allocation failed."
;
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"ALLOCATION_ERROR"
,
description
.
c_str
(),
...
...
@@ -149,18 +169,40 @@ void TangoSerialLink::write (std::string command_to_send) throw (Tango::DevFail
//- try
dd_in
<<
argin
;
this
->
_serial_proxy
->
command_inout
(
"DevSerWriteString"
,
dd_in
);
if
(
argin
)
{
delete
[]
argin
;
argin
=
0
;
}
//std::cout << "TangoSerialLink::write -> argin = *\"" << argin << "\"*" << std::endl;
}
catch
(
Tango
::
DevFailed
&
df
)
{
if
(
argin
)
{
delete
[]
argin
;
argin
=
0
;
}
description
=
"Unable to write command : "
+
command_to_send
;
Tango
::
Except
::
re_throw_exception
(
df
,
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoSerialLink::write"
);
}
catch
(...)
{
if
(
argin
)
{
delete
[]
argin
;
argin
=
0
;
}
description
=
"Unable to write command : "
+
command_to_send
;
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"COMMUNICATION_ERROR"
,
description
.
c_str
(),
(
const
char
*
)
"TangoSerialLink::write"
);
}
}
...
...
@@ -187,6 +229,13 @@ std::string TangoSerialLink::read (void) throw (Tango::DevFailed)
(
const
char
*
)
"Unable to perform a read operation"
,
(
const
char
*
)
"TangoSerialLink::read"
);
}
catch
(...)
{
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"COMMUNICATION_ERROR"
,
(
const
char
*
)
"Unable to perform a read operation"
,
(
const
char
*
)
"TangoSerialLink::read"
);
}
return
this
->
response
;
}
...
...
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