tma_init_state

Synopsis

    #include "tma.h"
    void tma_init_state( int partno, tma_state *cmds, char *name );
    int tma_process( long int now );
    void tma_succeed( int partno, int statecase );
    

Description

These are support functions for TMCALGO algorithms. They are called from the .tmc code which TMCALGO generates. Users should not need to call these functions directly.

tma_init_state() is called to when a TMA state is validated. It is responsible for initializing the status lines and setting up the internal structures which keep track of the current position within the algorithm.

tma_process() is called every second to execute algorithm commands. Its single argument is the "current" data stream time. (This will be very close to the current time when running an algorithm in realtime, but during playback, it will be the time when the data was taken.)

tma_succeed() is called to release a partition from a HOLD state. If statecase is greater than zero, it must match the third argument of the currently pending hold command. This form is generated by "Hold until" syntaxes. If statecase is less than zero, it must equal (but negative) to the fourth argument. This form is generated by the "Resume" statement.

Returns

tma_process() returns zero if there is no more work to be done at this time. If it returns a non-zero value, the TMCALGO-generated .tmc program uses the value in a switch statement to select a state to validate. (This value is referred to as a "state_case" within the tmcalgo source code.) A return value of -1 indicates that work is not completed, but no action is required by the caller other than to call tma_process() again. This is necessary when a "Resume" command is executed, which may unblock a partition that has already been passed over.

tma_init_state() and tma_succeed() have void returns.

See Also

TMA Internal functions.

Source File

/usr/local/src/nortlib/tmaR2.c

Alphabetical List
Subject List
Return to Manuals Page
webmaster@huarp.harvard.edu
Copyright 2001 by the President and Fellows of Harvard College