I wonder if the LCD font that I am using is the difference? I actually did a lot more work on it last night and it's really looking sweet. I started the database today and need to build a web interface to populate it. I have been thinking about how I want to do things all day and this is going to be pretty cool if everything comes together. This is basically what I have in mind:
Laptop #1: I have an old Dell Latitude CPi 366Mhz laptop that will be running the app we built in this thread. The timing light will be plugged into the serial port on this laptop. It will also be running a MySQL database and an Apache server. I have upgraded it to FC4 and just ordered some more memory and a new battery for it. I also stuck a wireless card in this laptop.
Laptop #2: My main laptop also running FC4 and has a wireless card.
We have about 4 hours before the event where the riders sign up and pay their entry fee. I will have a web app (PHP) built and running on Laptop 1 that I will connect to from Laptop #2 in the clubhouse and enter all the rider info into the database through that web app. In fact since it is a web database we could have more than one person at a time entering rider data. Before I entered it all by myself in a Calc spreadsheet.
During the event when a rider comes to the line I would like to be able to enter the rider number in the ET program we wrote in this thread, which would then pull up the rider info and display it along with the time. When the time is displayed I would like it automatically entered into the database associated with that rider number. Actually, I may need that time to be editable and have to have someone click a button to record it in the database. The reason for this is that the rider might not actually make it over the hill and we will have to record a footage rather than a time (which is the case mostly in the kids classes).
In the first climb we had this year I also had a laser printer hooked up and after each run in each class I would print out a sheet sorted by fastest rider and hang it on a bulletin board outside the timing shack. I am thinking that since I will have this on a wireless network we could have someone else bring in their laptop (laptop #3) and have a real time status page that could be browsed. It would save me a lot of printing and time not having to do that.
I am not sure if I want anyone entering data on the keyboard on laptop 1 though. I might want to do this from my laptop 2. I think leaving it as a display laptop only (and running the database and web server) is the best way to do it. I will have to enable this Tk app to recognize what rider is at the line and display their information. I guess this means that the Tk app will have to change quite a bit to also display the rider information and maybe record the rider number with the time in the history. I don't really want to worry about that until I get the web database built though.
I haven't started on the web app but I did create the tables I think I need based off of the information I have recorded in
the spreadsheet. Here's the schema I have come up with so far:
Code: Select all
CREATE TABLE `rider` (
`rid` int(11) NOT NULL auto_increment,
`last` varchar(25) NOT NULL default '',
`first` varchar(25) NOT NULL default '',
`city` varchar(25) NOT NULL default '',
`st` char(2) NOT NULL default '',
`age` smallint(6) NOT NULL default '0',
`dist` smallint(6) NOT NULL default '0',
`sponsor` varchar(50) NOT NULL default '',
`comments` text NOT NULL,
PRIMARY KEY (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
CREATE TABLE `class` (
`cid` char(3) NOT NULL default '',
`rid` int(11) NOT NULL default '0',
`bike` varchar(25) NOT NULL default '',
`sponsor` varchar(50) NOT NULL default '',
`comments` text NOT NULL,
PRIMARY KEY (`cid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `times` (
`cid` char(3) NOT NULL default '',
`et` varchar(6) NOT NULL default '',
`timestamp` timestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
This is "roughly" what I have thought out so far. I guess in addition to getting all the data in the database I have to figure out how to signal the ET Tk app for which rider is at the line. Really the idea is pretty simple, now I just have to motivate myself to write code which is getting harder to do these days. :)
Last night before calling it a night I wrote a little script to stick different times in the "time.dat" file every 1 second alternating with a "." to put it into the READY state. I fired up a second copy of the app and had it display on my second laptop over the wireless connection. So I had two copies of the Tk app running times every 1 second all night long. I just wanted to make sure it would hold up on climb night. It passed with flying colors. The old laptop running it only has 64MB of RAM and is a 366Mhz running FC4 (as I mentioned). I also have it running the ET Tk app, the MySQL database, and web server right now and it seems to be working very acceptably even with that little amount of RAM. I should have 256MB in it by the middle of the week so it will have more than enough to do what I want.
I'm open for suggestions on any of this and if anyone is interested in helping I would certainly take it. I certainly thank you for the boost with the perl-Tk! Sometimes I just need a nudge here and there and then I can't stop myself.