-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresetmode.hoc
80 lines (53 loc) · 1.77 KB
/
resetmode.hoc
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
// Salto
// (c) Charles CH Cohen, 2014-present
// this software is released to the public under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0
// International license (CC BY-NC-ND 4.0, in English).
// for any questions, please email [email protected]
// ------------------------------Directories---------------------------------------
strdef root
root = getcwd()
strdef lib, ses
strdef cwd
sprint(lib, "%s%s", root, "lib/")
sprint(ses, "%s%s", root, "ses/")
// --------------------------------------------------------------------------------
// -------------------------------Libraries----------------------------------------
load_file("stdgui.hoc")
chdir(lib)
load_file("startlib.hoc")
loadfile(ses, "morph.hoc")
idata = getvar(ses, "idata.dat")
load_file("setstim.hoc")
// --------------------------------------------------------------------------------
print "\nReset mode_ to Active or Passive"
mode_ = getvar(ses, "mode.dat")
strdef modeqstr, sesqstr
modeqstr = "\nEnter 0 for changing to Passive, 1 for Active [0/1]"
if (mode_ == 0) {
print "\nCurrent mode_ = Passive (0)"
ans = xred(modeqstr, 1, 0, 1)
if (ans == 0) {
print "mode_ unchanged"
} else if (ans == 1) {
print "\nChanging mode_ to Active...\n"
mode_ = 1
writebit(ses, "mode.dat", mode_)
print "mode_ changed to Active"
}
} else if (mode_ == 1) {
print "\nCurrent mode_ = Active (1)"
ans = xred(modeqstr, 0, 0, 1)
if (ans == 1) {
print "mode_ unchanged"
} else if (ans == 0) {
print "\nChanging mode_ to Passive...\n"
mode_ = 0
writebit(ses, "mode.dat", mode_)
print "mode_ changed to Passive"
}
}
print "\nPlease confirm starting IClamp:\n"
setfilestr(mode_, idata)
iampvec = getvec(ses, iampvecfilestr, iampvec)
changeiclamp()
print "\nYou may now restart the model"