Databases Reference
In-Depth Information
When the sample program is first started, the saved values (if they exist) are loaded by means
of these statements:
frm5Window.ComboBoxIColor.ListIndex =
Val(GetSetting("ColorMap", "Color", "IColor"))
frm5Window.ComboBoxFColor.ListIndex =
Val(GetSetting("ColorMap", "Color", "FColor"))
Figure 5.32 shows an example of linear color mapping over the entire range of values in
column A. Notice that, in this example, the color map was reversed (by checking the checkbox).
Values closest to the center (100.5 — shown on GUI) are green, and as values deviate from the
center value, they change from green to yellow to orange and finally to red at the extremes of
the window. Notice that the maximum and minimum values found in the column to be mapped
are determined and shown in the GUI (Max
100.5).
Although this example uses linear mapping to color the elements in a column, keep in mind
that such an algorithm could be altered to perform many other tasks. For example, instead of
coloring the element in a column, a row or column could be copied, moved, or written to a new
file depending upon where it was located in the mapping scheme. The mapping scheme algorithm
can also be altered to fit whatever parameters the user sees fit to model.
=
120, Min
=
81, Center
=
5.11
AUTOMATICALLY LOADING AND EXTRACTING DATA
FROM COMPLEX DIRECTORY STRUCTURES
Chances are that an application with any degree of sophistication will require data from many
sources. In such an instance, it is necessary for an application to have the ability to automatically
load data files from specified locations and extract the required data from the imported files to
complete a specified task the macro was developed to accomplish. Instrumentation will often dump
data with certain parameters to differently named folders. Going back to the example cited earlier
for an HPLC with four methods, each of which has a different percentage of methanol in solution
(40, 50, 60, and 70%), the following directory structure might be created.
Top folder: XYZ
Sub folders under XYZ: method40, method50, method60, method70
Now suppose that, after the instrument is run, each folder will contain a data file with the data
acquired for each percentage of methanol. The challenge here is to have the ability to “point” the
macro toward a file structure and have the program make a rational decision as to what files should
be imported and what data should be extracted. In many instances, files are automatically named
by machines with a date-time stamp format. For illustrative purposes, suppose three compounds
are run on an HPLC, and the directory structure set up for storage is that shown in Figure 5.33.
Within this directory structure, suppose that each data file is saved with a date-time stamp for a
filename like “YYYYMMDD-HHMMSS.xls.” Thus, the filename 20040219-150100.xls represents
a filename created on February 19, 2004, at 3:01:00 PM (in military 24-h time 15:01:00). In this
example, this file is stored on the accompanying CD-ROM in the directory:
\Chapter 5\Samples\AutoLoadDirs\Compound1\method40\
In this example, one data file is created each minute, and the files are stored by methods under
the compound name, after which they then increment to the next compound name and are again stored
by method under the current compound name. The data files in this example follow this format:
\Chapter 5\Samples\AutoLoadDirs\Compound1\method40\20040219-150100.xls
\Chapter 5\Samples\AutoLoadDirs\Compound1\method50\20040219-150200.xls
\Chapter 5\Samples\AutoLoadDirs\Compound1\method60\20040219-150300.xls
\Chapter 5\Samples\AutoLoadDirs\Compound1\method70\20040219-150400.xls
\Chapter 5\Samples\AutoLoadDirs\Compound2\method40\20040219-150500.xls
For this example, the data files created by the HPLC contain the information shown in Figure 5.34.
Search WWH ::




Custom Search