Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
NomadSpecialModules
Commits
f2000273
Commit
f2000273
authored
Dec 09, 2019
by
yannick legoc
Browse files
Copy the properties of the scan controller in VEXPController to prepare the vEXP spy
parent
dee78399
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/controllers/vexp/VEXPController.cpp
View file @
f2000273
...
...
@@ -86,6 +86,19 @@ VEXPController::VEXPController(const string& name) :
errorMessage
.
init
(
this
,
NOSAVE
,
"error_message"
);
moveModel
.
init
(
this
,
SAVE
,
"move_model"
);
qhScan
.
init
(
this
,
NOSAVE
,
"qh_scan"
);
qkScan
.
init
(
this
,
NOSAVE
,
"qk_scan"
);
qlScan
.
init
(
this
,
NOSAVE
,
"ql_scan"
);
enScan
.
init
(
this
,
NOSAVE
,
"en_scan"
);
dqhScan
.
init
(
this
,
NOSAVE
,
"dqh_scan"
);
dqkScan
.
init
(
this
,
NOSAVE
,
"dqk_scan"
);
dqlScan
.
init
(
this
,
NOSAVE
,
"dql_scan"
);
denScan
.
init
(
this
,
NOSAVE
,
"den_scan"
);
nbPointsScan
.
init
(
this
,
NOSAVE
,
"nb_points_scan"
);
runningScan
.
init
(
this
,
NOSAVE
,
"running_scan"
);
tasSettings
.
init
(
this
,
"tas_settings"
);
sample
.
init
(
this
,
"sample"
);
scattering
.
init
(
this
,
"scattering"
);
...
...
@@ -99,6 +112,8 @@ VEXPController::VEXPController(const string& name) :
a4Controller
.
init
(
this
,
"A4"
);
a5Controller
.
init
(
this
,
"A5"
);
a6Controller
.
init
(
this
,
"A6"
);
scanController
.
init
(
this
,
"scan"
);
}
VEXPController
::
VEXPController
(
const
VEXPController
&
controller
)
:
...
...
@@ -167,6 +182,42 @@ void VEXPController::refreshFloat64PropertyToMoveModel(SimpleProperty<float64>&
}
}
void
VEXPController
::
updateScanReference
(
int
index
)
{
if
(
index
==
0
)
{
qhScan
.
update
(
scanController
->
reference
.
get
(
0
));
}
else
if
(
index
==
1
)
{
qkScan
.
update
(
scanController
->
reference
.
get
(
1
));
}
else
if
(
index
==
2
)
{
qlScan
.
update
(
scanController
->
reference
.
get
(
2
));
}
else
if
(
index
==
3
)
{
enScan
.
update
(
scanController
->
reference
.
get
(
3
));
}
}
void
VEXPController
::
updateScanDelta
(
int
index
)
{
if
(
index
==
0
)
{
dqhScan
.
update
(
scanController
->
delta
.
get
(
0
));
}
else
if
(
index
==
1
)
{
dqkScan
.
update
(
scanController
->
delta
.
get
(
1
));
}
else
if
(
index
==
2
)
{
dqlScan
.
update
(
scanController
->
delta
.
get
(
2
));
}
else
if
(
index
==
3
)
{
denScan
.
update
(
scanController
->
delta
.
get
(
3
));
}
}
void
VEXPController
::
updateScanStatus
()
{
runningScan
.
update
(
scanController
->
commandStatus
.
isRunning
());
}
void
VEXPController
::
updateProperties
()
{
// Copy the values.
...
...
@@ -204,6 +255,19 @@ void VEXPController::updateProperties() {
a4
.
update
(
a4Controller
->
position
());
a5
.
update
(
a5Controller
->
position
());
a6
.
update
(
a6Controller
->
position
());
qhScan
.
update
(
scanController
->
reference
.
get
(
0
));
qkScan
.
update
(
scanController
->
reference
.
get
(
1
));
qlScan
.
update
(
scanController
->
reference
.
get
(
2
));
enScan
.
update
(
scanController
->
reference
.
get
(
3
));
dqhScan
.
update
(
scanController
->
delta
.
get
(
0
));
dqkScan
.
update
(
scanController
->
delta
.
get
(
1
));
dqlScan
.
update
(
scanController
->
delta
.
get
(
2
));
denScan
.
update
(
scanController
->
delta
.
get
(
3
));
nbPointsScan
.
update
(
scanController
->
nSteps
.
get
(
0
));
runningScan
.
update
(
scanController
->
commandStatus
.
isRunning
());
}
void
VEXPController
::
postConfiguration
()
{
...
...
@@ -257,6 +321,11 @@ void VEXPController::postConfiguration() {
registerRefresher
(
calca5
,
&
VEXPController
::
refreshFloat64PropertyToMoveModel
,
this
,
a5Controller
->
position
);
registerRefresher
(
calca6
,
&
VEXPController
::
refreshFloat64PropertyToMoveModel
,
this
,
a6Controller
->
position
);
// Scan properties.
registerUpdater
(
scanController
->
reference
,
&
VEXPController
::
updateScanReference
,
this
);
registerUpdater
(
scanController
->
delta
,
&
VEXPController
::
updateScanDelta
,
this
);
registerStatus
(
scanController
,
&
VEXPController
::
updateScanStatus
,
this
);
updateProperties
();
}
...
...
src/controllers/vexp/VEXPController.h
View file @
f2000273
...
...
@@ -24,6 +24,7 @@
#include "controllers/tas/common/Sample.h"
#include "controllers/tas/common/IncidentBeam.h"
#include "controllers/tas/common/TasScatteredBeam.h"
#include "controllers/common/scanlegacy/ParameterizableScan1D.h"
#include <boost/thread/thread.hpp>
#include <boost/thread/condition.hpp>
#include <boost/thread/mutex.hpp>
...
...
@@ -62,6 +63,10 @@ public:
void
updateProperties
();
void
updateScanReference
(
int
index
);
void
updateScanDelta
(
int
index
);
void
updateScanStatus
();
virtual
void
postConfiguration
();
void
calculate
(
float64
ki
,
float64
kf
,
float64
qh
,
float64
qk
,
float64
ql
,
int32
fx
,
int32
ss
);
...
...
@@ -118,6 +123,21 @@ public:
Property
<
std
::
string
>
errorMessage
;
Property
<
bool
>
moveModel
;
// Real scan properties.
Property
<
float64
>
qhScan
;
Property
<
float64
>
qkScan
;
Property
<
float64
>
qlScan
;
Property
<
float64
>
enScan
;
Property
<
float64
>
dqhScan
;
Property
<
float64
>
dqkScan
;
Property
<
float64
>
dqlScan
;
Property
<
float64
>
denScan
;
Property
<
int32
>
nbPointsScan
;
Property
<
bool
>
runningScan
;
// Controllers.
ControllerPtr
<
tas
::
TasSettings
>
tasSettings
;
ControllerPtr
<
tas
::
Sample
>
sample
;
ControllerPtr
<
tas
::
Scattering
>
scattering
;
...
...
@@ -131,6 +151,8 @@ public:
ControllerPtr
<
axis
::
AxisController
>
a4Controller
;
ControllerPtr
<
axis
::
AxisController
>
a5Controller
;
ControllerPtr
<
axis
::
AxisController
>
a6Controller
;
ControllerPtr
<
scan
::
ParameterizableScan1D
>
scanController
;
};
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment