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)
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')
def constraintsPanel(self): self.box = h.HBox() self.box.intercept(1) self.box.ref(self) s = h.Vector() cvodewrap.states(s) nstates = len(s) sref = h.ref('') h.xpanel("") h.xlabel('0<=') for i in range(nstates): h.xcheckbox('', (self.geq0[i], 'x'), self.constraintsButton) h.xpanel() h.xpanel("") h.xlabel('>=1') for i in range(nstates): cvodewrap.statename(i, sref, 1) h.xcheckbox(sref[0], (self.leq1[i], 'x'), self.constraintsButton) h.xpanel() for j in range(self.nsums): h.xpanel("") h.xlabel("S%d" % j) for i in range(nstates): h.xcheckbox('', (self.sumto1[j][i], 'x'), self.constraintsButton) h.xpanel() h.xpanel("") h.xbutton("Add Sum-to-1", self.constraintsButton) h.xbutton("Remove Empty", self.constraintsButton) h.xbutton("Close", self.constraintsButton) h.xlabel('QP Solver:') h.xstatebutton('cvxopt', (self, 'cvxopt_sel'), self.constraintsButton) h.xstatebutton('custom', (self, 'custom_sel'), self.constraintsButton) h.xpanel() self.box.intercept(0) self.box.map("Constraints")
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() h.finitialize(-65)
def build(self): self.box = h.HBox() self.box.intercept(1) self.box.ref(self) h.xpanel("") h.xlabel('0<=') h.xcheckbox('', (self, 'Vg'), self.button) h.xcheckbox('', (self, 'mg'), self.button) h.xcheckbox('', (self, 'ng'), self.button) h.xcheckbox('', (self, 'hg'), self.button) h.xcheckbox('', (self, 'Cag'), self.button) h.xcheckbox('', (self, 'Og'), self.button) h.xcheckbox('', (self, 'C1g'), self.button) h.xcheckbox('', (self, 'C2g'), self.button) h.xpanel() h.xpanel("") h.xlabel('<=1') h.xcheckbox('V', (self, 'Vl'), self.button) h.xcheckbox('m', (self, 'ml'), self.button) h.xcheckbox('n', (self, 'nl'), self.button) h.xcheckbox('h', (self, 'hl'), self.button) h.xcheckbox('[Ca2+]', (self, 'Cal'), self.button) h.xcheckbox('O', (self, 'Ol'), self.button) h.xcheckbox('C1', (self, 'C1l'), self.button) h.xcheckbox('C2', (self, 'C2l'), self.button) h.xpanel() h.xpanel("") h.xlabel('S0') h.xcheckbox('', (self, 'Vs0'), self.button) h.xcheckbox('', (self, 'ms0'), self.button) h.xcheckbox('', (self, 'ns0'), self.button) h.xcheckbox('', (self, 'hs0'), self.button) h.xcheckbox('', (self, 'Cas0'), self.button) h.xcheckbox('', (self, 'Os0'), self.button) h.xcheckbox('', (self, 'C1s0'), self.button) h.xcheckbox('', (self, 'C2s0'), self.button) h.xpanel() h.xpanel("") h.xlabel('S1') h.xcheckbox('V', (self, 'Vs1'), self.button) h.xcheckbox('m', (self, 'ms1'), self.button) h.xcheckbox('n', (self, 'ns1'), self.button) h.xcheckbox('h', (self, 'hs1'), self.button) h.xcheckbox('[Ca2+]', (self, 'Cas1'), self.button) h.xcheckbox('O', (self, 'Os1'), self.button) h.xcheckbox('C1', (self, 'C1s1'), self.button) h.xcheckbox('C2', (self, 'C2s1'), self.button) h.xpanel() h.xpanel("") h.xbutton("Add S2", self.button) h.xbutton("Remove Empty", self.button) h.xbutton("Close", self.button) h.xlabel('QP Solver:') h.xstatebutton('cvxopt', (self, 'cvxopt_sel'), self.button) h.xstatebutton('custom', (self, 'custom_sel'), self.button) h.xpanel() self.box.intercept(0)
def panel(self): h.xpanel("Variable or Fixed step") h.xcheckbox('use_fixed_step', (self, 'use_fixed_step')) h.xpanel()