Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
ASL
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
ASL
Commits
08dd1fba
"dev-el7-gcc82-x86/Dockerfile" did not exist on "main"
Commit
08dd1fba
authored
Dec 8, 2016
by
Sonia Minolli
Browse files
Options
Downloads
Patches
Plain Diff
Add config optimization at start time for contiuous analog acquisition (TANGODEVIC-1652)
parent
ba9065d5
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/asl/adlink/ADContinuousAIBoard.h
+5
-0
5 additions, 0 deletions
include/asl/adlink/ADContinuousAIBoard.h
src/adlink/ADContinuousAIBoard.cpp
+48
-10
48 additions, 10 deletions
src/adlink/ADContinuousAIBoard.cpp
with
53 additions
and
10 deletions
include/asl/adlink/ADContinuousAIBoard.h
+
5
−
0
View file @
08dd1fba
...
@@ -162,6 +162,11 @@ protected:
...
@@ -162,6 +162,11 @@ protected:
*/
*/
asl
::
ContinuousAIConfig
ai_config_
;
asl
::
ContinuousAIConfig
ai_config_
;
/**
* Configuration optimization flag.
*/
bool
first_config_
;
/**
/**
* Buffer index (use to identify "current" buffer).
* Buffer index (use to identify "current" buffer).
*/
*/
...
...
This diff is collapsed.
Click to expand it.
src/adlink/ADContinuousAIBoard.cpp
+
48
−
10
View file @
08dd1fba
...
@@ -103,7 +103,8 @@ ADContinuousAIBoard::ADContinuousAIBoard (unsigned short _type,
...
@@ -103,7 +103,8 @@ ADContinuousAIBoard::ADContinuousAIBoard (unsigned short _type,
has_been_started_at_least_once_
(
false
),
has_been_started_at_least_once_
(
false
),
last_sample_index_in_last_daq_buffer_
(
0
),
last_sample_index_in_last_daq_buffer_
(
0
),
stop_pos_
(
0
),
stop_pos_
(
0
),
stop_count_
(
0
)
stop_count_
(
0
),
first_config_
(
true
)
{
{
//- std::cout << "ADContinuousAIBoard::ADContinuousAIBoard <-" << std::endl;
//- std::cout << "ADContinuousAIBoard::ADContinuousAIBoard <-" << std::endl;
//- std::cout << "ADContinuousAIBoard::ADContinuousAIBoard ->" << std::endl;
//- std::cout << "ADContinuousAIBoard::ADContinuousAIBoard ->" << std::endl;
...
@@ -126,6 +127,14 @@ ADContinuousAIBoard::~ADContinuousAIBoard ()
...
@@ -126,6 +127,14 @@ ADContinuousAIBoard::~ADContinuousAIBoard ()
void
ADContinuousAIBoard
::
configure_continuous_ai
(
const
asl
::
ContinuousAIConfig
&
_ai_config
)
void
ADContinuousAIBoard
::
configure_continuous_ai
(
const
asl
::
ContinuousAIConfig
&
_ai_config
)
throw
(
asl
::
DAQException
)
throw
(
asl
::
DAQException
)
{
{
// configuration optimization:
asl
::
ContinuousAIConfig
prev_config
;
if
(
!
first_config_
)
{
// store previous config if not first time function is called
prev_config
=
this
->
ai_config_
;
}
//- store config locally
//- store config locally
this
->
ai_config_
=
_ai_config
;
this
->
ai_config_
=
_ai_config
;
...
@@ -147,9 +156,36 @@ void ADContinuousAIBoard::configure_continuous_ai (const asl::ContinuousAIConfig
...
@@ -147,9 +156,36 @@ void ADContinuousAIBoard::configure_continuous_ai (const asl::ContinuousAIConfig
"ADContinuousAIBoard::configure_continuous_ai"
);
"ADContinuousAIBoard::configure_continuous_ai"
);
}
}
const
asl
::
ActiveAIChannels
&
prev_ac
=
prev_config
.
get_active_channels
();
for
(
unsigned
int
c
=
0
;
c
<
ac
.
size
();
c
++
)
for
(
unsigned
int
c
=
0
;
c
<
ac
.
size
();
c
++
)
{
{
int
err
=
::
D2K_AI_CH_Config
(
this
->
idid_
,
ac
[
c
].
id
,
ac
[
c
].
range
|
ac
[
c
].
grd_ref
);
int
err
=
0
;
bool
do_config
=
true
;
// if not first time function is called, check if config has changed
if
(
!
first_config_
)
{
if
((
prev_ac
[
c
].
id
==
ac
[
c
].
id
)
&&
(
prev_ac
[
c
].
range
==
ac
[
c
].
range
)
&&
(
prev_ac
[
c
].
grd_ref
==
ac
[
c
].
grd_ref
))
{
// config equals, don't call D2K_AI_CH_Config function
do_config
=
false
;
}
else
{
do_config
=
true
;
}
}
else
{
do_config
=
true
;
}
if
(
do_config
)
{
err
=
::
D2K_AI_CH_Config
(
this
->
idid_
,
ac
[
c
].
id
,
ac
[
c
].
range
|
ac
[
c
].
grd_ref
);
}
if
(
err
<
0
)
if
(
err
<
0
)
{
{
...
@@ -159,6 +195,8 @@ void ADContinuousAIBoard::configure_continuous_ai (const asl::ContinuousAIConfig
...
@@ -159,6 +195,8 @@ void ADContinuousAIBoard::configure_continuous_ai (const asl::ContinuousAIConfig
err
);
err
);
}
}
}
}
first_config_
=
false
;
//- analog trigger config --------------------------------------------------
//- analog trigger config --------------------------------------------------
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
...
...
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