Author Topic: Fahrenheit-Celsius Converter  (Read 7481 times)

0 Members and 1 Guest are viewing this topic.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Fahrenheit-Celsius Converter
« on: May 16, 2020, 05:44:47 am »
Here at Quirky Towers we have been daily measuring our temperatures to make sure that we haven't caught any virus infection.  The digital thermometer which we're using suddenly changed from Celsius to Fahrenheit without being able to be set.  So this gave me the idea that it would be a fun project to make an Inform conversion program, even though, of course, the conversion is trivial.

Originally, I had hoped to combine a thermometer image with a Vertical Progress Bar Control in order to make a liquid column thermometer, as that would have been an interesting programming scheme.  But as there is not a vertical progress bar, all the thermometer features are created with images.

The Inform Controls used in this project are:

Picture Box - for display of images
Text Box - for data input and output
Label - for labelling(!)
Frame - for containing Radio Buttons
Radio Buttons - for changing scales
Button - for exiting program
Toggle Switch - for changing display conditions

From the URL, download the zip and extract the folder and place that in your QB64 folder.  Open the bas in the IDE and run (with "Output EXE to Source Folder" Run Option checked).  You will need to copy the file falcon.h to the QB64 folder if this does not exist there.

You can input a temperature either in Fahrenheit or in Celsius, by either changing the number in a text box followed by Enter or by moving the cursor onto the thermometer column and clicking.  Once a thermometer has been clicked in this way you cannot click a second time until you have moved the cursor away from the column and moved it back in.

The scales can be changed between body and room temperatures.  An image is displayed indicative of the temperature selected.

The data text boxes move up and down with the selected temperatures, but if this feature is annoying the Toggle Switch can be clicked to set the text boxes in fixed positions.

You will notice that for the Body Temperature setting, the 102°F and a scale marker next to it are incorrectly displayed.  This is an oddity as there is nothing in the code (so far as I know) different about this position: a very strange oddity.

https://www.dropbox.com/s/mm3p83rhmre5hfo/Fahrenheit.zip?dl=1

 
screenshot.png

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Fahrenheit-Celsius Converter
« Reply #1 on: May 16, 2020, 06:59:10 am »
Qwerkey this is adorable!

Can verify the math works out. Tested on freezing, boiling, and -40.
You're not done when it works, you're done when it's right.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Fahrenheit-Celsius Converter
« Reply #2 on: May 16, 2020, 08:04:15 am »
Oh, STxAxTIC, thank you.

A, you're adorable.
B, you're so beautiful.
C, you're a cutie full of charms.
D, you're a darling and
E, you're exciting and
F, you're a feather in my arms

G, you look good to me.
H, you're so heavenly.
I, you're the one I idolize.
J, we're like Jack and Jill.
K, you're so kissable.
L, is the love light in your eyes!