Skip to content

Commit

Permalink
removing temporary print ""
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasc-ubc committed Nov 19, 2015
1 parent 000eb67 commit 2620a2a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
28 changes: 23 additions & 5 deletions klayout_dot_config/pymacros/SiEPIC_EBeam_Path_to_Waveguide.lym
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Lukas Chrostowski 2015/11/17

Lukas Chrostowski 2015/11/18
- If the GUIDING_SHAPE (a path) is selected, don't do anything. Already a waveguide.
- removed need for numpy.array

"""

Expand Down Expand Up @@ -100,11 +101,17 @@ waveguide_snap_dist = 10
# Record a transaction, to enable "undo"
lv.transaction("Path to Waveguide")

print ("------------------ Path to Waveguide --------------")

# Find the selected paths
object_selection = lv.object_selection
# objects to delete:
to_delete = []

# new objects will become selected
new_selection = []

# Find the selected paths
object_selection = lv.object_selection

for o in object_selection:
if o.is_cell_inst():
print ("Selected object is a cell, rather than a path. Please select a path.")
Expand Down Expand Up @@ -213,9 +220,17 @@ for o in object_selection:
param = { "npoints": points_per_circle(radius), "radius": radius, "path": wg_path, "layer": LayerSi }
pcell = ly.create_cell("ROUND_PATH", "Basic", param )
t = pya.Trans(0, 0)
cell.insert(pya.CellInstArray(pcell.cell_index(), t))

# It would be nice to leave the newly created waveguide selected, to make it obvious to the user.
new_cell = cell.insert(pya.CellInstArray(pcell.cell_index(), t))

# Leave the newly created waveguide selected, to make it obvious to the user.
# http://klayout.de/forum/comments.php?DiscussionID=747
new_selectionN = len(new_selection)
new_selection.append( pya.ObjectInstPath() )
new_selection[new_selectionN].layer = LayerSiN
# new_selection[new_selectionN].cell_index = pcell.cell_index()
new_selection[new_selectionN].cell_index = new_cell
new_selection[new_selectionN].top = o.top
new_selection[new_selectionN].cv_index = o.cv_index

# Mark the path for deletion:
#shape_obj.delete()
Expand All @@ -228,6 +243,9 @@ for t in to_delete:
# Clear the layout view selection, since we deleted some objects (but others may be selected still):
lv.clear_object_selection()

# Select the newly added objects
lv.object_selection = new_selection

# Record a transaction, to enable "undo"
lv.commit()

Expand Down
6 changes: 3 additions & 3 deletions klayout_dot_config/pymacros/SiEPIC_EBeam_Verification.lym
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Lukas Chrostowski 2015/11/16
Lukas Chrostowski 2015/11/17
- debugging & fixing Verification problems

Lukas Chrostowski 2015/11/18
- removed need for numpy.array


"""

Expand Down Expand Up @@ -459,10 +462,8 @@ import math
def eng_str(x):
# x input in meters
# output in meters, engineering notation, rounded to 1 nm
print x
x = round(x*1E9)/1E9
y = abs(x)
print y
if y == 0:
return '0'
else:
Expand All @@ -483,7 +484,6 @@ def eng_str(x):
sign = '-' if x < 0 else ''
#return sign+str(z)+'E'+str(engr_exponent)
# return sign+ '%3.3f' % z +str(str_engr_exponent)
print z
return sign+ str(z) +str(str_engr_exponent)

def list_optical_waveguides(list_optical_waveguides):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Lukas Chrostowski 2015/11/16
Lukas Chrostowski 2015/11/18
- If the GUIDING_SHAPE is selected, find out the ROUND_PATH PCell it belongs to.
user can either select the PCell or it's ROUND_PATH.

Lukas Chrostowski 2015/11/18
- removed need for numpy.array

"""

Expand Down Expand Up @@ -75,7 +78,7 @@ print ("------------------ Waveguide to Path --------------")
# record objects to delete:
to_delete = []

# new objects will remain selected
# new objects will become selected
new_selection = []

# Find the selected objects
Expand Down Expand Up @@ -138,6 +141,7 @@ for t in to_delete:
# Clear the layout view selection, since we deleted some objects (but others may still be selected):
lv.clear_object_selection()

# Select the newly added objects
lv.object_selection = new_selection

# Record a transaction, to enable "undo"
Expand Down
3 changes: 3 additions & 0 deletions klayout_dot_config/pymacros/SiEPIC_EBeam_functions.lym
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ Lukas Chrostowski 2015/11/17
- improvements to Spice output, engineering format
- extensive testing of verification, including large test layout
- several floating point issues

Lukas Chrostowski 2015/11/18
- removed need for numpy.array

"""
import pya
Expand Down

0 comments on commit 2620a2a

Please sign in to comment.