load_file("nrngui.hoc")
cvode_active(1) 
celsius=34

objref stim, g, testcell1,  testcell2, testcell3, testcell4, testcell5, testcell6, testcell7, testcell8
objref testcell
tstop=1200

flag1=0
flag2=0
flag3=0
flag4=0
flag5=0
flag6=0
flag7=0
flag8=0

xpanel("",0)
xcheckbox(" int cNAC 0.4 nA ",&flag1, "foo()")
xcheckbox(" int cNAC 0.8 nA ",&flag2, "foo()")
xcheckbox(" int cAC 0.4 nA ",&flag3, "foo()")
xcheckbox(" int cAC 0.6 nA ",&flag4, "foo()")
xcheckbox(" pyr cAC 0.4 nA ",&flag5, "foo()")
xcheckbox(" pyr cAC 0.8 nA ",&flag6, "foo()")
xcheckbox(" int bAC 0.6 nA ",&flag7, "foo()")
xcheckbox(" int bAC 1.0 nA ",&flag8, "foo()")
xpanel()

load_file("cell_seed1_0-cnac-04.hoc") 
load_file("cell_seed2_0-cnac-08.hoc")
load_file("cell_seed7_0-cac-04.hoc")
load_file("cell_seed4_0-cac-06.hoc")
load_file("cell_seed4_0-pyr-04.hoc")
load_file("cell_seed3_0-pyr-08.hoc")
load_file("cell_seed2_0-bac-06.hoc")
load_file("cell_seed1_0-bac-10.hoc") 

load_file("fig4A-model.ses")

proc foo() {
	doNotify()
	objref testcell1, testcell2, testcell3, testcell4, testcell5, testcell6, testcell7, testcell8
	if (flag1==1) {
		print "waiting: loading morphology"
		testcell1 = new cNACnoljp1() 
		access testcell1.soma
		stim = new IClamp(0.5)
		stim.del=531
		stim.dur=400
		stim.amp=0.4
		run()
		flag1=0
	}

	if (flag2==1) {
		print "waiting: loading morphology"
		testcell2 = new cNACnoljp2() 
		access testcell2.soma
		stim = new IClamp(0.5)
		stim.del=531
		stim.dur=400
		stim.amp=0.8
		run()
		flag2=0
	}

	if (flag3==1) {
		print "waiting: loading morphology"
		testcell3 = new INT_cAC_noljp3() 
		access testcell3.soma
		stim = new IClamp(0.5)
		stim.del=531
		stim.dur=400
		stim.amp=0.4
		run()
		flag3=0
	}
	
	if (flag4==1) {
		print "waiting: loading morphology"
		testcell4 = new INT_cAC_noljp4() 
		access testcell4.soma
		stim = new IClamp(0.5)
		stim.del=531
		stim.dur=400
		stim.amp=0.6
		run()
		flag4=0
	}
	
	if (flag5==1) {
		print "waiting: loading morphology"
		testcell5 = new CA1_PC_cAC_sig5() 
		access testcell5.soma
		stim = new IClamp(0.5)
		stim.del=531
		stim.dur=400
		stim.amp=0.4
		run()
		flag5=0
	}
	
	if (flag6==1) {
		print "waiting: loading morphology"
		testcell6 = new CA1_PC_cAC_sig6() 
		access testcell6.soma
		stim = new IClamp(0.5)
		stim.del=531
		stim.dur=400
		stim.amp=0.8
		run()
		flag6=0
	}
	
	if (flag7==1) {
		print "waiting: loading morphology"
		testcell7 = new bACnoljp7() 
		access testcell7.soma
		stim = new IClamp(0.5)
		stim.del=531
		stim.dur=400
		stim.amp=0.6
		run()
		flag7=0
	}

	if (flag8==1) {
		print "waiting: loading morphology"
		testcell8 = new bACnoljp8() 
		access testcell8.soma
		stim = new IClamp(0.5)
		stim.del=531
		stim.dur=400
		stim.amp=1.0
		run()
		flag8=0
	}
}