General HydroStatics
Ship Stability Software
Command of the Week
(New or interesting aspects of GHS that you may not know about)

DB
(Requires GHS version 17.00 or later)

Starting with version 17.00, GHS features a data-base command.

For example, DB PutFixWt copies all your fixed weights (in the current GHS session) into the Data Base.

Similarly DB GetFixWt retrieves fixed weights.

To find out what fixed weights are currently stored for a particular ship:
DELETE ALL WEIGHTS
DB GetFixWt
STATUS FIXED

Weight items stored in the Data Base are kept permanently and do not have to be renewed between GHS sessions. The storage context is keyed to the Geometry file name. To prove it, try this:

READ SV.GF
ADD "STORES" 1.0, 20.0F, 0.1P, 5.5
DB PutFixWt
CLEAR
READ FV.GF
ADD "STORES" 0.25, 1.0A, 0.0, 6.6
DB PutFixWt
CLEAR
READ FV.GF
DB GetFixWt
STATUS FIXED
CLEAR
READ SV.GF
DB GetFixWt
STATUS FIXED

What are the advantages of using the Data Base to store fixed-weight items?

  • There is no file name to remember or file to maintain and locate when using the Data Base.
  • Any new or revised weight items can be added very easily to the Data Base at any time. For example, if you have new or revised weight items from a Load Editor session, simply issue the DB PutFixWt command.
  • Backup is simplified since there is only one Data Base folder for all your ships.
  • The Data Base can be accessed by more than one GHS session at the same time -- even dealing with the same ship.
  • The Data Base can be located on a network, making the same data available to multiple users.

The first time you issue any DB command, the Data Base folder is created automatically. After that, a subfolder (same name as the Geometry File) is automatically created for each Geometry file where DB commands are used.

DB PutFixWt can include a description parameter. For example, if you want to copy only weight items having descriptions beginning with "DECK A", the command is:
DB PutFixWt "DECK A*"

The effect of this is the same as using the ADD PREFIX command. For example,
ADD PREFIX "DECK A"
DB PutFixWt

Similarly, DB GetFixWt can have a description parameter. Also it can have a second parameter to specify the fraction of the Maximum Weight (if maximum weight and optionally VCG range are included when defining the weight with the ADD command). For example, try this:

ADD "CARGO" 0.0, 9.0A, 0.0, 12.0 /MAX:10 /VRANGE: 12.0
DB PutFixWt "CARGO"
DB GetFixWt "CARGO", 0.5
STATUS FIXED

For deleting fixed weights, DB DeleteFixWt is provided. If a parameter is given, it narrows the target.

Finally, DB LockFixWt protects all or selected weights against being modified by PutFixWt. A way to unlock a weight item in the Data Base is by deleting it and putting it back.

Light-ship weights are addressed by a parallel set of DB commands:
DB PutLSWt copies into the Data Base the main WEIGHT plus any ADDed weights having descriptions beginning with "+" or "*+". The following commands work like the FixWt commands but deal with the light-ship associated ADDed weights that begin with "+" or "*+":

DB GetLSWt
DB DeleteLSWt
DB LockLSWt

To view the DB documentation, the command is DB Info or simply DB.

Questions, comments, or requests?
Contact Creative Systems, Inc.

support@ghsport.com

USA phone: 360-385-6212 Fax: 360-385-6213
Office hours: 7:00 am - 4:00 pm Pacific Time, Monday - Friday

Mailing address:
PO Box 1910
Port Townsend, WA 98368 USA

www.ghsport.com

Click here for an index to this and previous COWs