115 |
115 |
116 var HopFormData = [ |
116 var HopFormData = [ |
117 { id: 0, en: 'Pellet', nl: 'pellets' }, |
117 { id: 0, en: 'Pellet', nl: 'pellets' }, |
118 { id: 1, en: 'Plug', nl: 'plugs' }, |
118 { id: 1, en: 'Plug', nl: 'plugs' }, |
119 { id: 2, en: 'Leaf', nl: 'bellen' } |
119 { id: 2, en: 'Leaf', nl: 'bellen' } |
|
120 // { id: 3, en: 'Leaf wet', nl: 'bellen nat' } |
120 ]; |
121 ]; |
121 var HopFormSource = { |
122 var HopFormSource = { |
122 localdata: HopFormData, |
123 localdata: HopFormData, |
123 datatype: "array", |
124 datatype: "array", |
124 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
125 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
840 pfactor += my_factor_pellet / 100; |
846 pfactor += my_factor_pellet / 100; |
841 } |
847 } |
842 if (Form == 1 ) { // Plug |
848 if (Form == 1 ) { // Plug |
843 pfactor += my_factor_plug / 100; |
849 pfactor += my_factor_plug / 100; |
844 } |
850 } |
|
851 // if (Form == 3) { // Wet leaf |
|
852 // pfactor += 5.5; // From https://github.com/chrisgilmerproj/brewday/blob/master/brew/constants.py |
|
853 // } |
845 |
854 |
846 if (Method == 0) { // Tinseth |
855 if (Method == 0) { // Tinseth |
847 /* http://realbeer.com/hops/research.html */ |
856 /* http://realbeer.com/hops/research.html */ |
848 var AddedAlphaAcids = (alpha * mass * 1000) / liters; |
857 var AddedAlphaAcids = (alpha * mass * 1000) / liters; |
849 var Bigness_factor = 1.65 * Math.pow( 0.000125, gravity - 1); |
858 var Bigness_factor = 1.65 * Math.pow( 0.000125, gravity - 1); |
956 } |
965 } |
957 |
966 |
958 |
967 |
959 |
968 |
960 function sg_to_plato(sg) { |
969 function sg_to_plato(sg) { |
961 if (sg > 0.5) |
970 // http://www.brewersfriend.com/2012/10/31/on-the-relationship-between-plato-and-specific-gravity/ |
962 return 259 - 259 / sg; |
971 return ((135.997 * sg - 630.272) * sg + 1111.14) * sg - 616.868; |
963 return 0; |
|
964 } |
972 } |
965 |
973 |
966 |
974 |
967 |
975 |
968 function plato_to_sg(plato) { |
976 function plato_to_sg(plato) { |
969 if (plato < 259) |
977 return 1 + (plato / (258.6 - ((plato / 258.2) * 227.1))); |
970 return 259 / (259 - plato); |
978 } |
971 return 1.000; |
979 |
|
980 |
|
981 |
|
982 function brix_to_sg(brix) { |
|
983 return plato_to_sg(brix / my_brix_correction); |
|
984 } |
|
985 |
|
986 |
|
987 |
|
988 function sg_to_brix(sg) { |
|
989 return sg_to_plato(sg) * my_brix_correction; |
972 } |
990 } |
973 |
991 |
974 |
992 |
975 |
993 |
976 function estimate_sg(sugars, batch_size) { |
994 function estimate_sg(sugars, batch_size) { |