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
cd39e039
Commit
cd39e039
authored
3 years ago
by
David Hammer
Browse files
Options
Downloads
Patches
Plain Diff
Karabo 2.10 does not allow slotName for KARABO_SLOT
parent
8b5870a9
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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/calng/base_correction.py
+20
-17
20 additions, 17 deletions
src/calng/base_correction.py
src/calng/calcat_utils.py
+9
-4
9 additions, 4 deletions
src/calng/calcat_utils.py
with
29 additions
and
21 deletions
src/calng/base_correction.py
+
20
−
17
View file @
cd39e039
...
@@ -32,6 +32,8 @@ from karabo.bound import (
...
@@ -32,6 +32,8 @@ from karabo.bound import (
)
)
from
karabo.common.api
import
KARABO_SCHEMA_DISPLAY_TYPE_SCENES
as
DT_SCENES
from
karabo.common.api
import
KARABO_SCHEMA_DISPLAY_TYPE_SCENES
as
DT_SCENES
from
karabo.common.states
import
State
from
karabo.common.states
import
State
from
karabo
import
version
as
karaboVersion
from
pkg_resources
import
parse_version
from
.
import
scenes
,
shmem_utils
,
utils
from
.
import
scenes
,
shmem_utils
,
utils
from
._version
import
version
as
deviceVersion
from
._version
import
version
as
deviceVersion
...
@@ -460,31 +462,32 @@ class BaseCorrection(PythonDevice):
...
@@ -460,31 +462,32 @@ class BaseCorrection(PythonDevice):
)
)
self
.
_last_processing_started
=
0
# not input handler should put timestamp
self
.
_last_processing_started
=
0
# not input handler should put timestamp
self
.
_rate_update_timer
=
utils
.
RepeatingTimer
(
self
.
_rate_update_timer
=
utils
.
RepeatingTimer
(
interval
=
0.5
,
interval
=
1
,
callback
=
self
.
_update_rate_and_state
,
callback
=
self
.
_update_rate_and_state
,
)
)
self
.
_buffer_lock
=
threading
.
Lock
()
self
.
_buffer_lock
=
threading
.
Lock
()
self
.
KARABO_SLOT
(
self
.
loadMostRecentConstants
)
self
.
KARABO_SLOT
(
self
.
loadMostRecentConstants
)
self
.
KARABO_SLOT
(
self
.
requestScene
)
self
.
KARABO_SLOT
(
self
.
requestScene
)
# TODO: the CalCatFriend could add these for us
if
parse_version
(
karaboVersion
)
>=
parse_version
(
"
2.11
"
):
# note: overly complicated slot function creation necessary for closure to work
# TODO: the CalCatFriend could add these for us
def
make_wrapper_capturing_constant
(
constant
):
# note: overly complicated slot function creation necessary for closure to work
def
aux
():
def
make_wrapper_capturing_constant
(
constant
):
self
.
calcat_friend
.
get_specific_constant_version_and_call_me_back
(
def
aux
():
constant
,
self
.
_load_constant_to_gpu
self
.
calcat_friend
.
get_specific_constant_version_and_call_me_back
(
constant
,
self
.
_load_constant_to_gpu
)
return
aux
for
constant
in
self
.
_constant_enum_class
:
slot_name
=
f
"
foundConstants.
{
constant
.
name
}
.overrideConstantVersion
"
meth_name
=
slot_name
.
replace
(
"
.
"
,
"
_
"
)
self
.
KARABO_SLOT
(
make_wrapper_capturing_constant
(
constant
),
slotName
=
meth_name
,
)
)
return
aux
for
constant
in
self
.
_constant_enum_class
:
slot_name
=
f
"
foundConstants.
{
constant
.
name
}
.overrideConstantVersion
"
meth_name
=
slot_name
.
replace
(
"
.
"
,
"
_
"
)
self
.
KARABO_SLOT
(
make_wrapper_capturing_constant
(
constant
),
slotName
=
meth_name
,
)
def
preReconfigure
(
self
,
config
):
def
preReconfigure
(
self
,
config
):
for
ts_path
in
(
for
ts_path
in
(
"
constantParameters.deviceMappingSnapshotAt
"
,
"
constantParameters.deviceMappingSnapshotAt
"
,
...
...
This diff is collapsed.
Click to expand it.
src/calng/calcat_utils.py
+
9
−
4
View file @
cd39e039
...
@@ -25,6 +25,8 @@ from karabo.bound import (
...
@@ -25,6 +25,8 @@ from karabo.bound import (
STRING_ELEMENT
,
STRING_ELEMENT
,
UINT32_ELEMENT
,
UINT32_ELEMENT
,
)
)
from
karabo
import
version
as
karaboVersion
from
pkg_resources
import
parse_version
from
.
import
utils
from
.
import
utils
...
@@ -91,11 +93,14 @@ def _add_status_schema_from_enum(schema, prefix, enum_class):
...
@@ -91,11 +93,14 @@ def _add_status_schema_from_enum(schema, prefix, enum_class):
.
defaultValue
(
""
)
.
defaultValue
(
""
)
.
reconfigurable
()
.
reconfigurable
()
.
commit
(),
.
commit
(),
SLOT_ELEMENT
(
schema
)
.
key
(
f
"
{
constant_node
}
.overrideConstantVersion
"
)
.
displayedName
(
"
Override constant version
"
)
.
commit
(),
)
)
if
parse_version
(
karaboVersion
)
>=
parse_version
(
"
2.11
"
):
(
SLOT_ELEMENT
(
schema
)
.
key
(
f
"
{
constant_node
}
.overrideConstantVersion
"
)
.
displayedName
(
"
Override constant version
"
)
.
commit
(),
)
class
DetectorStandin
(
typing
.
NamedTuple
):
class
DetectorStandin
(
typing
.
NamedTuple
):
...
...
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