Example #1
0
def process_events() :
  _lock.acquire()
  try:
    h.doNotify()
  except:
    print ("Exception in gui thread")
  _lock.release()
Example #2
0
File: gui.py Project: nrnhines/nrn
def process_events() :
  _lock.acquire()
  try:
    h.doNotify()
  except:
    print ("Exception in gui thread")
  _lock.release()
Example #3
0
def mkswc(swc_contents):
  f = open("temp.tmp", "w")
  f.write(swc_contents)
  f.close()
  swc = h.Import3d_SWC_read()
  swc.input("temp.tmp")
  ig = h.Import3d_GUI(swc)
  ig.box.unmap()
  h.doNotify()
  ig.box.map("Import3d", 650, 200, -1, -1)
  h.doNotify()
  ig.instantiate(None)

  print (swc_contents)
  h.topology()
  print (secinfo())
  print ("\n\n\n")
  return ig
Example #4
0
def process_events() :
  #h.doEvents()
  h.doNotify()
Example #5
0
def process_events():
    try:
        h.doNotify()
    except:
        print("Exception in gui thread")
Example #6
0
def process_events():
    #h.doEvents()
    h.doNotify()
Example #7
0
    with open(filename) as f:
        for line in f:
            line = line.strip()
            if line == '0 setlinewidth':
                line = '5 setlinewidth'
            lines.append(line)
    # now rewrite the file with the thicker linewidth
    with open(filename, 'w') as f:
        for line in lines:
            f.write(line + '\n')
    # now convert it to a png
    png_filename = 'images/image%04d.png' % image_count
    image_count += 1
    os.system('convert %s -crop 558x660+0+0 %s' % (filename, png_filename))

# stop time
stop_time = 100

advance_count = 0
while h.t < stop_time:
    h.fadvance()
    h.doNotify()
    if advance_count % save_every == 0:
        savefig()
    advance_count += 1
    print h.t

# convert the pictures to a video
os.system('rm -f movie.mp4')
os.system('avconv -qscale 5 -r 20 -b 9600 -i images/image%04d.png movie.mp4')
Example #8
0
def f():
    #h.doEvents()
    h.doNotify()