Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LFI_3751
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
MagneticDevices
LFI_3751
Commits
0aeb0586
Commit
0aeb0586
authored
May 22, 2006
by
Sebastien Leport
Browse files
Options
Downloads
Patches
Plain Diff
few bugs corrected
parent
3f87260e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/LFI_3751.cpp
+112
-47
112 additions, 47 deletions
src/LFI_3751.cpp
with
112 additions
and
47 deletions
src/LFI_3751.cpp
+
112
−
47
View file @
0aeb0586
...
@@ -226,12 +226,14 @@ namespace LFI_3751_ns
...
@@ -226,12 +226,14 @@ namespace LFI_3751_ns
detect_error
(
response
);
detect_error
(
response
);
response
=
response
.
substr
(
9
,
8
);
response
=
response
.
substr
(
16
,
1
);
char
current_enabled
=
XString
<
char
>::
convertFromString
(
response
);
if
(
response
[
0
]
==
0
)
if
(
current_enabled
==
'0'
)
*
attr_outputCurrent_read
=
false
;
*
attr_outputCurrent_read
=
false
;
if
(
response
[
0
]
==
1
)
if
(
current_enabled
==
'1'
)
*
attr_outputCurrent_read
=
true
;
*
attr_outputCurrent_read
=
true
;
attr
.
set_value
(
attr_outputCurrent_read
);
attr
.
set_value
(
attr_outputCurrent_read
);
...
@@ -254,14 +256,12 @@ namespace LFI_3751_ns
...
@@ -254,14 +256,12 @@ namespace LFI_3751_ns
if
(
attr_outputCurrent_write
==
false
)
// result:disable current
if
(
attr_outputCurrent_write
==
false
)
// result:disable current
response
=
write_read
(
"!101251+000.00022"
);
response
=
write_read
(
"!101251+000.00022"
);
if
(
attr_outputCurrent_write
==
true
)
// result:enable current
if
(
attr_outputCurrent_write
==
true
)
// result:enable current
response
=
write_read
(
"!101251+000.00123"
);
response
=
write_read
(
"!101251+000.00123"
);
detect_error
(
response
);
detect_error
(
response
);
}
}
//+----------------------------------------------------------------------------
//+----------------------------------------------------------------------------
//
//
// method : LFI_3751::read_temperaturePreset
// method : LFI_3751::read_temperaturePreset
...
@@ -299,11 +299,20 @@ namespace LFI_3751_ns
...
@@ -299,11 +299,20 @@ namespace LFI_3751_ns
preset
=
XString
<
double
>::
convertToString
(
attr_temperaturePreset_write
);
preset
=
XString
<
double
>::
convertToString
(
attr_temperaturePreset_write
);
if
(
attr_temperaturePreset_write
<
0
)
{
// format the frame commande to send to the LFI
// format the frame commande to send to the LFI
////////////////////////////////////////////////
////////////////////////////////////////////////
preset
=
format_data_to_send
(
preset
);
preset
=
format_data_to_send
(
preset
);
cmd
=
"!101203-"
+
preset
;
}
else
{
preset
=
format_data_to_send
(
preset
);
cmd
=
"!101203+"
+
preset
;
cmd
=
"!101203+"
+
preset
;
}
FCS
=
checksum
(
cmd
);
FCS
=
checksum
(
cmd
);
...
@@ -354,7 +363,9 @@ namespace LFI_3751_ns
...
@@ -354,7 +363,9 @@ namespace LFI_3751_ns
*
attr_resistanceMeasured_read
=
XString
<
double
>::
convertFromString
(
response
);
*
attr_resistanceMeasured_read
=
XString
<
double
>::
convertFromString
(
response
);
attr
.
set_value
(
attr_temperatureMeasured_read
);
*
attr_resistanceMeasured_read
=
*
attr_resistanceMeasured_read
*
1000
;
attr
.
set_value
(
attr_resistanceMeasured_read
);
}
}
//+----------------------------------------------------------------------------
//+----------------------------------------------------------------------------
...
@@ -606,7 +617,7 @@ namespace LFI_3751_ns
...
@@ -606,7 +617,7 @@ namespace LFI_3751_ns
std
::
string
response
;
std
::
string
response
;
response
=
write_read
(
"!10121
0
-001.00021"
);
response
=
write_read
(
"!10121
1
-001.00021"
);
detect_error
(
response
);
detect_error
(
response
);
}
}
...
@@ -630,17 +641,42 @@ namespace LFI_3751_ns
...
@@ -630,17 +641,42 @@ namespace LFI_3751_ns
std
::
string
response
=
write_read
(
"!101151+000.00021"
);
std
::
string
response
=
write_read
(
"!101151+000.00021"
);
detect_error
(
response
);
detect_error
(
response
);
response
=
response
.
substr
(
9
,
8
);
char
autotune_error_code
=
XString
<
char
>::
convertFromString
(
response
.
substr
(
11
,
1
));
char
autotune_state
=
XString
<
char
>::
convertFromString
(
response
.
substr
(
12
,
1
));
if
(
response
[
5
]
==
1
||
response
[
5
]
==
2
||
response
[
5
]
==
3
||
response
[
5
]
==
4
)
if
(
autotune_error_code
==
'1'
)
{
{
set_state
(
Tango
::
ALARM
);
set_state
(
Tango
::
ALARM
);
set_status
(
"
autotun
e error"
);
set_status
(
"
zero value current limit
e error"
);
}
}
else
if
(
autotune_error_code
==
'2'
)
{
set_state
(
Tango
::
ALARM
);
set_status
(
"current limit cannont reach SET T"
);
}
if
(
autotune_error_code
==
'3'
)
{
set_state
(
Tango
::
ALARM
);
set_status
(
"Non uniform TE I step measured"
);
}
if
(
autotune_error_code
==
'4'
)
{
set_state
(
Tango
::
ALARM
);
set_status
(
"Rate Sign Change"
);
}
if
(
autotune_error_code
!=
'1'
&&
autotune_error_code
!=
'2'
&&
autotune_error_code
!=
'3'
&&
autotune_error_code
!=
'4'
)
{
if
(
autotune_state
==
'0'
)
{
set_state
(
Tango
::
ON
);
set_status
(
"LFI is OK, manual PID configuration"
);
}
if
(
autotune_state
==
'1'
)
{
{
set_state
(
Tango
::
ON
);
set_state
(
Tango
::
ON
);
set_status
(
"LFI is OK"
);
set_status
(
"LFI is OK, automatic PID configuration"
);
}
}
}
return
argout
;
return
argout
;
}
}
...
@@ -801,10 +837,41 @@ namespace LFI_3751_ns
...
@@ -801,10 +837,41 @@ namespace LFI_3751_ns
DEBUG_STREAM
<<
"format_data_to_send()...entering"
<<
endl
;
DEBUG_STREAM
<<
"format_data_to_send()...entering"
<<
endl
;
int
index_point
;
int
index_point
;
std
::
string
formated_data
;
std
::
string
formated_data
;
char
sign
=
XString
<
char
>::
convertFromString
(
data
.
substr
(
0
,
1
));
if
(
sign
==
'-'
)
// negative preset
{
do
do
{
{
index_point
=
data
.
find
(
'.'
,
0
);
index_point
=
data
.
find
(
'.'
,
0
);
DEBUG_STREAM
<<
"index_point is "
<<
index_point
<<
endl
;
if
(
index_point
==
2
)
{
data
=
data
.
substr
(
1
,
index_point
+
3
);
data
=
data
.
insert
(
0
,
'0'
);
formated_data
=
data
.
insert
(
0
,
'0'
);
}
if
(
index_point
==
3
)
{
data
=
data
.
substr
(
1
,
index_point
+
3
);
formated_data
=
data
.
insert
(
0
,
'0'
);
}
if
(
index_point
==
4
)
{
formated_data
=
data
.
substr
(
1
,
index_point
+
3
);
}
}
while
(
index_point
<
0
);
// index_point = -1 means the "point" character has not been found
}
else
// positive preset
{
do
{
index_point
=
data
.
find
(
'.'
,
0
);
if
(
index_point
==
1
)
if
(
index_point
==
1
)
{
{
data
=
data
.
substr
(
0
,
index_point
+
4
);
data
=
data
.
substr
(
0
,
index_point
+
4
);
...
@@ -822,10 +889,8 @@ namespace LFI_3751_ns
...
@@ -822,10 +889,8 @@ namespace LFI_3751_ns
{
{
formated_data
=
data
.
substr
(
0
,
index_point
+
4
);
formated_data
=
data
.
substr
(
0
,
index_point
+
4
);
}
}
DEBUG_STREAM
<<
"format_data done"
<<
endl
;
}
while
(
index_point
<
0
);
// index_point = -1 means the "point" character has not been found
}
while
(
index_point
<
0
);
// index_point = -1 means the "point" character has not been found
}
return
formated_data
;
return
formated_data
;
}
}
...
@@ -851,7 +916,7 @@ namespace LFI_3751_ns
...
@@ -851,7 +916,7 @@ namespace LFI_3751_ns
Tango
::
Except
::
throw_exception
(
Tango
::
Except
::
throw_exception
(
(
const
char
*
)
"UNKNOW_ERROR"
,
(
const
char
*
)
"UNKNOW_ERROR"
,
(
const
char
*
)
"an error occured, look at the error code and look for the corresponding description in the controler manual"
,
(
const
char
*
)
"an error occured, look at the
end
error code and look for the corresponding description in the controler manual"
,
(
const
char
*
)
"LFI_3751::detect_error()"
);
(
const
char
*
)
"LFI_3751::detect_error()"
);
}
}
}
}
...
...
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