next up previous contents index
Next: Memory Methods on Time_Object Up: Time_Object Previous: The Time_Object Structure

Time_Parm

 

The Time_Object parameter are stored in a Time_Parm instance:  

#CLASS Time_Parm : Root {
  /* PRIVATE */
  BOUNDED_RULER **int_rul;  /* Ruler for integer parameter,
                                                not time dependent */
  FUNCTION_RULER **dbl_rul; /* Function ruler for double parameter */
  /* USER */
  int num_int_parm;         /* Number of integer parameter */
  int num_double_parm;      /* Number of double parameter  */
  int *int_parm;            /* Pointer to memory for integer parameter */
  double *double_parm;      /* Pointer to memory for double parameter  */
};

Each int/double parameter corresponds to a Ruler/Function_Ruler which allows to edit its value. The double variables are time-dependent, the Splines of the associated Function_Rulers describe their values as functions over the time, see 4.1.2.6.

There are only a few methods on Time_Parm for memory management, debugging, for (de)activating the rulers and for archiving the int and double values:

   GRAPE(tparm, "free")()
TIME_PARM * tparm
Delete an instance of class Time_Parm. All memory is freed using "list-free", the rulers are removed from the manager and deleted. See 5.4.4.1 for details on "delete"/"free".

   tex2html_wrap44616    tex2html_wrap44618
TIME_PARM * tparm
Allocate or free the memory for the int and double variable arrays and the corresponding Ruler arrays. num_int_parm and num_double_parm have to be set before "list-alloc" is called.

The rulers itself are not created by "list-alloc", this is usually done by the function g_time_parm_get_data (see below) which is called when a description file is read. "list-free" removes the rulers and deletes them before freeing the arrays.

   GRAPE(tparm, "get-info")(xlist)
TIME_PARM * tparm
XLIST * xlist
Add entries for the numbers of parameter and the parameter values to the superclass information, see section 5.4.7.3.

   tex2html_wrap44622    tex2html_wrap44624    tex2html_wrap44626
TIME_PARM * tparm
int state
TIME_OBJECT * timeobj
"set" activates (state == ON) or deactivates (state == OFF) all tparm rulers, "switch-send" toggles their state. "switch-comp-send" is the Time_Object counterpart of "switch-send", it just calls this method on timeobj-> time_parm.

   GRAPE(tparm, "xdr")(xdrp)
TIME_PARM * tparm
XDR * xdrp
Read the tparm variables from or write them to the XDR stream xdrp. This method should not be called directly, refer to 5.7 (especially 5.7.3) for details.

The rulers are currently not handled by this method, therefore the double variables will lose their time-dependency.

There are some utility function which help reading and handling the Time_Parm variables:

int g_time_parm_get_data(FILE *fp, TIME_PARM *tparm,
                         char *name, char *path, double *time)
reads in the number of int and double parameter and their initial values (see 8.2.1.3 for an example file), creates the corresponding rulers and adds them to the manager.

int g_time_parm_get_var_list(TIME_PARM *tparm, char *varlist)
simplifies parsing formulas which use the tparm variables. After calling this function the string varlist contains a list of the variable names separated by spaces (see 8.2.2.1 for naming conventions), it starts with "t" for the time followed by the int parameter "i ..." and the double parameter "a ...".

void g_time_parm_get_var_values(TIME_PARM *tparm, double time,
                                double *values)
helps evaluating functions. It stores the tparm variable values for the current time in the values array: values[] = {time, (double)int_parm[0], ..., (double)int_parm[num_int_parm - 1], double_parm[0], ..., double_parm[num_double_parm - 1] }.


next up previous contents index
Next: Memory Methods on Time_Object Up: Time_Object Previous: The Time_Object Structure

SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.