Visit Gigasoft's Web Site
 ProEssentials v9 Help

AppendYData

Scope

Graph, Scientific Graph, 3D Scientific Graph, and Polar/Smith Chart Objects.

Type

Property Array of type Single

Default

empty

Custom

NA

Ocx|Vcl

NA

DLL

PEP_faAPPENDYDATA

 

Purpose

This property is for transferring new YData into a graph which is being used in a real-time implementation. Existing YData will first be shifted to make room for the new data.

 

Comments

This property is write-only and can only be used with PEvset.

 

The direction of the shifted data is controlled with AppendToEnd.

 

Within the demo, see example 017 or 115.

 

After this property is set, the Graph Object will automatically regenerate and display the new image based upon the new data transferred into the object. This is why AppendPointLabelData, AppendXData or AppendXDataII should be first set before using this property. Do not call PEreinitialize or PEresetimage. This automatic image logic can be disabled with AppendWithNoUpdate.

 

If not using a Graph Object, you will have to explicitly call PEreinitialize, PEresetimage and InvalidateRect, or use PEactions = 0 (VCL users use xReinitAndReset) after all append type properties are set.

 

Important, when using PEvset with append type properties, the argument nItems should represent the number of elements per subset. This is different in how nItems is used with non append type arrays such as YData If the object has 4 subsets and you are adding 1 sample of YData for each subset, nItems should equal 1, and the array located by lpvData should contain 4 elements. The objects knows how many subsets they are managing, so it only needs to know how many new samples of YData are being added. If more than one sample of YData is being appended per subset, the data should be prepared in the following form:

 

Data Format     

s1p1 s1p2 s1p3 s1p4 ... s1pj

s2p1 s2p2 s2p3 s2p4 ... s2pj

s3p1 s3p2 s3p3 s3p4 ... s3pj

... ... ... ... ... ...

sip1 sip2 sip3 sip4 ... sipj

 

See Also: AppendToEnd, AppendYDataII

Chapter 7, Question 26 contains more information on real time topics. The example code included with ProEssentials also shows real time examples.

 

.NET Example (VB.NET)

Dim NewData(2) As Single
NewData(0) = (Rnd() * 20) + 2
NewData(1) = (Rnd() * 40) + 60

'// transfer new YData, this will also update and view new image //
Gigasoft.ProEssentials.Api.PEvset(Pego1.PeSpecial.hObject, Gigasoft.ProEssentials.DllProperties.APPENDYDATA, NewData, 1)

C / C++ Example

float fData[4]; /* first place new data into fData */

/* 4 subsets * 1 point = 4 elements, yet nItems = 1 */

PEvset (hWndPE, PEP_faAPPENDYDATA, fData, 1);

 

OCX Example

The following example appends 4 new data points, one per subset for a graph that has 4 subsets.

 

ReDim fData(4) ** first place new data into fData **

** 4 subsets * 1 point = 4 elements, yet nItems = 1 **

test = PEvset (PEGraph1, PEP_faAPPENDYDATA, fData(0), 1)

 

VCL Example

The following example appends 4 new data points, one per subset for a graph that has 4 subsets.

 

var

fData: array[0 .. 3] of Single;

{** first place new data into fData **}

{** 4 subsets * 1 point = 4 elements, yet nItems = 1 **}

PEvset (PEGraph1.hObject, PEP_faAPPENDYDATA, @fData, 1)