Example #1
0
    def __init__(self, parent, argv=()):
        self._init_ctrls(parent)
        #self.Maximize()

        self.ogl = frames.LensSystemOGL.LensSystemOGL(self)
        self.lens = frames.LensData.LensData(self)
        self.trace = frames.RayData.RayData(self)
        self.paraxial = frames.ParaxialData.ParaxialData(self)
        self.spot = frames.SpotDiagram.SpotDiagram(self)

        self.abr = frames.Aberrations.Aberrations(self)
        self.img = frames.Image.Image(self)

        if False:
            self.paraxial.Hide()
            self.spot.Hide()
            self.img.Hide()
            self.trace.Hide()
        else:
            for frame in [
                    self.ogl, self.lens
            ]:  #, self.trace, self.paraxial, self.spot, self.img]:
                frame.Show()
            for frame in [
                    self.abr, self.trace, self.paraxial, self.spot, self.img
            ]:
                frame.Hide()

        self.Tile()
        self.Cascade()
        self.Tile()
        self.file_cnt = 0
        self.file_name = 'untitled' + str(self.file_cnt) + '.lns'
        self.SetTitle(TITLE + self.file_name)
        self.saveable = False

        showDialog = True
        if showDialog:
            msg = 'OpenRayTrace, Copyright (C) 2007 Andrew Wilson\nOpenRayTrace comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are welcome to redistribute it under certain conditions (see About menu)'
            self.dlg = wx.MessageDialog(self, msg, 'GPL Copyright',
                                        wx.OK | wx.ICON_INFORMATION)
            self.dlg.ShowModal()
            #dlg.Destroy()
        if len(argv) > 1:
            assert len(argv) == 2, "Up to one filename handled."
            if argv[1].lower().endswith('.zmx'):
                from OpenRayTrace.DataModel import System
                self.file_name = argv[1]
                self.lens.setSystem(System.loadZMX(self.file_name))
            else:
                raise TypeError("Unrecognized argument: {}".format(argv[1]))
Example #2
0
    def __init__(self, parent, argv=()):
        self._init_ctrls(parent)                                    
        #self.Maximize()
        
        self.ogl      = frames.LensSystemOGL.LensSystemOGL(self)      
        self.lens     = frames.LensData.LensData(self)
        self.trace    = frames.RayData.RayData(self)
        self.paraxial = frames.ParaxialData.ParaxialData(self)
        self.spot     = frames.SpotDiagram.SpotDiagram(self)
        
        self.abr      = frames.Aberrations.Aberrations(self)
        self.img      = frames.Image.Image(self)
        
        if False:
            self.paraxial.Hide()        
            self.spot.Hide()        
            self.img.Hide()        
            self.trace.Hide()        
        else:
            for frame in [self.ogl, self.lens]: #, self.trace, self.paraxial, self.spot, self.img]:
                frame.Show()
            for frame in [self.abr, self.trace, self.paraxial, self.spot, self.img]:
                frame.Hide()

        self.Tile()
        self.Cascade()
        self.Tile()
        self.file_cnt = 0
        self.file_name = 'untitled'+str(self.file_cnt)+'.lns'
        self.SetTitle(TITLE + self.file_name)
        self.saveable = False
        
        showDialog = True
        if showDialog:
            msg =  'OpenRayTrace, Copyright (C) 2007 Andrew Wilson\nOpenRayTrace comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are welcome to redistribute it under certain conditions (see About menu)'
            self.dlg = wx.MessageDialog(self, msg, 'GPL Copyright', wx.OK | wx.ICON_INFORMATION)
            self.dlg.ShowModal()
            #dlg.Destroy()
        if len(argv) > 1:
            assert len(argv) == 2, "Up to one filename handled."
            if argv[1].lower().endswith('.zmx'):
                from OpenRayTrace.DataModel import System
                self.file_name = argv[1]
                self.lens.setSystem(System.loadZMX(self.file_name))
            else:
                raise TypeError("Unrecognized argument: {}".format(argv[1]))
Example #3
0
    def OnMenuOpen(self, event):
        dlg = wx.FileDialog(self, "Open Lens", ".", "", "Lens file (*.lns)|*.lns|ZEMAX file (*.zmx)|*.zmx", wx.OPEN | wx.CHANGE_DIR)
        try:
            if dlg.ShowModal() == wx.ID_OK:
                self.file_name = dlg.GetPath()
                self.SetTitle(TITLE + self.file_name)

                import os
                ext = os.path.splitext(self.file_name)[1].lower()
                if ext == '.lns':
                    with open(self.file_name) as fd:
                        t = pickle.load(fd)
                    self.lens.set_data(t)
                elif ext == '.zmx':
                    from OpenRayTrace.DataModel import System
                    self.lens.setSystem(System.loadZMX(self.file_name))
                self.saveable = True
        finally:
            dlg.Destroy()
Example #4
0
    def OnMenuOpen(self, event):
        dlg = wx.FileDialog(
            self, "Open Lens", ".", "",
            "Lens file (*.lns)|*.lns|ZEMAX file (*.zmx)|*.zmx",
            wx.OPEN | wx.CHANGE_DIR)
        try:
            if dlg.ShowModal() == wx.ID_OK:
                self.file_name = dlg.GetPath()
                self.SetTitle(TITLE + self.file_name)

                import os
                ext = os.path.splitext(self.file_name)[1].lower()
                if ext == '.lns':
                    with open(self.file_name) as fd:
                        t = pickle.load(fd)
                    self.lens.set_data(t)
                elif ext == '.zmx':
                    from OpenRayTrace.DataModel import System
                    self.lens.setSystem(System.loadZMX(self.file_name))
                self.saveable = True
        finally:
            dlg.Destroy()