Commit 5bc0d967 authored by Meade's avatar Meade

Added version 6.2.0. Annotated types to all variables. Cleaned up logic in...

Added version 6.2.0. Annotated types to all variables. Cleaned up logic in realABVFormatting(). Updated tests.
parent e393f718
## New In 6.2.0
* * Annotated types to all variables
* * Cleaned up unnecessary logic in `realABVFormatting()`
* * Updated tests to include all logic cases
## New In 6.1.0 ## New In 6.1.0
* * Made use lines explicit * * Made use lines explicit
* * Fixed strict floating point comparisons * * Fixed strict floating point comparisons
......
[[package]] [[package]]
name = "BrewStillery" name = "BrewStillery"
version = "6.1.0" version = "6.2.0"
dependencies = [ dependencies = [
"gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gio 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
......
[package] [package]
name = "BrewStillery" name = "BrewStillery"
version = "6.1.0" version = "6.2.0"
authors = ["Meade <thedarkula2049@gmail.com>", "Emily <marleybrush5@gmail.com>"] authors = ["Meade <thedarkula2049@gmail.com>", "Emily <marleybrush5@gmail.com>"]
description = "BrewStillery is a brewer's, vintner's, and distiller's calculator. It has a multitude of great functions, such as calculating ABV, determining carbonation, and total sparge water needed." description = "BrewStillery is a brewer's, vintner's, and distiller's calculator. It has a multitude of great functions, such as calculating ABV, determining carbonation, and total sparge water needed."
# documentation to come # documentation to come
......
...@@ -4,10 +4,10 @@ It has a multitude of great functions, such as calculating ABV, determining carb ...@@ -4,10 +4,10 @@ It has a multitude of great functions, such as calculating ABV, determining carb
Written in Rust, using GTK3 Written in Rust, using GTK3
## New In 6.1.0 ## New In 6.2.0
* * Made use lines explicit * * Annotated types to all variables
* * Fixed strict floating point comparisons * * Cleaned up unnecessary logic in `realABVFormatting()`
* * Changed `.validInput()` to return NAN instead of 0.0. Also changed all logic to use `.is_nan()` to match. * * Updated tests to include all logic cases
## Full Changelog ## Full Changelog
* [Available Here](CHANGELOG.md) * [Available Here](CHANGELOG.md)
......
...@@ -4,27 +4,27 @@ use functions::commonFunctions::{imperialOrMetric, inputMatching, singleInput}; ...@@ -4,27 +4,27 @@ use functions::commonFunctions::{imperialOrMetric, inputMatching, singleInput};
pub fn champagneCarbonationPrep(champagneCarbonationBuilder: &gtk::Builder) { pub fn champagneCarbonationPrep(champagneCarbonationBuilder: &gtk::Builder) {
let champagneCarbonationVolume: gtk::Entry = champagneCarbonationBuilder.get_object("champagneCarbonationVolume").expect("champagneCarbonationPrep(), champagneCarbonationVolume"); let champagneCarbonationVolume: gtk::Entry = champagneCarbonationBuilder.get_object("champagneCarbonationVolume").expect("champagneCarbonationPrep(), champagneCarbonationVolume");
let champagneCarbonationVolumeBuffer = champagneCarbonationVolume.get_text().expect("champagneCarbonationPrep(), champagneCarbonationVolumeBuffer"); let champagneCarbonationVolumeBuffer: String = champagneCarbonationVolume.get_text().expect("champagneCarbonationPrep(), champagneCarbonationVolumeBuffer");
let champagneVolume = champagneCarbonationVolumeBuffer.validInput(); let champagneVolume: f64 = champagneCarbonationVolumeBuffer.validInput();
let champagneCarbonationSugar: gtk::Entry = champagneCarbonationBuilder.get_object("champagneCarbonationSugar").expect("champagneCarbonationPrep(), champagneCarbonationSugar"); let champagneCarbonationSugar: gtk::Entry = champagneCarbonationBuilder.get_object("champagneCarbonationSugar").expect("champagneCarbonationPrep(), champagneCarbonationSugar");
let champagneCarbonationUnits: gtk::ComboBoxText = champagneCarbonationBuilder.get_object("champagneCarbonationUnits").expect("champagneCarbonationPrep(), champagneCarbonationUnits"); let champagneCarbonationUnits: gtk::ComboBoxText = champagneCarbonationBuilder.get_object("champagneCarbonationUnits").expect("champagneCarbonationPrep(), champagneCarbonationUnits");
let champagneCarbonationUnitsBuffer = champagneCarbonationUnits.get_active_id().expect("champagneCarbonationPrep(), champagneCarbonationUnitsBuffer"); let champagneCarbonationUnitsBuffer: String = champagneCarbonationUnits.get_active_id().expect("champagneCarbonationPrep(), champagneCarbonationUnitsBuffer");
let imperialOrMetric = champagneCarbonationUnitsBuffer.unitMatch(); let imperialOrMetric: imperialOrMetric = champagneCarbonationUnitsBuffer.unitMatch();
if champagneVolume.is_nan() { if champagneVolume.is_nan() {
champagneCarbonationSugar.set_text("Enter a number"); champagneCarbonationSugar.set_text("Enter a number");
} else if champagneVolume <= 0.0 { } else if champagneVolume <= 0.0 {
champagneCarbonationSugar.set_text("Enter a positive number"); champagneCarbonationSugar.set_text("Enter a positive number");
} else { } else {
let totalSugar = champagneCarbonationMaths(champagneVolume, imperialOrMetric); let totalSugar: f64 = champagneCarbonationMaths(champagneVolume, imperialOrMetric);
champagneOutput(totalSugar, imperialOrMetric, champagneCarbonationBuilder) champagneOutput(totalSugar, imperialOrMetric, champagneCarbonationBuilder)
} }
} }
pub fn champagneCarbonationMaths(champagneVolume: f64, imperialOrMetric: imperialOrMetric) -> f64 { pub fn champagneCarbonationMaths(champagneVolume: f64, imperialOrMetric: imperialOrMetric) -> f64 {
let mut totalSugar = 0.0; let mut totalSugar: f64 = 0.0;
if imperialOrMetric == imperialOrMetric::imperialGB { if imperialOrMetric == imperialOrMetric::imperialGB {
totalSugar = champagneVolume.gallonsGBToGallonsUS().volumeToSugarChampagne(); totalSugar = champagneVolume.gallonsGBToGallonsUS().volumeToSugarChampagne();
...@@ -38,7 +38,7 @@ pub fn champagneCarbonationMaths(champagneVolume: f64, imperialOrMetric: imperia ...@@ -38,7 +38,7 @@ pub fn champagneCarbonationMaths(champagneVolume: f64, imperialOrMetric: imperia
} }
pub fn champagneCarbonationFormatting(totalSugar: f64, imperialOrMetric: imperialOrMetric) -> String { pub fn champagneCarbonationFormatting(totalSugar: f64, imperialOrMetric: imperialOrMetric) -> String {
let mut sugar = String::from(""); let mut sugar: String = String::from("");
if imperialOrMetric == imperialOrMetric::imperialGB || imperialOrMetric == imperialOrMetric::imperialUS { if imperialOrMetric == imperialOrMetric::imperialGB || imperialOrMetric == imperialOrMetric::imperialUS {
if totalSugar < 0.995 { if totalSugar < 0.995 {
...@@ -68,7 +68,7 @@ pub fn champagneCarbonationFormatting(totalSugar: f64, imperialOrMetric: imperia ...@@ -68,7 +68,7 @@ pub fn champagneCarbonationFormatting(totalSugar: f64, imperialOrMetric: imperia
fn champagneOutput(totalSugar: f64, imperialOrMetric: imperialOrMetric, champagneCarbonationBuilder: &gtk::Builder) { fn champagneOutput(totalSugar: f64, imperialOrMetric: imperialOrMetric, champagneCarbonationBuilder: &gtk::Builder) {
let champagneCarbonationSugar: gtk::Entry = champagneCarbonationBuilder.get_object("champagneCarbonationSugar").expect("champagneCarbonationPrep(), champagneCarbonationSugar"); let champagneCarbonationSugar: gtk::Entry = champagneCarbonationBuilder.get_object("champagneCarbonationSugar").expect("champagneCarbonationPrep(), champagneCarbonationSugar");
let sugar = champagneCarbonationFormatting(totalSugar, imperialOrMetric); let sugar: String = champagneCarbonationFormatting(totalSugar, imperialOrMetric);
champagneCarbonationSugar.set_text(&sugar); champagneCarbonationSugar.set_text(&sugar);
} }
\ No newline at end of file
...@@ -36,7 +36,7 @@ pub trait allOverlays { ...@@ -36,7 +36,7 @@ pub trait allOverlays {
impl allOverlays for gtk::Builder { impl allOverlays for gtk::Builder {
fn new(&self) -> colourOverlay { fn new(&self) -> colourOverlay {
let allOverlays = colourOverlay { let allOverlays: colourOverlay = colourOverlay {
overlay: self.get_object("grainABVColourOverlay").expect("commonFunctions, allOverlays"), overlay: self.get_object("grainABVColourOverlay").expect("commonFunctions, allOverlays"),
colourOutput: gtk::ColorButton::new(), colourOutput: gtk::ColorButton::new(),
dimplePint: gtk::Image::new_from_file("/usr/share/BrewStillery/glassware/Dimple.png"), dimplePint: gtk::Image::new_from_file("/usr/share/BrewStillery/glassware/Dimple.png"),
...@@ -239,28 +239,28 @@ pub fn realIBU(brix: f64, wortVolume: f64, alphaAcid: f64, hopAmount: f64, boilT ...@@ -239,28 +239,28 @@ pub fn realIBU(brix: f64, wortVolume: f64, alphaAcid: f64, hopAmount: f64, boilT
pub fn realABVAndAttenuation(startingBrix: f64, finalBrix: f64) -> (f64, f64) { pub fn realABVAndAttenuation(startingBrix: f64, finalBrix: f64) -> (f64, f64) {
let wortCorrectionFactor: f64 = 1.040; let wortCorrectionFactor: f64 = 1.040;
let initialRefractiveIndex = startingBrix / wortCorrectionFactor; let initialRefractiveIndex: f64 = startingBrix / wortCorrectionFactor;
let finalRefractiveIndex = finalBrix / wortCorrectionFactor; let finalRefractiveIndex: f64 = finalBrix / wortCorrectionFactor;
let newCubic = (1.0 - 0.0044992999999999995 * initialRefractiveIndex) + (0.0117741 * finalRefractiveIndex) + (0.000275806 * initialRefractiveIndex.powi(2)) - (0.00127169 * finalRefractiveIndex.powi(2)) - (7.27999e-06 * initialRefractiveIndex.powi(3)) + (6.32929e-05 * finalRefractiveIndex.powi(3)); let newCubic: f64 = (1.0 - 0.0044992999999999995 * initialRefractiveIndex) + (0.0117741 * finalRefractiveIndex) + (0.000275806 * initialRefractiveIndex.powi(2)) - (0.00127169 * finalRefractiveIndex.powi(2)) - (7.27999e-06 * initialRefractiveIndex.powi(3)) + (6.32929e-05 * finalRefractiveIndex.powi(3));
let apparentAttenuation = 1.0 - (0.18080000000000002 * (668.72 * newCubic - 463.37 - 205.347 * newCubic.powi(2)) + 0.8192 * (668.72 * newCubic - 463.37 - 205.347 * newCubic.powi(2))) / (initialRefractiveIndex); let apparentAttenuation: f64 = 1.0 - (0.18080000000000002 * (668.72 * newCubic - 463.37 - 205.347 * newCubic.powi(2)) + 0.8192 * (668.72 * newCubic - 463.37 - 205.347 * newCubic.powi(2))) / (initialRefractiveIndex);
let attenuation = apparentAttenuation * 0.8192 * 100.0; let attenuation: f64 = apparentAttenuation * 0.8192 * 100.0;
let abv = ((0.01 / 0.8192) * (initialRefractiveIndex - (0.18080000000000002 * initialRefractiveIndex + 0.8192 * (668.72 * newCubic - 463.37 - 205.347 * newCubic.powi(2)))) / (2.0665-0.010665 * initialRefractiveIndex)) * 100.0; let abv: f64 = ((0.01 / 0.8192) * (initialRefractiveIndex - (0.18080000000000002 * initialRefractiveIndex + 0.8192 * (668.72 * newCubic - 463.37 - 205.347 * newCubic.powi(2)))) / (2.0665-0.010665 * initialRefractiveIndex)) * 100.0;
(abv, attenuation) (abv, attenuation)
} }
pub fn grainToGravity(volumeInGallonsUS: f64, weightInPounds: f64, grainGravity: f64) -> f64 { pub fn grainToGravity(volumeInGallonsUS: f64, weightInPounds: f64, grainGravity: f64) -> f64 {
let extractPotential = grainGravity.fract() * 1000.0; let extractPotential: f64 = grainGravity.fract() * 1000.0;
let extractionEfficiency = 0.57; let extractionEfficiency: f64 = 0.57;
// sane default here of 57% // sane default here of 57%
let mut originalGravity = 1.0; let mut originalGravity: f64 = 1.0;
// set to the gravity of water // set to the gravity of water
let specificGravityPoints = (weightInPounds * extractPotential * extractionEfficiency) / volumeInGallonsUS; let specificGravityPoints: f64 = (weightInPounds * extractPotential * extractionEfficiency) / volumeInGallonsUS;
if specificGravityPoints != 0.0 { if specificGravityPoints != 0.0 {
originalGravity = specificGravityPoints / 1000.0 + 1.0; originalGravity = specificGravityPoints / 1000.0 + 1.0;
......
This diff is collapsed.
...@@ -4,8 +4,8 @@ use functions::commonFunctions::{inputMatching, realABVAndAttenuation, FINAL_BRI ...@@ -4,8 +4,8 @@ use functions::commonFunctions::{inputMatching, realABVAndAttenuation, FINAL_BRI
pub fn guestimateABVPrep(guestimatorBuilder: &gtk::Builder) { pub fn guestimateABVPrep(guestimatorBuilder: &gtk::Builder) {
let guestimatorStartingBrix: gtk::Entry = guestimatorBuilder.get_object("guestimatorStartingBrix").expect("guestimateABVPrep(), guestimatorStartingBrix"); let guestimatorStartingBrix: gtk::Entry = guestimatorBuilder.get_object("guestimatorStartingBrix").expect("guestimateABVPrep(), guestimatorStartingBrix");
let guestimatorStartingBrixBuffer = guestimatorStartingBrix.get_text().expect("guestimateABVPrep(), guestimatorStartingBrixBuffer"); let guestimatorStartingBrixBuffer: String = guestimatorStartingBrix.get_text().expect("guestimateABVPrep(), guestimatorStartingBrixBuffer");
let startingBrix = guestimatorStartingBrixBuffer.validInput(); let startingBrix: f64 = guestimatorStartingBrixBuffer.validInput();
let guestimatorTemporaryOutput: gtk::Entry = guestimatorBuilder.get_object("guestimatorABV").expect("guestimateABVPrep(), guestimatorTemporaryOutput"); let guestimatorTemporaryOutput: gtk::Entry = guestimatorBuilder.get_object("guestimatorABV").expect("guestimateABVPrep(), guestimatorTemporaryOutput");
if startingBrix.is_nan() { if startingBrix.is_nan() {
...@@ -20,14 +20,14 @@ pub fn guestimateABVPrep(guestimatorBuilder: &gtk::Builder) { ...@@ -20,14 +20,14 @@ pub fn guestimateABVPrep(guestimatorBuilder: &gtk::Builder) {
} }
pub fn guestimateABVFormatting(startingBrix: f64) -> String { pub fn guestimateABVFormatting(startingBrix: f64) -> String {
let finalABV = format!("{:.2}%", realABVAndAttenuation(startingBrix, FINAL_BRIX_IDEAL).0); let finalABV: String = format!("{:.2}%", realABVAndAttenuation(startingBrix, FINAL_BRIX_IDEAL).0);
finalABV finalABV
} }
fn guestimateABVOutput(startingBrix: f64, guestimatorBuilder: &gtk::Builder) { fn guestimateABVOutput(startingBrix: f64, guestimatorBuilder: &gtk::Builder) {
let guestimatorABV: gtk::Entry = guestimatorBuilder.get_object("guestimatorABV").expect("guestimateABVOutput(), guestimatorABV"); let guestimatorABV: gtk::Entry = guestimatorBuilder.get_object("guestimatorABV").expect("guestimateABVOutput(), guestimatorABV");
let finalABV = guestimateABVFormatting(startingBrix); let finalABV: String = guestimateABVFormatting(startingBrix);
guestimatorABV.set_text(&finalABV); guestimatorABV.set_text(&finalABV);
} }
\ No newline at end of file
This diff is collapsed.
...@@ -13,22 +13,22 @@ pub struct gyleData { ...@@ -13,22 +13,22 @@ pub struct gyleData {
pub fn gyleCarbonationPrep(gyleBuilder: &gtk::Builder) { pub fn gyleCarbonationPrep(gyleBuilder: &gtk::Builder) {
let gyleStartingBrix: gtk::Entry = gyleBuilder.get_object("gyleStartingBrix").expect("gyleCarbonationPrep(), gyleStartingBrix"); let gyleStartingBrix: gtk::Entry = gyleBuilder.get_object("gyleStartingBrix").expect("gyleCarbonationPrep(), gyleStartingBrix");
let gyleStartingBrixBuffer = gyleStartingBrix.get_text().expect("gyleCarbonationPrep(), gyleStartingBrixBuffer"); let gyleStartingBrixBuffer: String = gyleStartingBrix.get_text().expect("gyleCarbonationPrep(), gyleStartingBrixBuffer");
let startingBrix = gyleStartingBrixBuffer.validInput(); let startingBrix: f64 = gyleStartingBrixBuffer.validInput();
let gyleDesiredCO2: gtk::Entry = gyleBuilder.get_object("gyleDesiredCO2").expect("gyleCarbonationPrep(), gyleDesiredCO2"); let gyleDesiredCO2: gtk::Entry = gyleBuilder.get_object("gyleDesiredCO2").expect("gyleCarbonationPrep(), gyleDesiredCO2");
let gyleDesiredCO2Buffer = gyleDesiredCO2.get_text().expect("gyleCarbonationPrep(), gyleDesiredCO2Buffer"); let gyleDesiredCO2Buffer: String = gyleDesiredCO2.get_text().expect("gyleCarbonationPrep(), gyleDesiredCO2Buffer");
let desiredCO2LevelTemp = gyleDesiredCO2Buffer.validInput(); let desiredCO2LevelTemp: f64 = gyleDesiredCO2Buffer.validInput();
let gyleWortVolume: gtk::Entry = gyleBuilder.get_object("gyleWortVolume").expect("gyleCarbonationPrep(), gyleWortVolume"); let gyleWortVolume: gtk::Entry = gyleBuilder.get_object("gyleWortVolume").expect("gyleCarbonationPrep(), gyleWortVolume");
let gyleWortVolumeBuffer = gyleWortVolume.get_text().expect("gyleCarbonationPrep(), gyleWortVolumeBuffer"); let gyleWortVolumeBuffer: String = gyleWortVolume.get_text().expect("gyleCarbonationPrep(), gyleWortVolumeBuffer");
let finalVolumeTemp = gyleWortVolumeBuffer.validInput(); let finalVolumeTemp: f64 = gyleWortVolumeBuffer.validInput();
let gyleTemporaryOutput: &gtk::Entry = &gyleBuilder.get_object("gyleCarbonationOutput").expect("gyleCarbonationPrep(), gyleTemporaryOutput"); let gyleTemporaryOutput: &gtk::Entry = &gyleBuilder.get_object("gyleCarbonationOutput").expect("gyleCarbonationPrep(), gyleTemporaryOutput");
let gyleCarbonationUnits: gtk::ComboBoxText = gyleBuilder.get_object("gyleCarbonationUnits").expect("gyleCarbonationPrep(), gyleCarbonationUnits"); let gyleCarbonationUnits: gtk::ComboBoxText = gyleBuilder.get_object("gyleCarbonationUnits").expect("gyleCarbonationPrep(), gyleCarbonationUnits");
let gyleCarbonationUnitsBuffer = gyleCarbonationUnits.get_active_id().expect("gyleCarbonationPrep(), gyleCarbonationUnitsBuffer"); let gyleCarbonationUnitsBuffer: String = gyleCarbonationUnits.get_active_id().expect("gyleCarbonationPrep(), gyleCarbonationUnitsBuffer");
let imperialOrMetric = gyleCarbonationUnitsBuffer.unitMatch(); let imperialOrMetric: imperialOrMetric = gyleCarbonationUnitsBuffer.unitMatch();
if startingBrix < 2.57 { if startingBrix < 2.57 {
gyleTemporaryOutput.set_text("Enter a Starting Brix greater than 2.57"); gyleTemporaryOutput.set_text("Enter a Starting Brix greater than 2.57");
...@@ -39,7 +39,7 @@ pub fn gyleCarbonationPrep(gyleBuilder: &gtk::Builder) { ...@@ -39,7 +39,7 @@ pub fn gyleCarbonationPrep(gyleBuilder: &gtk::Builder) {
} else if startingBrix <= 0.0 || desiredCO2LevelTemp <= 0.0 || finalVolumeTemp <= 0.0 { } else if startingBrix <= 0.0 || desiredCO2LevelTemp <= 0.0 || finalVolumeTemp <= 0.0 {
gyleTemporaryOutput.set_text("Enter a positive number"); gyleTemporaryOutput.set_text("Enter a positive number");
} else { } else {
let allInputs = gyleData { let allInputs: gyleData = gyleData {
startingGravity: startingBrix.brixToGravity(), startingGravity: startingBrix.brixToGravity(),
desiredCO2Level: desiredCO2LevelTemp, desiredCO2Level: desiredCO2LevelTemp,
finalVolume: finalVolumeTemp, finalVolume: finalVolumeTemp,
...@@ -62,8 +62,8 @@ pub fn gyleCarbonationVolumeUnits(allInputs: &mut gyleData) -> &mut gyleData { ...@@ -62,8 +62,8 @@ pub fn gyleCarbonationVolumeUnits(allInputs: &mut gyleData) -> &mut gyleData {
} }
pub fn gyleCarbonationMaths(mut allInputs: gyleData) -> gyleData { pub fn gyleCarbonationMaths(mut allInputs: gyleData) -> gyleData {
let startingPlato = allInputs.startingGravity.gravityToPlato(); let startingPlato: f64 = allInputs.startingGravity.gravityToPlato();
let finalPlatoIdeal = FINAL_GRAVITY_IDEAL.gravityToPlato(); let finalPlatoIdeal: f64 = FINAL_GRAVITY_IDEAL.gravityToPlato();
allInputs.gyleVolumeFloat = (0.24 * allInputs.finalVolume * allInputs.desiredCO2Level) / (startingPlato - finalPlatoIdeal); allInputs.gyleVolumeFloat = (0.24 * allInputs.finalVolume * allInputs.desiredCO2Level) / (startingPlato - finalPlatoIdeal);
...@@ -72,11 +72,13 @@ pub fn gyleCarbonationMaths(mut allInputs: gyleData) -> gyleData { ...@@ -72,11 +72,13 @@ pub fn gyleCarbonationMaths(mut allInputs: gyleData) -> gyleData {
pub fn gyleCarbonationFormatting(allInputs: gyleData) -> String { pub fn gyleCarbonationFormatting(allInputs: gyleData) -> String {
let mut finalOutput = String::from(""); let mut finalOutput: String = String::from("");
let gyleCarbonationMathsOutput: gyleData;
let gyleVolumeFinal: f64;
if allInputs.imperialOrMetric == imperialOrMetric::imperialGB { if allInputs.imperialOrMetric == imperialOrMetric::imperialGB {
let gyleCarbonationMathsOutput = gyleCarbonationMaths(allInputs); gyleCarbonationMathsOutput = gyleCarbonationMaths(allInputs);
let gyleVolumeFinal = gyleCarbonationMathsOutput.gyleVolumeFloat.litresToGallonsGB(); gyleVolumeFinal = gyleCarbonationMathsOutput.gyleVolumeFloat.litresToGallonsGB();
if gyleVolumeFinal >= 0.995 && gyleVolumeFinal < 1.005 { if gyleVolumeFinal >= 0.995 && gyleVolumeFinal < 1.005 {
finalOutput = format!("{:.0} gallon", gyleVolumeFinal); finalOutput = format!("{:.0} gallon", gyleVolumeFinal);
} else if gyleVolumeFinal.fract() >= 0.995 || gyleVolumeFinal.fract() < 0.005 { } else if gyleVolumeFinal.fract() >= 0.995 || gyleVolumeFinal.fract() < 0.005 {
...@@ -85,8 +87,8 @@ pub fn gyleCarbonationFormatting(allInputs: gyleData) -> String { ...@@ -85,8 +87,8 @@ pub fn gyleCarbonationFormatting(allInputs: gyleData) -> String {
finalOutput = format!("{:.2} gallons", gyleVolumeFinal); finalOutput = format!("{:.2} gallons", gyleVolumeFinal);
} }
} else if allInputs.imperialOrMetric == imperialOrMetric::imperialUS { } else if allInputs.imperialOrMetric == imperialOrMetric::imperialUS {
let gyleCarbonationMathsOutput = gyleCarbonationMaths(allInputs); gyleCarbonationMathsOutput = gyleCarbonationMaths(allInputs);
let gyleVolumeFinal = gyleCarbonationMathsOutput.gyleVolumeFloat.litresToGallonsUS(); gyleVolumeFinal = gyleCarbonationMathsOutput.gyleVolumeFloat.litresToGallonsUS();
if gyleVolumeFinal >= 0.995 && gyleVolumeFinal < 1.005 { if gyleVolumeFinal >= 0.995 && gyleVolumeFinal < 1.005 {
finalOutput = format!("{:.0} gallon", gyleVolumeFinal); finalOutput = format!("{:.0} gallon", gyleVolumeFinal);
} else if gyleVolumeFinal.fract() >= 0.995 || gyleVolumeFinal.fract() < 0.005 { } else if gyleVolumeFinal.fract() >= 0.995 || gyleVolumeFinal.fract() < 0.005 {
...@@ -95,8 +97,8 @@ pub fn gyleCarbonationFormatting(allInputs: gyleData) -> String { ...@@ -95,8 +97,8 @@ pub fn gyleCarbonationFormatting(allInputs: gyleData) -> String {
finalOutput = format!("{:.2} gallons", gyleVolumeFinal); finalOutput = format!("{:.2} gallons", gyleVolumeFinal);
} }
} else if allInputs.imperialOrMetric == imperialOrMetric::metric { } else if allInputs.imperialOrMetric == imperialOrMetric::metric {
let gyleCarbonationMathsOutput = gyleCarbonationMaths(allInputs); gyleCarbonationMathsOutput = gyleCarbonationMaths(allInputs);
let gyleVolumeFinal = gyleCarbonationMathsOutput.gyleVolumeFloat; gyleVolumeFinal = gyleCarbonationMathsOutput.gyleVolumeFloat;
if gyleVolumeFinal >= 0.995 && gyleVolumeFinal < 1.005 { if gyleVolumeFinal >= 0.995 && gyleVolumeFinal < 1.005 {
finalOutput = format!("{:.0} litre", gyleVolumeFinal); finalOutput = format!("{:.0} litre", gyleVolumeFinal);
} else if gyleVolumeFinal.fract() >= 0.995 || gyleVolumeFinal.fract() < 0.005 { } else if gyleVolumeFinal.fract() >= 0.995 || gyleVolumeFinal.fract() < 0.005 {
...@@ -114,9 +116,9 @@ fn gyleCarbonationOutput(mut allInputs: gyleData, gyleBuilder: &gtk::Builder) { ...@@ -114,9 +116,9 @@ fn gyleCarbonationOutput(mut allInputs: gyleData, gyleBuilder: &gtk::Builder) {
gyleCarbonationVolumeUnits(&mut allInputs); gyleCarbonationVolumeUnits(&mut allInputs);
let finalOutputFloat = gyleCarbonationMaths(allInputs); let finalOutputFloat: gyleData = gyleCarbonationMaths(allInputs);
let finalOutput = gyleCarbonationFormatting(finalOutputFloat); let finalOutput: String = gyleCarbonationFormatting(finalOutputFloat);
gyleCarbonationOutput.set_text(&finalOutput); gyleCarbonationOutput.set_text(&finalOutput);
} }
\ No newline at end of file
...@@ -26,20 +26,20 @@ pub struct sugarOutputStrings { ...@@ -26,20 +26,20 @@ pub struct sugarOutputStrings {
pub fn increaseABVPrep(increaseABVBuilder: &gtk::Builder) { pub fn increaseABVPrep(increaseABVBuilder: &gtk::Builder) {
let increaseABVStartingBrix: gtk::Entry = increaseABVBuilder.get_object("increaseABVStartingBrix").expect("increaseABVPrep(), increaseABVStartingBrix"); let increaseABVStartingBrix: gtk::Entry = increaseABVBuilder.get_object("increaseABVStartingBrix").expect("increaseABVPrep(), increaseABVStartingBrix");
let increaseABVBrixBuffer = increaseABVStartingBrix.get_text().expect("increaseABVPrep(), increaseABVBrixBuffer"); let increaseABVBrixBuffer: String = increaseABVStartingBrix.get_text().expect("increaseABVPrep(), increaseABVBrixBuffer");
let increaseABVDesiredABV: gtk::Entry = increaseABVBuilder.get_object("increaseABVDesiredABV").expect("increaseABVPrep(), increaseABVDesiredABV"); let increaseABVDesiredABV: gtk::Entry = increaseABVBuilder.get_object("increaseABVDesiredABV").expect("increaseABVPrep(), increaseABVDesiredABV");
let increaseABVABVBuffer = increaseABVDesiredABV.get_text().expect("increaseABVPrep(), increaseABVABVBuffer"); let increaseABVABVBuffer: String = increaseABVDesiredABV.get_text().expect("increaseABVPrep(), increaseABVABVBuffer");
let increaseABVCurrentVolume: gtk::Entry = increaseABVBuilder.get_object("increaseABVCurrentVolume").expect("increaseABVPrep(), increaseABVCurrentVolume"); let increaseABVCurrentVolume: gtk::Entry = increaseABVBuilder.get_object("increaseABVCurrentVolume").expect("increaseABVPrep(), increaseABVCurrentVolume");
let increaseABVVolumeBuffer = increaseABVCurrentVolume.get_text().expect("increaseABVPrep(), increaseABVVolumeBuffer"); let increaseABVVolumeBuffer: String = increaseABVCurrentVolume.get_text().expect("increaseABVPrep(), increaseABVVolumeBuffer");
let increaseABVFinalBrix: gtk::Entry = increaseABVBuilder.get_object("increaseABVFinalBrix").expect("increaseABVPrep(), increaseABVFinalBrix"); let increaseABVFinalBrix: gtk::Entry = increaseABVBuilder.get_object("increaseABVFinalBrix").expect("increaseABVPrep(), increaseABVFinalBrix");
let increaseABVSugar: gtk::Entry = increaseABVBuilder.get_object("increaseABVSugar").expect("increaseABVPrep(), increaseABVSugar"); let increaseABVSugar: gtk::Entry = increaseABVBuilder.get_object("increaseABVSugar").expect("increaseABVPrep(), increaseABVSugar");
let increaseABVHoney: gtk::Entry = increaseABVBuilder.get_object("increaseABVHoney").expect("increaseABVPrep(), increaseABVHoney"); let increaseABVHoney: gtk::Entry = increaseABVBuilder.get_object("increaseABVHoney").expect("increaseABVPrep(), increaseABVHoney");
let increaseABVUnits: gtk::ComboBoxText = increaseABVBuilder.get_object("increaseABVUnits").expect("increaseABVPrep(), increaseABVUnits"); let increaseABVUnits: gtk::ComboBoxText = increaseABVBuilder.get_object("increaseABVUnits").expect("increaseABVPrep(), increaseABVUnits");
let increaseABVUnitsBuffer = increaseABVUnits.get_active_id().expect("increaseABVPrep(), increaseABVUnitsBuffer"); let increaseABVUnitsBuffer: String = increaseABVUnits.get_active_id().expect("increaseABVPrep(), increaseABVUnitsBuffer");
let allInputs = increaseABVData { let allInputs = increaseABVData {
startingBrix: increaseABVBrixBuffer.validInput(), startingBrix: increaseABVBrixBuffer.validInput(),
...@@ -70,17 +70,17 @@ pub fn increaseABVPrep(increaseABVBuilder: &gtk::Builder) { ...@@ -70,17 +70,17 @@ pub fn increaseABVPrep(increaseABVBuilder: &gtk::Builder) {
} }
pub fn increaseABVMaths(allInputs: &increaseABVData) -> finalSugarFloat { pub fn increaseABVMaths(allInputs: &increaseABVData) -> finalSugarFloat {
let mut newStartingBrix = allInputs.startingBrix; let mut newStartingBrix: f64 = allInputs.startingBrix;
let mut newEstimatedABV = realABVAndAttenuation(newStartingBrix, FINAL_BRIX_IDEAL).0; let mut newEstimatedABV: f64 = realABVAndAttenuation(newStartingBrix, FINAL_BRIX_IDEAL).0;
while newEstimatedABV <= allInputs.desiredABV { while newEstimatedABV <= allInputs.desiredABV {
newStartingBrix = newStartingBrix + 0.001; newStartingBrix = newStartingBrix + 0.001;
newEstimatedABV = realABVAndAttenuation(newStartingBrix, FINAL_BRIX_IDEAL).0; newEstimatedABV = realABVAndAttenuation(newStartingBrix, FINAL_BRIX_IDEAL).0;
} }
let differenceBrix = newStartingBrix - allInputs.startingBrix; let differenceBrix: f64 = newStartingBrix - allInputs.startingBrix;
let mut finalOutputFloat = finalSugarFloat { let mut finalOutputFloat: finalSugarFloat = finalSugarFloat {
newStartingBrixFinal: newStartingBrix, newStartingBrixFinal: newStartingBrix,
sugarToAdd: 0.0, sugarToAdd: 0.0,
honeyToAdd: 0.0, honeyToAdd: 0.0,
...@@ -103,7 +103,7 @@ pub fn increaseABVMaths(allInputs: &increaseABVData) -> finalSugarFloat { ...@@ -103,7 +103,7 @@ pub fn increaseABVMaths(allInputs: &increaseABVData) -> finalSugarFloat {
} }
pub fn increaseABVFormatting(allInputs: &increaseABVData, finalOutputFloat: finalSugarFloat) -> sugarOutputStrings { pub fn increaseABVFormatting(allInputs: &increaseABVData, finalOutputFloat: finalSugarFloat) -> sugarOutputStrings {
let mut finalOutput = sugarOutputStrings { let mut finalOutput: sugarOutputStrings = sugarOutputStrings {
newStartingBrixFinal: format!("{:.2}°Bx", finalOutputFloat.newStartingBrixFinal), newStartingBrixFinal: format!("{:.2}°Bx", finalOutputFloat.newStartingBrixFinal),
sugarAmount: String::from(""), sugarAmount: String::from(""),
honeyAmount: String::from(""), honeyAmount: String::from(""),
...@@ -159,8 +159,8 @@ fn increaseABVOutput(allInputs: increaseABVData, increaseABVBuilder: &gtk::Build ...@@ -159,8 +159,8 @@ fn increaseABVOutput(allInputs: increaseABVData, increaseABVBuilder: &gtk::Build
let increaseABVSugar: gtk::Entry = increaseABVBuilder.get_object("increaseABVSugar").expect("increaseABVOutput(), increaseABVFinalBrix"); let increaseABVSugar: gtk::Entry = increaseABVBuilder.get_object("increaseABVSugar").expect("increaseABVOutput(), increaseABVFinalBrix");
let increaseABVHoney: gtk::Entry = increaseABVBuilder.get_object("increaseABVHoney").expect("increaseABVOutput(), increaseABVFinalBrix"); let increaseABVHoney: gtk::Entry = increaseABVBuilder.get_object("increaseABVHoney").expect("increaseABVOutput(), increaseABVFinalBrix");
let finalOutputFloat = increaseABVMaths(&allInputs); let finalOutputFloat: finalSugarFloat = increaseABVMaths(&allInputs);
let finalOutput = increaseABVFormatting(&allInputs, finalOutputFloat); let finalOutput: sugarOutputStrings = increaseABVFormatting(&allInputs, finalOutputFloat);
increaseABVFinalBrix.set_text(&finalOutput.newStartingBrixFinal); increaseABVFinalBrix.set_text(&finalOutput.newStartingBrixFinal);
increaseABVSugar.set_text(&finalOutput.sugarAmount); increaseABVSugar.set_text(&finalOutput.sugarAmount);
......
...@@ -4,12 +4,12 @@ use functions::commonFunctions::{inputMatching, realABVAndAttenuation}; ...@@ -4,12 +4,12 @@ use functions::commonFunctions::{inputMatching, realABVAndAttenuation};
pub fn realABVPrep(realABVBuilder: &gtk::Builder) { pub fn realABVPrep(realABVBuilder: &gtk::Builder) {
let realABVStartingBrix: gtk::Entry = realABVBuilder.get_object("realABVStartingBrix").expect("realABVPrep(), realABVStartingBrix"); let realABVStartingBrix: gtk::Entry = realABVBuilder.get_object("realABVStartingBrix").expect("realABVPrep(), realABVStartingBrix");
let realABVStartingBrixBuffer = realABVStartingBrix.get_text().expect("realABVPrep(), realABVStartingBrixBuffer"); let realABVStartingBrixBuffer: String = realABVStartingBrix.get_text().expect("realABVPrep(), realABVStartingBrixBuffer");
let startingBrix = realABVStartingBrixBuffer.validInput(); let startingBrix: f64 = realABVStartingBrixBuffer.validInput();
let realABVFinalBrix: gtk::Entry = realABVBuilder.get_object("realABVFinalBrix").expect("realABVPrep(), realABVFinalrealABVFinalBrixBrixInput"); let realABVFinalBrix: gtk::Entry = realABVBuilder.get_object("realABVFinalBrix").expect("realABVPrep(), realABVFinalrealABVFinalBrixBrixInput");
let realABVFinalBrixInputBuffer = realABVFinalBrix.get_text().expect("realABVPrep(), realABVFinalBrixInputBuffer"); let realABVFinalBrixInputBuffer: String = realABVFinalBrix.get_text().expect("realABVPrep(), realABVFinalBrixInputBuffer");
let finalBrix = realABVFinalBrixInputBuffer.validInput(); let finalBrix: f64 = realABVFinalBrixInputBuffer.validInput();
let realABVFinalABV: gtk::Entry = realABVBuilder.get_object("realABVFinalABV").expect("realABVPrep(), realABVFinalABV"); let realABVFinalABV: gtk::Entry = realABVBuilder.get_object("realABVFinalABV").expect("realABVPrep(), realABVFinalABV");
let realABVRealAttenuation: gtk::Entry = realABVBuilder.get_object("realABVRealAttenuation").expect("realABVPrep(), realABVRealAttenuation"); let realABVRealAttenuation: gtk::Entry = realABVBuilder.get_object("realABVRealAttenuation").expect("realABVPrep(), realABVRealAttenuation");
...@@ -35,13 +35,10 @@ pub fn realABVPrep(realABVBuilder: &gtk::Builder) { ...@@ -35,13 +35,10 @@ pub fn realABVPrep(realABVBuilder: &gtk::Builder) {
} }
pub fn realABVFormatting(abvFloat: f64, attenuationFloat: f64) -> (String, String) { pub fn realABVFormatting(abvFloat: f64, attenuationFloat: f64) -> (String, String) {
let abvFormatted; let mut abvFormatted: String = String::from("");
let attenuationFormatted; let mut attenuationFormatted: String = String::from("Enter legimate amounts");
if abvFloat > 26.0 || abvFloat <= 0.0 { if abvFloat > 0.0 && abvFloat < 26.0 {
abvFormatted = String::from("");
attenuationFormatted = String::from("Enter legimate amounts");
} else {
abvFormatted = format!("{:.2}%", abvFloat); abvFormatted = format!("{:.2}%", abvFloat);
attenuationFormatted = format!("{:.2}%", attenuationFloat); attenuationFormatted = format!("{:.2}%", attenuationFloat);
} }
......
...@@ -30,22 +30,22 @@ pub struct spargeOutputStrings { ...@@ -30,22 +30,22 @@ pub struct spargeOutputStrings {
pub fn waterSpargePrep(waterSpargeBuilder: &gtk::Builder) { pub fn waterSpargePrep(waterSpargeBuilder: &gtk::Builder) {
let spargePreFermentVolume: gtk::Entry = waterSpargeBuilder.get_object("spargePreFermentVolume").expect("waterSpargePrep(), spargePreFermentVolume"); let spargePreFermentVolume: gtk::Entry = waterSpargeBuilder.get_object("spargePreFermentVolume").expect("waterSpargePrep(), spargePreFermentVolume");
let spargePreFermentVolumeBuffer = spargePreFermentVolume.get_text().expect("waterSpargePrep(), spargePreFermentVolumeBuffer"); let spargePreFermentVolumeBuffer: String = spargePreFermentVolume.get_text().expect("waterSpargePrep(), spargePreFermentVolumeBuffer");
let spargeTotalGrain: gtk::Entry = waterSpargeBuilder.get_object("spargeTotalGrain").expect("waterSpargePrep(), spargeTotalGrain"); let spargeTotalGrain: gtk::Entry = waterSpargeBuilder.get_object("spargeTotalGrain").expect("waterSpargePrep(), spargeTotalGrain");
let spargeTotalGrainBuffer = spargeTotalGrain.get_text().expect("waterSpargePrep(), spargeTotalGrainBuffer"); let spargeTotalGrainBuffer: String = spargeTotalGrain.get_text().expect("waterSpargePrep(), spargeTotalGrainBuffer");
let spargeBoilTime: gtk::Entry = waterSpargeBuilder.get_object("spargeBoilTime").expect("waterSpargePrep(), spargeBoilTime"); let spargeBoilTime: gtk::Entry = waterSpargeBuilder.get_object("spargeBoilTime").expect("waterSpargePrep(), spargeBoilTime");
let spargeBoilTimeBuffer = spargeBoilTime.get_text().expect("waterSpargePrep(), spargeBoilTimeBuffer"); let spargeBoilTimeBuffer: String = spargeBoilTime.get_text().expect("waterSpargePrep(), spargeBoilTimeBuffer");
let spargeMashWater: gtk::Entry = waterSpargeBuilder.get_object("spargeMashWater").expect("waterSpargePrep(), spargeMashWater"); let spargeMashWater: gtk::Entry = waterSpargeBuilder.get_object("spargeMashWater").expect("waterSpargePrep(), spargeMashWater");
let spargeSpargeWater: gtk::Entry = waterSpargeBuilder.get_object("spargeSpargeWater").expect("waterSpargePrep(), spargeSpargeWater"); let spargeSpargeWater: gtk::Entry = waterSpargeBuilder.get_object("spargeSpargeWater").expect("waterSpargePrep(), spargeSpargeWater");
let spargeTotalWater: gtk::Entry = waterSpargeBuilder.get_object("spargeTotalWater").expect("waterSpargePrep(), spargeTotalWater"); let spargeTotalWater: gtk::Entry = waterSpargeBuilder.get_object("spargeTotalWater").expect("waterSpargePrep(), spargeTotalWater");
let waterSpargeUnits: gtk::ComboBoxText = waterSpargeBuilder.get_object("waterSpargeUnits").expect("waterSpargePrep(), waterSpargeUnits"); let waterSpargeUnits: gtk::ComboBoxText = waterSpargeBuilder.get_object("waterSpargeUnits").expect("waterSpargePrep(), waterSpargeUnits");
let waterSpargeUnitsBuffer = waterSpargeUnits.get_active_id().expect("waterSpargePrep(), waterSpargeUnitsBuffer"); let waterSpargeUnitsBuffer: String = waterSpargeUnits.get_active_id().expect("waterSpargePrep(), waterSpargeUnitsBuffer");
let mut allInputs = waterSpargeData { let mut allInputs: waterSpargeData = waterSpargeData {
preFermentVolume: spargePreFermentVolumeBuffer.validInput(), preFermentVolume: spargePreFermentVolumeBuffer.validInput(),
totalGrain: spargeTotalGrainBuffer.validInput(), totalGrain: spargeTotalGrainBuffer.validInput(),
boilTime: spargeBoilTimeBuffer.validInput(), boilTime: spargeBoilTimeBuffer.validInput(),
...@@ -87,17 +87,17 @@ fn waterSpargeSetValues(mut allInputs: waterSpargeData) -> waterSpargeData { ...@@ -87,17 +87,17 @@ fn waterSpargeSetValues(mut allInputs: waterSpargeData) -> waterSpargeData {
} }
pub fn waterSpargeMaths(allInputs: &waterSpargeData) -> finalSpargeFloat { pub fn waterSpargeMaths(allInputs: &waterSpargeData) -> finalSpargeFloat {
let trubLoss = allInputs.preFermentVolume * 0.05; let trubLoss: f64 = allInputs.preFermentVolume * 0.05;
// 5% is an acceptable norm // 5% is an acceptable norm
let equipmentLoss = allInputs.preFermentVolume * 0.08; let equipmentLoss: f64 = allInputs.preFermentVolume * 0.08;
// 8% is an acceptable norm // 8% is an acceptable norm
let totalWater = (((allInputs.preFermentVolume + trubLoss) / (1.0 - allInputs.wortShrinkage)) / (1.0 - ((allInputs.boilTime / 60.0) * allInputs.percentBoiloff))) + equipmentLoss + (allInputs.totalGrain * allInputs.grainAbsorption); let totalWater: f64 = (((allInputs.preFermentVolume + trubLoss) / (1.0 - allInputs.wortShrinkage)) / (1.0 - ((allInputs.boilTime / 60.0) * allInputs.percentBoiloff))) + equipmentLoss + (allInputs.totalGrain * allInputs.grainAbsorption);
// dividing boilTime by 60.0 because the formula requires hours // dividing boilTime by 60.0 because the formula requires hours
let mashWater = (allInputs.totalGrain * allInputs.mashThickness) / 4.0; let mashWater: f64 = (allInputs.totalGrain * allInputs.mashThickness) / 4.0;
let spargeWater = totalWater - mashWater; let spargeWater: f64 = totalWater - mashWater;
let finalOutputFloat = finalSpargeFloat { let finalOutputFloat: finalSpargeFloat = finalSpargeFloat {
mashVolume: mashWater, mashVolume: mashWater,
spargeVolume: spargeWater, spargeVolume: spargeWater,
totalVolume: totalWater, totalVolume: totalWater,
...@@ -107,7 +107,7 @@ pub fn waterSpargeMaths(allInputs: &waterSpargeData) -> finalSpargeFloat { ...@@ -107,7 +107,7 @@ pub fn waterSpargeMaths(allInputs: &waterSpargeData) -> finalSpargeFloat {
} }
pub fn waterSpargeFormatting(allInputs: &waterSpargeData, finalOutputFloat: finalSpargeFloat) -> spargeOutputStrings { pub fn waterSpargeFormatting(allInputs: &waterSpargeData, finalOutputFloat: finalSpargeFloat) -> spargeOutputStrings {
let mut finalOutput = spargeOutputStrings { let mut finalOutput: spargeOutputStrings = spargeOutputStrings {
mashVolumeFinal: String::from(""), mashVolumeFinal: String::from(""),
spargeVolumeFinal: String::from(""), spargeVolumeFinal: String::from(""),
totalVolumeFinal: String::from(""), totalVolumeFinal: String::from(""),
...@@ -197,8 +197,8 @@ fn waterSpargeOutput(allInputs: waterSpargeData, waterSpargeBuilder: &gtk::Build ...@@ -197,8 +197,8 @@ fn waterSpargeOutput(allInputs: waterSpargeData, waterSpargeBuilder: &gtk::Build
let spargeSpargeWater: gtk::Entry = waterSpargeBuilder.get_object("spargeSpargeWater").expect("waterSpargeOutput(), spargeSpargeWater"); let spargeSpargeWater: gtk::Entry = waterSpargeBuilder.get_object("spargeSpargeWater").expect("waterSpargeOutput(), spargeSpargeWater");
let spargeTotalWater: gtk::Entry = waterSpargeBuilder.get_object("spargeTotalWater").expect("waterSpargeOutput(), spargeTotalWater"); let spargeTotalWater: gtk::Entry = waterSpargeBuilder.get_object("spargeTotalWater").expect("waterSpargeOutput(), spargeTotalWater");
let finalOutputFloat = waterSpargeMaths(&allInputs); let finalOutputFloat: finalSpargeFloat = waterSpargeMaths(&allInputs);
let finalOutput = waterSpargeFormatting(&allInputs, finalOutputFloat); let finalOutput: spargeOutputStrings = waterSpargeFormatting(&allInputs, finalOutputFloat);
spargeMashWater.set_text(&finalOutput.mashVolumeFinal); spargeMashWater.set_text(&finalOutput.mashVolumeFinal);
spargeSpargeWater.set_text(&finalOutput.spargeVolumeFinal); spargeSpargeWater.set_text(&finalOutput.spargeVolumeFinal);
......
...@@ -2657,7 +2657,7 @@ ...@@ -2657,7 +2657,7 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_top">5</property> <property name="margin_top">5</property>
<property name="margin_bottom">5</property> <property name="margin_bottom">5</property>
<property name="label" translatable="yes">Version 6.1.0</property> <property name="label" translatable="yes">Version 6.2.0</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -2740,7 +2740,7 @@ ...@@ -2740,7 +2740,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="title">BrewStillery</property> <property name="title">BrewStillery</property>
<property name="subtitle">6.1.0</property> <property name="subtitle">6.2.0</property>
<property name="show_close_button">True</property> <property name="show_close_button">True</property>
<child> <child>
<placeholder/> <placeholder/>
......
...@@ -3,36 +3,36 @@ use functions::champagneCarbonation::{champagneCarbonationMaths, champagneCarbon ...@@ -3,36 +3,36 @@ use functions::champagneCarbonation::{champagneCarbonationMaths, champagneCarbon
#[test] #[test]
fn champagneMathsImperialGBTest() { fn champagneMathsImperialGBTest() {
let champagneVolume = 20.0; let champagneVolume: f64 = 20.0;
let imperialOrMetric = imperialOrMetric::imperialGB; let imperialOrMetric: imperialOrMetric = imperialOrMetric::imperialGB;
assert_eq!(champagneCarbonationMaths(champagneVolume, imperialOrMetric), 4.8038); assert_eq!(champagneCarbonationMaths(champagneVolume, imperialOrMetric), 4.8038);
} }
#[test] #[test]
fn champagneMathsImperialUSTest() { fn champagneMathsImperialUSTest() {
let champagneVolume = 20.0; let