Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
finesse
pykat
Commits
66c2a0df
Commit
66c2a0df
authored
May 15, 2016
by
Daniel Brown
Browse files
adding lens power option
parent
aeaad51a
Pipeline
#1196
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pykat/__init__.py
View file @
66c2a0df
...
...
@@ -3,7 +3,7 @@ from __future__ import division
from
__future__
import
print_function
from
__future__
import
unicode_literals
__version__
=
"1.0.
6
"
__version__
=
"1.0.
7
"
# This flag is used to switch on the gui features in pkat at import time
USE_GUI
=
False
...
...
pykat/components.py
View file @
66c2a0df
...
...
@@ -994,11 +994,30 @@ class lens(Component):
self
.
_requested_node_names
.
append
(
node2
)
self
.
_svgItem
=
None
self
.
__f
=
Param
(
"f"
,
self
,
SIfloat
(
f
))
self
.
__p
=
Param
(
"p"
,
self
,
None
)
@
property
def
f
(
self
):
return
self
.
__f
def
f
(
self
):
if
self
.
__f
is
not
None
:
return
self
.
__f
else
:
return
1
/
self
.
__p
@
f
.
setter
def
f
(
self
,
value
):
self
.
__f
.
value
=
SIfloat
(
value
)
def
f
(
self
,
value
):
self
.
__f
.
value
=
SIfloat
(
value
)
self
.
__p
.
value
=
None
@
property
def
p
(
self
):
if
self
.
__p
is
not
None
:
return
self
.
__p
else
:
return
1
/
self
.
__f
@
f
.
setter
def
p
(
self
,
value
):
self
.
__p
.
value
=
SIfloat
(
value
)
self
.
__f
.
value
=
None
@
staticmethod
def
parseFinesseText
(
text
):
...
...
@@ -1015,7 +1034,10 @@ class lens(Component):
raise
pkex
.
BasePyKatException
(
"Lens Finesse code format incorrect '{0}'"
.
format
(
text
))
def
getFinesseText
(
self
):
rtn
=
[
'lens {0} {1} {2} {3}'
.
format
(
self
.
name
,
self
.
f
.
value
,
self
.
nodes
[
0
].
name
,
self
.
nodes
[
1
].
name
)]
if
self
.
__p
is
None
:
rtn
=
[
'lens {0} {1} {2} {3}'
.
format
(
self
.
name
,
self
.
f
.
value
,
self
.
nodes
[
0
].
name
,
self
.
nodes
[
1
].
name
)]
else
:
rtn
=
[
'lens* {0} {1} {2} {3}'
.
format
(
self
.
name
,
self
.
p
.
value
,
self
.
nodes
[
0
].
name
,
self
.
nodes
[
1
].
name
)]
for
p
in
self
.
_params
:
rtn
.
extend
(
p
.
getFinesseText
())
...
...
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