2 #include <../../nrnconf.h>
53 static void point_menu(
Object*,
int);
90 char*
strstr(
const char*,
const char*);
117 sprintf(
buf,
"nrnglobalmechmenu(\"%s\")", sp->name);
130 if (sp->type == VAR && sp->subtype ==
USERDOUBLE &&
142 s[strlen(
suffix)] ==
'\0') {
147 for (
i = 0;
i < a->
sub[0];
i++) {
182 btype =
"(Parameters)";
188 btype =
"(Assigned)";
221 if (
p->dparam[4].val != 1) {
223 &
sec->prop->dparam[4].val,
257 mech_menu(p1, x,
type, path,
ms);
263 static bool nrn_is_const(
const char* path,
const char*
name) {
266 "%s for (hoc_ac_) if (hoc_ac_ > 0 && hoc_ac_ < 1) if (%s(hoc_ac_) != %s(.5)) {hoc_ac_ "
284 if (
ms && !
ms->is_selected(p1->
type)) {
301 for (
i = 0;
i < a->
sub[0];
i++) {
306 if (nrn_is_const(path,
n)) {
320 if (nrn_is_const(path,
vsym->
name)) {
374 bool locmenu =
false;
381 bool are_globals =
false;
425 hoc_execerror(ob->ctemplate->sym->name,
"not a point process");
429 make_label = int(
chkarg(2, -1., 1.));
431 point_menu(ob, make_label);
438 static void point_menu(
Object* ob,
int make_label) {
454 if (make_label == 1) {
456 }
else if (make_label == 0) {
458 }
else if (make_label == -1) {
483 #if defined(MikeNeubig)
546 double x =
chkarg(1, 0, 1);
560 hoc_execerror(
"Object arg must be MechanismStandard or a Point Process, not",
574 double x =
chkarg(1, 0, 1);
589 "Object arg must be MechanismStandard or a Point Process or a nrn.Segment, not",
623 n =
ms->name((
int)
chkarg(2, 0,
ms->count() - 1), rval);
698 if (
type < vartype) {
700 }
else if (vartype == 0 ||
type == vartype) {
755 pyactval = (*nrnpy_callable_with_args)(
pyact_, 3);
773 for (
j = 1;
j < size; ++
j) {
780 pyactval = (*nrnpy_callable_with_args)(
pyact_, 3);
856 for (
int i = 0;
i <
sec->nnode; ++
i) {
877 std::ostream&
o = *po;
880 o <<
buf << std::endl;
884 for (
i = 0;
i <
cnt; ++
i) {
887 o <<
buf << std::endl;
895 hoc_execerror(s,
" MechanismStandard method not implemented for GLOBAL type");
1007 return double(mt->
count());
1065 static const char*
nullstr =
"";
1077 static const char*
nullstr =
"";
1298 oc.
run(
"{xmenu(\"MechType\")}\n");
1311 "xbutton(\"%s\", \"hoc_ac_=%d %s\")\n",
1319 oc.
run(
"{xmenu()}\n");
const char * secname(Section *sec)
void nrn_pushsec(Section *sec)
double nrn_arc_position(Section *sec, Node *node)
Prop * nrn_mechanism(int type, Node *nd)
Section * chk_access(void)
const char * sec_and_position(Section *sec, Node *nd)
char * hoc_section_pathname(Section *sec)
Node * node_exact(Section *sec, double x)
void in(Section *, double x=-1.)
virtual ~MechanismStandard()
void out(Section *, double x=-1.)
MechanismStandard(const char *, int vartype)
void save(const char *, std::ostream *)
void action(const char *, Object *pyact)
void set(const char *, double val, int arrayindex=0)
double get(const char *, int arrayindex=0)
void panel(const char *label=NULL)
void point_process(Object **)
Point_process * pp_begin()
bool is_netcon_target(int)
MechanismType(bool point_process)
Point_process * pp_next()
void select(const char *)
void action(const char *, Object *pyact)
Symbol * find(const char *rangevar)
int var_type(Symbol *) const
double * prop_pval(const Symbol *, int arrayindex=0) const
static bool assign(Prop *src, Prop *dest, int vartype=0)
const char * name() const
int run(int argc, const char **argv)
static ostream * save_stream
virtual void unref() const
static void make_section_browser()
const char * string() const
Symbol * hoc_table_lookup(const char *, Symlist *)
static char * stmp[HOC_TEMP_CHARPTR_SIZE]
sprintf(buf, " if (secondorder) {\n" " int _i;\n" " for (_i = 0; _i < %d; ++_i) {\n" " _p[_slist%d[_i]] += dt*_p[_dlist%d[_i]];\n" " }}\n", numeqn, listnum, listnum)
double chkarg(int, double low, double high)
int nrn_vartype(Symbol *sym)
void hoc_execerror(const char *, const char *)
int hoc_is_object_arg(int narg)
HocSymExtension * hoc_var_extra(const char *name)
size_t hoc_total_array_data(Symbol *s, Objectdata *obd)
int hoc_is_str_arg(int narg)
void hoc_assign_str(char **cpp, const char *buf)
double * hoc_val_pointer(const char *s)
int is_obj_type(Object *obj, const char *type_name)
int hoc_is_double_arg(int narg)
void hoc_retpushx(double x)
void hoc_obj_ref(Object *obj)
char * hoc_object_name(Object *ob)
void hoc_dec_refcount(Object **pobj)
Symbol * hoc_lookup(const char *)
void hoc_obj_unref(Object *obj)
void hoc_push_object(Object *d)
char ** hoc_pgargstr(int narg)
#define TRY_GUI_REDIRECT_DOUBLE(name, obj)
#define TRY_GUI_REDIRECT_METHOD_ACTUAL_DOUBLE(name, sym, v)
Object ** hoc_objgetarg(int)
static const char * nullstr
Object ** hoc_temp_objptr(Object *)
#define ITERATE(itm, lst)
static Node * node(Object *)
int is_point_process(Object *)
void nrn_seg_or_x_arg(int iarg, Section **psec, double *px)
int const size_t const size_t n
void class2oc(const char *, void *(*cons)(Object *), void(*destruct)(void *), Member_func *, int(*checkpoint)(void **), Member_ret_obj_func *, Member_ret_str_func *)
static philox4x32_key_t k
void hoc_ivvaluerun_ex(CChar *name, CChar *var, double *pvar, Object *pyvar, CChar *action, Object *pyact, bool deflt=false, bool canrun=false, bool usepointer=false, HocSymExtension *extra=NULL)
void hoc_ivvalue(CChar *name, CChar *variable, bool deflt=false, Object *pyvar=0)
void hoc_ivbutton(CChar *name, CChar *action, Object *pyact=0)
void hoc_ivmenu(CChar *, bool add2menubar=false)
void hoc_ivpanelmap(int scroll=-1)
void hoc_ivpvalue(CChar *name, double *, bool deflt=false, HocSymExtension *extra=NULL)
void hoc_ivvaluerun(CChar *name, CChar *variable, CChar *action, bool deflt=false, bool canrun=false, bool usepointer=false, Object *pyvar=0, Object *pyact=0)
void hoc_ivpanel(CChar *, bool h=false)
void hoc_ivlabel(CChar *)
void hoc_ivpvaluerun(CChar *name, double *, CChar *action, bool deflt=false, bool canrun=false, HocSymExtension *extra=NULL)
static double done(void *v)
void section_menu(double, int, MechSelector *=NULL)
HocStruct Symbol ** ppsym
HocStruct cTemplate * ctemplate
char * strstr(char *cs, char *ct)