Delphi provides excellent tools for building business and database applications. It provides less for the sciences in the way of number crunching and data visualization. It is, however, possible to extend the Delphi tool pallet and we are currently in the process of writing and testing a collection of Delphi components, Science Tools, that make it easy for students to perform many of data analysis and visualization tasks.
It is our intention to provide documentation for Science Tools using the standard Windows help file format and on line using the WWW. As is often the case, documentation lags behind the development of the software. Please feel free to ask questions about the syntax of a particular Science Tool method. Send suggestions and bug reports to Wolfgang Christian at Davidson College.
Science Tools are distributed in compiled Delphi Component Units, i.e., DCU files, only. Copy these components into your Delphi LIB directory and read the Borland Delphi manual for instructions on how to add these components to your tool pallet. Since some Science Tools are based on copyrighted code that can only be distributed in compiled form, source code is not distributed. The parser that has been incorporated into the Graph Inspector is part of the CUPS Project and the ThreeD/Contour plotting component is based, in part, on similar CUPS routines. This code and is not freely distributable.
Please contact Wolfgang Christian if you need the source code for special applications. You will have to provide proof of purchase for the required CUPS Utilites.
Science Tools compiled DCU files may be downloaded for personal non-commercial use by instructors who are employed at and students who are enrolled in accredited educational institutions. Licenses allowing Science tools to be used in a course my be granted at ZERO COST by contacting Wolfgang Christian, Physics Department, Davidson College, Davidson, NC 28036.
We have converted the Windows HELP FILE for Science Tools into a WWW Science Tools hypertext help file. The conversion is not perfect but you can now use your browser to look up Science Tools syntax and sample code. The best documentation for the tools may be the mini-apps that demonstrate how we use the tools for various programming exercises in our computational physics course.
| SciTools.ZIP | The complete package of libraries (*.DCU), forms (*.FRM), and help (*.HLP) files. |
| SciTools.HLP | The help files in case you want to browse. You will need the Win 95 help reader. Get the table of contents too. |
| SciTools.CNT | |
| SciTool3.HLP | The Windows 3.1 version of the help file. Use only as a last resort! |
Science Tools are Object Oriented Components that perform common data analysis and visualization tasks with a minimal amount of code. For example, a programmer can drag an SGraph component from the Delphi toolbar, size and position it on the screen using the mouse, and write the following code to produce a graph of a sin function:
var i:Integer; x,y:Double; begin for i:=0 to 1023 do begin x:=4*Pi*i/1023; y:=Sin(6*Pi*x); Graph.RegisterDatum(1,x,y); end; Graph.Invalidate; end;
The SGraph object will plot the data to fit using automatic scaling. The SGraph object is smart enough to "remember" that data that it was sent so that it can repaint the window as required by the operating system. In addition, the user can right click on the graph at runtime to view the data and change the data's display properties.
A slightly more extensive code fragment that plots two data series is shown below along with the resulting graph. The first series, a Gaussian, is plotted in blue. The second series, random data points, is shown a red triangles. Each series is first cleared to remove old data and drawing styles are set to produce the desired result. This following sample code fragment was extracted from the SciTools.hlp Windows help file.
var i:Integer;x,y:Double; begin Graph.ClearSeriesData(5); Graph.SetSeriesStyle(5,clBlue,True,none); Graph.ClearSeriesData(6); Graph.SetSeriesStyle(6,clRed,False,Triangle); for i:=0 to 100 do begin x:=i/10; y:=exp(-Sqr(x-5)); Graph.RegisterDatum(5,x,y); y:=y+Random(1000)/10000; Graph.RegisterDatum(6,x,y); end; Graph.Invalidate; end;