Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Lakeshore_336
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
Temperature
Lakeshore_336
Commits
509211fa
Commit
509211fa
authored
Nov 22, 2010
by
Jean Coquet
Browse files
Options
Downloads
Patches
Plain Diff
test with HW to be continued
parent
998f60f1
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/task/HWProxy.cpp
+31
-13
31 additions, 13 deletions
src/task/HWProxy.cpp
src/task/HWProxy.h
+5
-2
5 additions, 2 deletions
src/task/HWProxy.h
src/task/StringTokenizer.cpp
+1
-1
1 addition, 1 deletion
src/task/StringTokenizer.cpp
with
37 additions
and
16 deletions
src/task/HWProxy.cpp
+
31
−
13
View file @
509211fa
...
...
@@ -68,14 +68,23 @@ namespace HWProxy_ns
this
->
set_periodic_msg_period
(
this
->
conf
.
periodic_timeout_ms
);
this
->
comproxy
=
0
;
this
->
command_ok
=
0
;
this
->
command_error
=
0
;
this
->
consecutive_command_error
=
0
;
com_state_enum_str
.
push_back
(
std
::
string
(
"HWP_UNKNOWN_ERROR"
));
com_state_enum_str
.
push_back
(
std
::
string
(
"HWP_INITIALIZATION_ERROR"
));
com_state_enum_str
.
push_back
(
std
::
string
(
"HWP_COMMUNICATION_ERROR"
));
com_state_enum_str
.
push_back
(
std
::
string
(
"HWP_COMMAND_ERROR"
));
com_state_enum_str
.
push_back
(
std
::
string
(
"HWP_HARDWARE_ERROR"
));
com_state_enum_str
.
push_back
(
std
::
string
(
"HWP_SOFTWARE_ERROR"
));
com_state_enum_str
.
push_back
(
std
::
string
(
"HWP_NO_ERROR"
));
//- check that Loop Number is correct
if
(
conf
.
loop_number
!=
1
&&
conf
.
loop_number
!=
2
)
{
ERROR_STREAM
<<
"USER ERROR Loop Number must be [1|2]"
<<
std
::
endl
;
ERROR_STREAM
<<
"USER ERROR Loop Number
<"
<<
conf
.
loop_number
<<
">
must be [1|2]"
<<
std
::
endl
;
this
->
com_state
=
HWP_INITIALIZATION_ERROR
;
this
->
last_error
=
"USER ERROR Loop Number must be [1|2]
\n
"
;
}
...
...
@@ -125,9 +134,9 @@ namespace HWProxy_ns
}
catch
(...)
{
ERROR_STREAM
<<
"HWProxy::HWProxy Error trying to allocate Ramp State Manager"
<<
std
::
endl
;
this
->
com_state
=
HWP_INITIALIZATION_ERROR
;
this
->
last_error
=
"Error trying to allocate Ramp State Manager
\n
"
;
ERROR_STREAM
<<
"HWProxy::HWProxy Error trying to allocate Ramp State Manager"
<<
std
::
endl
;
}
//- initialize the variables
...
...
@@ -177,17 +186,20 @@ namespace HWProxy_ns
//- THREAD_INIT =======================
case
yat
::
TASK_INIT
:
{
DEBUG_STREAM
<<
"HWProxy::handle_message::T
HREAD
_INIT::thread is starting up"
<<
std
::
endl
;
DEBUG_STREAM
<<
"HWProxy::handle_message::T
ASK
_INIT::thread is starting up"
<<
std
::
endl
;
//- "initialization" code goes here
last_error
=
"No Error
\n
"
;
if
(
com_state
==
HWP_INITIALIZATION_ERROR
)
if
(
this
->
com_state
==
HWP_INITIALIZATION_ERROR
)
{
ERROR_STREAM
<<
"HWProxy::handle_message::TASK_PERIODIC DO NOTHING REASON : INITIALIZATION_ERROR"
<<
std
::
endl
;
ERROR_STREAM
<<
"HWProxy::handle_message::TASK_INIT DO NOTHING REASON : INITIALIZATION_ERROR"
<<
std
::
endl
;
INFO_STREAM
<<
"HWProxy::handle_message::TASK_INIT::com_state = "
<<
int
(
com_state
)
<<
" str = "
<<
com_state_enum_str
[
com_state
]
<<
com_state
<<
std
::
endl
;
return
;
}
//- initialize variables by reading HW
DEBUG_STREAM
<<
"HWProxy::handle_message::TASK_INIT::initializing variables"
<<
std
::
endl
;
try
{
this
->
read_temperatures
();
...
...
@@ -197,7 +209,7 @@ namespace HWProxy_ns
}
catch
(...)
{
this
->
com_state
=
HWP_
INITIALIZ
ATION_ERROR
;
this
->
com_state
=
HWP_
COMMUNIC
ATION_ERROR
;
this
->
last_error
=
"Error TASK_INIT Error trying to read HW parameters [try to restart devicce]
\n
"
;
ERROR_STREAM
<<
"HWProxy::process_message::TASK_INIT Error trying read HW parameters"
<<
std
::
endl
;
}
...
...
@@ -890,8 +902,8 @@ namespace HWProxy_ns
if
(
com_state
==
HWP_INITIALIZATION_ERROR
||
this
->
comproxy
==
0
)
return
false
;
Tango
::
DeviceData
cmd_argout
;
Tango
::
DeviceData
cmd_argin
;
Tango
::
DeviceData
dd_in
;
Tango
::
DeviceData
dd_out
;
try
{
...
...
@@ -902,8 +914,11 @@ namespace HWProxy_ns
response
.
clear
();
DEBUG_STREAM
<<
"HWProxy::write_read try to send command ["
<<
cmd
<<
"]"
<<
std
::
endl
;
cmd_argout
=
this
->
comproxy
->
command_inout
(
"WriteRead"
,
cmd_argin
);
cmd_argout
>>
response
;
Tango
::
DevString
ds
;
ds
=
CORBA
::
string_dup
(
cmd
.
c_str
());
dd_in
<<
ds
;
dd_out
=
this
->
comproxy
->
command_inout
(
"WriteRead"
,
dd_in
);
dd_out
>>
response
;
DEBUG_STREAM
<<
"HWProxy::write_read response to command ["
<<
cmd
<<
"] received ["
<<
response
<<
"]"
<<
std
::
endl
;
}
//- response empty
...
...
@@ -949,7 +964,7 @@ namespace HWProxy_ns
if
(
com_state
==
HWP_INITIALIZATION_ERROR
||
this
->
comproxy
==
0
)
return
false
;
Tango
::
DeviceData
cmd_arg
in
;
Tango
::
DeviceData
dd_
in
;
try
{
...
...
@@ -957,7 +972,10 @@ namespace HWProxy_ns
yat
::
AutoMutex
<>
guard
(
this
->
lock
);
DEBUG_STREAM
<<
"HWProxy::write try to send command ["
<<
cmd
<<
"]"
<<
std
::
endl
;
this
->
comproxy
->
command_inout
(
"Write"
,
cmd_argin
);
Tango
::
DevString
ds
;
ds
=
CORBA
::
string_dup
(
cmd
.
c_str
());
dd_in
<<
ds
;
this
->
comproxy
->
command_inout
(
"Write"
,
dd_in
);
}
}
catch
(
Tango
::
DevFailed
&
e
)
...
...
This diff is collapsed.
Click to expand it.
src/task/HWProxy.h
+
5
−
2
View file @
509211fa
...
...
@@ -10,7 +10,7 @@
#include
<tango.h>
#include
<yat4tango/DeviceTask.h>
#include
<yat/Timer.h>
#include
<yat/
time/
Timer.h>
#include
<yat4tango/ThreadSafeDeviceProxy.h>
#include
"RampingStateManager.h"
...
...
@@ -151,7 +151,7 @@ namespace HWProxy_ns
//- access temperature (the input configured for this loop)
double
get_temperature
(
void
)
throw
(
Tango
::
DevFailed
)
{
if
(
this
->
com_state
=
HWP_INITIALIZATION_ERROR
)
if
(
this
->
com_state
=
=
HWP_INITIALIZATION_ERROR
)
{
Tango
::
Except
::
throw_exception
(
"DATA_OUT_OF_RANGE"
,
" temperature index must be in [0...3]"
,
...
...
@@ -334,6 +334,9 @@ namespace HWProxy_ns
//- The regulation (Ramp) State Manager
rsm_ns
::
RampingStateMachine
*
reg_manager
;
std
::
vector
<
std
::
string
>
com_state_enum_str
;
};
}
//- namespace
...
...
This diff is collapsed.
Click to expand it.
src/task/StringTokenizer.cpp
+
1
−
1
View file @
509211fa
...
...
@@ -7,7 +7,7 @@
//////////////////////////////////////////////////////////////////////
#include
"StringTokenizer.h"
#include
<yat/XString.h>
#include
<yat/
utils/
XString.h>
//- Ctor with initialisation---------------------------------------------
...
...
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