예제 #1
0
 def __init__(self):
     """
     @fn      __init__
     @brief   Constructor
     """
     self.mockup = Mockup()
     self.status = False
     pass
예제 #2
0
class Parking40(object):
    """
    @class   Parking40
    @brief   Parking40 business logic
    """

    def __init__(self):
        """
        @fn      __init__
        @brief   Constructor
        """
        self.mockup = Mockup()
        self.status = False
        pass

    def isParking(self, status):
        """
        @fn      isParking
        @brief   Is-Parking called by GUI
        """
        self.status = status
        return True

    def login(self, username, password):
        """
        @fn      login
        @brief   Login called by GUI
        """
        result = self.mockup.login(username, password)
        return result

    def reportFreeParkingplace(self, position):
        """
        @fn      reportFreeParkingplace
        @brief   Report a free parking-place to the online service
        """
        result = self.mockup.reportFreeParkingplace(position)
        return result

    def startCar(self):
        """
        @fn      startCar
        @brief   The driver starts the car
        """
        position = self.mockup.getPosition()
        result = self.mockup.reportFreeParkingPlace(position)
        return result

    def wantToPark(self):
        """
        @fn      wantToPark
        @brief   Want-to-Park called by GUI
        """
        return True

    def getFreeParkingPlaces(self):
        """
        @fn      getFreeParkingPlaces
        @brief   Get-free-Parking-places called by GUI
        """
        position = self.mockup.getPosition()
        parkingPlaces = self.mockup.getFreeParkingPlaces(position)
        return parkingPlaces

    def selectParkingPlace(self, parkingPlace):
        """
        @fn      selectParkingPlace
        @param   parkingPlace
        @brief   Get-free-Parking-places called by GUI
        """
        position = self.mockup.getPosition()
        parkingPlaces = self.mockup.getFreeParkingPlaces(position)
        return parkingPlace

    def parkTheCar(self):
        """
        @fn      parkTheCar
        @brief   Park-the-Car called by GUI
        """
        return True