public ComputedDataModel GetHealthMessage(ComputedDataModel computedDataModel) { computedDataModel = GetSummaryMessage(computedDataModel); computedDataModel = GetHydrationMessage(computedDataModel); computedDataModel = GetSleepMessage(computedDataModel); computedDataModel = GetBreaksMessage(computedDataModel); return(computedDataModel); }
public void OnGet() { //Read in ComputedDataModel for displaying of Data. computedDataModel = DataDisplay.computedDataModel; computedDataModel.TotalProductivityLoss = (computedDataModel.TotalProductivityLoss * 100); computedDataModel.SleepProductivityLoss = (computedDataModel.SleepProductivityLoss * 100); computedDataModel.WaterProductivityLoss = (computedDataModel.WaterProductivityLoss * 100); computedDataModel.BreaksProductivityLoss = (computedDataModel.BreaksProductivityLoss * 100); }
private ComputedDataModel TotalMonetaryLoss(ComputedDataModel computedDataModel) { //Compute the total Monetary cost per week due to bad working conditions. //Hydration computedDataModel.WaterMonetaryLoss = (computedDataModel.WaterProductivityLoss * computedDataModel.WeeklySalary); computedDataModel.SleepMonetaryLoss = (computedDataModel.SleepProductivityLoss * computedDataModel.WeeklySalary); computedDataModel.BreaksMonetaryLoss = (computedDataModel.BreaksProductivityLoss * computedDataModel.WeeklySalary); computedDataModel.TotalWeeklyMonetaryLoss = (computedDataModel.WaterMonetaryLoss + computedDataModel.SleepMonetaryLoss + computedDataModel.BreaksMonetaryLoss); computedDataModel.TotalYearlyMonetaryLoss = (computedDataModel.Salary * computedDataModel.TotalProductivityLoss); computedDataModel.WaterAnnualLoss = (computedDataModel.WaterMonetaryLoss * 52); computedDataModel.SleepAnnualLoss = (computedDataModel.SleepMonetaryLoss * 52); computedDataModel.BreaksAnnualLoss = (computedDataModel.BreaksMonetaryLoss * 52); return(computedDataModel); }
private ComputedDataModel GetChartValues(ComputedDataModel computedDataModel) { //Get Break values for chart. computedDataModel.BreaksChart1 = computedDataModel.BreaksProductivityLoss * 100; computedDataModel.BreaksChart2 = (100 - computedDataModel.BreaksChart1); //Get Sleep values for chart. computedDataModel.SleepChart1 = computedDataModel.SleepProductivityLoss * 100; computedDataModel.SleepChart2 = 100 - computedDataModel.SleepChart1; //Get Water values for chart. computedDataModel.WaterChart1 = computedDataModel.WaterProductivityLoss * 100; computedDataModel.WaterChart2 = 100 - computedDataModel.WaterChart1; return(computedDataModel); }
private ComputedDataModel GetSummaryMessage(ComputedDataModel computedDataModel) { if (computedDataModel.TotalProductivityLoss == 0) { computedDataModel.SummaryMessage = "Congrats! You are operating at the most Productive you can be. Your water intake is healthy as you have drank " + computedDataModel.Water + " Glasses of water today!"; computedDataModel.SummaryMessage += " You have also taken at least one break every Hour in your " + computedDataModel.DailyHours + " Hour working Day."; computedDataModel.SummaryMessage += "This coupled with nightly sleep of " + computedDataModel.Sleep + " Hours means you are functioning at full capacity."; computedDataModel.SummaryMessage += "For more detailed information click one of the subheadings from the navigation bar!"; return(computedDataModel); } else { computedDataModel.SummaryMessage = "Oops! Unfortunatley you are not working at full capacity due to your physical habits. As a result of this you are Loosing " + (computedDataModel.TotalProductivityLoss * 100) + "% of your productivity. This can easily be remedied by by simple means such as more sleep, breaks and water. For a more detailed analysis click one of the subheadings from the navigation bar!"; return(computedDataModel); } }
public ComputedDataModel TotalProductivityLost(ComputedDataModel computedDataModel) { //Add value to a list of doubles. computedDataModel.SleepProductivityLoss = (GetSleepLoss(computedDataModel.SleepDeficit)); computedDataModel.WaterProductivityLoss = GetHydrationLoss(computedDataModel.WaterDeficit); computedDataModel.BreaksProductivityLoss = GetBreakLoss(computedDataModel.Breaks, computedDataModel.DailyHours); computedDataModel.TotalProductivityLoss = computedDataModel.WaterProductivityLoss; computedDataModel.TotalProductivityLoss += computedDataModel.BreaksProductivityLoss; computedDataModel.TotalProductivityLoss += computedDataModel.SleepProductivityLoss; computedDataModel = TotalMonetaryLoss(computedDataModel); computedDataModel = NormaliseValues(computedDataModel); computedDataModel = GetChartValues(computedDataModel); return(computedDataModel); }
private ComputedDataModel GetBreaksMessage(ComputedDataModel computedDataModel) { if (computedDataModel.BreaksProductivityLoss > 0) { computedDataModel.BreaksMessage = "You have not taken enough intermittent breaks today, by taking only " + computedDataModel.Breaks + " breaks can result in decreased " + " productivity and more physical pressure on your body."; return(computedDataModel); } else if (computedDataModel.BreaksProductivityLoss == 0) { computedDataModel.BreaksMessage = "You have had the correct number of Breaks. By taking only " + computedDataModel.Breaks + " breaks You have increased efficiency and mood and reduced your chances of injuries as a result of sitting for long periods."; return(computedDataModel); } else { computedDataModel.BreaksMessage = "You have had too many breaks"; return(computedDataModel); } }
private ComputedDataModel GetHydrationMessage(ComputedDataModel computedDataModel) { if (computedDataModel.WaterDeficit < 0) { computedDataModel.WaterMessage = "You have not consumed enough water to perform at full capacity, this can result in lack of concentration and efficiency. You have only consumed " + computedDataModel.Water + " glasses of water. This is below the recommended daily amount."; return(computedDataModel); } else if (computedDataModel.WaterDeficit == 0) { computedDataModel.WaterMessage = "Awesome! You have drank the correct amount of water, this means you are more alert and feeling better. Your intake of " + computedDataModel.Water + " Glasses of water is inline with the recommended daily amount."; return(computedDataModel); } else { computedDataModel.WaterMessage = "Woah! You have gone above and beyond. You are consuming more than the recommended amount,this will contribute to mood and efficiency. Your intake of " + computedDataModel.Water + " glasses of water is above average. Be careful not to over do it as too much water can be dangerous."; return(computedDataModel); } }
/*public List<double> DecryptModel(EncryptedDataModel encryptedDataModel) * { * //Takes in a Ciphertext and returns a List of Plaintext. * List<double> doubleList = new List<double>(); * * //Decrypt to Plaintext. * doubleList.Add(PrepareModel(encryptedDataModel.Age)); * //Remove BMI for now. * //doubleList.Add(PrepareModel(encryptedDataModel.BMI)); * doubleList.Add(PrepareModel(encryptedDataModel.Breaks)); * doubleList.Add(PrepareModel(encryptedDataModel.Height)); * doubleList.Add(PrepareModel(encryptedDataModel.Weight)); * doubleList.Add(PrepareModel(encryptedDataModel.Water)); * doubleList.Add(PrepareModel(encryptedDataModel.Sleep)); * doubleList.Add(PrepareModel(encryptedDataModel.HoursWeek)); * doubleList.Add(PrepareModel(encryptedDataModel.HoursPerDay)); * doubleList.Add(PrepareModel(encryptedDataModel.Salary)); * doubleList.Add(PrepareModel(encryptedDataModel.SleepProductivityLoss)); * doubleList.Add(PrepareModel(encryptedDataModel.WaterProductivityLoss)); * doubleList.Add(PrepareModel(encryptedDataModel.WeeklySalary)); * doubleList.Add(PrepareModel(encryptedDataModel.TotalBreakTime)); * return doubleList; * }*/ public ComputedDataModel DecryptModel(EncryptedDataModel encryptedDataModel) { ComputedDataModel computedDataModel = new ComputedDataModel(); // Store returned double value in given attribute computedDataModel.Age = PrepareModel(encryptedDataModel.Age); computedDataModel.Height = PrepareModel(encryptedDataModel.Height); computedDataModel.Weight = PrepareModel(encryptedDataModel.Weight); computedDataModel.Breaks = PrepareModel(encryptedDataModel.Breaks); computedDataModel.TotalBreakTime = PrepareModel(encryptedDataModel.TotalBreakTime); computedDataModel.WeeklyHours = PrepareModel(encryptedDataModel.HoursWeek); computedDataModel.DailyHours = PrepareModel(encryptedDataModel.HoursPerDay); computedDataModel.Salary = PrepareModel(encryptedDataModel.Salary); computedDataModel.WeeklySalary = PrepareModel(encryptedDataModel.WeeklySalary); computedDataModel.Sleep = PrepareModel(encryptedDataModel.Sleep); computedDataModel.SleepDeficit = PrepareModel(encryptedDataModel.SleepProductivityLoss); computedDataModel.Water = PrepareModel(encryptedDataModel.Water); computedDataModel.WaterDeficit = PrepareModel(encryptedDataModel.WaterProductivityLoss); // Return computedDataModel return(computedDataModel); }
private ComputedDataModel GetSleepMessage(ComputedDataModel computedDataModel) { if (computedDataModel.SleepDeficit < 0) { computedDataModel.SleepMessage = "You are unfortunatley, sleep deprived. By only sleeping for " + computedDataModel.Sleep + " Hours you are reducing your cognitive ability and efficiency at tasks. This can be remedied by increasing your nightly sleep."; computedDataModel.SleepMessage += " You are currently operating on a sleep deficit of " + computedDataModel.SleepDeficit + " hours. By sleeping more this can be fixed."; return(computedDataModel); } else if (computedDataModel.SleepDeficit == 0) { computedDataModel.SleepMessage = "Perfect! You are receiving the correct amount of sleep per night. This has many benefits such as a larger working memory, increased multitasking ability and greater efficiency at tasks."; computedDataModel.SleepMessage = "Receiving " + computedDataModel.Sleep + " Also both increase energy mood and wellbeing. Good work!"; return(computedDataModel); } else { computedDataModel.SleepMessage = "Zzzzz. You are no stranger to sleeping! Getting a good nights sleep is essential to working efficiently and a better mood. "; computedDataModel.SleepMessage += " By sleeping for " + computedDataModel.Sleep + " Hours per night you are being well rested. You have a sleep surplus of" + computedDataModel.SleepDeficit + " hours."; return(computedDataModel); } }
private ComputedDataModel NormaliseValues(ComputedDataModel computedDataModel) { computedDataModel.Age = Math.Round(computedDataModel.Age, 0); computedDataModel.Breaks = Math.Round(computedDataModel.Breaks, 0); computedDataModel.BreaksMonetaryLoss = Math.Round(computedDataModel.BreaksMonetaryLoss, 2); computedDataModel.WeeklyHours = Math.Round(computedDataModel.WeeklyHours, 1); computedDataModel.DailyHours = Math.Round(computedDataModel.DailyHours, 2); computedDataModel.Salary = Math.Round(computedDataModel.Salary, 2); computedDataModel.WeeklySalary = Math.Round(computedDataModel.WeeklySalary, 2); computedDataModel.Sleep = Math.Round(computedDataModel.Sleep, 2); computedDataModel.SleepMonetaryLoss = Math.Round(computedDataModel.SleepMonetaryLoss, 2); computedDataModel.Water = Math.Round(computedDataModel.Water); computedDataModel.WaterMonetaryLoss = Math.Round(computedDataModel.WaterMonetaryLoss, 2); computedDataModel.TotalWeeklyMonetaryLoss = Math.Round(computedDataModel.TotalWeeklyMonetaryLoss, 2); computedDataModel.TotalYearlyMonetaryLoss = Math.Round(computedDataModel.TotalYearlyMonetaryLoss, 2); computedDataModel.WaterDeficit = Math.Round(computedDataModel.WaterDeficit); computedDataModel.SleepDeficit = Math.Round(computedDataModel.SleepDeficit); computedDataModel.SleepAnnualLoss = Math.Round(computedDataModel.SleepAnnualLoss, 2); computedDataModel.BreaksAnnualLoss = Math.Round(computedDataModel.BreaksAnnualLoss, 2); computedDataModel.WaterAnnualLoss = Math.Round(computedDataModel.WaterAnnualLoss, 2); return(computedDataModel); }
public void OnGet() { computedDataModel = DataDisplay.computedDataModel; }
private void MessageGeneration(ComputedDataModel computedDataModel) { }
public void PassToDataDisplay(ComputedDataModel computedDataModel) { DataDisplay.computedDataModel = computedDataModel; }