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
finesse
pykat
Commits
98549ca8
Commit
98549ca8
authored
8 years ago
by
Daniel Toyra
Browse files
Options
Downloads
Patches
Plain Diff
Added support for loss in isolator component
parent
aeaad51a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pykat/components.py
+20
-4
20 additions, 4 deletions
pykat/components.py
with
20 additions
and
4 deletions
pykat/components.py
+
20
−
4
View file @
98549ca8
...
...
@@ -901,7 +901,7 @@ class grating(Component):
return
self
.
_svgItem
class
isolator
(
Component
):
def
__init__
(
self
,
name
,
node1
,
node2
,
S
=
0
,
node3
=
"
dump
"
,
option
=
0
):
def
__init__
(
self
,
name
,
node1
,
node2
,
S
=
0
,
node3
=
"
dump
"
,
option
=
0
,
L
=
0
):
Component
.
__init__
(
self
,
name
)
self
.
_requested_node_names
.
append
(
node1
)
...
...
@@ -911,12 +911,19 @@ class isolator(Component):
self
.
_option
=
option
self
.
__S
=
Param
(
"
S
"
,
self
,
SIfloat
(
S
))
self
.
__L
=
Param
(
"
L
"
,
self
,
SIfloat
(
L
))
@property
def
S
(
self
):
return
self
.
__S
@S.setter
def
S
(
self
,
value
):
self
.
__S
.
value
=
SIfloat
(
value
)
@property
def
L
(
self
):
return
self
.
__L
@L.setter
def
L
(
self
,
value
):
self
.
__L
.
value
=
SIfloat
(
value
)
@staticmethod
def
parseFinesseText
(
text
):
values
=
text
.
split
()
...
...
@@ -934,7 +941,15 @@ class isolator(Component):
if
len
(
values
)
==
4
:
return
isolator
(
values
[
0
],
values
[
2
],
values
[
3
],
values
[
1
],
option
=
option
)
elif
len
(
values
)
==
5
:
return
isolator
(
values
[
0
],
values
[
2
],
values
[
3
],
node3
=
values
[
4
],
S
=
values
[
1
],
option
=
option
)
# Checking if loss is specified
if
values
[
2
].
isnumeric
():
return
isolator
(
values
[
0
],
values
[
3
],
values
[
4
],
values
[
1
],
L
=
values
[
2
],
option
=
option
)
else
:
return
isolator
(
values
[
0
],
values
[
2
],
values
[
3
],
node3
=
values
[
4
],
S
=
values
[
1
],
option
=
option
)
elif
len
(
values
)
==
6
:
return
isolator
(
values
[
0
],
values
[
3
],
values
[
4
],
values
[
1
],
values
[
5
],
option
,
values
[
2
])
else
:
raise
pkex
.
BasePyKatException
(
"
Isolator Finesse code format incorrect
'
{0}
'"
.
format
(
text
))
...
...
@@ -944,11 +959,12 @@ class isolator(Component):
elif
self
.
_option
==
1
:
cmd
=
"
isol*
"
rtn
=
[
'
{cmd} {0} {1} {2} {3} {4}
'
.
format
(
self
.
name
,
self
.
S
.
value
,
self
.
nodes
[
0
].
name
,
self
.
nodes
[
1
].
name
,
self
.
nodes
[
2
].
name
,
cmd
=
cmd
)]
rtn
=
[
'
{cmd} {0} {1} {2} {3} {4}
{5}
'
.
format
(
self
.
name
,
self
.
S
.
value
,
self
.
L
.
value
,
self
.
nodes
[
0
].
name
,
self
.
nodes
[
1
].
name
,
self
.
nodes
[
2
].
name
,
cmd
=
cmd
)]
for
p
in
self
.
_params
:
rtn
.
extend
(
p
.
getFinesseText
())
print
(
rtn
)
return
rtn
def
getOptivisComponent
(
self
):
...
...
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