Ejemplo n.º 1
0
 def build(self):
     self.box = h.HBox()
     self.box.intercept(1)
     self.box.ref(self)
     h.xpanel("")
     h.xbutton("Button 1", (self.bact, 1))
     h.xbutton("Button 2", (self.bact, (2, )))
     h.xbutton("Button 3", self.bact_noarg)
     h.xbutton("Button 4", (self.bact_2arg, ("hello", 4)))
     for i in range(3):
         h.xradiobutton("Radio " + str(i), (self.bact, i))
     h.xmenu("Menu")
     for i in range(3):
         h.xbutton("Item " + str(i), (self.bact, i))
     for i in range(3):
         h.xradiobutton("Radio " + str(i), (self.bact, i))
     h.xcheckbox('checkbox', (self, 'cbstate'), self.cb)
     h.xstatebutton('state', (self, 'sbut'), self.st)
     h.xmenu()
     h.xpanel()
     self.g = h.Graph()
     self.g.menu_tool('graph menu tool 1', self.gcb, (self.gsel, 1))
     h.xpanel("")
     h.xvalue("x", (self, "x"), 1, self.chgx)
     h.xcheckbox('checkbox', (self, 'cbstate'), self.cb)
     h.xstatebutton('state', (self, 'sbut'), self.st)
     h.xlabel('fixed label')
     h.xvarlabel((self, 'ss'))
     h.xslider((self, 'x'), 0, 20, self.slide)
     self.g.menu_tool('graph menu tool 2', self.gcb, (self.gsel, 2))
     h.xpanel()
     self.box.intercept(0)
Ejemplo n.º 2
0
def bld(x, y):
    global g, tt, ttstr, grp, sgrp, pras
    tt = 0.0
    ttstr = h.ref('tt=0.000000000')
    v = h.VBox()
    v.intercept(1)
    g = h.Graph()
    g.size(0, x, 0, y)
    h.xpanel("", 1)
    h.xvarlabel(ttstr)
    h.xvalue("group", (this_module, "grp"), 1, ttcallback)
    h.xslider((this_module, "sgrp"), 0, 100, ttscallback)
    h.xpanel()
    v.intercept(0)
    v.map("wave front", 100, 100, 700, 500)
    return v
Ejemplo n.º 3
0
    print(thing2)
    return


is_checked2 = h.ref(0)
my_str = h.ref('yay!')

h("""
proc onpress() {
    print "The HOC onpress function was called"
}
""")

h.xpanel("Hello world")
h.xlabel("Here is some text")
h.xvalue("h.t", "t")
h.xcheckbox("a checkbox", is_checked_ref, "onpress()")
h.xcheckbox("a checkbox", (is_checked, 'checked'), onpress)
h.xstatebutton("Toggle", is_checked2, onpress2)
hb = h.HBox()
hb.intercept(True)
h.xbutton("finitialize", "finitialize(-65)")
h.xbutton("run", "run()")
h.xbutton("test", (buttontest, ("hallo", "goodbye")))
hb.intercept(False)
hb.map()
h.xvarlabel(my_str)
#g = h.Graph()
#g.addvar("v", "seg.v")
h.xpanel()
Ejemplo n.º 4
0
 def xvalue (self,name,var,obj=py,runner=pr):
   h.xpanel("")
   h.xvalue(name,(obj, var),0,runner)
   h.xpanel()
Ejemplo n.º 5
0
 def paramPanel(self):
     self.box = h.VBox()
     self.box.intercept(1)
     h.xpanel('')
     h.xlabel('Likelihood numerical parameters')
     h.xlabel('    Measurement noise')
     c = self.Eve.Obs.C
     for o in c:
         h.xvalue('sigma: ' + o.hpt.s(), (o, 'sigma'), 1)
     h.xlabel('    Process noise')
     h.xvalue('Injection interval', (self, 'inj_invl'), 1,
              self.inj_invl_changed)
     s = h.Vector()
     cvodewrap.states(s)
     sref = h.ref('')
     for i in range(len(s)):
         cvodewrap.statename(i, sref, 1)
         h.xvalue('Diffusion Coeff[%d,%d]: ' % (i, i) + sref[0],
                  (self.processNoise[i], 'x'), 1, (self.fillPB, i))
     h.xcheckbox('Fox & Lu Diffusion (for Hodgkin-Huxley)?', (self, 'hhB'),
                 self.hhBButton)
     h.xvalue('  Fox & Lu: Number Na Channels', (self, 'nNa'), 1,
              self.hhBButton)
     h.xvalue('  Fox & Lu: Number K Channels', (self, 'nK'), 1,
              self.hhBButton)
     h.xlabel('    Initial Uncertainty')
     for i in range(len(s)):
         print i
         cvodewrap.statename(i, sref, 1)
         h.xvalue('Initial Stand Dev[%d]: ' % i + sref[0],
                  (self.Sdiag[i], 'x'), 1, (self.fillS, i))
     h.xbutton('Show state funnels', self.show_state_funnels)
     h.xpanel()
     self.box.intercept(0)
     self.box.map('Likelihood parameters')
Ejemplo n.º 6
0
from neuron import h

h('foo = 2')
h.variable_domain('foo', 1, 5)
h.units('foo', 'cm')

h.xpanel("test")
h.xvalue("foo", "foo", 1)
h.xpvalue("foo", h._ref_foo, 1)
h.xpanel()