Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pykat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Sebastian Steinlechner
pykat
Commits
2cea3562
Commit
2cea3562
authored
11 years ago
by
Andreas Freise
Browse files
Options
Downloads
Patches
Plain Diff
starting to add scale as attribute for detectors.
parent
445bb049
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pykat/detectors.py
+10
-0
10 additions, 0 deletions
pykat/detectors.py
pykat/param.py
+21
-0
21 additions, 0 deletions
pykat/param.py
with
31 additions
and
0 deletions
pykat/detectors.py
+
10
−
0
View file @
2cea3562
...
@@ -10,6 +10,8 @@ import pykat.gui.resources
...
@@ -10,6 +10,8 @@ import pykat.gui.resources
from
pykat.utils
import
*
from
pykat.utils
import
*
from
pykat.gui.graphics
import
*
from
pykat.gui.graphics
import
*
from
pykat.node_network
import
*
from
pykat.node_network
import
*
from
pykat.param
import
Param
,
ScaleParam
class
Detector
(
object
)
:
class
Detector
(
object
)
:
def
__init__
(
self
,
name
,
node
):
def
__init__
(
self
,
name
,
node
):
...
@@ -22,6 +24,7 @@ class Detector(object) :
...
@@ -22,6 +24,7 @@ class Detector(object) :
self
.
__node
=
None
self
.
__node
=
None
self
.
_params
=
[]
self
.
_params
=
[]
self
.
_mask
=
{}
self
.
_mask
=
{}
self
.
__scale
=
ScaleParam
(
"
scale
"
,
self
,
SIfloat
(
1.0
))
if
node
.
find
(
'
*
'
):
if
node
.
find
(
'
*
'
):
self
.
_alternate_beam
=
True
self
.
_alternate_beam
=
True
...
@@ -46,6 +49,13 @@ class Detector(object) :
...
@@ -46,6 +49,13 @@ class Detector(object) :
def
getQGraphicsItem
(
self
):
def
getQGraphicsItem
(
self
):
return
None
return
None
@property
def
scale
(
self
):
return
self
.
__scale
@scale.setter
def
sclae
(
self
,
value
):
self
.
__scale
=
SIfloat
(
value
)
@property
@property
def
node
(
self
):
return
self
.
__node
def
node
(
self
):
return
self
.
__node
@node.setter
@node.setter
...
...
This diff is collapsed.
Click to expand it.
pykat/param.py
+
21
−
0
View file @
2cea3562
...
@@ -165,3 +165,24 @@ class AttrParam(Param):
...
@@ -165,3 +165,24 @@ class AttrParam(Param):
rtn
.
extend
(
super
(
AttrParam
,
self
).
getFinesseText
())
rtn
.
extend
(
super
(
AttrParam
,
self
).
getFinesseText
())
return
rtn
return
rtn
class
ScaleParam
(
Param
):
"""
The scale parameter of a detector is set using the Finesse `scale` command.
This inherits directly from a Param object so can be set whether this attribute
is putable or a putter.
If the value pf the parameter is not 1.0 the scale command will be printed.
"""
def
getFinesseText
(
self
):
rtn
=
[]
if
self
.
value
!=
1.0
:
rtn
.
append
(
"
scale {0} {1}
"
.
format
(
self
.
_owner
.
name
,
self
.
value
))
rtn
.
extend
(
super
(
ScaleParam
,
self
).
getFinesseText
())
return
rtn
This diff is collapsed.
Click to expand it.
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