Fit Sample Data
Overview
The fit sample data example has two main parts.
First, using Visual Basic, we wrote an ActiveX DLL and installed it on our server. This DLL references the BestFit Developer's Kit ActiveX library, and all the code for fitting a set of input data and returning the nicely formatted graphs and results you seeing the example's result window.
Second, we wrote a sequence of web pages to retrieve some
input data from the user, and to display the fit results.
One of the web pages in the sequence uses VBScript to call
our DLL, passing it the data entered by the user. When the
fitting is complete, the results page combines together the
statistics and graphs generated by the DLL into a nicely formatted
page, suitable for display.
RDKX_FitSampleData.DLLL
This
DLL contains two publicly accessible methods.
The GetRandomData method, is a utility routine for getting a set of default random data that can be displayed in a web page.
The PerformFit method takes as arguments all the input data, as well as an output directory to which it will write graphs and results. The PerformFit method performs the following five steps:
1. Initializes the BDK
2. Defines a BDKInput Object
3. Fits the Input, and Selects
the Best Result
4. Generates the Results For
Display
5. Shuts Down the BDK
The method generates two files in the output directory specified, "GRAPH.JPG," and "FITRESULTS.HTML". The files are combined together by the calling .ASP page to make the final page that is displayed to the user.
In the code listings, items in blue are an object, method or property from the RDKX.
Fit_Sample_Data_Results.ASP
This
.ASP page uses VBScript to call the RDKX_FitSampleData.DLL
which is installed on our server. It then writes the results
generated by the DLL (the \GRAPH.JPG and \FITRESULTS.HTML
files) into a nicely formatted web page. A previous web page
passes in the model parameters defined by the user using an
HTML form.