Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MythenWAXS
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Tango devices
Acquisition
1D
MythenWAXS
Commits
4267f09d
Commit
4267f09d
authored
7 years ago
by
Arafat Nourredine
Browse files
Options
Downloads
Patches
Plain Diff
minor changes : Rename a data member
parent
700645dd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/MythenPool.cpp
+28
-32
28 additions, 32 deletions
src/MythenPool.cpp
src/MythenPool.h
+26
-25
26 additions, 25 deletions
src/MythenPool.h
with
54 additions
and
57 deletions
src/MythenPool.cpp
+
28
−
32
View file @
4267f09d
...
...
@@ -25,7 +25,6 @@
namespace
MythenWAXS_ns
{
//----------------------------------------------------------------------------------------------------------------------
//- MythenPool Ctor
//----------------------------------------------------------------------------------------------------------------------
...
...
@@ -65,7 +64,6 @@ void MythenPool::set_state(Tango::DevState state)
}
}
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
...
...
@@ -79,7 +77,6 @@ Tango::DevState MythenPool::get_state()
}
}
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
...
...
@@ -273,7 +270,7 @@ void MythenPool::stop()
const
std
::
vector
<
float
>&
MythenPool
::
get_frame_x
()
{
yat
::
MutexLock
scoped_lock
(
m_proxy_lock
);
return
m_x_values
;
return
m_
frame_
x_values
;
}
//----------------------------------------------------------------------------------------------------------------------
...
...
@@ -282,7 +279,7 @@ const std::vector<float>& MythenPool::get_frame_x()
const
std
::
vector
<
float
>&
MythenPool
::
get_frame_y
()
{
yat
::
MutexLock
scoped_lock
(
m_proxy_lock
);
return
m_y_values
;
return
m_
frame_
y_values
;
}
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
...
...
@@ -291,8 +288,8 @@ void MythenPool::compute_frame_xy()
{
yat
::
MutexLock
scoped_lock
(
m_proxy_lock
);
m_x_values
.
clear
();
m_y_values
.
clear
();
m_
frame_
x_values
.
clear
();
m_
frame_
y_values
.
clear
();
unsigned
nb_total_modules
=
0
;
//get the motor position tth2C
double
theta_position
;
...
...
@@ -318,16 +315,16 @@ void MythenPool::compute_frame_xy()
for
(
unsigned
k
=
0
;
k
<
frame
.
size
();
k
++
)
{
double
twotheta
=
theta_position
-
m_deltas
.
at
(
nb_total_modules
+
j
)
+
(
180.0
/
M_PI
)
*
atan
((
m_centers
.
at
(
nb_total_modules
+
j
)
-
(
1279
-
k
))
*
m_prop
.
pixel_size
/
m_distances
.
at
(
nb_total_modules
+
j
));
m_deltas
.
at
(
nb_total_modules
+
j
)
+
(
180.0
/
M_PI
)
*
atan
((
m_centers
.
at
(
nb_total_modules
+
j
)
-
(
1279
-
k
))
*
m_prop
.
pixel_size
/
m_distances
.
at
(
nb_total_modules
+
j
));
//NB: Mythen modules are mounted in opposite sens, why we use (1279-k) instead of k !!
m_x_values
.
push_back
(
twotheta
);
m_y_values
.
push_back
(
frame
.
at
(
k
)
*
m_scales
.
at
(
nb_total_modules
+
j
));
m_
frame_
x_values
.
push_back
(
twotheta
);
m_
frame_
y_values
.
push_back
(
frame
.
at
(
k
)
*
m_scales
.
at
(
nb_total_modules
+
j
));
}
}
INFO_STREAM
<<
"m_x_values.size() = "
<<
m_x_values
.
size
()
<<
std
::
endl
;
INFO_STREAM
<<
"m_y_values.size() = "
<<
m_y_values
.
size
()
<<
std
::
endl
;
INFO_STREAM
<<
"m_
frame_
x_values.size() = "
<<
m_
frame_
x_values
.
size
()
<<
std
::
endl
;
INFO_STREAM
<<
"m_
frame_
y_values.size() = "
<<
m_
frame_
y_values
.
size
()
<<
std
::
endl
;
nb_total_modules
+=
nb_modules
;
INFO_STREAM
<<
"
\n
"
<<
std
::
endl
;
INFO_STREAM
<<
"nb_total_modules = "
<<
nb_total_modules
<<
std
::
endl
;
...
...
@@ -355,8 +352,8 @@ void MythenPool::decode_equation_parameters()
if
(
line
.
count
()
!=
4
)
{
Tango
::
Except
::
throw_exception
(
"LOGIC_ERROR"
,
"Check the format of the 'EquationParameters' Device Property !"
,
"MythenPool::decode_equation_parameters()"
);
"Check the format of the 'EquationParameters' Device Property !"
,
"MythenPool::decode_equation_parameters()"
);
}
for
(
unsigned
itoken
=
0
;
itoken
<
line
.
count
();
itoken
++
)
...
...
@@ -370,8 +367,8 @@ void MythenPool::decode_equation_parameters()
if
(
field
.
count
()
!=
2
)
{
Tango
::
Except
::
throw_exception
(
"LOGIC_ERROR"
,
"Check the format of the 'EquationParameters' Device Property !"
,
"MythenPool::decode_equation_parameters()"
);
"Check the format of the 'EquationParameters' Device Property !"
,
"MythenPool::decode_equation_parameters()"
);
}
item_name
=
field
[
0
];
...
...
@@ -429,8 +426,8 @@ void MythenPool::decode_equation_parameters()
ostringstream
ossMsgErr
;
ossMsgErr
<<
e
.
what
();
Tango
::
Except
::
throw_exception
(
"LOGIC_ERROR"
,
ossMsgErr
.
str
().
c_str
(),
"MythenPool::decode_equation_parameters()"
);
ossMsgErr
.
str
().
c_str
(),
"MythenPool::decode_equation_parameters()"
);
}
}
//----------------------------------------------------------------------------------------------------------------------
...
...
@@ -453,7 +450,6 @@ void MythenPool::compute_state_status()
if
(
m_state
!=
Tango
::
INIT
)
{
//////////////////////////////////////////////////////////
try
{
//more than one proxy mythen devices
...
...
@@ -488,7 +484,7 @@ void MythenPool::compute_state_status()
break
;
case
Tango
::
RUNNING
:
running_count
++
;
break
;
break
;
default:
fault_count
++
;
break
;
//NOP
...
...
@@ -529,7 +525,7 @@ void MythenPool::compute_state_status()
status
.
str
(
""
);
status
<<
"At least one Device is in FAULTy state !
\n
"
;
status
<<
"---------------------------------------------------
\n
"
;
status
<<
proxy_status
.
str
();
status
<<
proxy_status
.
str
();
set_status
(
status
.
str
());
DEBUG_STREAM
<<
"MythenPool::compute_state_status() - [END]"
<<
endl
;
return
;
...
...
@@ -543,7 +539,7 @@ void MythenPool::compute_state_status()
status
.
str
(
""
);
status
<<
"Acquisition is Running ...
\n
"
;
status
<<
"---------------------------------------------------
\n
"
;
status
<<
proxy_status
.
str
();
status
<<
proxy_status
.
str
();
set_status
(
status
.
str
());
DEBUG_STREAM
<<
"MythenPool::compute_state_status() - [END]"
<<
endl
;
return
;
...
...
@@ -557,7 +553,7 @@ void MythenPool::compute_state_status()
status
.
str
(
""
);
status
<<
"Waiting for request ...
\n
"
;
status
<<
"---------------------------------------------------
\n
"
;
status
<<
proxy_status
.
str
();
status
<<
proxy_status
.
str
();
set_status
(
status
.
str
());
DEBUG_STREAM
<<
"MythenPool::compute_state_status() - [END]"
<<
endl
;
return
;
...
...
@@ -571,7 +567,7 @@ void MythenPool::compute_state_status()
status
.
str
(
""
);
status
<<
"At least one Device is not in the expected state !
\n
"
;
status
<<
"---------------------------------------------------
\n
"
;
status
<<
proxy_status
.
str
();
status
<<
proxy_status
.
str
();
set_status
(
status
.
str
());
DEBUG_STREAM
<<
"MythenPool::compute_state_status() - [END]"
<<
endl
;
return
;
...
...
@@ -620,9 +616,9 @@ void MythenPool::process_message(yat::Message& msg) throw (Tango::DevFailed)
{
ERROR_STREAM
<<
e
.
what
()
<<
ENDLOG
;
std
::
stringstream
status
;
status
<<
"Unable to create proxy to ( "
<<
proxy_name
<<
" ) :
\n
"
<<
"--> Memory allocation exception.
\n
"
<<
endl
;
status
<<
"Unable to create proxy to ( "
<<
proxy_name
<<
" ) :
\n
"
<<
"--> Memory allocation exception.
\n
"
<<
endl
;
set_state
(
Tango
::
INIT
);
set_status
(
status
.
str
());
return
;
...
...
@@ -631,10 +627,10 @@ void MythenPool::process_message(yat::Message& msg) throw (Tango::DevFailed)
{
ERROR_STREAM
<<
e
<<
ENDLOG
;
std
::
stringstream
status
;
status
<<
"Unable to create proxy to ( "
<<
proxy_name
<<
" ) :
\n
"
<<
"--> check the value of the 'ProxiesNames' property.
\n
"
<<
"--> check the state of the device ( "
<<
proxy_name
<<
" ).
\n
"
<<
endl
;
status
<<
"Unable to create proxy to ( "
<<
proxy_name
<<
" ) :
\n
"
<<
"--> check the value of the 'ProxiesNames' property.
\n
"
<<
"--> check the state of the device ( "
<<
proxy_name
<<
" ).
\n
"
<<
endl
;
set_state
(
Tango
::
INIT
);
set_status
(
status
.
str
());
return
;
...
...
This diff is collapsed.
Click to expand it.
src/MythenPool.h
+
26
−
25
View file @
4267f09d
...
...
@@ -89,54 +89,52 @@ public:
/// dtor
virtual
~
MythenPool
();
/// get the last state
of the task
/// get the last state
Tango
::
DevState
get_state
();
/// get the last status
of the task
/// get the last status
std
::
string
get_status
();
/// start the acquisition
/// start the acquisition
on all Mythen2Detector devices
void
snap
();
/// stop the acquisition
/// stop the acquisition
on all Mythen2Detector devices
void
stop
();
/// write energy
/// write energy
on all modules of all Mythen2Detector devices
void
write_energy
(
float
);
///
get the last status of the task
///
write threshold on all modules of all Mythen2Detector devices
void
write_threshold
(
float
);
/// write
threshold
/// write
exposure on all Mythen2Detector devices
void
write_exposure_time
(
double
);
/// write nbFrames
/// write nbFrames
on all Mythen2Detector devices
void
write_nb_frames
(
long
);
/// write flatfield correct
y
ion flag
/// write flatfield correction flag
on all Mythen2Detector devices
void
write_flatfield_correction
(
bool
);
/// write rate correction flag
/// write rate correction flag
on all Mythen2Detector devices
void
write_rate_correction
(
bool
);
/// write badchannel interpolation flag
/// write badchannel interpolation flag
on all Mythen2Detector devices
void
write_badchannel_interpolation
(
bool
);
/// read the total nb of modules
/// read the total nb of modules
of all Mythen2Detector devices
long
get_nb_modules
();
/// read the total nb of channels
/// read the total nb of channels
of all Mythen2Detector devices
long
get_nb_channels
();
/// read the frame (x)
/// read the frame (x)
(twotheta angle in degrees)
const
std
::
vector
<
float
>&
get_frame_x
();
/// read the frame (x)
const
std
::
vector
<
float
>&
get_frame_y
();
/// compute the frame
void
compute_frame_xy
();
/// read the frame (y) (intensity)
const
std
::
vector
<
float
>&
get_frame_y
();
protected:
/// [yat4tango::DeviceTask implementation]
void
process_message
(
yat
::
Message
&
msg
)
throw
(
Tango
::
DevFailed
);
...
...
@@ -147,19 +145,22 @@ protected:
/// fix the status in a scoped_lock
void
set_status
(
const
std
::
string
&
status
);
/// compute internal state/status
of task
/// compute internal state/status
void
compute_state_status
();
/// decode property
coefs
/// decode
equation parameters
property
void
decode_equation_parameters
();
/// compute the frameX & frameY
void
compute_frame_xy
();
///owner device server
Tango
::
DeviceImpl
*
m_device
;
///
task
state
/// state
Tango
::
DevState
m_state
;
///
task
status
/// status
std
::
stringstream
m_status
;
/// lock for general state
...
...
@@ -172,8 +173,8 @@ protected:
std
::
vector
<
yat
::
SharedPtr
<
yat4tango
::
DeviceProxyHelper
>
>
m_proxy_mythens
;
yat
::
SharedPtr
<
yat4tango
::
DeviceProxyHelper
>
m_proxy_motor
;
std
::
vector
<
float
>
m_x_values
;
std
::
vector
<
float
>
m_y_values
;
std
::
vector
<
float
>
m_
frame_
x_values
;
std
::
vector
<
float
>
m_
frame_
y_values
;
std
::
vector
<
float
>
m_deltas
;
std
::
vector
<
float
>
m_centers
;
std
::
vector
<
float
>
m_distances
;
...
...
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