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
9f83c043
Commit
9f83c043
authored
Jan 28, 2020
by
yannick legoc
Browse files
Added attributes to spy in D22AutoConfig
parent
e2caac75
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/controllers/lss/d22autoconfig/D22AutoConfig.cpp
View file @
9f83c043
...
...
@@ -47,7 +47,9 @@ AutoConfig::AutoConfig(const std::string& name) :
serverEndpoint
.
init
(
this
,
SAVE
,
"cameo_server"
);
initialized
.
init
(
this
,
NOSAVE
,
"initialized"
);
scatterModelType
.
init
(
this
,
NOSAVE
|
SPY
,
"scatter_model_type"
,
"Model"
);
scatterModelType
.
init
(
this
,
NOSAVE
,
"scatter_model_type"
);
scatterModel
.
init
(
this
,
NOSAVE
|
SPY
,
"scatter_model"
,
"Model"
);
scatterModelAccuracy
.
init
(
this
,
NOSAVE
|
SPY
,
"scatter_model_accuracy"
,
"Accuracy"
);
sampleParameters
.
init
(
this
,
NOSAVE
|
SPY
,
"sample_parameters"
,
"Sample"
);
calcTypeSize
.
init
(
this
,
NOSAVE
,
"calc_type_size"
);
...
...
@@ -310,49 +312,51 @@ void AutoConfig::start() {
autoConfigResponse
.
ParseFromString
(
response
);
scatterModelType
=
autoConfigResponse
.
scattermodeltype
();
scatterModel
=
autoConfigResponse
.
scattermodel
();
scatterModelAccuracy
=
autoConfigResponse
.
scattermodelaccuracy
();
string
status
=
autoConfigResponse
.
status
();
if
(
status
==
"ERROR"
)
{
commandProgression
=
100
;
commandStatus
.
setError
();
}
else
{
int
size
=
autoConfigResponse
.
results_size
();
resultSize
=
size
;
int
size
=
autoConfigResponse
.
results_size
();
resultSize
=
size
;
type
.
resize
(
size
);
distance
.
resize
(
size
);
wavelength
.
resize
(
size
);
collimation
.
resize
(
size
);
type
.
resize
(
size
);
distance
.
resize
(
size
);
wavelength
.
resize
(
size
);
collimation
.
resize
(
size
);
for
(
int
i
=
0
;
i
<
size
;
++
i
)
{
type
.
set
(
i
,
autoConfigResponse
.
results
(
i
).
type
());
distance
.
set
(
i
,
autoConfigResponse
.
results
(
i
).
parameters
().
distance
());
wavelength
.
set
(
i
,
autoConfigResponse
.
results
(
i
).
parameters
().
wavelength
());
collimation
.
set
(
i
,
autoConfigResponse
.
results
(
i
).
parameters
().
collimation
());
}
for
(
int
i
=
0
;
i
<
size
;
++
i
)
{
type
.
set
(
i
,
autoConfigResponse
.
results
(
i
).
type
());
distance
.
set
(
i
,
autoConfigResponse
.
results
(
i
).
parameters
().
distance
());
wavelength
.
set
(
i
,
autoConfigResponse
.
results
(
i
).
parameters
().
wavelength
());
collimation
.
set
(
i
,
autoConfigResponse
.
results
(
i
).
parameters
().
collimation
());
}
string
sampleParametersString
;
for
(
int
i
=
0
;
i
<
autoConfigResponse
.
sampleparameters_size
()
-
1
;
++
i
)
{
sampleParametersString
+=
autoConfigResponse
.
sampleparameters
(
i
).
type
()
+
" "
+
to_string
(
autoConfigResponse
.
sampleparameters
(
i
).
value
())
+
", "
;
}
int
i
=
autoConfigResponse
.
sampleparameters_size
()
-
1
;
sampleParametersString
+=
autoConfigResponse
.
sampleparameters
(
i
).
type
()
+
" "
+
to_string
(
autoConfigResponse
.
sampleparameters
(
i
).
value
());
sampleParameters
=
sampleParametersString
;
string
sampleParametersString
;
for
(
int
i
=
0
;
i
<
autoConfigResponse
.
sampleparameters_size
()
-
1
;
++
i
)
{
sampleParametersString
+=
autoConfigResponse
.
sampleparameters
(
i
).
type
()
+
" "
+
to_string
(
autoConfigResponse
.
sampleparameters
(
i
).
value
())
+
", "
;
}
int
i
=
autoConfigResponse
.
sampleparameters_size
()
-
1
;
sampleParametersString
+=
autoConfigResponse
.
sampleparameters
(
i
).
type
()
+
" "
+
to_string
(
autoConfigResponse
.
sampleparameters
(
i
).
value
());
sampleParameters
=
sampleParametersString
;
// Intermediate progression.
commandProgression
=
50
;
// Intermediate progression.
command
Progression
=
50
;
if
(
status
==
"ERROR"
)
{
command
Status
.
setError
()
;
log
(
Level
::
s_Error
)
<<
"No prediction"
<<
endlog
;
}
else
{
log
(
Level
::
s_Debug
)
<<
"Apply"
<<
endlog
;
apply
();
// End progression.
commandProgression
=
100
;
commandStatus
.
setIdle
();
}
// End progression.
commandProgression
=
100
;
commandStatus
.
setIdle
();
log
(
Level
::
s_Info
)
<<
"Finished auto settings"
<<
endlog
;
}
...
...
src/controllers/lss/d22autoconfig/D22AutoConfig.h
View file @
9f83c043
...
...
@@ -51,6 +51,8 @@ public:
Property
<
bool
>
initialized
;
Property
<
std
::
string
>
scatterModelType
;
Property
<
std
::
string
>
scatterModel
;
Property
<
std
::
string
>
scatterModelAccuracy
;
Property
<
std
::
string
>
sampleParameters
;
Property
<
int32
>
calcTypeSize
;
...
...
src/controllers/lss/d22autoconfig/NumorMessages.proto
View file @
9f83c043
...
...
@@ -55,7 +55,9 @@ message InitResponse {
message
NumorResponse
{
required
string
scatterModelType
=
1
;
required
string
status
=
2
;
repeated
SampleParameters
sampleParameters
=
3
;
repeated
Result
results
=
4
;
required
string
scatterModel
=
2
;
required
string
scatterModelAccuracy
=
3
;
required
string
status
=
4
;
repeated
SampleParameters
sampleParameters
=
5
;
repeated
Result
results
=
6
;
}
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