• PATRONS: Did you know we've a chat function for you now? Look to the bottom of the screen, you can chat, set up rooms, talk to each other individually or in groups! Click 'Chat' at the right side of the chat window to open the chat up.
  • Love Gotmead and want to see it grow? Then consider supporting the site and becoming a Patron! If you're logged in, click on your username to the right of the menu to see how as little as $30/year can get you access to the patron areas and the patron Facebook group and to support Gotmead!
  • We now have a Patron-exclusive Facebook group! Patrons my join at The Gotmead Patron Group. You MUST answer the questions, providing your Patron membership, when you request to join so I can verify your Patron membership. If the questions aren't answered, the request will be turned down.

Mead Calculator - V1.0

African Bronze Honey - 50% off for GotMead members

JamesP

Senior Member
Lifetime GotMead Patron
Dec 3, 2003
654
1
0
53
Brisbane Australia
Vicky/Pete,

I finally got around to doing the next version.

Changes:


  • Method of calculation now uses a third degree polynomial to determine Brix from SG, rather than assuming 8 gravity points per gallon of honey in 5 gallons. (thenew value is between 6 and 7 gravity points)
  • Switched layout location of Target SG & Vol with Current SG & Vol (as suggested by Angus)
  • Potential Alcohol Conversion utility added
  • Conversion of quarts/pints/cups/... to Gallons fixed
  • Blending utility selects the volume when you click the associated text entry box
  • Blending utility added radio buttons to change the headings (eye candy!)
  • Batch Util calculations now use 3rd degree polynomials to convert SG to Plato/Brix/Balling
  • Blending Utility now has buttons to select which value to calculate
  • Changing the Gravity type or PA type on the Batch Utility changes the selection on the Potential Alc utility (but not vice versa)
  • Added reset and clear buttons to the Blending Util

Note, the change in layout (2nd dot point) may confuse people for a bit, since the results are at the top, not the bottom now.

An obvious addition is dot point 3, the Potential Alcohol Conversion (I've forgotten who suggested this, but thanks!)

[Note: the attached doc files contain html. I had to save it as a doc file to attach them. Attaching as a zip file didn't work]
 

Smarrikåka

NewBee
Registered Member
Sep 25, 2006
344
1
0
41
Stockholm, Sweden
www.mjodhamnen.se
Well, when going from 1kg of honey to liters, it will say that this will be equal to 1.333 liters

If this were true the density of honey would be around 0,75 kg/liter, which isn't right.

The density of water should be around 1 kg/liter
The density of honey should be around 1.36 kg/liter

So I think you may have gotten the relationship inversed somehow.
 

JamesP

Senior Member
Lifetime GotMead Patron
Dec 3, 2003
654
1
0
53
Brisbane Australia
It is fixed in V1.0 (1kg honey <-> 0.6955 Litre)

However, weight to volume conversion is not fully accurate without including the density of the "material". I haven't added that much complexity to the calculator (yet).

So weight measures are assuming that "sugars" plus water contributes fully to the density, which of course is not true, but is close enough for honey.

If you puree fruit, then weight/volume conversion should be close enough also.
 

pain

GotMead Owner
Staff member
Administrator
Moderator
Apr 5, 1996
1,625
3
38
North Carolina
gotmead.com
James, I uploaded the new code, and created the new help page. The help window is a bit narrow, suggestions on how to change the code so it opens up wider?

Looks *fab*. Thanks *so* much for doing this. You are a true friend, and I can't tell you how much I appreciate your work on this.
 

pain

GotMead Owner
Staff member
Administrator
Moderator
Apr 5, 1996
1,625
3
38
North Carolina
gotmead.com
The code is in, and it should work.

James, when I put in code like that, I can only use what's between the body tags. Does this affect the code's ability to work?
 

ZachR

NewBee
Registered Member
Oct 24, 2009
156
0
0
North Carolina
Looks good, but it isn't calculating for me either. This message popped up when I clicked on the link: "overLIB 4.10 or later is required for the HideForm Plugin."

BTW, I am using Firefox 3.5.7
 

pain

GotMead Owner
Staff member
Administrator
Moderator
Apr 5, 1996
1,625
3
38
North Carolina
gotmead.com
Looks like it won't calc because the <body onclick> function is missing. However, I can't put that in a php generated page, so I'll get James to give me a function to put in, that should fix it.

Sorry about the problems, folks, we'll get 'er done.
 

JamesP

Senior Member
Lifetime GotMead Patron
Dec 3, 2003
654
1
0
53
Brisbane Australia
Vicky,

looks like not all the javascript code got copied in. Maybe it exceeded the amount of data allowed. (Also check that the data I sent you wasn't somehow truncated).

Either way, he scripts won't run because there will be javascript errors - hence why the calculate button didn't work.

How do we proceed from here?

PS - did you check out the SG table generator ?

James
 

pain

GotMead Owner
Staff member
Administrator
Moderator
Apr 5, 1996
1,625
3
38
North Carolina
gotmead.com
OK, I re-inserted the code, by hand using the sql tables, and I'm showing all the code in the source when I open the page, but the buttons still don't work...

Thoughts?
 

JamesP

Senior Member
Lifetime GotMead Patron
Dec 3, 2003
654
1
0
53
Brisbane Australia
Vicky,

Yes, all the code is there now.

The only thing I can think of, is to remove the tags that hide the script from HTML,
so change
Code:
 <SCRIPT LANGUAGE="Javascript">
<!--
   //
to

Code:
 <SCRIPT LANGUAGE="Javascript">
   //

and remove at the end of the javascript section the corresponding
Code:
// -->
===============================================

There is another error:
Code:
onClick="window.open(‘index.php?option=
should be
Code:
onClick="window.open('index.php?option=
 

JamesP

Senior Member
Lifetime GotMead Patron
Dec 3, 2003
654
1
0
53
Brisbane Australia
Vicky,

The forum is too smart. It converted & into & in the javascript which stopped the scripts working.

Starting from
Code:
<SCRIPT type="text/javascript" LANGUAGE="JavaScript">

   //
   // Residual Sugar at SG=1.000
   //
search for & in an if statement, and replace with just the ampersand symbol

as in
Code:
   if ( (vMask & 12) == 8) {  // do **Target Gravity**  (targVol checked, targGrav uncheched)
becomes
Code:
   if ( (vMask & 12) == 8) {  // do **Target Gravity**  (targVol checked, targGrav uncheched)
There should be about seven of these to change.

====================================

Also, I left a degugging statement in there. Can this alert() statement be removed by changing
Code:
		  vTVol = (vSugar*1000 + (SGToSugarConc(vCSg) * vCVol)) / SGToSugarConc(vTSg);  // convert g/L to kg/L
//alert(vCSg+' '+vCVol+' '+vTSg+' '+vTVol);
		  theForm.vol_valt.value = Number(vTVol / Number(theForm.targvol_s.options[theForm.targvol_s.selectedIndex].value));
to
Code:
		  vTVol = (vSugar*1000 + (SGToSugarConc(vCSg) * vCVol)) / SGToSugarConc(vTSg);  // convert g/L to kg/L
		  theForm.vol_valt.value = Number(vTVol / Number(theForm.targvol_s.options[theForm.targvol_s.selectedIndex].value));
====================================

Also, if you can, change the body tag to be
Code:
<BODY onClick="i_updateStats()">
(the forum software might not let you do this)



Thanks, heaps!!!
 

pain

GotMead Owner
Staff member
Administrator
Moderator
Apr 5, 1996
1,625
3
38
North Carolina
gotmead.com
::grumble:: I have been working on this directly in the DB, and it doesn't *have* the & signs converted there, which means it's converting them when the page renders, and I'll have to figure that out. I'll surf the joomla support and figure it out.

The only alert statment I"m turning up is:
Code:
      var vCD = Number(theForm.blend_totvol.value);
//alert(vA+'!'+vB+'!'+vC+'!'+vD+'!'+vM+'!'+vCD);

      // ensure blen value is BETWEEN value#1 and value#2
I can't use body tags in a content management system, it creates its own body tags, so I can only use what's between the body tags. I did a bit of googling, and found a couple pages where they discuss creating a bit of code to deal with that when you can't do it in the body tag. I closed the page tho and can't seem to turn them back up. But the code looked pretty straightforward (if you're good with javascript, which I'm not, LOL).
 

pain

GotMead Owner
Staff member
Administrator
Moderator
Apr 5, 1996
1,625
3
38
North Carolina
gotmead.com
OK, by hacking the core code of the site, I think its working ok now. Test it folks, and make sure it comes back with stuff that looks right.

James, get back to me on the other items, we'll get 'em working...
 
African Bronze Honey - 50% off for GotMead members