def __init__(self, parent, **opts): BaseGui.__init__(self, parent, title="Database Tool", menus=["Connection", "Get", "Put"], pycommand=True) controls = [ ["Connection", "Choose Data Store", self.selectDB], ["Get", "List All Entries", self.list], ["Get", "Show Details", self.infoprint], ["Get", "Search", self.do_search], ["Get", "Download Single File", self.download], ["Get", "Download Several Files", self.downloadGroup], ["Put", "Upload Current File", self.upload], ] self.fillMenus(controls) self.mainSizer = wx.BoxSizer(wx.VERTICAL) self.main.SetSizer(self.mainSizer) self.main.SetAutoLayout(True) self.SetAutoLayout(True) self.mainSizer.Add(wx.StaticText(self.main, -1, "Connected To:"), 1, wx.GROW | wx.ALL | wx.ALIGN_CENTRE, 5) self.dbid = wx.StaticText(self.main, -1, "") self.mainSizer.Add(self.dbid, 1, wx.GROW | wx.ALL | wx.ALIGN_CENTRE, 5) self.dbreccount = wx.StaticText(self.main, -1, "0 Records") self.mainSizer.Add(self.dbreccount, 1, wx.GROW | wx.ALL | wx.ALIGN_CENTRE, 5) self.selectDB(None, URLS[0], "/CercalSystem/") self.doc = self.Parent.document self.SetSize(wx.Size(500, 200))
def __init__(self, gui, cell): self.gui=gui self.cell=cell self.selectedSections = self.cell._sections.values() #self.selectedSections = [cell.getSection("section[117]")] BaseGui.__init__(self, gui, title="Edit Cell %s" % cell.name(), menus=["File", "Selection", "Synapse", "Mechanism","Measurements", "Morphology"], pycommand=True,height=4) commands=[["File", "Quit", lambda x: self.Destroy()], ["Selection", "Select Sections", self.makeSel], ['Selection', 'Select Spatial Region', self.selectLocation], ["Selection", "Export Selection", self.exportSel], ["Selection", "Import Selection", self.importSel], ["Selection", "Clear Selection", self.killSel], ["Synapse", "Synapse Info", self.synapseInfo], ["Synapse", "Make Masks", self.makeMasks], ["Synapse", "Mask Selected Sections", self.makeUniformMask], ["Synapse", "Make Synapses", self.makeSyn], ["Synapse", "Remove Synapses", self.delSyn], ["Synapse", "Scramble Synapses", self.randomSyn], ["Synapse", "Edit Synapses", self.editSyn], ["Synapse", "Silence Selection", self.silenceSel], ["Mechanism", "Set Mechanism Density", self.setProperty], ["Mechanism", "SMR cheat density", self.setPropertysmrcheat], ["Mechanism", "Copy Mechanisms", self.dupMech], ["Mechanism", "Insert Mechanism", self.addMech], ["Mechanism", "Remove Mechanism", self.delMech], ["Mechanism", "Strip All Mechanisms", self.nukeMech], ["Mechanism", "Load Parameters from File", self.loadParams], ["Mechanism", "Fit passive properties", self.setPass], ["Measurements", "Input Impedance", self.getRin], ["Morphology", "Random Connectivity", self.fuzzBall], ["Morphology", "Cut tips", self.antiFuzzBall], ["Morphology", "Uniform Sections", self.splitCell], ["Morphology", "Human Readable Names", self.assignNames], ["Morphology", "Simple Names", self.simpleNames], ["Morphology", "Load Morphology", self.getCellMorph]] self.fillMenus(commands) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(wx.StaticText(self.main, -1, "%s" % str(self.cell)), 0, wx.ALIGN_CENTRE|wx.ALL, 5) self.info=wx.StaticText(self.main, -1, "00000 Sections, 00000 Synapses, 00 Channel Types") sizer.Add(self.info, 1, wx.ALIGN_CENTRE|wx.ALL, 5) self.nsel=wx.StaticText(self.main, -1,"%i (All) Sections Selected" % len(self.selectedSections)) sizer.Add(self.nsel, 1, wx.ALIGN_CENTRE|wx.ALL, 5) self.main.SetSizer(sizer) self.main.SetAutoLayout(True) sizer.Fit(self) self.setInfo() self.SetSize(wx.Size(600,300))
def __init__(self, parent, exp): BaseGui.__init__( self, parent, id=-1, title="RunControl", menus=["File", "Recording", "Control"], pycommand=True, height=6, memory=100000, ) guicommands = [ ["File", "Write Hoc", self.writeHoc], ["Recording", "Set Display", self.display], ["Recording", "Load neuron output", self.loadBat], ["File", "Quit", lambda x: self.Destroy()], ] self.fillMenus(guicommands) self.gui = parent id = wx.NewId() self.menus["Control"].AppendCheckItem(id, "Clear Directory") wx.EVT_MENU(self, id, self.setCD) self.CD = True self.menus["Control"].Check(id, True) self.exp = exp self.exp.report = self.threadReport self.xm = parent sizer = wx.BoxSizer(wx.VERTICAL) self.tit = wx.StaticText(self.main, -1, self.exp.upath()) sizer.Add(self.tit, 0, wx.GROW | wx.ALIGN_LEFT | wx.ALL, 0) rhs = wx.BoxSizer(wx.HORIZONTAL) l = wx.StaticText(self.main, -1, "Directory:") rhs.Add(l, 0, wx.GROW | wx.ALIGN_LEFT | wx.ALL, 0) cw = os.getcwd() l = wx.StaticText(self.main, -1, cw) rhs.Add(l, 0, wx.GROW | wx.ALIGN_LEFT | wx.ALL, 0) sizer.Add(rhs, 0, wx.GROW | wx.ALL, 0) self.main.SetSizer(sizer) self.main.SetAutoLayout(True) # self.SetSize((400,180)) sizer.Fit(self.main) EVT_UPDATE_GUI(self, self.OnUpdate) EVT_REPORT(self, self.OnReport)
def __init__(self, parent=None, **kwargs): kwargs.update(self.init_defaults) BaseGui.__init__(self, parent, **kwargs) self.fillMenus(self.gen_controls()) self.mainSizer = wx.BoxSizer(wx.VERTICAL) self.main.SetSizer(self.mainSizer) self.main.SetAutoLayout(True) if self.controlpanel: self.panel=self.controlpanel(self.main, self) self.mainSizer.Add(self.panel, self.panel.gr, wx.ALIGN_BOTTOM|wx.ALL, 5) if self.preferences: self.load_saved_prefs() self.graph=None self.newGraph(kwargs.get('gclass'), kwargs.get('size'))
def __init__(self, parent=None, opt=None): BaseGui.__init__(self, parent, id=-1, title="Optimizer Analysis", menus = ["Data", "Units", "Analysis"], pycommand=True, height=6, memory=100000) guicommands=[["Data","Load Data", self.load], ["Data", "Create Data Element", self.save], ["Data","----"], ["Data","Reload Analysis Module", self.bounce], ["Data","Quit", self.quit], ["Units", "Show", self.displayUnit], ["Units", "Assign", self.assign], ["Units", "Re-Evaluate", self.evalUnit]] self.ga=opt self.pars=opt.params() self.condition={} self.fillMenus(guicommands) sizer = wx.BoxSizer(wx.VERTICAL) self.tit = wx.StaticText(self.main, -1, 'No Algorithm') sizer.Add(self.tit, 1, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) self.sizeinf = wx.StaticText(self.main, -1, ' No Data ') sizer.Add(self.sizeinf, 1, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) self.stats = wx.StaticText(self.main, -1, ' -- ') sizer.Add(self.stats, 1, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) self.main.SetSizer(sizer) self.main.SetAutoLayout(True) sizer.Fit(self.main) self.SetSize((600,200)) self.bounce() self.np=len(self.pars._pars) self.nunits=0 if opt.attrib('EvalConditions'): self.hasEC=opt.attrib('EvalConditions') else: self.hasEC=0 storesize=self.np+1+self.hasEC self.data=None if ast.verify(opt.attrib('File'), storesize, 1): self.ast=ast.ArrayStore(opt.attrib('File'), 'w') else: self.report("Optimizer File attribute does not refference a valid arraystore. You will need to load data by hand") self.ast=None self.showInfo()
def __init__(self, sim=None, **kwargs): BaseGui.__init__(self, None, title="Robo Viewer", menus=["File", "Sim", "Controls"], pycommand=True,height=4, showframe=False) controls=[["File", "Preferences", self.setPreferences], ["File", "Quit", lambda x:self.Destroy()], ["File", "Save State", self.saveState], ["File", "Load State", self.loadState], ["Sim", "Run 1 Frame", lambda x:self.runSim(1.0, 'frame')], ["Sim", "Run", lambda x:self.runSim('auto', 'sec')], ["Sim", "Clear recording", self.flushRec], ["Sim", "Reset", self.resetSim], ["Controls", "simple posture/control", self.simpCon], ["Controls", "Test random step", self.randTest], ["Controls", "Test custom step", self.stepTest], ["Controls", "Open Control File", self.getSteps], ["Controls", "Show Control File", self.showSteps], ] self.fillMenus(controls) self.preferenceInfo=[] self.preferences = {'delay':0, 'step':.005, 'frame rate':24, 'record':0, 'runtime':2.0} self.load_saved_prefs() self.mainSizer = wx.BoxSizer(wx.VERTICAL) self.main.SetSizer(self.mainSizer) self.main.SetAutoLayout(True) self.graph=RoboGraph(self.main) self.graph.report=self.report self.graph.keybindings['y']=lambda x:self.runSim(1.0, 'frame') self.mainSizer.Add(self.graph, 1, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) self.graph.Show(True) self.mainSizer.Fit(self.main) self.SetSize(wx.Size(600,700)) self.recdir=os.path.join(os.getcwd(), 'roboviewer') self.frame=0 if not os.path.isdir(self.recdir): os.mkdir(self.recdir) self.sim=sim from distutils.util import get_platform if 'linux' in get_platform(): #this is a black magic bug workaround. self.addmenucommand(["File", "Init", self.postInit]) else: self.postInit()
def __init__(self, master=None, **kwargs): BaseGui.__init__(self, master, title="Mien Update Manager", menus=["File"], pycommand=False, showframe=False) self.preferences=getPrefs() self.preferenceInfo=preferenceInfo fmen=self.menus['File'] id = wx.NewId() fmen.Insert(0, id, "Preferences") wx.EVT_MENU(self, id, self.setPreferences) id = wx.NewId() fmen.Append(id, 'Quit') wx.EVT_MENU(self, id, lambda x:self.Destroy()) self.mainSizer = wx.BoxSizer(wx.VERTICAL) self.mainSizer.Add(wx.StaticText(self.main, -1, "MIEN: %s" % getMienDir()), 1, wx.ALIGN_CENTRE|wx.ALL, 5) self.repostring=wx.StaticText(self.main, -1,"Repository: %s/%s" % (self.preferences['Repository'],self.preferences['Rev'] )) self.mainSizer.Add(self.repostring, 0, wx.ALIGN_CENTRE|wx.ALL, 5) self.blockpath=wx.StaticText(self.main, -1,"Installing blocks to : %s" % (self.preferences['BlockInstall'], )) self.mainSizer.Add(self.blockpath, 0, wx.ALIGN_CENTRE|wx.ALL, 5) box=wx.BoxSizer(wx.HORIZONTAL) self.mods=AWList(self.main, -1, style=wx.LC_REPORT | wx.SUNKEN_BORDER) self.mods.InsertColumn(0, "Package") self.mods.InsertColumn(1, "Local Version") self.mods.InsertColumn(2, "Repository Version") self.mods.SetColumnWidth(0, 200) box.Add(self.mods, 3,wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) bb=wx.BoxSizer(wx.VERTICAL) for com in [ ('Edit Config', self.setPreferences), ('Scan Repository', self.scan), ('Select All', self.sellect), ('Show Descriptions', self.info), ('Install/Update', self.update), ('Remove', self.kill)]: id = wx.NewId() btn=wx.Button(self.main, id, com[0]) wx.EVT_BUTTON(self.main, id, com[1]) bb.Add(btn, 1, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) box.Add(bb, 1, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) self.mainSizer.Add(box, 15, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) self.repo={'deps':None, 'scan':None} self.fillList() self.main.SetSizer(self.mainSizer) self.main.SetAutoLayout(True) self.mainSizer.Fit(self.main) self.baseSizer.Fit(self)
def __init__(self, dv, **kwargs): tty=kwargs.get('tty', None) title=kwargs.get('title',"Locus Viewer") BaseGui.__init__(self, dv, title=title, menus=["File", "Display"], pycommand=True,height=4, TTY=tty, showframe=False) controls=[["File","Select Elements To Show", self.select], ["Display", "Show All Functions", self.allFuncs], ["Display", "Select Data", self.select], ] self.dv = dv if dv: self.document = self.dv.document self.fillMenus(controls) self.mainSizer = wx.BoxSizer(wx.VERTICAL) self.main.SetSizer(self.mainSizer) self.main.SetAutoLayout(True) self.graph=Graph(self.main, -1) self.mainSizer.Add(self.graph, 1, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) self.SetSize(wx.Size(800,600)) self.stdFileMenu() self.data = []
def __init__(self, parent, ga): BaseGui.__init__(self, parent, id=-1, title="Optimizer Control", menus = ["Algorithm"], pycommand=True, height=10, memory=100000, TTY=False) guicommands=[["Algorithm","Test", self.test], ["Algorithm","Prep", self.prep], ["Algorithm","Load previous run", self.resume], ["Algorithm","Quick Resume", self.rerun], ["Algorithm","Run", self.run], ["Algorithm","Stop", self.stop], ["Algorithm","Snapshot", self.snapshot], ["Algorithm","Assign Best", self.assign], ["Algorithm","Quit", self.quit]] self.fillMenus(guicommands) self.ga=ga self.runthread=None self._oldreport=self.ga.report self.ga.report = self.threadReport sizer = wx.BoxSizer(wx.VERTICAL) self.tit = wx.StaticText(self.main, -1, self.ga.attrib('File')) sizer.Add(self.tit, 1, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) pars=ga.params() inf = "%i params, %.5g values" % (len(pars._pars), pars.size()) self.inf = wx.StaticText(self.main, -1,inf) sizer.Add(self.inf, 1, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) self.start = wx.StaticText(self.main, -1,'Not Running') sizer.Add(self.start, 1, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) self.stats = wx.StaticText(self.main, -1, '%i Units, best: %.3f' % (0, -1)) sizer.Add(self.stats, 1, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) self.main.SetSizer(sizer) self.main.SetAutoLayout(True) sizer.Fit(self.main) self.SetSize((400,400)) EVT_UPDATE_GUI(self, self.OnUpdate) EVT_REPORT(self, self.OnReport)
def __init__(self, master=None, **kwargs): if master: pc=False else: pc=True BaseGui.__init__(self, master, title="Cell Viewer", menus=["File", "Display", "Selection","Extensions", "Spatial"], pycommand=pc,height=4, showframe=False) controls=[ ["File", "Apply Filter to File", self.pruneFile], ["Display", "Select Plots", self.selPlots], ["Display", "Group Plots", self.groupPlots], ["Display", "Hide/Color Groups", self.groupOpts], ["Display", "Set View Toggle", self.setBlink], ["Display", "Change Background Color", self.setClearColor], ["Display", "Replot", self.addAll], ["Display", "Filter", self.setFilter], ['Selection',"Clear Selection", self.selectNone], ['Selection',"Show Selection", self.showSelection], ['Selection',"Export Point", self.exportPoint], ['Selection',"Import Point", self.importPoint], ['Selection',"Select Section", self.selectSec], ['Selection',"Select Radius", self.selectSphere], ['Selection',"Select Distal", self.selectDistal], ['Selection',"Select Proximal", self.selectProx], ['Selection',"Invert Selection", self.selectInverse], ['Selection',"Select Path", self.selectPath], ['Selection',"Center View on Point", self.centerOnPoint], ['Selection',"Select Distal", self.selectDistal], ['Selection',"Keep Select Colors", self.keepSelectionColors], ] self.preferenceInfo=[ {"Name":"Cell Plot Style", 'Type':'List', 'Value':['frustum', 'mixed', 'line']}, {"Name":"Sphere Plot Style", 'Type':'List', 'Value':['Spheres', 'Fixed Points', 'Scaled Points']}, {"Name":"Always Reload Extensions", "Type":"List", "Value":[True, False]}, {"Name":"Show Point Labels", "Type":"List", "Value":[False, True]}, {"Name":"Blink Mode", "Type":"List", "Value":['Hide', 'Highlight']}, {"Name":"Density Plot Mode", "Type":"List", "Value":["cart", "points"]}, {"Name":"Non-Selected Plots", 'Type':'List', 'Value':['Hidden', 'Faded']}] self.preferences = {"Cell Plot Style":'frustum', "Min Diameter":0.0, "Ruler Ticks":100.0, "Blink Mode":"Hide", "Highlight Color":(1.0, 1.0, 1.0), "Show Point Labels":False, "Sphere Plot Style":'Spheres', "Always Reload Extensions":False, "Density Plot Mode":"points", "Line Width":1, "Default Point Size":1, 'Non-Selected Plots':'Hidden'} self.xm=None self.document = None if master: self.xm = master controls.insert(0, ["Selection", "Import Selection", self.impSel]) controls.insert(0, ["Selection", "Export Selection", self.expSel]) self.document = self.xm.document controls.append(["File", "Close", lambda x: self.Destroy()]) self.fillMenus(controls) else: controls.append(['Display', 'Data Editor', self.launchDE]) self.fillMenus(controls) self.stdFileMenu() self.displayfilter=None self.mainSizer = wx.BoxSizer(wx.VERTICAL) self.main.SetSizer(self.mainSizer) self.main.SetAutoLayout(True) self.graph=CellGraph(self.main, self) self.graph.report=self.report self.graph.OnShiftClick=self.selectObj self.graph.OnShiftRight=self.selectNearest self.graph.SetCursor(wx.StockCursor(wx.CURSOR_CROSS)) self.mainSizer.Add(self.graph, 1, wx.GROW|wx.ALIGN_CENTRE|wx.ALL, 5) self.graph.Show(True) self.graph.SetDropTarget(self.dropLoader) self.mainSizer.Fit(self.main) self.SetSize(wx.Size(600,700)) for s in self.graph.global_options: lpn="graph - %s" % (s,) val=getattr(self.graph, s) self.preferences[lpn]=val self.loaddir="" self.savedir="" self.selected=[] self._foundLastPoint = [] self._foundSpatialPoint = [] self.extmod=cve.CVExtMod(self) self.extmod.makeMenus() self.load_saved_prefs() self.graph.rulerticks = self.preferences["Ruler Ticks"]