Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LoCuM_4
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
BeamDiagnostics
LoCuM_4
Commits
9fef22e4
Commit
9fef22e4
authored
Nov 21, 2007
by
Sebastien Leport
Browse files
Options
Downloads
Patches
Plain Diff
no message
parent
d6475224
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/LoCuM_4.cpp
+37
-24
37 additions, 24 deletions
src/LoCuM_4.cpp
src/LoCuM_4.h
+12
-5
12 additions, 5 deletions
src/LoCuM_4.h
src/Makefile.linux
+147
-0
147 additions, 0 deletions
src/Makefile.linux
with
196 additions
and
29 deletions
src/LoCuM_4.cpp
+
37
−
24
View file @
9fef22e4
static
const
char
*
RcsId
=
"$Header: /users/chaize/newsvn/cvsroot/Instrumentation/LoCuM_4/src/LoCuM_4.cpp,v 1.1
6
2007-11-21 1
0:16:51
sebleport Exp $"
;
static
const
char
*
RcsId
=
"$Header: /users/chaize/newsvn/cvsroot/Instrumentation/LoCuM_4/src/LoCuM_4.cpp,v 1.1
7
2007-11-21 1
1:29:17
sebleport Exp $"
;
//+=============================================================================
//
// file : LoCuM_4.cpp
...
...
@@ -13,9 +13,15 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
//
// $Author: sebleport $
//
// $Revision: 1.1
6
$
// $Revision: 1.1
7
$
//
// $Log: not supported by cvs2svn $
// Revision 1.16 2007/11/21 10:16:51 sebleport
// - code cleaning
// - remove XbpmLocum proxy property
// - "reset" command removed
// - dev_status() in comment
//
// Revision 1.15 2007/09/17 12:27:27 sebleport
// proxies are now created in always_executed_hook
//
...
...
@@ -87,7 +93,6 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
#include
<LoCuM_4Class.h>
#include
"PogoHelper.h"
#include
"XString.h"
#include
<math.h>
#include
<iostream>
...
...
@@ -216,16 +221,7 @@ namespace LoCuM_4_ns
//-----------------------------------------------------------------------------
void
LoCuM_4
::
always_executed_hook
()
{
// create devices proxy if it does not exist
dev_status_
=
"serial proxy = "
+
serialProxyName
+
"
\n
"
;
if
(
mySerial
==
0
)
{
_DEV_TRY
(
create_proxy_Serialline
(),
"create_proxy_Serialline"
,
"LoCuM_4::always_executed_hook()"
);
}
}
//+----------------------------------------------------------------------------
//
...
...
@@ -238,6 +234,14 @@ namespace LoCuM_4_ns
{
DEBUG_STREAM
<<
"LoCuM_4::read_attr_hardware(vector<long> &attr_list) entering... "
<<
endl
;
// Add your own code here
if
(
mySerial
==
0
)
{
_DEV_TRY
(
create_proxy_Serialline
(),
"create_proxy_Serialline"
,
"LoCuM_4::always_executed_hook()"
);
}
}
//+----------------------------------------------------------------------------
//
...
...
@@ -428,11 +432,18 @@ Tango::DevString LoCuM_4::send_locum4_command(Tango::DevString argin)
Tango
::
DevState
argout
=
DeviceImpl
::
dev_state
();
DEBUG_STREAM
<<
"LoCuM_4::dev_state(): entering... !"
<<
endl
;
// create devices proxy if it does not exist
dev_status_
=
"serial proxy = "
+
serialProxyName
+
"
\n
"
;
// Add your own code to control device here
if
(
mySerial
==
0
)
{
dev_status_
=
"no more communication with locum4 amplifier
\n
"
;
dev_status_
+
=
"no more communication with locum4 amplifier
\n
"
;
return
Tango
::
FAULT
;
}
else
{
dev_status_
+=
"locum is fine
\n
"
;
return
Tango
::
ON
;
}
}
...
...
@@ -574,16 +585,17 @@ Tango::DevString LoCuM_4::send_locum4_command(Tango::DevString argin)
(
*
LF
)[
0
]
=
10
;
Tango
::
DevS
tring
resp
=
""
;
long
nb_char_written
=
0
;;
std
::
s
tring
resp
=
""
;
long
nb_char_written
=
0
;
if
(
local
=
false
)
// flag to cut the communitcation with the hardware
{
//
if(local=false) // flag to cut the communitcation with the hardware
//
{
//- send command
_DEV_TRY_REACTION
(
mySerial
->
command_inout
(
"DevSerWriteString"
,
cmd_to_send
.
c_str
(),
nb_char_written
),
"send locum command to the serial line"
,
"LoCuM_4::write_read"
,
set_state
(
Tango
::
FAULT
);
if
(
mySerial
)
{
delete
mySerial
;
...
...
@@ -595,6 +607,7 @@ Tango::DevString LoCuM_4::send_locum4_command(Tango::DevString argin)
mySerial
->
command_inout
(
"DevSerWriteChar"
,
LF
,
nb_char_written
),
"send LF character the serial line"
,
"LoCuM_4::write_read"
,
set_state
(
Tango
::
FAULT
);
if
(
mySerial
)
{
delete
mySerial
;
...
...
@@ -609,22 +622,23 @@ Tango::DevString LoCuM_4::send_locum4_command(Tango::DevString argin)
mySerial
->
command_inout
(
"DevSerReadString"
,
readMode
,
resp
),
"read the command response"
,
"LoCuM_4::write_read"
,
set_state
(
Tango
::
FAULT
);
if
(
mySerial
)
{
delete
mySerial
;
mySerial
=
0
;
});
}
set_state
(
Tango
::
ON
);
}
/* }
else
{
Tango::Except::throw_exception(
(const char*) "COMMUNICATION BROKEN",
(const char*) "local mode enabled.Call Init device to select the remote mode ",
(
const
char
*
)
"LoCuM_4::dev_state()"
);
}
(const char*) "LoCuM_4::write_read()");
}*/
set_state
(
Tango
::
ON
);
return
string
(
resp
);
...
...
@@ -715,7 +729,6 @@ Tango::DevString LoCuM_4::send_locum4_command(Tango::DevString argin)
return
0.0001
;
}
}
}
// ********************************************************************************************
...
...
This diff is collapsed.
Click to expand it.
src/LoCuM_4.h
+
12
−
5
View file @
9fef22e4
...
...
@@ -8,9 +8,15 @@
//
// $Author: sebleport $
//
// $Revision: 1.1
2
$
// $Revision: 1.1
3
$
//
// $Log: not supported by cvs2svn $
// Revision 1.12 2007/11/21 10:16:51 sebleport
// - code cleaning
// - remove XbpmLocum proxy property
// - "reset" command removed
// - dev_status() in comment
//
// Revision 1.11 2007/09/17 08:14:47 sebleport
// code cleaned
//
...
...
@@ -47,14 +53,15 @@
#ifndef _LOCUM_4_H
#define _LOCUM_4_H
#include
<tango.h>
//using namespace Tango;
#include
"DeviceProxyHelper.h"
#include
"TangoExceptionsHelper.h"
#include
"Xstring.h"
#include
<tango.h>
/**
* @author $Author: sebleport $
* @version $Revision: 1.1
2
$
* @version $Revision: 1.1
3
$
*/
// Add your own constants definitions here.
...
...
This diff is collapsed.
Click to expand it.
src/Makefile.linux
0 → 100644
+
147
−
0
View file @
9fef22e4
#=============================================================================
#
# file : Makefile.h
#
# description : Makefile for DeviceServer
#
# $Author: stephle $
#
# $Revision: 1.1 $
#
# $Log: Makefile.linux,v $
# Revision 1.1 2007/11/20 16:17:45 stephle
# initial import
#
# Revision 1.4 2006/10/09 16:09:48 malik
# support the merging of different static libs into another
#
# Revision 1.3 2006/03/21 16:59:13 hardion
# * Add Software Support to Makefile process
#
# Revision 1.2 2006/03/21 15:25:20 hardion
# * Update Pogo
# * fix bug in Makefile process
#
# Revision 1.3 2006/03/14 14:57:34 hardion
# * Update Makefile process to allow compilation of library
#
# Revision 1.2 2006/01/05 16:51:30 hardion
# * Update Makefile.linux and tango.opt for library use
#
#
#=============================================================================
#=============================================================================
# OUTPUT_TYPE can be one of the following :
# - 'STATIC_LIB' for a static library (.a)
# - 'DYNAMIC_LIB' for a dynamic library (.so)
# - 'DEVICE' for a device server (will automatically include and link
# with Tango dependencies)
# - 'SIMPLE_EXE' for an executable with no dependency (for exemple the test tool
# of a library with no Tango dependencies)
#
OUTPUT_TYPE
=
DEVICE
#=============================================================================
# OUTPUT_DIR is the directory which contains the build result.
# if not set, the standard location is :
# - $HOME/DeviceServers if OUTPUT_TYPE is DEVICE
# - ../bin for others
#
OUTPUT_DIR
=
#=============================================================================
# PACKAGE_NAME is the name of the library/device/exe you want to build
# - for a device server, PACKAGE_NAME will be prefixed by 'ds_'
# - for a library (static or dynamic), PACKAGE_NAME will be prefixed by 'lib'
# - for a simple executable, PACKAGE_NAME will be the name of the executable
#
PACKAGE_NAME
=
LoCuM_4
#=============================================================================
# INC_DIR_USER is the list of all include path needed by your sources
# - for a device server, tango dependencies are automatically appended
# - '-I ../include' and '-I .' are automatically appended in all cases
#
# -I$(SOLEIL_ROOT)/hw-support/ace/include for ACE library
# -I$(SOLEIL_ROOT)/hw-support/asl/include for ASL library
# -I$(SOLEIL_ROOT)/sw-support/hkl/include for HKL library
# ...etc
#
INC_DIR_USER
=
#=============================================================================
# LIB_DIR_USER is the list of user library directories
# - for a device server, tango libraries directories are automatically appended
# - '-L ../lib' is automatically appended in all cases
# -L $(SOLEIL_ROOT)/hw-support/ace/lib for ACE library
# -L $(SOLEIL_ROOT)/hw-support/asl/lib for ASL library
# -L $(SOLEIL_ROOT)/sw-support/hkl/lib for HKL library
# ...etc
#
LIB_DIR_USER
=
#=============================================================================
# LFLAGS_USR is the list of user link flags
# - for a device server, tango libraries directories are automatically appended
# - '-ldl -lpthread' is automatically appended in all cases
#
# !!! ATTENTION !!!
# Be aware that the order matters.
# For example if you must link with libA, and if libA depends itself on libB
# you must use '-lA -lB' in this order as link flags, otherwise you will get
# 'undefined reference' errors
#
# -lACE for ACE
# -lASL for ASL
# -lHKL for HKL
#
LFLAGS_USR
=
#=============================================================================
# CXXFLAGS_USR lists the compilation flags specific for your library/device/exe
# This is the place where to put your compile-time macros using '-Dmy_macro'
#
# -DACE_HAS_EXCEPTIONS -D__ACE_INLINE__ for ACE
#
#CXXFLAGS_USR=-DSIMULATED_AXIS
#
# include Standard TANGO compilation options
#
include
$(SOLEIL_ROOT)/env/tango.opt
#=============================================================================
# SVC_OBJS is the list of all objects needed to make the output
#
SVC_OBJS
=
$(
OBJDIR
)
/ClassFactory.o
\
$(
OBJDIR
)
/main.o
\
$(
OBJDIR
)
/
$(
PACKAGE_NAME
)
Class.o
\
$(
OBJDIR
)
/
$(
PACKAGE_NAME
)
.o
\
$(
OBJDIR
)
/
$(
PACKAGE_NAME
)
StateMachine.o
#=============================================================================
# EXTERNAL_LIBS is used only if you build a static library
# it is the list of the other static libraries you want to merge with the current one.
# the built library will contain symbols from SVC_OBJS and all objects embedded in EXTERNAL_LIBS
#
#EXTERNAL_LIBS = $(SOLEIL_ROOT)/sw-support/external_lib_1/lib/libExternal.lib
#
# Verbose mode
#
#.SILENT:
#
# include common targets
#
include
$(SOLEIL_ROOT)/env/common_target.opt
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