Esempio n. 1
0
        public async Task <NutritionTable> GetTableAsync(byte[] picture, uint width, uint height)
        {
            var ocrString = await OCRAsync(picture, width, height);

            await new Windows.UI.Popups.MessageDialog(ocrString).ShowAsync();

            return(NutritionTable.Parse(ocrString));
        }
Esempio n. 2
0
        public void Update(NutritionTable nutritionTable)
        {
            var balance = NutritionService.GetBalance(nutritionTable);

            KCals             = balance.KCals;
            CarbPercentage    = balance.CarbPercentage;
            ProteinPercentage = balance.ProteinPercentage;
            FatPercentage     = balance.FatPercentage;
            CarbKCals         = balance.CarbsKCals;
            ProteinKCals      = balance.ProteinKCals;
            FatKCals          = balance.FatKCals;
        }
        void Done()
        {
            var nutritionTable = new NutritionTable
            {
                Carbs         = Carbs.Value,
                SugarCarbs    = SugarCarbs.Value,
                Protein       = Protein.Value,
                Fat           = Fat.Value,
                SaturatedFats = SaturatedFats.Value,
                Salt          = Salt.Value,
            };

            ShowViewModel <InfoViewModel>(nutritionTable);
        }
Esempio n. 4
0
 public IHealthBalance GetBalance(NutritionTable table)
 {
     return(new HealthBalance(table));
 }
Esempio n. 5
0
 public double GetScore(NutritionTable table)
 {
     throw new NotImplementedException();
 }
Esempio n. 6
0
 public HealthBalance(NutritionTable table)
 {
     this.nutritionTable = table;
 }