// zapstimu_DC.hoc, based on zapstim.hoc
/* The stimulus is generated by an instance of the Fzap_DC class 
(a point process that produces a sine wave of user-specified duration and
amplitude, that sweeps over a range of frequencies at a constant rate).
For each section that has the xtra mechanism, this waveform 
is used to drive is_xtra.
The transfer resistance rx_xtra takes care of the 
amplitude and sign of the local extracellular field.
*/

// default values
DEL = 2000  // ms
DUR = 4000  // ms
// AMP = 1  // nA
AMP = 40  // V/m


objref fz
fz = new Fzap_DC(0.5)
// setpointer fz.x, is_xtra(0.5)
// setpointer fz.x, is_xtra
setpointer fz.x, E_xtrau

proc setstim() {
  fz.del = $1
  fz.dur = $2
  fz.amp = $3
}

setstim(DEL, DUR, AMP)

print "Use setstim(DEL, DUR, AMP) to change latency (ms), duration (ms),"
print " and amplitude (V/m) of applied electrical field."
/*
xpanel("Applied Electrical Field", 0)
  xvalue("del (ms)", "DEL", 1, "setstim(DEL,DUR,F0,F1,AMP)", 0, 1)
  xvalue("dur (ms)", "DUR", 1, "setstim(DEL,DUR,F0,F1,AMP)", 0, 1)
  xvalue("start f (Hz)", "F0", 1, "setstim(DEL,DUR,F0,F1,AMP)", 0, 1)
  xvalue("end f (Hz)", "F1", 1, "setstim(DEL,DUR,F0,F1,AMP)", 0, 1)
  xvalue("amp (V/m)", "AMP", 1, "setstim(DEL,DUR,F0,F1,AMP)", 0, 1)
xpanel(73,497)
*/