Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
calng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
calibration
calng
Commits
c8f59f47
Commit
c8f59f47
authored
3 years ago
by
Philipp Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
manager: Move properties for pipeline instantation to their own node
parent
e3ebc723
No related branches found
No related tags found
2 merge requests
!12
Snapshot: field test deployed version as of end of run 202201
,
!3
Base correction device, CalCat interaction, DSSC and AGIPD devices
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/calng/CalibrationManager.py
+31
-27
31 additions, 27 deletions
src/calng/CalibrationManager.py
with
31 additions
and
27 deletions
src/calng/CalibrationManager.py
+
31
−
27
View file @
c8f59f47
...
@@ -226,8 +226,29 @@ class WebserverApiNode(Configurable):
...
@@ -226,8 +226,29 @@ class WebserverApiNode(Configurable):
accessMode
=
AccessMode
.
RECONFIGURABLE
)
accessMode
=
AccessMode
.
RECONFIGURABLE
)
class
RuntimeParametersNode
(
Configurable
):
class
InstantiationOptionsNode
(
Configurable
):
# Queried from CorrectionsDevices via slot?
restoreMatcherSources
=
Bool
(
displayedName
=
'
Restore matcher sources
'
,
description
=
'
Attempt to retrieve and restore the last known
'
'
configuration for slow and fast sources of matcher
'
'
devices when the pipeline is instantiated.
'
,
defaultValue
=
False
,
accessMode
=
AccessMode
.
RECONFIGURABLE
)
autoActivateGroupBridges
=
Bool
(
displayedName
=
'
Activate bridges automatically
'
,
description
=
'
Whether to activate all group bridges immediately after
'
'
instantation.
'
,
defaultValue
=
False
,
accessMode
=
AccessMode
.
RECONFIGURABLE
)
autoActivateGroupMatchers
=
Bool
(
displayedName
=
'
Activate group matchers automatically
'
,
description
=
'
Whether to activate all group matchers immediately after
'
'
instantation.
'
,
defaultValue
=
False
,
accessMode
=
AccessMode
.
RECONFIGURABLE
)
def
_device
(
self
):
def
_device
(
self
):
# Pretty sure this is not supposed to work like this.
# Pretty sure this is not supposed to work like this.
...
@@ -403,6 +424,11 @@ class CalibrationManager(DeviceClientBase, Device):
...
@@ -403,6 +424,11 @@ class CalibrationManager(DeviceClientBase, Device):
description
=
'
Configurations for the webserver API to control device
'
description
=
'
Configurations for the webserver API to control device
'
'
servers.
'
)
'
servers.
'
)
instantiationOptions
=
Node
(
InstantiationOptionsNode
,
displayedName
=
'
Instantiation options
'
,
description
=
'
Optional flags controlling the pipeline instantiation.
'
)
doNotCompressEvents
=
Bool
(
doNotCompressEvents
=
Bool
(
requiredAccessLevel
=
AccessLevel
.
GOD
,
requiredAccessLevel
=
AccessLevel
.
GOD
,
accessMode
=
AccessMode
.
READONLY
,
accessMode
=
AccessMode
.
READONLY
,
...
@@ -424,28 +450,6 @@ class CalibrationManager(DeviceClientBase, Device):
...
@@ -424,28 +450,6 @@ class CalibrationManager(DeviceClientBase, Device):
self
.
state
=
State
.
CHANGING
self
.
state
=
State
.
CHANGING
background
(
self
.
_instantiate_pipeline
())
background
(
self
.
_instantiate_pipeline
())
restoreMatcherSources
=
Bool
(
displayedName
=
'
Restore matcher sources
'
,
description
=
'
Attempt to retrieve and restore the last known
'
'
configuration for slow and fast sources of matcher
'
'
devices when the pipeline is instantiated.
'
,
defaultValue
=
False
,
accessMode
=
AccessMode
.
RECONFIGURABLE
)
autoActivateBridges
=
Bool
(
displayedName
=
'
Activate bridges automatically
'
,
description
=
'
Whether to activate all group bridges immediately
'
'
after instantation
'
,
defaultValue
=
True
,
accessMode
=
AccessMode
.
RECONFIGURABLE
)
autoActivateGroupMatchers
=
Bool
(
displayedName
=
'
Activate group matchers automatically
'
,
description
=
'
Whether to activate all group matchers (feeding group bridges)
'
'
immediately after instantation
'
,
defaultValue
=
True
,
accessMode
=
AccessMode
.
RECONFIGURABLE
)
outputAxisOrder
=
String
(
outputAxisOrder
=
String
(
displayedName
=
'
Output axis order
'
,
displayedName
=
'
Output axis order
'
,
description
=
'
Axes of main data output can be reordered after correction.
'
description
=
'
Axes of main data output can be reordered after correction.
'
...
@@ -954,7 +958,7 @@ class CalibrationManager(DeviceClientBase, Device):
...
@@ -954,7 +958,7 @@ class CalibrationManager(DeviceClientBase, Device):
'
fsSource
'
,
input_source_by_module
[
vname
])
'
fsSource
'
,
input_source_by_module
[
vname
])
for
vname
in
modules_by_group
[
group
]]
for
vname
in
modules_by_group
[
group
]]
if
self
.
restoreMatcherSources
:
if
self
.
instantiationOptions
.
restoreMatcherSources
:
try
:
try
:
old_config
=
await
getConfigurationFromPast
(
old_config
=
await
getConfigurationFromPast
(
matcher_device_id
,
datetime
.
now
().
isoformat
())
matcher_device_id
,
datetime
.
now
().
isoformat
())
...
@@ -970,7 +974,7 @@ class CalibrationManager(DeviceClientBase, Device):
...
@@ -970,7 +974,7 @@ class CalibrationManager(DeviceClientBase, Device):
matcher_device_id
,
config
matcher_device_id
,
config
):
):
return
return
elif
self
.
autoActivateGroupMatchers
:
elif
self
.
instantiationOptions
.
autoActivateGroupMatchers
:
async
def
_activate_matcher
(
device_id
):
async
def
_activate_matcher
(
device_id
):
with
await
getDevice
(
device_id
)
as
device
:
with
await
getDevice
(
device_id
)
as
device
:
await
sleep
(
3
)
await
sleep
(
3
)
...
@@ -995,7 +999,7 @@ class CalibrationManager(DeviceClientBase, Device):
...
@@ -995,7 +999,7 @@ class CalibrationManager(DeviceClientBase, Device):
server
,
class_ids
[
'
bridge
'
],
bridge_device_id
,
config
server
,
class_ids
[
'
bridge
'
],
bridge_device_id
,
config
):
):
return
return
elif
self
.
autoActivateBridges
:
elif
self
.
instantiationOptions
.
autoActivate
Group
Bridges
:
# Delay the slot a bit since it will get lost during
# Delay the slot a bit since it will get lost during
# instantation.
# instantation.
...
...
This diff is collapsed.
Click to expand it.
David Hammer
@hammerd
mentioned in commit
3566342d
·
2 years ago
mentioned in commit
3566342d
mentioned in commit 3566342d031db1bb435b6430f100afdbaaa6c4bf
Toggle commit list
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