Skip to content
Aussieveedubbers

off topic nazis and non programmers DO NOT READ

0 likes
Share Share on Facebook Share on X Share on Reddit

amazer kombi pilot

3,187 posts · joined Aug 2002 ·

#371360
For those who dont know me I am heavily involved in organising motorsport events, particularly hilllclimbs. For the uninitiated, hillclimbing is a where drivers compete against the clock to complete an uphill course. It's a timed solo event starting at the bottom and ending at the top of a hill or mountain. Pike's Peak is probably the best known hillclimb. At present the timing 'system' is a light beam/reflector at both ends of the track, sending a signal down a wire to a stopwatch. The times are written in a book as well as manually entered into an excel spreadsheet.

I want to create a computerised timing system. It will have a database that I enter drivers details in before the event. They will be stored in a database so that I dont have to enter the details every race, like I do now with excel. (licence number as PK). All the competitors times would also be stored, with the date, so that I could call up any results at any time.

When the event starts I want to be able to control the entire show with a PC. When a car comes to the line I want to be able to hit a function key, F2 for eg, and that will pop up a dialog box to enter the car number. That car and drivers details should come on screen so that I can have a visual check its the right car. Then by clicking on a start button, the car gets the green light, the timing signals are sent straight into the computer, and timing entered automatically.... next car...F2 etc.

Thinking of a java application as its what I am most comfortable with, but also thinking of having an apache server, and using jsp pages or servlets... because I hate formatting things in a java frame.. have never quite mastered that! Any thoughts on what I should use?

And my main stumbling block would be how do I send signals to the green light from the computer? How do I get signals from the light beams to the computer? I know these kind of things would be in use for industrial applications everywhere, but its not something they teach you at uni. Any thoughts on how you do this. or links to information would be much appreciated.

[Edited on 13-6-2005 by amazer]
Chris.... kombi pilot, oval dreamer... finisher #26971 2005 city to surf

penguin ackkkkkk thhhhhpt!

3,383 posts · joined Aug 2002 ·

#371513
Chris,
I am not a programmer or an off topic nazi, but I can say that we have used a system that you are talking about for downhill skiing already at Mt Hotham. Not sure what it is called but they use a radio signalled system rather than a wired setup. That way we can transfer it from course to course (slalom to downhill etc) without wires etc.
I know that they had a relay at teh start gate for when we moved the gate ( a small boom across our legs that simply rotates out of the way) and I wouldn't think it would be that hard to rig a small transmitter/relay off your green light if you were allowed to add it to the wiring system.
If you want I can try and ask about and see what was made up or bought?
'Ah, whatever................'

Brad Wolfsburg Elder

3,764 posts · joined Aug 2002 ·

#371522
You will need to use the timing gear at the track or the track nazi's will get you.

The application itself would be quite simple and I would think java will work quite well. Maybe tie it into something like Access table to store data and make it easier.

getting signal would not be that hard either as I would imagine the time gear you use has some sort of print out, if so then it is alredy sending it in a data form. If not the light is being activated by some sort of signal.
Brad
Why copy when you can own an original ?
Meyers Manx Australia

amazer kombi pilot

3,187 posts · joined Aug 2002 ·

#371581
whats used now is extremely basic.

there is a round reflector on one side of the track... just like on the white posts on the road side only white.. and some kind of light sensor thingo on the other. when the 'beam' is broken, there is a single wire going to the stop watch... a stop watch just like would be used for athletics training. The connection looks just like a small headphone jack like a walkman type doohicky. There is no print out, the time is written down in a book. Before I got there, that was it! I created an excel spreadsheet that at least picks out each drivers fastest time and ranks them for position in class and outright. Which also let me print them out and have them posted on a board for all to see.

Its open for error. If the timer writes it down wrong, or a typo going into the computer and it causes mayhem and arguments, eg Torrens vs Durie class 2E record... not that they are the only ones. And also uses one more person than necessary.

I am sure that there must be industrial applications on automated production lines wanting the same things. Unless they are using custom hardware.
Chris.... kombi pilot, oval dreamer... finisher #26971 2005 city to surf

andrewh Officially Full-On Dubber

284 posts · joined Jan 2004 ·

#371597
The interface to the green light thing could be tricky to do in Java. It depends on how it works at the moment. From the sounds of it the connection is pretty low level at the moment. To get that working on a PC may require some sort of hardware interface and a program written in some lower level programming language.

The data part of the application sounds relatively straightforward though.

If Java is what you're comfortable with then that would be the best choice.

I'm guessing that you're presently running on a Windows machine (from your reference to Excel). A lot of what you describe could probably be written in Access (coming from someone who loathes Access), and use a bit of VBA code to call the thing that handles the timing. Writing it in Access will probably see the thing come into existence quit a lot faster than having to write a whole application in Java or most other programming languages probably.

Quoll Officially Full-On Dubber

232 posts · joined Jan 2003 ·

#371616
yeah java won't like connecting to the light, C/C++ would be a better choice as it can communicate with serial ports etc better (This is what I have heard form people doing mechatronics who do java with me.)

General_Failure Use your head, don't abuse it!

1,036 posts · joined Jun 2004 ·

#371626
If possible go for C/C++. There are plenty of interfacing routines available and included in the libraries. or you could just interface directly using assembler. Guess you wouldn't want to do that though.

You seem to like the web interface if I understand correctly. You could have a C program running in a CGI setup interfacing with a database using SQL (much easier). The whole thing could be displayed via DHTML generated by the program too.
personally web interfaces put a feeling of dread into me. Wouldn't you prefer a nice shiny app?
What OS do you want it to run on?
Win32, Unix/Linux, MacOS, AmigaOS etc etc.

Perl is another good language to put it together in. Nowhere near as fast as the compiled languages, but it's the swiss-army chainsaw of programming languages.
If at first you don't succeed. Build, build again.
Vehicle: 1975 Special order delivery walkthrough panel based LCA pop-top camper. Motor: Nippon 1.8L Single port Wasserboxer, Transmission: 3 rib 002.

andrewh Officially Full-On Dubber

284 posts · joined Jan 2004 ·

#371672
C and C++ sound like overkill for most of this app though. I'd definitely use something like Java or a .Net language (if you don't mind it being basically Windows only) for the main data part of it, and use C/C++ just for the interface to the timer.

Another language you could look at is Python. It too is an interpreted language, but almost everybody I've encountered loves it, and it's extensible using C++.

To be honest though Java is probably the best choice since you are already comfortable with it and it will probably be easier to write a web app than to program CGI scripts in C/C++/Python/Bash/Perl.

bat69 There is no status

791 posts · joined Apr 2005 ·

#371722
Westlake Automobile Club in Newcastle have a full electronic timing system very similar to what you are talking about. Everyones name goes into the system when your entries received. They punch in your race number at the start line and all your times are recorded electronically. After every car has completed the stage you press a button and it prints out all times for outright and class placings in order. Fantastic. The bloke who designed it is a Westlakes member and is a dead set electronic guru.
White Knuckle Racing Team [/i]
"Drive it like dirt"

amazer kombi pilot

3,187 posts · joined Aug 2002 ·

#371730
The interface to the green light thing could be tricky to do in Java. It depends on how it works at the moment.
ohh its very high tech. There is a little white box with a relay inside, and a toggle switch on top, connected by alligator clips to a 12V battery. I pull switch and light goes green.

It would be a windows machine, currently an older pentium, very low spec. Running windows 98 which would scare most but if its only running this one thing, not connected to internet its fine. Could go linux if there was a benefit to be had.

Apart from the signals in and out, I could easily do this in java using mysql. I would have difficulty in C++ because I know absolute zero (or less) about graphics and windows with C++. Maybe I need to learn. Everything has to be free hence my windows/apache/perl/mysql limitation.(within reason)
Chris.... kombi pilot, oval dreamer... finisher #26971 2005 city to surf

andrewh Officially Full-On Dubber

284 posts · joined Jan 2004 ·

#371755
amazer wrote:ohh its very high tech. There is a little white box with a relay inside, and a toggle switch on top, connected by alligator clips to a 12V battery. I pull switch and light goes green.
This could be the tricky bit then. Working out how to control it all from a computer could be a challenge. You might have to speak to someone who knows more about hardware, or see if there's any generic PC controllers for switching things.
Apart from the signals in and out, I could easily do this in java using mysql. I would have difficulty in C++ because I know absolute zero (or less) about graphics and windows with C++. Maybe I need to learn. Everything has to be free hence my windows/apache/perl/mysql limitation.(within reason)
Java with MySql seems like a good combination. It has the advantage of being able to run it under any OS fairly effortlessly if you decide you need to do that.

If you decide to write this, what plans do you have for the software? Is it something you're going to keep solely for your own use or do you plan to sell it/give it away free to others?

vanderaj Administrator a suffusion of yellow

3,130 posts · joined Aug 2002 ·

#371758
amazer wrote:
The interface to the green light thing could be tricky to do in Java. It depends on how it works at the moment.
ohh its very high tech. There is a little white box with a relay inside, and a toggle switch on top, connected by alligator clips to a 12V battery. I pull switch and light goes green.

It would be a windows machine, currently an older pentium, very low spec. Running windows 98 which would scare most but if its only running this one thing, not connected to internet its fine. Could go linux if there was a benefit to be had.

Apart from the signals in and out, I could easily do this in java using mysql. I would have difficulty in C++ because I know absolute zero (or less) about graphics and windows with C++. Maybe I need to learn. Everything has to be free hence my windows/apache/perl/mysql limitation.(within reason)
Latency on Windows 98 is not good, particularly on older machines - it's basically non-deterministic. You're much better off using something like Windows XP or Linux 2.6 kernel which can guarantee processor scheduling for real time processes.

Depending on your timing needs (hundredths of a second?) you will need to use a low-level program written in something fairly fast like C, C++, Java or a .NET language, and you can write the stats side of things in anything you like.

My personal preference is .NET for that - simple and fast. However, you mention the box is fairly low end. In which case, you're better off getting a Fedora or Ubuntu CD-ROM and writing it in Apache / PHP / MySQL. The timing program would need to be written in !PHP as PHP is a dog. PHP can be run from the command line, so that's not the limitation. Java would do nicely, but it MUST not write to the database until after it has captured the time. If the machine is low end, Java is inappropriate as JVM's are notorious for snaffling lots of memory for no reason.

Andrew

amazer kombi pilot

3,187 posts · joined Aug 2002 ·

#371775
argh, why is everything so hard. I want to learn abut .NET, but the cheapest courses I have found require selling my only child. You're all scaring me. I think I may start with the basics, leave the timing till last, just copy things over as I do now with excel. At least then poeple within the car club may think I am clever, even if I have jsut written an uncecessary application that just mimics excel. Probably wont try to implement clippy :P Then when it works and I install it at Huntley, then try to go further.. will probably have to rewrite it in another language, but I have kept my rudimentary skills alive in the meantime.
Chris.... kombi pilot, oval dreamer... finisher #26971 2005 city to surf

andrewh Officially Full-On Dubber

284 posts · joined Jan 2004 ·

#371801
Learning .Net is not something that will necessarily require you to go on a course. There are plenty of free resources for learning .Net on the internet. I taught myself more than enough .Net to do what you're trying to do basically from experience and reading up on the internet on topics like ADO.Net.

If you already have experience with Java then moving to C# (or you could even write in J#) will not be a huge shock. Although having said that I use Visual Studio for .Net programming which takes away a lot of the pain of designing forms and doing builds. If you had to do it all with text editors and the SDK tools then I imagine it would be a different experience.

On the subject of timing, would the app itself have to do the timing? I was thinking that you'd just be using an external timing device and capturing the time from it somehow.