| 16 | | |
|---|
| 17 | | h('obfunc new_IClamp() { return new IClamp($1) }') |
|---|
| 18 | | h('obfunc newlist() { return new List() }') |
|---|
| 19 | | h('obfunc newvec() { return new Vector($1) }') |
|---|
| 20 | | h('obfunc new_NetConO() { return new NetCon($o1, $o2, $3, $4, $5) }') |
|---|
| 21 | | h('obfunc new_NetConP() { return new NetCon("&v($1)", $2, $3, $4, $5) }') |
|---|
| 22 | | h('obfunc new_File() { return new File() }') |
|---|
| | 118 | Random = new_hoc_class('Random') |
|---|
| | 119 | CVode = new_hoc_class('CVode') |
|---|
| | 120 | |
|---|
| | 121 | h('obfunc new_IClamp() { return new IClamp($1) }') |
|---|
| | 122 | h('obfunc newlist() { return new List() }') |
|---|
| | 123 | h('obfunc newvec() { return new Vector($1) }') |
|---|
| | 124 | h('obfunc new_NetConO() { return new NetCon($o1, $o2, $3, $4, $5) }') |
|---|
| | 125 | h('obfunc new_NetConP() { return new NetCon(&v($1), $o2, $3, $4, $5) }') |
|---|
| | 126 | h('objref nil') |
|---|
| | 127 | h('obfunc new_NetConO_nil() { return new NetCon($o1, nil) }') |
|---|
| | 128 | h('obfunc new_NetConP_nil() { return new NetCon(&v($1), nil) }') |
|---|
| | 129 | h('obfunc new_File() { return new File() }') |
|---|
| 214 | | if section: |
|---|
| 215 | | section.push() |
|---|
| 216 | | self.hoc_obj = h.new_NetConP(position, target.hoc_obj, threshold, delay, weight) |
|---|
| 217 | | h.pop_section() |
|---|
| 218 | | else: |
|---|
| 219 | | self.hoc_obj = h.new_NetConO(source.hoc_obj, target.hoc_obj, threshold, delay, weight) |
|---|
| | 227 | # What about generalising to obtain the NetCon object via pc.gid_connect(), if source is |
|---|
| | 228 | # an integer? |
|---|
| | 229 | if hasattr(target, 'hoc_obj'): |
|---|
| | 230 | target = target.hoc_obj |
|---|
| | 231 | if target is None: |
|---|
| | 232 | if section: |
|---|
| | 233 | section.push() |
|---|
| | 234 | self.hoc_obj = h.new_NetConP_nil(position) |
|---|
| | 235 | h.pop_section() |
|---|
| | 236 | else: |
|---|
| | 237 | self.hoc_obj = h.new_NetConO_nil(source.hoc_obj) |
|---|
| | 238 | else: |
|---|
| | 239 | if section: |
|---|
| | 240 | section.push() |
|---|
| | 241 | self.hoc_obj = h.new_NetConP(position, target, threshold, delay, weight) |
|---|
| | 242 | h.pop_section() |
|---|
| | 243 | else: |
|---|
| | 244 | self.hoc_obj = h.new_NetConO(source.hoc_obj, target, threshold, delay, weight) |
|---|