Swing Apollo space program mission timer

Still on vacation i took the chance to spent some time on watching movies i ordered some time ago and so i watched several movies related to the Nasa moon landing program which lead to the landing on the moon in july 20th 1969.
In the movie MoonShot which tells the story of Apollo 11 and it’s flight to the moon in 1969 i was fascinated by the board computer of the command module and took a picture of the mission timer which looked great to me…

MissionTimerOriginal.jpg

Because i love coding in Java and those things could be easily done in Java’s swing framework i decided to create a little mission timer by myself and that’s a picture of the result

MissionTimerJava.png

I don’t know if it’s useful to anybody but for those of you who like it, i added the source as netbeans project here MissionTimer.zip

You will find two classes in the project, a JFrame and a TimerPanel. (If you would like to use the TimerPanel in another project you just can drag’n drop the TimerPanel class onto a JFrame, JPanel etc.)

To start or stop the timer you just have to click on the panel with the left mousebutton. To reset the panel just doubleclick on the panel.

Enjoy it and keep swinging…

 

2 thoughts to “Swing Apollo space program mission timer”

  1. I have created seven segment displays before in several languages. Common Lisp, C, Visual FoxPro (yuk!), but not Java.

    In all cases I separated drawing the segments from the conversion of digits to segments. I also considered it a „character“ to segments conversion, where the character could be a digit, or some alpha characters.

    So I would have a function that could take „0123456789ABbCcdEFGHhIiJLlOoPrSUuy-=_“ and return the proper segments.

    I would have a digit panel (or whatever made sense in the language I was using) which could display the seven segments. It would accept a character and use the previous function to decide what segments to turn on.

    I would have a display object that contained one or more digits. The digit objects all had an On and Off color for the segments. The display object also had an On and Off color that would be assigned to all of its digits if the display’s On or Off colors were changed. The display object further had a Background color. By adjusting the On/Off/Background color of a display, you could mimic LED, LCD, Fluorescent, or Neon displays. Sometimes LCD displays have varying background colors.

    The display object could be passed a string, like „123.45“. The display object also had a left/right justify setting. The display object would take the assigned string and assign the individual characters to the digits, which would in turn illuminate their appropriate segments. Thus, you could pass a display a string like „-123“, or „Error“, or „hi“ or „lo“, „Of“, etc.

    In FoxPro (but not in Common Lisp or C), I took this further by creating a „keyboard“ object. You would put „buttons“ on it. Any time a button was pressed, an „event“ fired passing the label of the key. Keys would be „0“ thru „9“, „C“, „CE“, „+“, „-„, „x“, „/“, etc. I also create a „chip“ object that would accept the fired keystrokes and could modify a display object such that the combination of objects formed a calculator.

    Since the „chip“ objects subclassed from an abstract chip, I could replace the „chip“ object so that, for example, I could convert from an algebraic calculator to an RPN calculator. The keyboard and chip could likewise be replaced to form a scientific calculator (but I never actually implemented a scientific calculator subclass).

    The logical conclusion would be a „calculator construction set“ application. Maybe someday I’ll do one in Java.

    Another idea that I never implemented was to replace seven-segment digits in the display object with other digit objects that had more segments capable of displaying letters such as X, Y, V, M, N, /, \, ?, etc. The interface to the Display object would not need to be changed. When constructing the Display, you would simply have it use a different Digit subclass that has more segments.

    Thanks for your cool display. Your display looks so much better than mine by not having a solid background color.

Kommentare sind geschlossen.