Пример #1
0
def registerMenuItems():
    import os
    #from . import scripts, examples, lumerical, install

    global SIMPHONY_ACTIONS
    count = len(SIMPHONY_ACTIONS)
    menu = pya.Application.instance().main_window().menu()
    path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "files",
                        "light.png")

    import sys

    s1 = "simphony_menu"
    if not (menu.is_menu(s1)):
        menu.insert_menu("help_menu", s1, "Simphony %s" % simphony.__version__)

    #s2 = "simulations"
    #if not(menu.is_menu(s1 + "." + s2)):
    #    menu.insert_menu(s1 + ".end", s2, "Waveguides")

    if not (menu.is_menu("@toolbar.cir_sim_simphony")):
        SIMPHONY_ACTIONS.append(pya.Action())
        menu.insert_item("@toolbar.end", "cir_sim_simphony",
                         SIMPHONY_ACTIONS[count])
    SIMPHONY_ACTIONS[count].title = "Simphony\nSimulation"
    SIMPHONY_ACTIONS[count].on_triggered(
        SiEPIC_Simphony.single_port_simulation.circuit_analysis)
    SIMPHONY_ACTIONS[count].icon = path
    count += 1
Пример #2
0
def registerMenuItems():
    import os
    from . import scripts, examples, lumerical, install
    import SiEPIC.__init__

    global ACTIONS
    count = 0
    menu = pya.Application.instance().main_window().menu()
    path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "files",
                        "INTERCONNECT_icon.png")

    import sys
    if int(sys.version[0]) > 2 and sys.platform == 'darwin':
        extra = " Py3"
    else:
        extra = ''

    s1 = "siepic_menu"
    if not (menu.is_menu(s1)):
        menu.insert_menu("help_menu", s1,
                         "SiEPIC %s" % SiEPIC.__init__.__version__ + extra)

    s2 = "waveguides"
    if not (menu.is_menu(s1 + "." + s2)):
        menu.insert_menu(s1 + ".end", s2, "Waveguides")

    s2 = "layout"
    if not (menu.is_menu(s1 + "." + s2)):
        menu.insert_menu(s1 + ".end", s2, "Layout")

    s2 = "exlayout"
    if not (menu.is_menu(s1 + "." + s2)):
        menu.insert_menu(s1 + ".end", s2, "Example Layouts")

    s2 = "verification"
    if not (menu.is_menu(s1 + "." + s2)):
        menu.insert_menu(s1 + ".end", s2, "Verification")

    s2 = "simulation_circuits"
    if not (menu.is_menu(s1 + "." + s2)):
        menu.insert_menu(s1 + ".end", s2, "Simulation, Circuits")

    s2 = "simulation_components"
    if not (menu.is_menu(s1 + "." + s2)):
        menu.insert_menu(s1 + ".end", s2, "Simulation, Components")

    s2 = "measurements"
    if not (menu.is_menu(s1 + "." + s2)):
        menu.insert_menu(s1 + ".end", s2, "Measurement Data")

    if not (menu.is_menu("@toolbar.cir_sim")):
        ACTIONS.append(pya.Action())
        menu.insert_item("@toolbar.end", "cir_sim", ACTIONS[count])
    ACTIONS[count].title = "Circuit \nSimulation"
    ACTIONS[count].on_triggered(
        lumerical.interconnect.circuit_simulation_toolbar)
    ACTIONS[count].icon = path
    count += 1

    if 0:
        if not (menu.is_menu("@toolbar.cir_sim.mc_sim")):
            ACTIONS.append(pya.Action())
            menu.insert_item("@toolbar.cir_sim.end", "mc_sim", ACTIONS[count])
        ACTIONS[count].title = "INTERCONNECT Monte Carlo Simulations"
        ACTIONS[count].on_triggered(
            lumerical.interconnect.circuit_simulation_monte_carlo)
        ACTIONS[count].icon = path
        count += 1

        if not (menu.is_menu("@toolbar.cir_sim.launch_lumerical")):
            ACTIONS.append(pya.Action())
            menu.insert_item("@toolbar.cir_sim.end", "launch_lumerical",
                             ACTIONS[count])
        ACTIONS[count].title = "INTERCONNECT Circuit Simulation"
        ACTIONS[count].on_triggered(lumerical.interconnect.circuit_simulation)
        ACTIONS[count].icon = path
        count += 1

        if not (menu.is_menu("@toolbar.cir_sim.update_netlist")):
            ACTIONS.append(pya.Action())
            menu.insert_item("@toolbar.cir_sim.end", "update_netlist",
                             ACTIONS[count])
        ACTIONS[count].title = "INTERCONNECT Update Netlist"
        ACTIONS[count].on_triggered(
            lumerical.interconnect.circuit_simulation_update_netlist)
        ACTIONS[count].icon = path
Пример #3
0
          path2 = [(lx2,ly2),(ux2,uy2)]
          crd2 = coords(path2)
          lay = 9
          create_box(crd2,lay)
          lay = 11
          create_box(crd2,lay)
     
     #Via
          via2 = [(vx2,vy2),(vux2,vuy2)]
          vcrd2 = coords(via2)
          lay = 10
          create_box(vcrd2,lay)
      
      
      
action1 = pya.Action()
action1.title = "Router"
action1.tool_tip = "Router"
action1.on_triggered(Router)
menu = pya.MainWindow.instance().menu()
# Insert it main menu: where, name, action:
#menu.insert_item("tools_menu.end", "Router", action1)
# Insert into toolbar: for the router
menu.insert_item("@toolbar.end", "Router", action1)


#Build Matrix for later
#Build Maze based on  Border Boundary Box
#rows = int(input()) ux from Border Box
#cols = int(input())  uy from Border Box