Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit898f7cd

Browse files
committed
Added some new coffee recipes
1 parentddcb1a8 commit898f7cd

File tree

5 files changed

+127
-2
lines changed

5 files changed

+127
-2
lines changed

‎nbproject/configs/Raspberry_Pi.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ $target.profile=profile-remote
44
$target.run=run-remote
55
compile.on.save.unsupported.remote.platform=true
66
debug-transport=dt_socket
7-
platform.runtime=Raspberry_Pi
7+
platform.runtime=CoffeePi

‎src/com/nighthacking/recipe/CommandLineReciperRunner.java‎renamed to ‎src/com/nighthacking/recipe/CommandLineRecipeRunner.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author Stephen Chin <steveonjava@gmail.com>
77
*/
8-
publicclassCommandLineReciperRunnerextendsRecipeRunner {
8+
publicclassCommandLineRecipeRunnerextendsRecipeRunner {
99

1010
privatefinalDisplaydisplay =newCommandLineDisplay();
1111

‎src/com/nighthacking/recipe/Step.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ public static Step waitFor(Ingredient ingredient, double margin) {
6464
returnnewStep(e ->e.getScale().waitForStable(w ->Math.abs(w -ingredient.getWeight()) <margin));
6565
}
6666

67+
publicstaticStepwaitForAtLeast(Ingredientingredient) {
68+
returnwaitForAtLeast(ingredient,ingredient.getWeight() /10);
69+
}
70+
71+
publicstaticStepwaitForAtLeast(Ingredientingredient,doublemargin) {
72+
returnnewStep(e ->e.getScale().waitFor(w ->w >ingredient.getWeight() -margin /2));
73+
}
74+
6775
publicstaticStepcountdown(intseconds) {
6876
returnnewStep(e ->e.getDisplay().countdown(seconds));
6977
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
packagecom.nighthacking.recipes;
2+
3+
importcom.nighthacking.recipe.Step;
4+
importcom.nighthacking.recipe.Ingredient;
5+
importcom.nighthacking.recipe.Recipe;
6+
7+
/**
8+
* @author Stephen Chin <steveonjava@gmail.com>
9+
*/
10+
publicclassCleverCoffeeDripperimplementsRecipe {
11+
12+
privatestaticfinaldoubleCUP_SIZE =300;// grams
13+
privatefinalIngredientbeans;
14+
privatefinalIngredientwater;
15+
16+
publicCleverCoffeeDripper(doublestrength) {
17+
beans =Ingredient.byWeight(CoffeeCalculator.grindWeight(strength,CUP_SIZE),"Graos de Cafe");
18+
water =Ingredient.byWeight(CUP_SIZE,"Agua");
19+
}
20+
21+
@Override
22+
publicStringname() {
23+
return"Clever Coffee Dripper";
24+
}
25+
26+
@Override
27+
publicStringdescription() {
28+
return"Preparacao precisa de uma caneca de cafe usando "
29+
+" um coador de cafe e uma balanca.";
30+
}
31+
32+
@Override
33+
publicIngredient[]ingredients() {
34+
returnnewIngredient[]{beans,water};
35+
}
36+
37+
@Override
38+
publicStep[]steps() {
39+
returnnewStep[]{
40+
Step.say("Adicione " +beans),
41+
Step.waitFor(beans),
42+
Step.say("Otimo, agora tire os graos de cafe da balanca."),
43+
Step.waitForClear(),
44+
Step.say("Hora do trabalho pesado! Moa os graos de cafe!!!"),
45+
Step.say("Coloque o filtro no coador de cafe e jogue o cafe moido dentro"),
46+
Step.waitForContents(),
47+
Step.tare(),
48+
Step.say("Coloque " +water +" a 97oC"),
49+
Step.waitForAtLeast(water),
50+
Step.countdown(60),
51+
Step.say("Pronto! Coloque o coador de cafe em cima da caneca."),
52+
Step.waitForClear(),
53+
Step.say("Experimente o seu Java cafe agora!")
54+
};
55+
}
56+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
packagecom.nighthacking.recipes;
2+
3+
importcom.nighthacking.recipe.Step;
4+
importcom.nighthacking.recipe.Ingredient;
5+
importcom.nighthacking.recipe.Recipe;
6+
7+
/**
8+
* @author Stephen Chin <steveonjava@gmail.com>
9+
*/
10+
publicclassPourOverCoffeeimplementsRecipe {
11+
12+
privatestaticfinaldoubleCUP_SIZE =200;// grams
13+
privatestaticfinaldoubleBREW_RATIO =.15;// beans / water
14+
privatefinalIngredientbeans;
15+
privatefinalIngredientbrewingWater;
16+
privatefinalIngredientextraWater;
17+
18+
publicPourOverCoffee(doublestrength) {
19+
beans =Ingredient.byWeight(CoffeeCalculator.grindWeight(strength,CUP_SIZE),"Coffee Beans");
20+
brewingWater =Ingredient.byWeight(CUP_SIZE *BREW_RATIO,"Water");
21+
extraWater =Ingredient.byWeight(CUP_SIZE -brewingWater.getWeight(),"Water");
22+
}
23+
24+
@Override
25+
publicStringname() {
26+
return"Pout Over Coffee";
27+
}
28+
29+
@Override
30+
publicStringdescription() {
31+
return"Precisely brews 1 cup of coffee using a pour over method and a scale.";
32+
}
33+
34+
@Override
35+
publicIngredient[]ingredients() {
36+
returnnewIngredient[]{beans,brewingWater,extraWater};
37+
}
38+
39+
@Override
40+
publicStep[]steps() {
41+
returnnewStep[]{
42+
Step.say("Add " +beans),
43+
Step.waitFor(beans),
44+
Step.say("Great, take your beans off the scale now."),
45+
Step.waitForClear(),
46+
Step.say("Put your cup, dripper, filter, and grinds on"),
47+
Step.waitForContents(),
48+
Step.tare(),
49+
Step.say("Pour " +brewingWater +" at 200F"),
50+
Step.waitForAtLeast(brewingWater),
51+
Step.tare(),
52+
Step.countdown(30),
53+
Step.say("Pour an additional " +extraWater),
54+
Step.waitForAtLeast(extraWater),
55+
Step.countdown(60),
56+
Step.say("Done! Take your coffee off the scale."),
57+
Step.waitForClear(),
58+
Step.say("Enjoy your Java brew!")
59+
};
60+
}
61+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp