int tclcommand_observable_update(Tcl_Interp* interp, int argc, char** argv, int* change, observable* obs) { char buffer[TCL_DOUBLE_SPACE]; if ( observable_update(obs) ) { Tcl_AppendResult(interp, "\nFailed to update observable\n", (char *)NULL ); return TCL_ERROR; } return TCL_OK; }
void autoupdate_observables() { int i; for (i=0; i<n_observables; i++) { // printf("checking observable %d autoupdate is %d \n", i, observables[i]->autoupdate); if (observables[i]->autoupdate && sim_time-observables[i]->last_update>observables[i]->autoupdate_dt*0.99999) { // printf("updating %d\n", i); observable_update(observables[i]); } } }