Esempio n. 1
0
boolean special_pnt_call(Object* ob, Symbol* sym, int narg) {
	char* name = sym->name;
	if (strcmp(name, "loc") == 0) {
		int type = ob->ctemplate->symtable->last->subtype;
		int ptype = pnt_map[type];
		if (narg != 1) {
			hoc_execerror("no argument", 0);
		}
		double x = hoc_look_inside_stack(narg-1, NUMBER)->val;
		Section* sec = chk_access();
		Node* node = node_exact(sec, x);	
		nrn_loc_point_process(ptype, ob2pntproc(ob), sec, node);
		hoc_pushx(x);
		return true;
	}else if (strcmp(name, "has_loc") == 0) {
		Point_process* p = ob2pntproc(ob);
		hoc_pushx(double(p != nil && p->sec != nil));
		return true;
	}else if (strcmp(name, "get_loc") == 0) {
		hoc_pushx(get_loc_point_process(ob2pntproc(ob)));
		return true;
	}else{
		return false;
	}
}	
Esempio n. 2
0
void hoc_assignsym(Psym* p, double val){
	arayonstack(p);
	hoc_pushx(val);
	hoc_pushs(p->sym);
	hoc_assign();
	hoc_nopop();
}
Esempio n. 3
0
File: audit.c Progetto: nrnhines/nrn
void hoc_Saveaudit(void) {
	int err;
#if !OCSMALL
	err = hoc_saveaudit();
#endif
	hoc_ret();
	hoc_pushx((double)err);
}
Esempio n. 4
0
 void nrniv_bind_thread() {
     IFGUI
     bindq_ = new VoidPQueue(10);
     bind_tid_ = int(*hoc_getarg(1));
     //printf("nrniv_bind_thread %d\n", bind_tid_);
     iv_bind_enqueue_ = iv_bind_enqueue;
     ENDGUI
     hoc_pushx(1.);
     hoc_ret();
 }
Esempio n. 5
0
static void call(Symbol* s, Node* nd, Prop* p) {
	Section* sec = nd->sec;
	Object* ob = p->ob;
	double x = nrn_arc_position(sec, nd);
	nrn_pushsec(sec);
	hoc_pushx(x);
//printf("hoc_call_objfunc %s ob=%s\n", s->name, hoc_object_name(ob));
	hoc_call_objfunc(s, 1, ob);
	nrn_popsec();
}
Esempio n. 6
0
File: audit.c Progetto: nrnhines/nrn
void hoc_Retrieveaudit(void) {
	int err, id;
#if !OCSMALL
	if (ifarg(1)) {
		id = (int)chkarg(1, 0., 1e7);
	}else{
		id = 0;
	}
#endif
	err = hoc_retrieve_audit(id);
	hoc_ret();
	hoc_pushx((double)err);
}
Esempio n. 7
0
static void arayonstack(Psym* p) {
	int i;
	double d;
	
	if (p->nsub) {
		if (!ISARRAY(p->sym) || p->nsub != p->arayinfo->nsub) {
			hoc_execerror("wrong number of subscripts for ", p->sym->name);
		}
		for (i=0; i < p->nsub; i++) {
			d = p->sub[i];
			hoc_pushx(d);
		}
	}
}
Esempio n. 8
0
static PyObject* NPySecObj_connect(NPySecObj* self, PyObject*  args) {
	PyObject* p;
	NPySecObj* parent;
	double parentx, childend;
	parentx = -1000.; childend = 0.;
	if (!PyArg_ParseTuple(args, "O|dd", &p, &parentx, &childend)) {
		return NULL;
	}
	if (PyObject_TypeCheck(p, psection_type)) {
		parent = (NPySecObj*)p;
		if (parentx == -1000.) { parentx = 1.; }
	}else if (PyObject_TypeCheck(p, psegment_type)) {
		parent = ((NPySegObj*)p)->pysec_;
		if (parentx != -1000.) { childend = parentx; }
		parentx = ((NPySegObj*)p)->x_;
	}else{
		PyErr_SetString(PyExc_TypeError, "first arg not a nrn.Section or nrn.Segment");
		return NULL;
	}
//printf("NPySecObj_connect %s %g %g\n", parent, parentx, childend);
	if (parentx > 1. || parentx < 0.) {
		PyErr_SetString(PyExc_ValueError, "out of range 0 <= parentx <= 1.");
		return NULL;
	}
	if (childend != 0. && childend != 1.) {
		PyErr_SetString(PyExc_ValueError, "child connection end must be  0 or 1");
		return NULL;
	}
	Py_INCREF(self);
	hoc_pushx(childend);
	hoc_pushx(parentx);
	nrn_pushsec(self->sec_);
	nrn_pushsec(parent->sec_);
	simpleconnectsection();
	return (PyObject*)self;
}
Esempio n. 9
0
void hoc_boolean_dialog(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 10
0
void hoc_xcheckbox(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 11
0
void hoc_xpvalue() {	hoc_ret(); hoc_pushx(0.);}
Esempio n. 12
0
void hoc_xmenu(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 13
0
void hoc_xstatebutton(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 14
0
void hoc_save_session(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 15
0
void hoc_print_session(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 16
0
void hoc_checkpoint(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 17
0
void hoc_pwman_place(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 18
0
void hoc_xpanel(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 19
0
void nrniv_bind_thread(void) {hoc_ret(); hoc_pushx(0.);}
Esempio n. 20
0
void hoc_xradiobutton(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 21
0
void ivoc_style(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 22
0
void hoc_xslider(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 23
0
void hoc_xvarlabel(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 24
0
void hoc_xfixedvalue(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 25
0
void hoc_continue_dialog(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 26
0
void hoc_string_dialog(void) { hoc_ret(); hoc_pushx(0.);}
Esempio n. 27
0
JNIEXPORT void JNICALL Java_neuron_Neuron_pushArgD
  (JNIEnv *, jclass, jdouble x){
//printf("pushArgD %g\n", x);
	hoc_pushx(x);
}
Esempio n. 28
0
void hoc_notify_iv(void) {hoc_ret(); hoc_pushx(0.);}