Ejemplo n.º 1
0
 public static double CalculateMealCarbs(int targerSugar, int currentSugar, UnitReductionUnits unitReductionUnits, double unitReductionValue,
                                             double insulinCarbohydrateRatio, DosageUnits dosageUnits, double insulinDosage)
 {
     if (unitReductionValue == 0) return 0;
     double mealCarbs = (insulinDosage - (currentSugar - targerSugar) / unitReductionValue) * insulinCarbohydrateRatio;
     return mealCarbs;
 }
Ejemplo n.º 2
0
 public static double CalculatingInsulinDose(int targerSugar, int currentSugar, UnitReductionUnits unitReductionUnits, double unitReductionValue, 
                                                double insulinCarbohydrateRatio, DosageUnits dosageUnits, double mealCarbs)
 {
     if (unitReductionValue == 0 || insulinCarbohydrateRatio == 0) return 0;
     double insulinDosage = (currentSugar - targerSugar) / unitReductionValue + mealCarbs / insulinCarbohydrateRatio;
     return insulinDosage;
 }
Ejemplo n.º 3
0
        public usrSupplementsCycleDosageEditor()
        {
            InitializeComponent();

            foreach (DosageType dosageType in Enum.GetValues(typeof(DosageType)))
            {
                DosageTypes.Add(new ListItem <DosageType>(EnumLocalizer.Default.Translate(dosageType), dosageType));
            }
            foreach (DosageUnit dosageUnit in Enum.GetValues(typeof(DosageUnit)))
            {
                DosageUnits.Add(new ListItem <DosageUnit>(EnumLocalizer.Default.Translate(dosageUnit), dosageUnit));
            }
            foreach (SupplementCycleDayRepetitions repetition in Enum.GetValues(typeof(SupplementCycleDayRepetitions)))
            {
                Repetitions.Add(new ListItem <SupplementCycleDayRepetitions>(EnumLocalizer.Default.Translate(repetition), repetition));
            }
            foreach (TimeType timeType in Enum.GetValues(typeof(TimeType)))
            {
                TimeTypes.Add(new ListItem <TimeType>(EnumLocalizer.Default.Translate(timeType), timeType));
            }
        }