/usr/share/nrn/lib/hoc/showmech.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 | /*
?0 UserClasses ShowMechanism
Show where a membrane mechanism exists on the cell and allow setting of
parameters as constants whereever the mechanism exists.
The currently displayed mechanism is named in the label at the top of the
lower portion of the panel.
The top part uses a Shape scene to color red all the sections that have
insert'ed the mechanism. Colors black all the sections where the
mechanism does not exist.
When a valueeditor showing a parmameter is changed in the lower portion
the value is used to set the corresponding range variable to a constant
forall sections that contain the mechanism.
? MechType
Menu for selecting the currently displayed mechanism.
?0 User HocCode ShowMechanism
*/
help ?0
begintemplate ShowMechanism
public v1
objectvar deck, v1, mt, deck, mlist, mm, shape, sl
strdef s
proc init() {
sl = $o1
item=1
build()
if (numarg(2)) {
if ($2 == 1) {
v1.map("ShowMechanism")
}
}
}
proc build() {
mt = new MechanismType(0)
mt.action("change_mech()")
deck = new Deck()
mlist = new List()
build_deck()
build_box()
mt.select(item)
hoc_ac_=item
change_mech()
}
proc build_deck() {local i
deck.intercept(1)
for i=0, mt.count() - 1 {
mt.select(i)
mt.selected(s)
mm = new MechanismStandard(s)
mm.action("change_prop()")
mlist.append(mm)
forsec sl if (ismembrane(s)) mm.in() // last one is the default
mm.panel()
}
deck.intercept(0)
}
proc build_box() {
v1 = new VBox()
v1.save("")
v1.intercept(1)
shape = new Shape()
xpanel("ShowMechanism", 1)
mt.menu()
// xbutton("Help", "help ShowMechanism UserClasses")
xpanel()
deck.map("")
v1.intercept(0)
}
proc change_mech() {
item = hoc_ac_
mt.select(item)
item = mt.selected(s)
deck.flip_to(item)
shape.color_all(1)
forsec sl if (ismembrane(s)) {
shape.color(2)
}
}
proc change_prop() {
forsec sl if (ismembrane(s)) {
mlist.object(item).out()
}
}
endtemplate ShowMechanism
objectvar showmech, showmechseclist
proc makeshowmechanism() {
if(!execute1("v", 0)) {
continue_dialog("No accessed section: Can't start a ShowMechanism")
return
}
showmechseclist = new SectionList()
forall showmechseclist.append()
showmech = new ShowMechanism(showmechseclist, 1)
}
|