Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
NomadSpecialModules
Commits
785aa8e2
Commit
785aa8e2
authored
Mar 04, 2016
by
Cristina Cocho
Browse files
Modifications in D22SpectroSampleSequencer due to new SampleChanger
parent
d48f6a2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/controllers/lss/d22special/D22SpectroSampleSequencer.cpp
View file @
785aa8e2
...
...
@@ -17,7 +17,6 @@
*/
#include
"D22SpectroSampleSequencer.h"
#include
"InstrumentAbstraction/Lss/SampleChangerController.h"
#include
"InstrumentAbstraction/Base/DataParams.h"
#include
"controllers/common/family/Families.h"
...
...
@@ -37,8 +36,8 @@ D22SpectroSampleSequencer::D22SpectroSampleSequencer(const std::string & name) :
setFamily
(
family
::
SAMPLE_ENVIRONMENT
);
registerConfiguration
(
"SampleChanger"
,
SAMPLE_CHANGER_EXPERIMENT_CONTROLLER
,
(
AbstractController
**
)
&
m_sampleChanger
);
registerConfiguration
(
"DataParams"
,
DATA_PARAMS_EXPERIMENT_CONTROLLER
,
(
AbstractController
**
)
&
m_dataParams
);
m_sampleChanger
.
init
(
this
,
"SampleChanger"
);
countWithSpectro
.
init
(
this
,
"count_spectro"
);
maxPos
.
init
(
this
,
SAVE
,
"max_pos"
);
...
...
@@ -166,7 +165,7 @@ void D22SpectroSampleSequencer::postConfiguration() {
changer
.
setpoint
.
setEnumeratedLabels
(
changerLabels
);
}
//Another default values
maxSlot
=
any_cast
<
int32
>
(
m_sampleChanger
->
getValue
(
SampleChangerController
::
MAX_CHA_PROPERTY
));
maxSlot
=
m_sampleChanger
->
currentSlotMaxNum
();
//
any_cast<int32>(m_sampleChanger->getValue(SampleChangerController::MAX_CHA_PROPERTY));
changer
.
setpoint
=
1
;
totalTime
=
10
;
...
...
@@ -181,8 +180,10 @@ void D22SpectroSampleSequencer::postConfiguration() {
}
void
D22SpectroSampleSequencer
::
refreshChangerSetpoint
(
int32
number
)
{
m_sampleChanger
->
setValue
(
SampleChangerController
::
CHANGER_NUMBER_PROPERTY
,
number
);
maxSlot
=
any_cast
<
int32
>
(
m_sampleChanger
->
getValue
(
SampleChangerController
::
MAX_CHA_PROPERTY
));
m_sampleChanger
->
changer
=
number
;
maxSlot
=
m_sampleChanger
->
currentSlotMaxNum
();
// m_sampleChanger->setValue(SampleChangerController::CHANGER_NUMBER_PROPERTY, number);
// maxSlot = any_cast<int32>(m_sampleChanger->getValue(SampleChangerController::MAX_CHA_PROPERTY));
}
void
D22SpectroSampleSequencer
::
refreshNumSlotSetpoint
(
int32
number
)
{
...
...
@@ -234,7 +235,8 @@ void D22SpectroSampleSequencer::start() {
commandProgression
=
((
float64
)
i
/
(
float64
)
numSlot
.
setpoint
())
*
100
;
//(1) Set up values of controllers
m_sampleChanger
->
setValue
(
SampleChangerController
::
WANTED_CHA_PROPERTY
,
apply_samplePosition
[
i
]);
m_sampleChanger
->
slot
.
setpoint
=
apply_samplePosition
[
i
];
// m_sampleChanger->setValue(SampleChangerController::WANTED_CHA_PROPERTY, apply_samplePosition[i]);
try
{
//We will always work with the count controller in TIME MODE
...
...
@@ -260,9 +262,10 @@ void D22SpectroSampleSequencer::start() {
// (2) Move sampleChanger
m_ChangerStarted
=
true
;
Sender
<
ClientCommand
>::
begin
();
Sender
<
ClientCommand
>::
post
(
ClientCommand
(
m_sampleChanger
,
START_COMMAND
));
Sender
<
ClientCommand
>::
endIf
();
m_sampleChanger
->
startCommand
();
// Sender<ClientCommand>::begin();
// Sender<ClientCommand>::post(ClientCommand(m_sampleChanger, START_COMMAND));
// Sender<ClientCommand>::endIf();
m_ChangerStarted
=
false
;
if
(
commandStatus
.
isWarning
())
{
...
...
@@ -301,7 +304,8 @@ void D22SpectroSampleSequencer::stop() {
countWithSpectro
->
stopCommand
();
m_CountStarted
=
false
;
}
else
if
(
m_ChangerStarted
)
{
Sender
<
ClientCommand
>::
post
(
ClientCommand
(
m_sampleChanger
,
STOP_COMMAND
));
m_sampleChanger
->
stopCommand
();
// Sender<ClientCommand>::post(ClientCommand(m_sampleChanger, STOP_COMMAND));
m_ChangerStarted
=
false
;
}
}
...
...
src/controllers/lss/d22special/D22SpectroSampleSequencer.h
View file @
785aa8e2
...
...
@@ -20,6 +20,7 @@
#define D22SPECTROSAMPLESEQUENCER_H_
#include
<Controller.h>
#include
"controllers/lss/common/SampleChangerController.h"
#include
"CountWithSpectro.h"
namespace
d22special
{
...
...
@@ -48,8 +49,8 @@ private:
void
refreshAcquisitionTime
(
int32
index
,
float64
value
)
throw
(
CannotSetValue
);
void
refreshNumSlotSetpoint
(
int32
number
);
AbstractController
*
m_sampleChanger
;
AbstractController
*
m_dataParams
;
ControllerPtr
<
lss
::
SampleChangerController
>
m_sampleChanger
;
ControllerPtr
<
CountWithSpectro
>
countWithSpectro
;
Property
<
int32
>
maxPos
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment