Book Image

Delphi Cookbook

By : Daniele Teti
Book Image

Delphi Cookbook

By: Daniele Teti

Overview of this book

Table of Contents (14 chapters)
Delphi Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Displaying a measure on a 2D graph like an oscilloscope


An oscilloscope is a type of electronic test instrument that allows the observation of constantly varying signal voltages. Usually, information is shown as a two-dimensional plot graph of one or more signals as a function of time. In this recipe, you'll implement a type of oscilloscope to display data generated by a background thread. Obviously, in this recipe, you'll not create an accurate oscilloscope, rather a nice real-world utilization of retrieving data and using it continuously in the GUI.

Getting ready

You'll use the TThreadedQueue<Extended> class to bring out data from the background thread to the main thread. The approach is similar to that shown in the recipe Talking with the main thread using a thread-safe queue, but in this case, we've to show data in a complex way—on a 2D graph showing only the last n data retrieved.

How to do it...

This recipe has a background thread acting like an analogic signal generator that is...