begintemplate ScreenUpdateHandler public begin, flush, view_count, add, remove external flush_list objref this strdef stmt proc init() { stmt = $s1 } proc add() { if (flush_list.index(this) == -1) { flush_list.append(this) } } proc remove() { local i i = flush_list.index(this) if (i > -1) { flush_list.remove(i) } } proc begin() { //printf("%s.begin %g\n", this, t) } proc flush() { //printf("%s.flush %g\n", this, t) execute(stmt) } func view_count() { //printf("%s.view_count %g\n", this, t) return 1 } endtemplate ScreenUpdateHandler objref gl, gls[nmitral+ngranule], tvt, rt, tvi, tvs tvt= new Vector(0) tvi= new Vector(0) tvs= new Vector(0) proc gly() { gl.erase() gl.path() gl.m(t,0) gl.l(t,nmitral) gl.s(8,3) } proc glys() {local s, x s=$1 if (s= pattern_idvec_.size) { return } tt = pattern_tvec_.x[idx] for m=0, nmitral + ngranule -1 { gls[m].erase() } // light up if a spike between tt and t for i=idx, pattern_idvec_.size-1 { if (pattern_tvec_.x[i] > t) { break } m = pattern_idvec_.x[i] if (m < nmitral + ngranule) { glys(m) } } idx = i+1 sc_.g.flush() }