Operating systems, development tools, and professional services
for connected embedded systems
for connected embedded systems
![]() |
![]() |
![]() |
![]() |
PtMTrendAddData(), PtMTrendChangeData()
Add or change data for a PtMTrend widget
Synopsis:
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 );
Arguments:
- widget
- A pointer to a widget of type PtMTrend.
- graph_no
- The number of the graph to be added to or changed, in the range 0 to trend count - 1, inclusive.
- newdata
- A pointer to an array of the new data (see below).
- nsamples
- 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.
Description:
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:
- trend sample[last_sample] = newdata[nsamples - 1].
- trend sample[last_sample + 1] = newdata[nsamples - 2].
- ...
- trend sample[last_sample + nsamples - 1] = newdata[0].
If last_sample + nsamples - 1 is outside the range of samples for the widget, some initial portion of the new data is discarded.
Classification:
Photon
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | No |
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)