TSLGenericReal.OnProcessData
From Mitov Wiki Doc
(Difference between revisions)
(Automated Syncronization with Documentation) |
(Automated Syncronization with Documentation) |
(4 intermediate revisions by one user not shown) |
Latest revision as of 00:29, 26 June 2013
This is a Beta Read Only version of this page. Please review and send recommendations to mitov@mitov.com. We will enable the editing as soon as we are happy with the overall Wiki site.
Description
Use the OnProcessData event handler to write code that responds when a data buffer is received.
Write your custom code to process the data inside the event. The incoming data will be contained inside the InBuffer. You can assign the processed data to the OutBuffer.
You can prevent the output buffer to be sent to the next component by setting SendOutputData to False.
Usually occurs when a new data buffer is generated during data capturing or data playback.
Delphi Example:
// Plot the buffer data procedure TForm1.SLGenericReal1ProcessData(Sender: TObject; InBuffer: ISLRealBuffer; var OutBuffer: ISLRealBuffer; var SendOutputData: Boolean); var I : Integer; begin Chart1.Series[ 0 ].Clear(); for I := 0 to InBuffer.GetSize() - 1 do Chart1.Series[ 0 ].Add( InBuffer.Items[ I ], , clRed ); end;
C++ Builder Example:
// Plot the buffer data void __fastcall TForm1::SLGenericReal1ProcessData(TObject *Sender, TSLCRealBuffer InBuffer, TSLCRealBuffer &OutBuffer, bool &SendOutputData) { Chart1->Series[ 0 ]->Clear(); for( int i = 0; i < InBuffer.GetSize(); i ++ ) Chart1->Series[ 0 ]->Add( InBuffer[ i ], "", clRed ); }
Visual C++ Example:
// Plot the buffer data void __stdcall CCustomFilterDemoDlg::SLGenericReal1FilterData(void *Sender, TSLCRealBuffer InBuffer, TSLCRealBuffer &OutBuffer, bool &SendOutputData) { for( int i = 0; i < InBuffer.GetSize(); i ++ ) { double Value = InBuffer[ i ]; // Plot the Value with your favorite chart component. } }