SourceForge Logo

JScoreKeeper



Download the source/documentation now.


Introduction

Autocross Scorekeeer Tools is a growing set of utilties for use with the Autocross Scorekeeper database. The code, written in Java, provides an core networked interface to the database and some class abstractions of the data upon which the various application are built. The idea is to augment what Scorekeeper already provides, not replace anything. The current programs are:

Statistics Viewer
Dynamic Posting Sheet
Posting Helper
Online Auditing Tool

Other possible utilities include an interactive tool for cleaning the database or a display indicating change to championship standings (more useful near the end of the season). The project page containg the code and other things is at http://sourceforge.net/projects/jscorekeeper/

Developing Your Own GUI

The tools work off of a local ODBC database pointer via a client-server setup. The server runs on the machine where the database is located and receives requests with possible XML data attached. It performs the requested lookup and responds with an XML document containing the results.

The protocol uses both TCP and UDP. TCP is used during the direct download of data as it already deals with fragmenting data into packets, reassembly, retransmission, etc. UDP is used to discover a server and to broadcast updated result diffs to listening clients. The idea is to reduce the amount of bandwidth used so that many clients can use the service at the same time even when over a low bandwidth wireless network. The protocol also provides sequence information for the sets of data that are read from the database so that diffs can be provided and resynced upon rather than sending the entire set of run data for an event.

For new GUI development, the org.wwscc.client.ClientAdapter class provides an easy method for discovering a server, connecting, downloading the necessary data, receiveing updates and resyncing. All the GUI class must do is start the adapter thread after passing the class an ObjectQueue pointer (this is a blocking queue) to tell it where to place new data received.

        ObjectQueue inQueue = new ObjectQueue();
        ClientAdapter client = new ClientAdapter(inQueue);
        client.start();
        
        Object o = inQueue.getNext();

The first two objects passed to the GUI will be an EventInfo object and an Vector object containing a list of ClassEntry objects. After this, the only objects that will be passed along are Entrant and Run objects as they are received from the server. A single Entrant object with a given carID will always be passed before any related Run objects. Updated Run objects (information in the database changed) may be passed along later. Entrant changes are not monitored.

The GUI components created by the ClientAdapter will appear like so:

Discovering and selecting a server:


Picking a event from the list of events on that server:


A download status box for the initial download of all the current data: