2 #include <../../nrnconf.h>
43 static void point_menu(
Object*,
int);
133 for (
i = 0;
i < a->
sub[0];
i++) {
168 btype =
"(Parameters)";
174 btype =
"(Assigned)";
208 &(
sec->prop->dparam[7].literal_value<
double>())},
214 if (
p->dparam[4].literal_value<
double>() != 1) {
218 &(
sec->prop->dparam[4].literal_value<
double>())},
237 pnodemenu(
p, x,
type, sname.string(),
ms);
252 mech_menu(p1, x,
type, path,
ms);
258 static bool nrn_is_const(
const char* path,
const char*
name) {
261 "%s for (hoc_ac_) if (hoc_ac_ > 0 && hoc_ac_ < 1) if (%s(hoc_ac_) != %s(.5)) {hoc_ac_ "
296 for (
i = 0;
i < a->
sub[0];
i++) {
301 if (nrn_is_const(path,
n)) {
315 if (nrn_is_const(path,
vsym->
name)) {
369 bool locmenu =
false;
376 bool are_globals =
false;
425 make_label = int(
chkarg(2, -1., 1.));
427 point_menu(ob, make_label);
434 static void point_menu(
Object* ob,
int make_label) {
450 if (make_label == 1) {
452 }
else if (make_label == 0) {
454 }
else if (make_label == -1) {
541 double x =
chkarg(1, 0, 1);
555 hoc_execerror(
"Object arg must be MechanismStandard or a Point Process, not",
569 double x =
chkarg(1, 0, 1);
584 "Object arg must be MechanismStandard or a Point Process or a nrn.Segment, not",
616 return ms->is_array((
int)
chkarg(1, 0,
ms->count() - 1));
623 n =
ms->name((
int)
chkarg(2, 0,
ms->count() - 1), rval);
706 if (
type < vartype) {
708 }
else if (vartype == 0 ||
type == vartype) {
785 for (
j = 1;
j < size; ++
j) {
868 for (
int i = 0;
i <
sec->nnode; ++
i) {
889 std::ostream& o = *po;
890 o << obref <<
" = new MechanismStandard(\"" <<
np_->
name() <<
"\")" << std::endl;
894 for (
i = 0;
i <
cnt; ++
i) {
895 o << obref <<
".set(\"" << sym->
name <<
"\", " << *
np_->
pval(sym,
i) <<
", " <<
i
904 hoc_execerror(
s,
" MechanismStandard method not implemented for GLOBAL type");
1016 return double(mt->
count());
1055 return double(mt->is_ion());
1080 static const char*
nullstr =
"";
1092 static const char*
nullstr =
"";
1305 oc.
run(
"{xmenu(\"MechType\")}\n");
1318 buf,
"xbutton(\"%s\", \"hoc_ac_=%d %s\")\n",
s->name,
i,
mti_->
action_.c_str());
1323 oc.
run(
"{xmenu()}\n");
ReceiveFunc * pnt_receive
const char * secname(Section *sec)
name of section (for use in error messages)
void mech_uninsert1(Section *sec, Symbol *s)
void nrn_pushsec(Section *sec)
void nrn_parent_info(Section *s)
double nrn_arc_position(Section *sec, Node *node)
Prop * nrn_mechanism(int type, Node *nd)
int node_index(Section *sec, double x)
returns nearest index to x
const char * sec_and_position(Section *sec, Node *nd)
char * hoc_section_pathname(Section *sec)
Node * node_exact(Section *sec, double x)
like node_index but give proper node when x is 0 or 1 as well as in between
void mech_insert1(Section *sec, int type)
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)
const char * name() const
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 * findsym(const char *rangevar)
const char * name() const
bool copy_out(NrnProperty &dest, int vartype=0)
neuron::container::data_handle< double > pval(const Symbol *, int index)
bool copy(bool to_prop, Prop *dest, Node *nd_dest, int vartype=0)
int run(int argc, const char **argv)
static std::ostream * save_stream
virtual void unref() const
static void make_section_browser()
void class2oc(const char *, ctor_f *cons, dtor_f *destruct, Member_func *, Member_ret_obj_func *, Member_ret_str_func *)
Symbol * hoc_table_lookup(const char *, Symlist *)
static char * stmp[HOC_TEMP_CHARPTR_SIZE]
HocReturnType hoc_return_type_code
double chkarg(int, double low, double high)
int hoc_is_object_arg(int narg)
HocSymExtension * hoc_var_extra(const char *name)
size_t hoc_total_array_data(const Symbol *s, Objectdata *obd)
neuron::container::data_handle< double > hoc_val_handle(std::string_view s)
int hoc_is_str_arg(int narg)
void hoc_assign_str(char **cpp, const char *buf)
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)
bool is_array(const Symbol &sym)
Point_process * ob2pntproc(Object *ob)
Object ** hoc_objgetarg(int)
static const char * nullstr
#define ITERATE(itm, lst)
void hoc_execerror(const char *s1, const char *s2)
constexpr do_not_search_t do_not_search
impl_ptrs methods
Collection of pointers to functions with python-version-specific implementations.
int Sprintf(char(&buf)[N], const char *fmt, Args &&... args)
Redirect sprintf to snprintf if the buffer size can be deduced.
int is_point_process(Object *)
void nrn_seg_or_x_arg(int iarg, Section **psec, double *px)
static Node * node(Object *)
int const size_t const size_t n
neuron::container::data_handle< double > point_process_pointer(Point_process *, Symbol *, int)
std::vector< Memb_func > memb_func
int nrn_vartype(const Symbol *sym)
static Object * callable_with_args(Object *ho, int narg)
void hoc_ivvalue(CChar *name, CChar *variable, bool deflt=false, Object *pyvar=0)
void hoc_ivpvalue(CChar *name, neuron::container::data_handle< double >, bool deflt=false, HocSymExtension *extra=NULL)
void hoc_ivpvaluerun(CChar *name, neuron::container::data_handle< double >, CChar *action, bool deflt=false, bool canrun=false, HocSymExtension *extra=NULL)
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_ivvaluerun(CChar *name, CChar *variable, CChar *action, bool deflt=false, bool canrun=false, bool usepointer=false, Object *pyvar=0, Object *pyact=0)
void hoc_ivvaluerun_ex(CChar *name, CChar *var, neuron::container::data_handle< double > pvar, Object *pyvar, CChar *action, Object *pyact, bool deflt=false, bool canrun=false, bool usepointer=false, HocSymExtension *extra=NULL)
void hoc_ivpanel(CChar *, bool h=false)
void hoc_ivlabel(CChar *)
static double done(void *v)
void section_menu(double, int, MechSelector *=NULL)
Object ** hoc_temp_objptr(Object *)
A point process is computed just like regular mechanisms.
T get() const
Explicit conversion to any T.
Object *(* callable_with_args)(Object *, int narg)