Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
ContinuousAO
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
ContinuousAO
Commits
887b082e
Commit
887b082e
authored
Aug 1, 2022
by
System User
Browse files
Options
Downloads
Patches
Plain Diff
[ICATHALES-6] Renommage du error_message et modification des throw
parent
be29e371
No related branches found
No related tags found
1 merge request
!1
[ICATHALES-6] - Device do not start when driver not availible
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ContinuousAO.cpp
+29
-38
29 additions, 38 deletions
src/ContinuousAO.cpp
src/ContinuousAO.h
+2
-5
2 additions, 5 deletions
src/ContinuousAO.h
with
31 additions
and
43 deletions
src/ContinuousAO.cpp
+
29
−
38
View file @
887b082e
...
...
@@ -167,7 +167,7 @@ void ContinuousAO::init_device()
ch5
=
0
;
ch6
=
0
;
ch7
=
0
;
error_message
=
""
;
m_
error_message
=
"
An error has occured
"
;
// Initialise variables to default values
//--------------------------------------------
...
...
@@ -179,12 +179,8 @@ void ContinuousAO::init_device()
//- check memory allocation
if
(
ao
==
0
)
{
set_internal_state
();
Tango
::
Except
::
throw_exception
(
(
const
char
*
)(
"OUT_OF_MEMORY"
),
(
const
char
*
)(
"out of memory error"
),
(
const
char
*
)(
"ContinuousAO::init_device"
)
);
raise_error
(
"ContinuousAO::init_device
\n
out of memory error while initializing ADLinkContinuousAO"
);
return
;
}
asl
::
ContinuousAOConfig
config
;
...
...
@@ -198,13 +194,8 @@ void ContinuousAO::init_device()
ch7
=
new
double
[
bufferDepth
];
if
(
ch0
==
0
||
ch1
==
0
||
ch2
==
0
||
ch3
==
0
||
ch4
==
0
||
ch5
==
0
||
ch6
==
0
||
ch7
==
0
)
{
set_internal_state
();
delete_device
();
Tango
::
Except
::
throw_exception
(
(
const
char
*
)(
"OUT_OF_MEMORY"
),
(
const
char
*
)(
"out of memory error"
),
(
const
char
*
)(
"ContinuousAO::init_device"
)
);
raise_error
(
"ContinuousAO::init_device
\n
out of memory error while initializing channel's datas"
);
return
;
}
...
...
@@ -540,33 +531,30 @@ void ContinuousAO::init_device()
DEBUG_STREAM
<<
"ContinuousAO::init_device : init acq"
<<
std
::
endl
;
try
{
_ASL_TRY
//_ACTION
(
_ASL_TRY
(
ao
->
init
(
adl
::
DAQ2502
,
boardNum
),
"init"
,
"ContinuousAO::init_device"
,
set_internal_state
()
"ContinuousAO::init_device"
);
DEBUG_STREAM
<<
"ContinuousAO::init_device : config acq"
<<
std
::
endl
;
try
{
_ASL_TRY
//_ACTION
(
_ASL_TRY
(
ao
->
configure
(
config
),
"configure"
,
"ContinuousAO::init_device"
,
set_internal_state
()
"ContinuousAO::init_device"
);
}
catch
(...)
{
error_message
=
"Error while configuring driver"
;
raise_error
(
"ContinuousAO::init_device
\n
Error while configuring driver"
);
return
;
}
}
catch
(...)
{
error_message
=
"Error while init driver"
;
raise_error
(
"ContinuousAO::init_device
\n
Error while initializing the driver"
);
return
;
}
//ao->configure(config);
...
...
@@ -1428,10 +1416,7 @@ void ContinuousAO::set_internal_state(void)
break
;
case
asl
::
ContinuousAO
::
FAULT
:
set_state
(
Tango
::
FAULT
);
if
(
error_message
==
""
)
set_status
(
"An error has occured"
);
else
set_status
(
error_message
);
set_status
(
m_error_message
);
break
;
case
asl
::
ContinuousAO
::
UNKNOWN
:
default:
...
...
@@ -1472,4 +1457,10 @@ void ContinuousAO::save_waveform(double* waveform, string wfm_channel)
"ContinuousAO::save_waveform"
,
);
}
void
ContinuousAO
::
raise_error
(
std
::
string
p_error_message
)
{
m_error_message
=
p_error_message
;
set_state
(
Tango
::
FAULT
);
}
}
// namespace
This diff is collapsed.
Click to expand it.
src/ContinuousAO.h
+
2
−
5
View file @
887b082e
...
...
@@ -326,6 +326,7 @@ public :
ADLinkContinuousAO
*
ao
;
// asl::ContinuousAOConfig* config;
void
set_internal_state
(
void
);
void
raise_error
(
std
::
string
p_error_message
);
// save a channel waveform in the database
void
ContinuousAO
::
save_waveform
(
double
*
waveform
,
string
wfm_channel
);
double
*
ch0
;
...
...
@@ -338,11 +339,7 @@ public :
double
*
ch7
;
double
err_ctr
;
short
use_fifo
;
std
::
string
error_message
;
std
::
string
m_error_message
;
protected
:
// Add your own data members here
...
...
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