Installation and use of DBLog: (c) Pino Zollo ZP4KFX, GNU GPL license.

DBLog can be installed form the source tarball or from the various distributions packages.

If you decide to start from the source do the following:

As DBLog is written in GAMBAS 2 the first step is to get GAMBAS >=2.5 up and running.
Make practice with the IDE and run the examples that come with it.

In any mode of installation you will need the following:

 DBLog uses the following programs:

-  PostgreSQL for storing qso data's and all configurations.
-  cwdaemon  for sending CW code.
-  rigctld from hamlib >=1.2.7 for interacting with your radio.
-  xdx for receiving  cluster spots.
-  xplanet for showing the earth map.
-  fldigi for digimodes
-  tail 

so you will need to install all these programs from your distribution,
if available, otherwise from the original sources, and configure them.

First install and test the RDBM PostgreSQL; read the tutorial and spend few days
playing with 'psql', the program to interact with it.

If you use PostgreSQL for the first time you should know that it
comes with two data bases named 'template0' and 'template1'.
It comes also with the user 'postgres'.
So to connect for the first time the magic command is:

             psql template1 -U postgres


If it does not work possibly you have to edit as "root" the file pg_hba.conf. For instance
in SuSE 11.1 it is in /var/lib/pgsql/data; or elsewhere depending on the distribution you
have (Debian has it in /etc/postgresql/8.3/main ).
 Change the line:

 local      all       all     ident sameuser

in

 local      all       all     trust

and cross fingers !

The next step is to create the users, give them the right authorization etc., 
then create the data bases (one or more: I use one for testing and the other for 
real use).

To generate and fill the data base tables read the detailed information
into the file README into the directory LOG.

Read the previous statement again until you understand it.

WARNING: New versions of DBLog may add new tables or modify the old ones. 

You need to back-up your database with pg_dump and add the new tables if needed.

Make sure that cwdaemon starts correctly without giving errors and keys correctly your radio. Eventually modify /etc/defaults/cwdaemon .
In my case I use the device ttyS0 and priority -3.

In Debian cwdaemon is stared at boot by inet.d. I do not know about other distributions.

All other programs are run (and killed) by DBLog when needed.

For using the map produced by 'xplanet' you need to edit the file
 /etc/xplanet/config/default
put 

marker_file=/home/your_user/qthmarker

where your_user is the name of your account.
DBLog will write into this file call and coordinates of your qth and
of the other station.

Install hamlib >= 1.2.7 : DBLog will use the daemon 'rigctld'. Update the
configuration table in accord to your radio brand and setup. In my case
data is stored in zp4kfxconf.db. You sure made your own file.
DBLog, at start, runs 'rigctld' passing the configuration record found into the 
'configs' table. This table is loaded with the data's contained in zp4kfxconf.db
(in my case)...you do your own file.

Run Gambas2, load DBLog and run it.(If starting from sources)

Connect to the database with the right user name and password and enjoy it.

If the database does not exist DBLog will ask you if you want create a new one.

You can edit the configuration records and select which configuration to load at run
Just try the 'Config' menu.
NOTE: every configuration record MUST have a unic name.


In RUN mode the qso start time (time_on) is updated when the call in entered.
In S&P mode it takes to decide when the time starts clicking on "Start QSO".
If you forget it the start time will be the one of logging.

The use for logging QSOs is straightforward: in the main window write the call, then
press Tab to go to other fields. At the end of the QSO <Log it>. If you press Enter
the query in the query window will be executed.

In the CW Keyer window you can also press Bar Space or Enter to jump from one field to the next one.

In the SQL Request window you can give any kind of SQL command: search for
something, modify a record or delete what you want. 
Keep the SQL manual at hand !!!...and be careful !!

ADIF export function remembers the number of the last exported qso.
In any case you can change the range to export.

Use UTF-8 encoding for making back-up's of your data's; Use ISO-ISO-8859-1 if that file
will be used by other loggers not capable of UTF-8 encoding. 

The ADIF import, imports ADIF files and updates statistics at the same time.
Errors are logged into the file ImportErrors.txt into your home directory.

The 'Update Statistics' needs to be run after having loaded an empty data base
or any time you feel that something is wrong.


The window "QSOList" shows the last  qso's in the log at start time.


If you want to do a correction to a recent QSO, just click on it. All the data's will be copied into the
upper entry fields. Edit what you need and then click button on the far right to change them into the data base.
A right click will allow to DELETE a qso....for ever.

When you receive a new QSL, just write the call into the 'Call' entry field and press 'Enter':
one or more records will appear. Click on the confirmed one.
All data's will be copied into the upper entry fields. Click on the QSL button and then far right button
for definitive change and statistics update.

To get the cluster spots from xdx it takes to configure it to write DX spots to a
file: Preferences..Output..Save DX Spots

You can tune the radio clicking on a DX Spot in the Cluster window or in the
Spot window.
If you set the RUN mode the window Spots will remember your CQ frequency in 
case you move the dial around.
If in S&P mode Spots remembers calls you entered in the main logging window.
To get this miracle there are two ways: change focus from the 'call' field
to some other or move the radio dial.
The Spot window will follow the radio band if in mode 'Follow'.
Disable Follow if you want S&P in other bands while monitoring the previous band.
 
A right click on Spot allows to delete a spot or to memorize it permanently.

To have a good idea about the propagation you can NCDXF to tune them.
You can be interested in a single beacon or in a band.
In the first case select the beacon with the combo selector or just click
on the beacon line. In the second case select the band with the combo.
You can see the map with MAP. Stop the scanning before closing the window.

If you want use DBLog as 'Log Server' read the file SERVER_DOC.

Possible problem:
Sometime clicking on a menu all X-windows get frozen...the reason is not known at present.
Just kill -9 dblog.

Sometime exporting an ADIF file dblog crashes. The solution is in GAMBAS 2.14.1

Changing configuration on the fly will stop rigctld and start it again.

If the QT libraries ar not installed, by default, dblog will use GTK that does not 
look very nice.
Please install QT.

The configuration of QT can change notably the appearance of the windows.
You can reduce the size of the window reducing the font size with 'qtconfig'.

Of course you can change look and colors at your pleasure.
