Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SingleShotAO
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
InputOutput
ADLINK
SingleShotAO
Commits
a9fd5241
Commit
a9fd5241
authored
4 months ago
by
Alexandre MALFREYT
Browse files
Options
Downloads
Patches
Plain Diff
fix: abort in delete_device (and inherently in init and exit)
parent
4a82daf2
No related branches found
No related tags found
2 merge requests
!4
develop -> main
,
!2
[CTRLRFC-1594] Apply memorized dynamic attributes at init
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/SingleShotAO.cpp
+39
-31
39 additions, 31 deletions
src/SingleShotAO.cpp
with
39 additions
and
31 deletions
src/SingleShotAO.cpp
+
39
−
31
View file @
a9fd5241
...
...
@@ -129,7 +129,32 @@ SingleShotAO::SingleShotAO(Tango::DeviceClass *cl,const char *s,const char *d)
//-----------------------------------------------------------------------------
void
SingleShotAO
::
delete_device
()
{
DEBUG_STREAM
<<
"SingleShotAO::delete_device(): entering... !"
<<
endl
;
// Make sure running processes are aborted properly if channels are running
//--------------------------------------------
try
{
_abort
();
}
catch
(
Tango
::
DevFailed
&
df
)
{
ERROR_STREAM
<<
df
<<
endl
;
RETHROW_DEVFAILED
(
df
,
"DRIVER_FAILURE"
,
"could not abort [caught Tango::DevFailed]"
,
"SingleShotAO::delete_device"
);
}
catch
(...)
{
ERROR_STREAM
<<
"SingleShotAO::init::unknown exception caught"
<<
std
::
endl
;
THROW_DEVFAILED
(
"DRIVER_FAILURE"
,
"could not abort [unknown error]"
,
"SingleShotAO::delete_device"
);
}
// Delete device allocated objects
//--------------------------------------------
yat4tango
::
TraceHelper
t
(
"SingleShotAO::delete_device"
,
this
);
if
(
m_manager
)
...
...
@@ -138,14 +163,16 @@ void SingleShotAO::delete_device()
m_manager
=
NULL
;
}
//- release the asl::SingleShotAO object
// Release the asl::SingleShotAO object
//--------------------------------------------
if
(
m_ssao
)
{
delete
m_ssao
;
m_ssao
=
NULL
;
}
// remove dynamic attributes
// Remove dynamic attributes
//--------------------------------------------
if
(
m_dyn_attr_manager
)
{
try
...
...
@@ -165,7 +192,8 @@ void SingleShotAO::delete_device()
m_dyn_attr_manager
=
NULL
;
}
//- remove the inner appender
// Remove the inner appender
//--------------------------------------------
yat4tango
::
Logging
::
release
(
this
);
yat4tango
::
DeviceInfo
::
release
(
this
);
}
...
...
@@ -315,7 +343,9 @@ void SingleShotAO::init_device()
return
;
}
// get frequency value in database
//--------------------------------------------
try
{
m_frequency
=
yat4tango
::
PropertyHelper
::
get_memorized_attribute
<
double
>
(
this
,
"frequency"
);
...
...
@@ -326,6 +356,7 @@ void SingleShotAO::init_device()
DEBUG_STREAM
<<
"Failed to get frequency value. Maybe there is no value yet."
<<
std
::
endl
;
}
// initialize the AO manager
//--------------------------------------------
try
...
...
@@ -348,28 +379,6 @@ void SingleShotAO::init_device()
}
// Make sure running processes are aborted properly
//--------------------------------------------
try
{
_abort
();
}
catch
(
Tango
::
DevFailed
&
df
)
{
ERROR_STREAM
<<
df
<<
endl
;
RETHROW_DEVFAILED
(
df
,
"DRIVER_FAILURE"
,
"could not abort [caught Tango::DevFailed]"
,
"SingleShotAO::init"
);
}
catch
(...)
{
ERROR_STREAM
<<
"SingleShotAO::init::unknown exception caught"
<<
std
::
endl
;
THROW_DEVFAILED
(
"DRIVER_FAILURE"
,
"could not abort [unknown error]"
,
"SingleShotAO::init"
);
}
// Create dynamic attributes
//--------------------------------------------
...
...
@@ -1047,9 +1056,8 @@ void SingleShotAO::_abort()
yat4tango
::
PropertyHelper
::
set_memorized_attribute
(
this
,
kCHANNEL
+
std
::
to_string
(
l_cpt
),
l_val_channel
);
DEBUG_STREAM
<<
"Memorizing channel "
<<
l_cpt
<<
" to "
<<
l_val_channel
<<
std
::
endl
;
double
l_val_initial
=
m_manager
->
get_initial
(
l_cpt
);
yat4tango
::
PropertyHelper
::
set_memorized_attribute
(
this
,
kINITIAL
+
std
::
to_string
(
l_cpt
),
l_val_initial
);
DEBUG_STREAM
<<
"Memorizing initial "
<<
l_cpt
<<
" to "
<<
l_val_initial
<<
std
::
endl
;
yat4tango
::
PropertyHelper
::
set_memorized_attribute
(
this
,
kINITIAL
+
std
::
to_string
(
l_cpt
),
l_val_channel
);
DEBUG_STREAM
<<
"Memorizing initial "
<<
l_cpt
<<
" to "
<<
l_val_channel
<<
std
::
endl
;
}
}
m_manager
->
abort
();
...
...
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