Skip to content

Commit

Permalink
recipe volume selection improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-mcl committed Sep 11, 2020
1 parent 816c3b8 commit bbb229f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/db/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"default.equipment.profile": "All Grain - Standard 5 Gal/19l Batch - Cooler",
"default.equipment.profile": "All Grain - 25l Plastic Mash Tun",
"backend.google.drive.directory.name": "brewday_data",
"backend.google.drive.directory.id": "1isNhil9ESxEyMgNqtZ69kRUyUURqCdDR",
"ui.theme": "jmetro.light",
Expand Down
20 changes: 19 additions & 1 deletion src/main/java/mclachlan/brewday/recipe/Recipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ public void dryRun()
this.log = new ProcessLog();
this.volumes = new Volumes();

dryRun(this.volumes, this.log);
}

/*-------------------------------------------------------------------------*/
public void dryRun(Volumes volumes, ProcessLog log)
{
sortSteps(log);

for (ProcessStep s : getSteps())
Expand All @@ -276,7 +282,6 @@ public void dryRun()
catch (BrewdayException e)
{
log.addError(s.getName() + ": " + e.getMessage());
// e.printStackTrace();
return;
}
}
Expand Down Expand Up @@ -585,4 +590,17 @@ public List<Volume> getBeers()

return result;
}

/*-------------------------------------------------------------------------*/
public List<String> getAllVolumeNames()
{
List<String> result = new ArrayList<>();

for (ProcessStep step : steps)
{
result.addAll(step.getOutputVolumes());
}

return result;
}
}
5 changes: 2 additions & 3 deletions src/main/java/mclachlan/brewday/ui/jfx/ProcessStepPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
package mclachlan.brewday.ui.jfx;

import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.function.*;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.geometry.Insets;
Expand Down Expand Up @@ -351,7 +350,7 @@ protected void addComputedVolumePane(String uiLabelKey, Function<T, String> getM
/*-------------------------------------------------------------------------*/
protected ObservableList<String> getVolumesOptions(Recipe recipe, Volume.Type... types)
{
List<String> vec = new ArrayList<>(recipe.getVolumes().getVolumes(types));
List<String> vec = new ArrayList<>(recipe.getAllVolumeNames());
Collections.sort(vec);
vec.add(0, UiUtils.NONE);
return FXCollections.observableList(vec);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public void refresh(Map<String, T> map)
unfilteredList.clear();

this.map = map;
System.out.println("map.size() = [" + map.size() + "]");

unfilteredList.addAll(map.values());
tableView.sort();
Expand Down

0 comments on commit bbb229f

Please sign in to comment.