Page 1 of 3 123 LastLast
Results 1 to 20 of 44

Thread: Mead Calculator - V1.0

  1. #1
    Join Date
    Dec 2003
    Location
    Brisbane Australia
    Posts
    654

    Default Mead Calculator - V1.0

    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]

  2. #2
    Join Date
    May 2007
    Location
    The Fusel Shack, in the swamp west of Ft. Lauderdale, Florida
    Posts
    8,641

    Default

    Ooooooh....This sounds great! When do we get to see this beauty?
    Last edited by Medsen Fey; 01-13-2010 at 09:17 PM.
    Lanne pase toujou pi bon
    (Past years are always better)

  3. #3

    Default

    Hello James. Looking forward to it. I see you changed some volume conversions, but did you fix the liter conversion too?

  4. #4
    Join Date
    Dec 2003
    Location
    Brisbane Australia
    Posts
    654

    Default

    Quote Originally Posted by Smarrikåka View Post
    . . . did you fix the liter conversion too?
    There were issues with the quantity conversion to cups (in the additional Sugars section). What was the issue with Litres ?

  5. #5

    Default

    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.

  6. #6
    Join Date
    Dec 2003
    Location
    Brisbane Australia
    Posts
    654

    Default

    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.

  7. #7
    Join Date
    Apr 1996
    Location
    Youngsville, NC
    Posts
    1,608

    Default

    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.
    Wassail!

    Vicky Rowe
    Owner & Webmistress, Gotmead.com
    Executive Director, American Mead Makers Association
    http://www.mead-makers.org
    Making Mead since 1995

  8. #8
    Join Date
    May 2007
    Location
    The Fusel Shack, in the swamp west of Ft. Lauderdale, Florida
    Posts
    8,641

    Default

    It looks great, but it doesn't seem to be calculating. Is is turned on yet?
    Lanne pase toujou pi bon
    (Past years are always better)

  9. #9
    Join Date
    Apr 1996
    Location
    Youngsville, NC
    Posts
    1,608

    Default

    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?
    Wassail!

    Vicky Rowe
    Owner & Webmistress, Gotmead.com
    Executive Director, American Mead Makers Association
    http://www.mead-makers.org
    Making Mead since 1995

  10. #10

    Default

    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

  11. #11
    Join Date
    Apr 1996
    Location
    Youngsville, NC
    Posts
    1,608

    Default

    Workin on it guys. I'll get with James and we'll get it fixed.
    Wassail!

    Vicky Rowe
    Owner & Webmistress, Gotmead.com
    Executive Director, American Mead Makers Association
    http://www.mead-makers.org
    Making Mead since 1995

  12. #12
    Join Date
    Apr 1996
    Location
    Youngsville, NC
    Posts
    1,608

    Default

    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.
    Wassail!

    Vicky Rowe
    Owner & Webmistress, Gotmead.com
    Executive Director, American Mead Makers Association
    http://www.mead-makers.org
    Making Mead since 1995

  13. #13
    Join Date
    Dec 2003
    Location
    Brisbane Australia
    Posts
    654

    Default

    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

  14. #14
    Join Date
    Apr 1996
    Location
    Youngsville, NC
    Posts
    1,608

    Default

    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?
    Wassail!

    Vicky Rowe
    Owner & Webmistress, Gotmead.com
    Executive Director, American Mead Makers Association
    http://www.mead-makers.org
    Making Mead since 1995

  15. #15
    Join Date
    Dec 2003
    Location
    Brisbane Australia
    Posts
    654

    Default

    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=

  16. #16
    Join Date
    Apr 1996
    Location
    Youngsville, NC
    Posts
    1,608

    Default

    OK, did this, and help button is working now. But the rest seems to be having issues.

    OK, next idea? LOL...
    Wassail!

    Vicky Rowe
    Owner & Webmistress, Gotmead.com
    Executive Director, American Mead Makers Association
    http://www.mead-makers.org
    Making Mead since 1995

  17. #17
    Join Date
    Dec 2003
    Location
    Brisbane Australia
    Posts
    654

    Default

    Vicky,

    The forum is too smart. It converted & into &amp; 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 &amp; in an if statement, and replace with just the ampersand symbol

    as in
    Code:
       if ( (vMask &amp; 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!!!

  18. #18
    Join Date
    Apr 1996
    Location
    Youngsville, NC
    Posts
    1,608

    Default

    ::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).
    Wassail!

    Vicky Rowe
    Owner & Webmistress, Gotmead.com
    Executive Director, American Mead Makers Association
    http://www.mead-makers.org
    Making Mead since 1995

  19. #19
    Join Date
    Apr 1996
    Location
    Youngsville, NC
    Posts
    1,608

    Default

    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...
    Wassail!

    Vicky Rowe
    Owner & Webmistress, Gotmead.com
    Executive Director, American Mead Makers Association
    http://www.mead-makers.org
    Making Mead since 1995

  20. #20

    Default

    Looks like it's working now. Thanks Vicky and James!

Page 1 of 3 123 LastLast

Similar Threads

  1. Using the mead calculator
    By YogiBearMead726 in forum Mead NewBees - Post your Questions Here
    Replies: 2
    Last Post: 11-05-2010, 11:18 AM
  2. Re: I believe I don't know how to use the mead calculator correctly
    By Chimerix in forum Site Suggestions, New Toys and Tools
    Replies: 1
    Last Post: 02-10-2007, 03:56 AM
  3. Mead Calculator Assistance
    By painthappy in forum Mead NewBees - Post your Questions Here
    Replies: 1
    Last Post: 08-26-2005, 12:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •