Caution: This version of this document is no longer maintained. For the latest documentation, see

PtMTrendAddData(), PtMTrendChangeData()

Add or change data for a PtMTrend widget


void PtMTrendAddData( PtWidget_t *widget,
                      unsigned graph_no,
                      const int *newdata,
                      unsigned nsamples );

void PtMTrendChangeData( PtWidget_t *widget,
                         unsigned graph_no,
                         int const *newdata,
                         unsigned last_sample,
                         unsigned nsamples );


A pointer to a widget of type PtMTrend.
The number of the graph to be added to or changed, in the range 0 to trend count - 1, inclusive.
A pointer to an array of the new data (see below).
The number of samples in the array.
last_sample (PtMTrendChangeData() only)
The index of the newest sample to replace, where 0 is considered to be the index of the most recently added sample.


PtMTrendAddData() lets you add data for a PtMtrend, while PtMTrendChangeData() lets you change existing data.

The newdata array is ordered with the oldest sample at newdata[0], and the newest at newdata[nsamples - 1]. The oldest sample to be replaced has an index of last_sample + nsamples - 1;

The samples in the trend are replaced as follows:

If last_sample + nsamples - 1 is outside the range of samples for the widget, some initial portion of the new data is discarded.



Interrupt handler No
Signal handler No
Thread No