Jozzek Posted December 21, 2016 Share Posted December 21, 2016 Witam, jestem w trakcie tworzenia rozbudowanego kalkulatora piwowarskiego(udostępnie go za darmo na forum.) Potrzebuje wzór na nagazowanie piwa w butelkach. Szukam juz z 5h i niemoge znaleźć. Proszę o pomoc. Wysłano z Galaxy S7 Link to comment Share on other sites More sharing options...
dirk gently Posted December 21, 2016 Share Posted December 21, 2016 Ja to zrobiłem tak: public static double CalculateCo2Units(Recipe recipe) { double co2 = (recipe.Fermentation.RefermentationSugar / 4) / recipe.BatchVolume; double celsius = recipe.Fermentation.SecondaryTemperature; ; double fahrenheit = Converter.Celsius2Fahrenheit(celsius); double residualCo2 = 3.0378 - (0.050062 * fahrenheit) + (0.00026555 * fahrenheit * fahrenheit); return co2 + residualCo2; } Zawsze zresztą można zrobić reverse engineering BrewTargeta. Link to comment Share on other sites More sharing options...
Jozzek Posted December 21, 2016 Author Share Posted December 21, 2016 Ja to zrobiłem tak: public static double CalculateCo2Units(Recipe recipe) { double co2 = (recipe.Fermentation.RefermentationSugar / 4) / recipe.BatchVolume; double celsius = recipe.Fermentation.SecondaryTemperature; ; double fahrenheit = Converter.Celsius2Fahrenheit(celsius); double residualCo2 = 3.0378 - (0.050062 * fahrenheit) + (0.00026555 * fahrenheit * fahrenheit); return co2 + residualCo2; } Zawsze zresztą można zrobić reverse engineering BrewTargeta. A napiałbyś to jako wzór ? Nie kapuje tego jezyka zabardzo, ja pisze w Delphi. Wysłano z Galaxy S7 Link to comment Share on other sites More sharing options...
dirk gently Posted December 21, 2016 Share Posted December 21, 2016 (edited) a co tu jest do rozumienia? Język jak język. Mój pascal jest bardzo zardzewiały, ale proszę: function CalculateCo2Units(Recipe recipe): real; var co2, celsius, fahrenheit, residualCo2: real;beginco2 := (recipe.Fermentation.RefermentationSugar / 4) / recipe.BatchVolume;celsius := recipe.Fermentation.SecondaryTemperature; fahrenheit := Converter.Celsius2Fahrenheit(celsius);residualCo2 := 3.0378 - (0.050062 * fahrenheit) + (0.00026555 * fahrenheit * fahrenheit);CalculateCo2Units := co2 + residualCo2;end; Edited December 21, 2016 by dirk gently Link to comment Share on other sites More sharing options...
Jozzek Posted December 21, 2016 Author Share Posted December 21, 2016 a co tu jest do rozumienia? Język jak język. Mój pascal jest bardzo zardzewiały, ale proszę: function CalculateCo2Units(Recipe recipe): real; var co2, celsius, fahrenheit, residualCo2: real; begin co2 := (recipe.Fermentation.RefermentationSugar / 4) / recipe.BatchVolume; celsius := recipe.Fermentation.SecondaryTemperature; fahrenheit := Converter.Celsius2Fahrenheit(celsius); residualCo2 := 3.0378 - (0.050062 * fahrenheit) + (0.00026555 * fahrenheit * fahrenheit); CalculateCo2Units := co2 + residualCo2; end; Dziękuje. Wysłano z Galaxy S7 Link to comment Share on other sites More sharing options...
sihox Posted December 21, 2016 Share Posted December 21, 2016 Zawsze zresztą można zrobić reverse engineering BrewTargeta. Źródełka brewtargeta wiszą sobie na githubie. Oni liczą tak: https://github.com/Brewtarget/brewtarget/blob/develop/src/PrimingDialog.cpp Przy okazji cześć wszystkim jako, że to mój pierwszy post na forum Link to comment Share on other sites More sharing options...
dirk gently Posted December 21, 2016 Share Posted December 21, 2016 Źródełka brewtargeta wiszą sobie na githubie. Oni liczą tak: https://github.com/Brewtarget/brewtarget/blob/develop/src/PrimingDialog.cpp Paskudne pomieszanie warstwy widoku z warstwą biznesową Link to comment Share on other sites More sharing options...
Jozzek Posted December 21, 2016 Author Share Posted December 21, 2016 Źródełka brewtargeta wiszą sobie na githubie. Oni liczą tak: https://github.com/Brewtarget/brewtarget/blob/develop/src/PrimingDialog.cpp Paskudne pomieszanie warstwy widoku z warstwą biznesową Ale działa bez zarzutu. Wysłano z Galaxy S7 Link to comment Share on other sites More sharing options...
dirk gently Posted December 21, 2016 Share Posted December 21, 2016 Akurat ostatnie co można powiedzieć o BT to że działa bez zarzutu. Jakość kodu jakoś tak zawsze pozostaje w korelacji z jakością produktu, im projekt większy tym korelacja ściśliejsza... Link to comment Share on other sites More sharing options...
redlum Posted December 21, 2016 Share Posted December 21, 2016 Dirk jak myślę że jak kolega prosił o funkcje - to chodziło mu o funkcje matematyczna a nie funkcje w jakimś języku programowania Wysłane z mojego A0001 przy użyciu Tapatalka Link to comment Share on other sites More sharing options...
dirk gently Posted December 21, 2016 Share Posted December 21, 2016 A co to jest Twoim zdaniem: co2 = (recipe.Fermentation.RefermentationSugar / 4) / recipe.BatchVolume; Link to comment Share on other sites More sharing options...
redlum Posted December 24, 2016 Share Posted December 24, 2016 (edited) Funkcja matematyczna zawarta w funkcji programu. Nie dla każdego przejrzyście napisana. Wysłane z mojego A0001 przy użyciu Tapatalka Edited December 24, 2016 by redlum Link to comment Share on other sites More sharing options...
Enethion Posted December 27, 2016 Share Posted December 27, 2016 Z pierwszej zmiennej odcinamy "recipe.Fermentation.", z drugiej "recipe." i mamy przejrzyście jak diabli. Już pomijając, że Pascal nagle pasował autorowi wątku, czego nie rozumiem, bo same wzory są praktycznie niezmienne. Składnia języka się zmieniła - jasne, ale to nie są różnice jak między angielskim, a japońskim! W minutę można to przepisać do bieda języka PHP, czy totalnego wariactwa jakim jest JavaScript (choć JS lubię odkąd zacząłem się bawić z NodeJS xD). Pewnie znajdą się wariaci, co zapiszą to w BrainF**ku Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now