Ejemplo n.º 1
0
    def update_exercise_page(self, canvas):
        try:
            lastrowindex = lastline()
            lastRowInfo(lastrowindex)
            length = Exercise_length()
            Fig = length.csv_plot_exercise_length()
            canvas.figure = Fig
            canvas.draw()

        except (ValueError):
            label = ttk.Label(ResultsBloodPressurePage,
                              text=("No change to data."),
                              font=LARGE_FONT)
            label.pack(pady=10, padx=10)
Ejemplo n.º 2
0
    def update_running_page(self, canvas):
        try:
            lastrowindex = lastline()
            lastRowInfo(lastrowindex)
            distance = Distance_Ran()
            Fig = distance.csv_plot_Distance()
            canvas.figure = Fig
            canvas.draw()

        except (ValueError):
            label = ttk.Label(ResultsBloodPressurePage,
                              text=("No change to data."),
                              font=LARGE_FONT)
            label.pack(pady=10, padx=10)
Ejemplo n.º 3
0
    def update_smoking_page(self, canvas):
        try:
            lastrowindex = lastline()
            lastRowInfo(lastrowindex)
            cigs = Cigarettes()
            Fig = cigs.csv_plot_cigarettes()
            canvas.figure = Fig
            canvas.draw()

        except (ValueError):
            label = ttk.Label(ResultsBloodPressurePage,
                              text=("No change to data."),
                              font=LARGE_FONT)
            label.pack(pady=10, padx=10)
Ejemplo n.º 4
0
    def update_weight_page(self, canvas):
        try:
            lastrowindex = lastline()
            lastRowInfo(lastrowindex)
            bw = Body_Weight()
            Fig = bw.csv_plot_bodyWeight()
            canvas.figure = Fig
            canvas.draw()

        except (ValueError):
            label = ttk.Label(ResultsBloodPressurePage,
                              text=("No change to data."),
                              font=LARGE_FONT)
            label.pack(pady=10, padx=10)
Ejemplo n.º 5
0
def refresh():
    from data import csv_reader

    number_of_last_row_index = csv_reader.lastline()
    row_for_weight_comparisson_index = number_of_last_row_index - 1

    values_from_CSV = csv_reader.lastRowInfo(number_of_last_row_index)

    if (values_from_CSV[0] == -1):
        return "Input some data to get some calculations."
    else:
        blood_pressure = values_from_CSV[0]
        body_mass_index = values_from_CSV[1]
        body_weight = values_from_CSV[2]
        time_spend_exercising_minutes = values_from_CSV[3]
        cigarettes_smoked_per_day = values_from_CSV[4]

        recommendation_to_user = reccomend_blood_pressure(blood_pressure)
        recommendation_to_user += reccomend_body_weight(
            body_mass_index, time_spend_exercising_minutes)
        is_user_overweight = is_overweight(body_mass_index)
        if is_user_overweight:
            body_weight_previous_day = csv_reader.semiLastRowWeightComparisson(
                row_for_weight_comparisson_index)
            recommendation_to_user += weight_difference(
                body_weight, body_weight_previous_day,
                number_of_last_row_index)
        recommendation_to_user += smoking_reccomend(cigarettes_smoked_per_day)

        return recommendation_to_user