This commit is contained in:
sidya82
2015-02-04 15:33:15 +01:00
parent 952b215c0c
commit 2a1099c450
9 changed files with 63 additions and 46 deletions

View File

@@ -20,7 +20,12 @@ class Borne:
bornes = []
@staticmethod
def MajBornes():
pass
print(Borne.bornes)
for b in Borne.bornes:
b.MajBorne()
def MajBorne(self):
self.__ui.lcdNumber.display(self.__parking.nbPlacesLibresParking)
def __init__(self, main, parking):
self.__parking = parking
@@ -41,6 +46,7 @@ class Borne:
self.__ui.btn_recuperer.clicked.connect(self.recuperer)
# Validator
@@ -50,6 +56,8 @@ class Borne:
self.nonVoiture()
self.showWindow()
self.__ui.nomParking.setText("Borne " + str(len(self.bornes)+1) + " - Parking : " +parking.nom)
Borne.bornes.append(self)
Borne.MajBornes()
def blockAll(self):
@@ -84,6 +92,7 @@ class Borne:
self.__ui.lineEdit_id.setText("")
self.__ui.numeroTicketLineEdit.setText("")
self.__ui.labIdClient.setText("Non identifier")
Borne.MajBornes()
def newVoiture(self):
"""
@@ -105,13 +114,13 @@ class Borne:
:return:
"""
try :
self.__c = Client.get(self.__ui.lineEdit_id.text())
self.__c = Client(self.__ui.lineEdit_id.text())
self.__ui.label_aff.setText("Bonjour " + str(self.__c.nom) + " " + str(self.__c.prenom))
self.__ui.labIdClient.setText("Vous étes identifier")
self.__ui.box_id.setDisabled(True)
self.__ui.box_service.setDisabled(False)
self.__ui.btn_desabo.setDisabled(False)
except IndexError :
except Exception :
self.__ui.label_aff.setText("Echec identification")
self.__ui.labIdClient.setText("Non identifier")
@@ -139,7 +148,6 @@ class Borne:
str(self.__ui.prenomLineEdit.text()),
"",
TypeAbonnement.ABONNE)
print(self.__c)
self.__ui.label_aff.setText("Votre id membre est : " + self.__c.id)
self.__ui.lineEdit_id.setText(self.__c.id)
self.identification()
@@ -153,25 +161,25 @@ class Borne:
if self.__c is None:
p = self.__parking.recherchePlace(self.__v_actuel)
if p is not None:
id = Teleporteur.teleporterVoiture(self.__v_actuel, p)
placement = Teleporteur.teleporterVoiture(self.__v_actuel, p)
else:
if self.__c.abonnement != TypeAbonnement.SUPER_ABONNE:
p = self.__parking.recherchePlace(self.__v_actuel)
if p is not None :
id = Teleporteur.teleporterVoiture(self.__v_actuel, p)
placement = Teleporteur.teleporterVoiture(self.__v_actuel, p)
if self.__ui.checkBox_Livraison_2.isChecked():
Service(None, self.__c, p, TypeService.LIVRAISON)
Service(None, self.__c, placement, TypeService.LIVRAISON)
if self.__ui.checkBox_Entretien_2.isChecked():
Service(None, self.__c, p, TypeService.ENTRETIEN)
Service(None, self.__c, placement, TypeService.ENTRETIEN)
if self.__ui.checkBox_Maintenance_2.isChecked():
Service(None, self.__c, p, TypeService.MAINTENANCE)
Service(None, self.__c, placement, TypeService.MAINTENANCE)
else:
Teleporteur.teleporterVoitureSuperAbonne(self.__v_actuel)
if id is not None:
placement = Teleporteur.teleporterVoitureSuperAbonne(self.__v_actuel, self.__parking)
if placement is not None:
self.nonVoiture()
self.ticketDepot(id)
self.ticketDepot(placement.id)
else:
self.__ui.label_aff.setText("Aucune Place Disponible Pour Votre Véhicule. Devenez Super Abonné!")
self.__ui.label_aff.setText("Aucune Place Correspondante. Devenez Super Abonné!")
def recuperer(self):

View File

@@ -98,15 +98,19 @@ class Main:
self.__ui.btn_borne.setDisabled(True)
#onglet Service
for s in Service.serviceEnCours:
if s.typeService == TypeService.LIVRAISON :
self.__ui.comboBox_livraison.addItem(str(s.id))
if s.typeService == TypeService.ENTRETIEN :
self.__ui.comboBox_entretien.addItem(str(s.id))
if s.typeService == TypeService.MAINTENANCE :
self.__ui.comboBox_maintenance.addItem(str(s.id))
self.__ui.comboBox_livraison.clear()
self.__ui.comboBox_entretien.clear()
self.__ui.comboBox_maintenance.clear()
if self.__ui.comboBox.count() > 1:
for s in Service.getAllEnCours(p[self.__ui.comboBox.currentIndex() - 1]):
if s.typeService == TypeService.LIVRAISON :
self.__ui.comboBox_livraison.addItem(str(s.id))
if s.typeService == TypeService.ENTRETIEN :
self.__ui.comboBox_entretien.addItem(str(s.id))
if s.typeService == TypeService.MAINTENANCE :
self.__ui.comboBox_maintenance.addItem(str(s.id))
#Onglet Stats
#Onglet Stats
def creerParking(self):
@@ -136,8 +140,8 @@ class Main:
def afficherBornes(self):
if self.__ui.comboBox.currentIndex() != 0:
self.__view.hide()
Borne.bornes.append(Borne(self, Parking.getAllActif()[self.__ui.comboBox.currentIndex() - 1]))
Borne.bornes.append(Borne(self, Parking.getAllActif()[self.__ui.comboBox.currentIndex() - 1]))
Borne(self, Parking.getAllActif()[self.__ui.comboBox.currentIndex() - 1])
Borne(self, Parking.getAllActif()[self.__ui.comboBox.currentIndex() - 1])
def nouveau(self):
result = QtGui.QMessageBox.question(self.__view,

View File

@@ -8,13 +8,13 @@ class Teleporteur:
def teleporterVoiture(voiture, place):
p = Placement(None,voiture, place)
place.prendre()
return p.id
return p
@staticmethod
def teleporterVoitureSuperAbonne(voiture, parking):
place = parking.addPlaceSuperAbo()
place = parking.addPlaceSuperAbo(parking)
p = Placement(None, voiture, place)
return p.id
return p
@staticmethod
def teleporterVersSortie(placement):

View File

@@ -1,5 +1,3 @@
__author__ = 'sidya'
import logging
from logging.handlers import RotatingFileHandler
@@ -50,7 +48,6 @@ class Log(object):
"""
Log Manager
"""
def __init__(self):
"""
Define 3 differents log :