Exemple #1
0
    def GetGraphFloor(self, userName):
        """
            To get the graph of the number of floor
            :param self: the object
            :param userName: the name of the user
            :return nameGraph: the name of the graph
        """

        dataFloor = authentification.mainAuthentification(3)

        arrayDay = self.GetArrayX(dataFloor, 'activities-floors')
        arrayFloor = self.GetArrayY(dataFloor, 'activities-floors')
        nameGraph = self.SaveGraph(arrayDay, arrayFloor, userName, "floors")

        return nameGraph
Exemple #2
0
    def GetGraphStep(self, userName):
        """
            To get the graph of the step
            :param self: the object
            :param userName: the name of the user
            :return nameGraph: the name of the graph
        """

        dataStep = authentification.mainAuthentification(2)

        arrayDay = self.GetArrayX(dataStep, 'activities-steps')
        arrayStep = self.GetArrayY(dataStep, 'activities-steps')
        nameGraph = self.SaveGraph(arrayDay, arrayStep, userName, "steps")

        return nameGraph
Exemple #3
0
    def GetGraphHeart(self, userName):
        """
            To get the graph of the heart rate
            :param self: the object
            :param userName: the name of the user
            :return nameGraph: the name of the graph
        """

        dataHeart = authentification.mainAuthentification(1)

        arrayTimes = self.GetArrayTimes(dataHeart)
        arrayHR = self.GetArrayHR(dataHeart)
        nameGraph = self.SaveGraphHeart(arrayTimes, arrayHR, userName)

        return nameGraph
Exemple #4
0
    def GetGraphDistance(self, userName):
        """
            To get the graph of the distance
            :param self: the object
            :param userName: the name of the user
            :return nameGraph: the name of the graph
        """

        dataDistance = authentification.mainAuthentification(5)

        arrayDay = self.GetArrayX(dataDistance, 'activities-distance')
        arrayDistance = self.GetArrayY(dataDistance, 'activities-distance')
        nameGraph = self.SaveGraph(arrayDay, arrayDistance, userName,
                                   "distance")

        return nameGraph
Exemple #5
0
    def GetGraphCalories(self, userName):
        """
            To get the graph of the calories
            :param self: the object
            :param userName: the name of the user
            :return nameGraph: the name of the graph
        """

        dataCalories = authentification.mainAuthentification(4)

        arrayDay = self.GetArrayX(dataCalories, 'activities-calories')
        arrayCalorie = self.GetArrayY(dataCalories, 'activities-calories')
        nameGraph = self.SaveGraph(arrayDay, arrayCalorie, userName,
                                   "calories")

        return nameGraph
Exemple #6
0
    def GetGraphMinutes(self, userName):
        """
            To get the graph of the minutes
            :param self: the object
            :param userName: the name of the user
            :return nameGraph: the name of the graph
        """

        dataMinutes = authentification.mainAuthentification(6)

        arrayDay = self.GetArrayX(dataMinutes, 'activities-minutesSedentary')
        arrayMinutes = self.GetArrayY(dataMinutes,
                                      'activities-minutesSedentary')
        nameGraph = self.SaveGraph(arrayDay, arrayMinutes, userName,
                                   "minutesSedentary")

        return nameGraph
Exemple #7
0
    def GetGraphActive(self, userName):
        """
            To get the graph of the active minute
            :param self: the object
            :param userName: the name of the user
            :return nameGraph: the name of the graph
        """

        dataActive = authentification.mainAuthentification(7)

        arrayDay = self.GetArrayX(dataActive, 'activities-minutesVeryActive')
        arrayActive = self.GetArrayY(dataActive,
                                     'activities-minutesVeryActive')
        nameGraph = self.SaveGraph(arrayDay, arrayActive, userName,
                                   "minutesVeryActive")

        return nameGraph
Exemple #8
0
    def WriteFile(self, userName):
        """
            Write in a file data of the day
            :param self: the object
            :param userName: the name of the user
        """

        dataHeart = authentification.mainAuthentification(1)

        date = time.localtime()
        date2 = str(date.tm_mday) + "-" + str(date.tm_mon) + "-" + str(
            date.tm_year)
        nomFichier = userName + "_" + date2 + ".json"

        with open(nomFichier, 'w') as f:
            data = {}
            data["contenu"] = dataHeart['activities-heart-intraday']['dataset']
            json.dump(data, f, indent=4)
# -*- coding: utf-8 -*-

import authentification
import imageViewer

from PyQt5 import QtCore, QtGui, QtWidgets

#Connexion and get profile data
connexionProfile = authentification.mainAuthentification(0)

#Name of the user
nameUser = connexionProfile['user']['displayName']

#Open the application
imageViewer.mainInterface(nameUser)