need some programmer help
Moderator: Moderators
- Spinning Hat
- Inmate
- Posts: 2564
- Joined: Wed Jun 07, 2000 10:06 am
- Location: Minneapolis, MN
- Contact:
need some programmer help
I've been looking for the last few days unsuccessfully for a timer/stopwatch chronograph that I can run on my desktop when I run practice ATC problems. There's plenty of different ones out there, but I haven't found any that will allow me to set a custom time, and count up like a real clock would, and still allow me to stop, rewind, etc.
The reason i need this kind of functionality, is when running a control problem, we need to have a clock running so we can plan our traffic flows, etc. and in a non-radar environment, time is our friend. We have one in class that we use, but it is owned/ protected by FAA, and I do not have access to it outside the classroom. Anyone know of any out there like this, or know a good way to put one together using Java?
The reason i need this kind of functionality, is when running a control problem, we need to have a clock running so we can plan our traffic flows, etc. and in a non-radar environment, time is our friend. We have one in class that we use, but it is owned/ protected by FAA, and I do not have access to it outside the classroom. Anyone know of any out there like this, or know a good way to put one together using Java?
- XMEN Gambit
- Site Admin
- Posts: 4122
- Joined: Thu Nov 18, 1999 12:00 am
Found this after a quick search, sounds like what you're talking about...
http://www.filesland.com/companies/dnSo ... watch.html
http://www.filesland.com/companies/dnSo ... watch.html
- Spinning Hat
- Inmate
- Posts: 2564
- Joined: Wed Jun 07, 2000 10:06 am
- Location: Minneapolis, MN
- Contact:
-
- Inmate
- Posts: 966
- Joined: Thu Jan 17, 2002 5:26 pm
- Spinning Hat
- Inmate
- Posts: 2564
- Joined: Wed Jun 07, 2000 10:06 am
- Location: Minneapolis, MN
- Contact:
-
- Inmate
- Posts: 2369
- Joined: Mon Oct 02, 2000 12:09 am
- Location: Silverdale, WA
Here is a stopwatch in java...
http://wiki.forum.nokia.com/index.php/A ... E#Download
Here is another one that looks more useful:
http://www.cooperjr.name/Java_stopwatch
I just glanced real quick, and it looks like source and .jar files are available for both.
http://wiki.forum.nokia.com/index.php/A ... E#Download
Here is another one that looks more useful:
http://www.cooperjr.name/Java_stopwatch
I just glanced real quick, and it looks like source and .jar files are available for both.
-
- Inmate
- Posts: 966
- Joined: Thu Jan 17, 2002 5:26 pm
Ok, here's take one: http://www.microsmithinc.com/BlackRider/HatClock.zip
Simple instructions:
* 2 buttons, start/stop & reset.
-- Start/Stop starts & stops the clock
-- Reset resets the time to what's in the DateTimePicker control
* maximize for full screen effect!
Pardon the colors (assuming they work). I figured green/black would work well full screen. They worked fine on my computer, but on my dad's laptop the background color was white & it looked kind of goofy.
Oh, and this was a 10 min project turned into about 2 hours. I was writing it like I learned to program in the 90's and my brother came in and basically had me rewrite the entire program, making full use of the .NET API. My integers for Hours, Minutes, etc. all went into a DateTime and all the methods that gave me meant that all the code I wrote for formatting the Label string (clock) went right out the door. All I needed now was a simple .ToString("HH:mm:ss.ff") and DONE!
The fun part was scaling the font. I took the ratios of newWidth/origWidth and newHeight/origHeight and multiplied the smallest one against the original font size... but I couldn't directly modify the font size. So my bro. figured out that we could create a new Font instance w/ the new font size and labelClock.Text.Font = newFont and DONE!
So after those two hours my code was 1/4 the length of the original code and twice as functional!
Simple instructions:
* 2 buttons, start/stop & reset.
-- Start/Stop starts & stops the clock
-- Reset resets the time to what's in the DateTimePicker control
* maximize for full screen effect!
Pardon the colors (assuming they work). I figured green/black would work well full screen. They worked fine on my computer, but on my dad's laptop the background color was white & it looked kind of goofy.
Oh, and this was a 10 min project turned into about 2 hours. I was writing it like I learned to program in the 90's and my brother came in and basically had me rewrite the entire program, making full use of the .NET API. My integers for Hours, Minutes, etc. all went into a DateTime and all the methods that gave me meant that all the code I wrote for formatting the Label string (clock) went right out the door. All I needed now was a simple .ToString("HH:mm:ss.ff") and DONE!
The fun part was scaling the font. I took the ratios of newWidth/origWidth and newHeight/origHeight and multiplied the smallest one against the original font size... but I couldn't directly modify the font size. So my bro. figured out that we could create a new Font instance w/ the new font size and labelClock.Text.Font = newFont and DONE!
So after those two hours my code was 1/4 the length of the original code and twice as functional!
- Spinning Hat
- Inmate
- Posts: 2564
- Joined: Wed Jun 07, 2000 10:06 am
- Location: Minneapolis, MN
- Contact:
That looks great, and works really good, but I think the time is slow. I had done a completely non scientific comparison between my system clock ticking off seconds, and the java clock Asha posted above, and it was about 1.75 to one. Also, is there a way I can set it for the 24 hour clock? I don't need to use AM PM, since all ATC is done in UTC. If not, no biggie, we can do the conversion to the 24hr clock in real time.
Damn you guys are awesome.
Damn you guys are awesome.
-
- Inmate
- Posts: 966
- Joined: Thu Jan 17, 2002 5:26 pm
lol, I just realized it is slow............... I think I might know what it is.
*update* Ok, redownload it. I forgot the the Windows Forms Timer isn't accurate enough to use for a clock (not at the milliseconds level anyway). So I simply changed it to a deltaTime = lastTime.Subtract(DateTime.Now) to find a more accurate change in time for timer ticks. I tested it for 45 minutes and it was accurate as far as I could tell.
*update* Ok, redownload it. I forgot the the Windows Forms Timer isn't accurate enough to use for a clock (not at the milliseconds level anyway). So I simply changed it to a deltaTime = lastTime.Subtract(DateTime.Now) to find a more accurate change in time for timer ticks. I tested it for 45 minutes and it was accurate as far as I could tell.
- Spinning Hat
- Inmate
- Posts: 2564
- Joined: Wed Jun 07, 2000 10:06 am
- Location: Minneapolis, MN
- Contact: