Skip to content

Commit

Permalink
in getMachineProgram amount per component is now rounded to integer.
Browse files Browse the repository at this point in the history
  • Loading branch information
liefersfl committed Apr 16, 2018
1 parent 1fadd6d commit b343eac
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/app/model/cocktail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class Cocktail {
var lines: any[] = []
// total fragments
var fragmentsCount = this.getFragmentsCount()

this.layers.reverse().forEach(layer => {
var programComponents: any[] = []
layer.components.forEach(component => {
Expand All @@ -60,13 +60,19 @@ export class Cocktail {
"amount": this.amount / fragmentsCount
});
}
});
lines.push({
"components": programComponents,
"timing": 2,
"sleep": 0
});
}
});

// Round all component amount to integers
programComponents.forEach(pc => {
pc["amount"] = Math.round(pc["amount"])
});

lines.push({
"components": programComponents,
"timing": 2,
"sleep": 0
});
}
)
var program = {
"recipe": {
Expand Down

0 comments on commit b343eac

Please sign in to comment.