/usr/share/nrn/lib/hoc/pointman.hoc is in neuron 7.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | /*
?0 UserClasses PointProcessManager
Select location and type of Point Process.
Each instance manages a single point process.
Default is a current injection electrode inserted in the middle of the
current section that supplies a short current pulse of sufficient amplitude
to elicit an action potential in a 100 um2 hh patch.
usage: section p = new PointProcessManager([xplacement, yplacement])
p.pp is the point process currently installed in the cell.
Note that when one point process is replaced by another
the parameters are saved in a MechanismStandard. When
the point process is re-installed, those parameters are restored.
If the panel is saved in a session, the MechanismStandard's are
saved as well.
?1 SelectPointProcess
?0 User HocCode PointProcessManager
*/
help ?0
begintemplate PointProcessManager
public dist, v1, pp, move, maction
external hoc_sf_
objectvar pp
objref mt, sec, ms[1], sf, v1, this
objref shape, d1
strdef mname, tempstr, ppname, sloc
double mstate[1]
proc init() {
i = 0
ppindex = -1
sec = new SectionRef()
xloc = .5
build()
maction(-1)
make_sloc()
if (numarg() == 1) if ($1 == 0) return
v1.map("PointProcessManager")
}
proc make_sloc() {
sec.sec sectionname(tempstr)
sprint(sloc, "at: %s(%g)", tempstr, xloc)
}
func dist() {local x // return arc length between sloc and rootsection(0)
sec.root distance(0, 0)
sec.sec x = distance(1, xloc)
return x
}
proc build() { local i
v1 = new VBox()
v1.priority(990)
v1.ref(this)
v1.full_request(1)
v1.save("save()")
v1.intercept(1)
sf = new StringFunctions()
xpanel("PointProcessManager")
build_menu()
xmenu("Show")
xradiobutton("Shape", "d1.flip_to(0)")
// xbutton("Section Browser", "show_browser()")
xradiobutton("Parameters", "if (object_id(pp)) d1.flip_to(1)")
xmenu()
xvarlabel(ppname)
xvarlabel(sloc)
xpanel()
d1 = new Deck()
d1.intercept(1)
show_shape()
d1.intercept(0)
d1.map()
v1.intercept(0)
d1.flip_to(0)
}
proc build_menu() {
mt = new MechanismType(1)
objectvar ms[mt.count()]
xmenu("SelectPointProcess")
xradiobutton("none", "maction(-1)")
for i=0,mt.count()-1 {
mt.select(i)
mt.selected(mname)
sprint(tempstr, "maction(%d)", i)
xradiobutton(mname, tempstr)
}
xmenu()
}
proc show_shape() {
//print "show_shape\n"
// v2.clear()
// v2.intercept(1)
shape = new Shape()
shape.action("move()")
if (object_id(pp)) {
shape.point_mark(pp, 3)
}
// v2.intercept(0)
hoc_ac_ = xloc
sec.sec move()
}
proc move() {xloc = hoc_ac_
if(object_id(shape)) {
shape.select()
}
sec = new SectionRef()
if (object_id(pp)) {
if (hoc_sf_.is_artificial(pp) == 0) {
pp.loc(xloc)
}
}
make_sloc()
// shape.mark(0, xloc, 2)
}
proc maction() { local i
i = $1
if (ppindex != -1) { // save parameters and remove old one
ms[ppindex].in(pp)
objectvar pp
if (object_id(shape)) {
shape.point_mark_remove(pp)
}
d1.remove_last()
}
if (i != -1) { // make a new one and put in the previous params
mt.select(i)
mt.selected(mname)
if (object_id(ms[i]) == 0) {
ms[i] = new MechanismStandard(mname)
}
sprint(tempstr, "pp = new %s(%g)", mname, xloc)
sec.sec execute(tempstr, this)
ms[i].out(pp)
sprint(ppname, "%s", pp)
d1.intercept(1)
nrnpointmenu(pp, 0)
d1.intercept(0)
d1.flip_to(1)
if (object_id(shape)) {
shape.point_mark(pp, 3)
}
}else{
sprint(ppname, "None")
}
ppindex = i
doNotify()
}
proc save() { local i
v1.save("load_file(\"pointman.hoc\")\n}\n{")
sec.sec sectionname(tempstr)
sprint(tempstr, "%s ocbox_ = new PointProcessManager(0)", tempstr)
v1.save(tempstr)
v1.save("}\n{object_push(ocbox_)}\n{")
for i=0, mt.count()-1 {
if (object_id(ms[i])) {
if (ppindex == i) {
ms[i].in(pp)
}
mt.select(i)
mt.selected(tempstr)
sprint(tempstr, "mt.select(\"%s\") i = mt.selected()", tempstr)
v1.save(tempstr)
sprint(tempstr, "ms[i]")
ms[i].save(tempstr)
}
}
if (ppindex != -1) {
mt.select(ppindex)
mt.selected(tempstr)
sprint(tempstr, "mt.select(\"%s\") i = mt.selected() maction(i)", tempstr)
v1.save(tempstr)
}
sprint(tempstr, "hoc_ac_ = %g", xloc)
v1.save(tempstr)
v1.save("sec.sec move() d1.flip_to(0)")
v1.save("}\n{object_pop() doNotify()}\n{")
v1.save("ocbox_ = ocbox_.v1")
}
endtemplate PointProcessManager
objectvar tempobj
proc makeppm() {
if(!execute1("v", 0)) {
continue_dialog("No accessed section: Can't start a PointProcessManager")
return
}
tempobj = new PointProcessManager()
objectvar tempobj
}
|