Copyright 2004 by gINT Software. All rights reserved worldwide.
GR005.TXT
gINT Rules Code Samples - 005
Requires gINT version 6.1.016 or later.
NOTE: Code samples are provided free of charge and as-is. gINT Software makes no claim or warranty as to the accuracy of the samples. It is the responsibility of the user to ensure that the code performs as it should. Comments, suggestions, and error reports are appreciated.
Description
===========
Illustrates the use of the "gINT Rules Procedure on Empty Dataset" table property to prepopulate data. There are samples for five different types of data. Since all the data that were inserted on the prepopulation may not have been used for a particular dataset, there are code procedures on save that illustrate three different methods of removing unused records.
SAMPLE:
Add a new borehole in the POINT table and supply a Hole Depth. Then move to the SAMPLE table. The empty dataset procedure (SampleInitialize) inserts split spoon samples at depths of 1, 5, 10, 15, 20, 25, 30, and then one every 10 feet thereafter. Insertions are stopped by the value of the hole depth.
After entering additional data and saving, the save procedure (SampleCheck) removes all records that were inserted by SampleInitialize where no data was changed. It is assumed that split spoon samples were not taken at those depths.
DYNAMIC PROBE:
This is a parent-child screen whose structure is taken from the AGS database structure.
Add a new borehole in the parent grid and specify a dynamic probe type in the Type field. On placing focus in the child grid, depths are inserted at each 0.075 meters if the type is "DPM", 0.1 meters otherwise (including blank). Depths are inserted to the depth of the hole, which is obtained from the HOLE (POINT) table.
On save, the DynamicProbeCheck procedure removes all records that only have data in the Depth field.
INCLINOMETER:
This prepopulates the depths of the inclinometer readings in the INCLINOMETER READINGS table, which is the child grid of under the INCLINOMETER RESULTS tab. This structure is from the database shipped with the LOG A GNGL01 general purpose report (Inclinometer Plots on a Log) on our Web site (www.gcagint.com/sf_gnrl.htm).
Add a new Date/Time in the parent grid of the INCLINOMETER RESULTS tab and then put focus in the child grid (INCLINOMETER READINGS table). The sample code (InclinometerInitialize) builds a list of all depths that were used in at other dates within the borehole. It inserts the sorted list into the child. So for the first date/time in a borehole, nothing will be inserted in the child.
On save, the InclinometerCheck procedure all records that only have data in the Depth field.
SIEVE:
These are the standard SIEVE/SV READINGS tables in the gINT Lab Testing facility. The only differences are the "Sieve Set" field in the parent grid, which is a lookup to all items in the Data Design:Readings Lists application, and the "Name" field in the child table, which displays the sieve common names.
Click in the child grid (SV READINGS table). The sieves associated with the sieve set specified in the parent grid will be inserted. If the "Sieve Set" field in the parent grid is empty, the ASTM SET 1 sieves are inserted. The function gINTRules.GridData.ReadingsListLoadFnB is used to populate the grid and the "Compact On Save" argument of the function is set to "True" meaning that on save all records that only have data from populated with the ReadingsListLoadFnB function will be removed. This is handled by gINT so a "SieveCheck" procedure is not needed.
HYDROMETER:
These are the standard HYDROMETER/HYD READINGS tables in the gINT Lab Testing facility.
Click in the child grid (HYD READINGS table). The reading times of 2, 5, 15, 30, 60, 240, and 1440 minutes are inserted.
There is no check procedure to remove rows where there is only a time value. Generally, all readings are used but it would be a good idea to have such a check. We will leave this as an exercise for the user.
Revision History
================
19 February 2004:
1. The RecordCount property of recordsets generated from the OpenRecordset method of databases may not be accurate without first moving to the last record. We missed this in the InclinometerInitialize procedure of the GR005 module:
Set snDepths = gINTRules.CurrentProject.OpenRecordset(sSql, dbOpenSnapshot)
With snDepths
If Not .EOF Then
glNumRows = .RecordCount
The code needs to move to the last record before setting glNumRows. That is:
Set snDepths = gINTRules.CurrentProject.OpenRecordset(sSql, dbOpenSnapshot)
With snDepths
If Not .EOF Then
.MoveLast
glNumRows = .RecordCount
.MoveFirst
The corrected code is in this build of the project.
--------------------------
08 January 2004:
1. Corrected comment in all the GR005 procedures that stated that the procedures needed to be referenced in the "gINT Rules Pre-process on Save" property. The correct property is "gINT Rules Procedure on Empty Dataset".
--------------------------
05 January 2004:
1. Added sample code for the dynamic probe, inclinometer, sieve, and hydrometer data.
2. Changed the HoleDepthFnD function in the COMMON PROCEDURES module to use the ForeignKeyValues property instead of the ParentRecord property which doesn't work in the child grid of a parent-child screen.
--------------------------
03 November 2003:
Initial upload
*************************************************
INCLUDED FILES:
GR005.GLB:
gINT Rules code modules:
GR005 Main
DynamicProbeCheck
DynamicProbeInitialize
HydrometerInitialize
InclinometerCheck
InclinometerInitialize
SampleCheck
SampleInitialize
SieveInitialize
GR005 COMMON PROCEDURES DeleteRows
DeleteRowsThatJustHaveDepth
HoleDepthFnD
InitFieldsFnB
InitSampleDataFnL
RecordsetClose
Readings Lists ASTM SET 1
ASTM SET 2
GR005.GPJ:
Sample project that makes use of the code modules.
*************************************************
INSTALLATION PROCEDURE:
Copy the files wherever you prefer. To see the gINT Rules code modules you must either merge the GLB into your library (Utilities:Lib Merge/Copy) or change to the included library (File:Change Library).
*************************************************
SPECIAL NOTES:
None
*************************************************