\o/
This commit is contained in:
parent
2a1099c450
commit
b7b6a84643
@ -1,12 +1,8 @@
|
||||
import sqlite3
|
||||
|
||||
from src.c.Main import Main
|
||||
from src.m.connexionBDD import connexionBDD
|
||||
|
||||
|
||||
__author__ = 'sidya'
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# c = connexionBDD()
|
||||
#c.initialisationBDD()
|
||||
|
102
src/c/Borne.py
102
src/c/Borne.py
@ -1,4 +1,4 @@
|
||||
from PyQt4 import QtGui
|
||||
from PyQt4 import QtGui, QtCore
|
||||
|
||||
from src.c.Teleporteur import Teleporteur
|
||||
from src.m.Parking import Placement
|
||||
@ -18,9 +18,9 @@ class Borne:
|
||||
Controleur de la vue des bornes permettant l'accès au parking
|
||||
"""
|
||||
bornes = []
|
||||
|
||||
@staticmethod
|
||||
def MajBornes():
|
||||
print(Borne.bornes)
|
||||
for b in Borne.bornes:
|
||||
b.MajBorne()
|
||||
|
||||
@ -28,9 +28,10 @@ class Borne:
|
||||
self.__ui.lcdNumber.display(self.__parking.nbPlacesLibresParking)
|
||||
|
||||
def __init__(self, main, parking):
|
||||
self.__nomBorne = "Borne " + str(len(self.bornes) + 1)
|
||||
self.__parking = parking
|
||||
self.__main = main
|
||||
self.__main.activity("Affichage Borne", self.__main.lvl.INFO)
|
||||
self.__main.activity("Affichage " + self.__nomBorne, self.__main.lvl.INFO)
|
||||
|
||||
self.__w = MyQWidget(self.__main)
|
||||
self.__ui = Ui_Borne()
|
||||
@ -48,14 +49,18 @@ class Borne:
|
||||
|
||||
|
||||
# Validator
|
||||
|
||||
|
||||
validatorText = QtGui.QRegExpValidator(QtCore.QRegExp('^([a-zA-Z\'àâéèêôùûçñãõÀÂÉÈÔÙÛÑÃÕÇ\s-]{2,30})$'))
|
||||
validatorCB = QtGui.QRegExpValidator(QtCore.QRegExp('^([0-9]*)$'))
|
||||
self.__ui.nomLineEdit.setValidator(validatorText)
|
||||
self.__ui.prenomLineEdit.setValidator(validatorText)
|
||||
self.__ui.lieuLineEdit_2.setValidator(validatorText)
|
||||
self.__ui.numeroCarteLineEdit.setValidator(validatorCB)
|
||||
|
||||
self.__ui.label_aff.setStyleSheet("qproperty-alignment: AlignCenter; font-size: 28px")
|
||||
self.__ui.nomParking.setStyleSheet("qproperty-alignment: AlignCenter; font-size: 28px")
|
||||
self.nonVoiture()
|
||||
self.showWindow()
|
||||
self.__ui.nomParking.setText("Borne " + str(len(self.bornes)+1) + " - Parking : " +parking.nom)
|
||||
self.__ui.nomParking.setText(self.__nomBorne + " - Parking : " + parking.nom)
|
||||
Borne.bornes.append(self)
|
||||
Borne.MajBornes()
|
||||
|
||||
@ -75,6 +80,7 @@ class Borne:
|
||||
Met en etat initial de départ sans voiture
|
||||
:return:
|
||||
"""
|
||||
self.__main.activity(self.__nomBorne + " : En Attente d'une voiture", self.__main.lvl.INFO)
|
||||
self.__ui.label_aff.setText("Dream park")
|
||||
self.__c = None
|
||||
self.__ui.box_abo.setDisabled(True)
|
||||
@ -101,6 +107,7 @@ class Borne:
|
||||
"""
|
||||
self.__ui.btn_Voiture.setDisabled(True)
|
||||
self.__v_actuel = Camera.donnerVoiture()
|
||||
self.__main.activity(self.__nomBorne + " : Arrivee : " + str(self.__v_actuel), self.__main.lvl.INFO)
|
||||
self.__ui.box_abo.setDisabled(False)
|
||||
self.__ui.box_garer.setDisabled(False)
|
||||
self.__ui.box_id.setDisabled(False)
|
||||
@ -120,9 +127,17 @@ class Borne:
|
||||
self.__ui.box_id.setDisabled(True)
|
||||
self.__ui.box_service.setDisabled(False)
|
||||
self.__ui.btn_desabo.setDisabled(False)
|
||||
except Exception :
|
||||
self.__v_actuel.setClient(self.__c)
|
||||
self.__main.activity(self.__nomBorne + " : Mise a jour : " + str(self.__v_actuel), self.__main.lvl.INFO)
|
||||
self.__main.activity(self.__nomBorne + " : Identification : " + str(self.__c), self.__main.lvl.INFO)
|
||||
except IndexError:
|
||||
self.__ui.label_aff.setText("Echec identification")
|
||||
self.__ui.labIdClient.setText("Non identifier")
|
||||
self.__main.activity(self.__nomBorne + " : Identifiant Invalide", self.__main.lvl.INFO)
|
||||
except Exception as e:
|
||||
self.error("Une erreur est survenu lors de votre identification")
|
||||
self.__main.activity(self.__nomBorne + " : Erreur lors de l'indentification " + str(e),
|
||||
self.__main.lvl.FAIL)
|
||||
|
||||
def abo(self):
|
||||
"""
|
||||
@ -135,6 +150,7 @@ class Borne:
|
||||
"",
|
||||
TypeAbonnement.SUPER_ABONNE)
|
||||
self.__ui.label_aff.setText("Mise a jour de votre abonnement effectué")
|
||||
self.__main.activity(self.__nomBorne + " : Mise à jour : " + str(self.__c), self.__main.lvl.INFO)
|
||||
else:
|
||||
if self.__ui.checkBox.isChecked():
|
||||
self.__c = Client(None,
|
||||
@ -148,16 +164,18 @@ class Borne:
|
||||
str(self.__ui.prenomLineEdit.text()),
|
||||
"",
|
||||
TypeAbonnement.ABONNE)
|
||||
self.identification()
|
||||
self.__main.activity(self.__nomBorne + " : Ajout : " + str(self.__c), self.__main.lvl.INFO)
|
||||
self.__ui.label_aff.setText("Votre id membre est : " + self.__c.id)
|
||||
self.__ui.lineEdit_id.setText(self.__c.id)
|
||||
self.identification()
|
||||
|
||||
|
||||
def garer(self):
|
||||
"""
|
||||
Gestion de la validation de garer son vehicule
|
||||
:return:
|
||||
"""
|
||||
id = None
|
||||
placement = None
|
||||
if self.__c is None:
|
||||
p = self.__parking.recherchePlace(self.__v_actuel)
|
||||
if p is not None:
|
||||
@ -168,18 +186,24 @@ class Borne:
|
||||
if p is not None:
|
||||
placement = Teleporteur.teleporterVoiture(self.__v_actuel, p)
|
||||
if self.__ui.checkBox_Livraison_2.isChecked():
|
||||
Service(None, self.__c, placement, TypeService.LIVRAISON)
|
||||
s = Service(None, self.__c, placement, TypeService.LIVRAISON)
|
||||
self.__main.activity(self.__nomBorne + " : Nouveau : " + str(s), self.__main.lvl.INFO)
|
||||
if self.__ui.checkBox_Entretien_2.isChecked():
|
||||
Service(None, self.__c, placement, TypeService.ENTRETIEN)
|
||||
s = Service(None, self.__c, placement, TypeService.ENTRETIEN)
|
||||
self.__main.activity(self.__nomBorne + " : Nouveau : " + str(s), self.__main.lvl.INFO)
|
||||
if self.__ui.checkBox_Maintenance_2.isChecked():
|
||||
Service(None, self.__c, placement, TypeService.MAINTENANCE)
|
||||
s = Service(None, self.__c, placement, TypeService.MAINTENANCE)
|
||||
self.__main.activity(self.__nomBorne + " : Nouveau : " + str(s), self.__main.lvl.INFO)
|
||||
else:
|
||||
placement = Teleporteur.teleporterVoitureSuperAbonne(self.__v_actuel, self.__parking)
|
||||
if placement is not None:
|
||||
self.nonVoiture()
|
||||
self.ticketDepot(placement.id)
|
||||
self.__main.activity(self.__nomBorne + " : Nouveau : " + str(placement), self.__main.lvl.INFO)
|
||||
else:
|
||||
self.__ui.label_aff.setText("Aucune Place Correspondante. Devenez Super Abonné!")
|
||||
self.__main.activity(self.__nomBorne + " : Pas de place dispo pour " + str(self.__v_actuel),
|
||||
self.__main.lvl.INFO)
|
||||
|
||||
|
||||
def recuperer(self):
|
||||
@ -187,13 +211,21 @@ class Borne:
|
||||
Essaie de recuperer une voiture avec le numero de ticket (lineedit)
|
||||
:return:
|
||||
"""
|
||||
p = None
|
||||
try:
|
||||
p = Placement.get(self.__ui.numeroTicketLineEdit.text())
|
||||
Teleporteur.teleporterVersSortie(p)
|
||||
self.nonVoiture()
|
||||
self.ticketDepot(id)
|
||||
p = Placement(self.__ui.numeroTicketLineEdit.text())
|
||||
except IndexError:
|
||||
self.__ui.label_aff.setText("Mauvais numero de ticket")
|
||||
self.__main.activity(self.__nomBorne + " : Mauvais numero de ticket", self.__main.lvl.INFO)
|
||||
try:
|
||||
Teleporteur.teleporterVersSortie(p)
|
||||
except Exception:
|
||||
self.__ui.label_aff.setText("Voiture déjà recuperé")
|
||||
self.__main.activity(self.__nomBorne + " : Recuperation déjà effectué : " + str(p), self.__main.lvl.INFO)
|
||||
if p is not None:
|
||||
self.nonVoiture()
|
||||
self.ticketRetrait(p, Service.getAllServicePlacement(p))
|
||||
self.__main.activity(self.__nomBorne + " : Recuperation : " + str(p), self.__main.lvl.INFO)
|
||||
|
||||
def ticketDepot(self, id):
|
||||
QtGui.QMessageBox.information(self.__w,
|
||||
@ -201,12 +233,36 @@ class Borne:
|
||||
"Votre numero ticket : " + str(id)
|
||||
)
|
||||
|
||||
def ticketRetrait(self):
|
||||
def ticketRetrait(self, placement, services):
|
||||
if placement.voiture.client == "NULL":
|
||||
prix = placement.place.typePlace.prix
|
||||
s = "Prix : " + str(prix) + "€" + \
|
||||
"\nMerci de votre confiance! Bonne journée !"
|
||||
else:
|
||||
prix = placement.place.typePlace.prix - placement.place.typePlace.prix * 10 / 100
|
||||
s = "Prix : " + str(placement.place.typePlace.prix) + "- 10% = " + \
|
||||
str(prix) + "€"
|
||||
for service in services:
|
||||
if service.typeService == TypeService.MAINTENANCE:
|
||||
name = "Maintenance"
|
||||
elif service.typeService == TypeService.ENTRETIEN:
|
||||
name = "Entretien"
|
||||
else:
|
||||
name = "Autre Service"
|
||||
|
||||
if service.estRealiser():
|
||||
s += "\nService : " + name + " + 2€"
|
||||
else:
|
||||
s += "\nNous n'avons pas pu réaliser le service" + name + "."
|
||||
s += "\nVeuillez nous excuser de la gène ocassionée."
|
||||
s += "Le Montant sera débiter automatiquement sur votre compte."
|
||||
s += "\nMerci de votre confiance! Bonne journée !"
|
||||
QtGui.QMessageBox.information(self.__w,
|
||||
"Ticket",
|
||||
"Merci de votre confiance! Bonne journée !"
|
||||
str(s)
|
||||
)
|
||||
|
||||
|
||||
def showWindow(self):
|
||||
"""
|
||||
Gestion affichage de la vue borne
|
||||
@ -221,16 +277,16 @@ class Borne:
|
||||
Gestion de sortie de la vue borne
|
||||
:return:
|
||||
"""
|
||||
self.__main.activity(self.__nomBorne + " : Quitter", self.__main.lvl.INFO)
|
||||
self.__main.showWindow()
|
||||
|
||||
|
||||
def error(self):
|
||||
def error(self, msg):
|
||||
"""
|
||||
Qdialog message erreur
|
||||
:return:
|
||||
"""
|
||||
QtGui.QMessageBox.warning(self.__w,
|
||||
QtGui.QMessageBox.warning(self._w,
|
||||
"Erreur ...",
|
||||
"Une erreur est survenue ...")
|
||||
self.__w.hide()
|
||||
self.__main.showWindow()
|
||||
msg
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
from PyQt4 import QtGui
|
||||
from PyQt4 import QtGui, QtCore
|
||||
|
||||
from src.m.Parking import Parking, TypePlace
|
||||
from src.v.MyQWidget import MyQWidget
|
||||
@ -12,6 +12,7 @@ class CreaParking:
|
||||
"""
|
||||
Controleur de cretion de parking
|
||||
"""
|
||||
|
||||
def __init__(self, main):
|
||||
self._main = main
|
||||
self._main.activity("Debut Creation Parking", self._main.lvl.INFO)
|
||||
@ -27,17 +28,12 @@ class CreaParking:
|
||||
self._ui.btn_annuler.clicked.connect(self.annuler)
|
||||
|
||||
# Validator
|
||||
#self._ui.lineEdit_nbNiv.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]*')))
|
||||
self._ui.lineEdit_nom.setValidator(
|
||||
QtGui.QRegExpValidator(QtCore.QRegExp('^([0-9a-zA-Z\'àâéèêôùûçñãõÀÂÉÈÔÙÛÑÃÕÇ\s-]{2,30})$')))
|
||||
|
||||
self._ui.tableWidget.insertRow(self._ui.tableWidget.rowCount())
|
||||
self.showWindow()
|
||||
|
||||
def majNbPlaceTotal(self):
|
||||
nb = 0
|
||||
for i in range(0, self._ui.tableWidget.rowCount()):
|
||||
nb += int(self._ui.tableWidget.itemAt(i, 3).text())
|
||||
self._ui.nbPlacesTotal.setText(str(nb))
|
||||
|
||||
def addRow(self):
|
||||
"""
|
||||
Ajoute une ligne de creation de place
|
||||
@ -65,7 +61,7 @@ class CreaParking:
|
||||
|
||||
if result == QtGui.QMessageBox.Yes:
|
||||
self._main.activity("Annulation Creation Parking", self._main.lvl.INFO)
|
||||
#self._w.hide()
|
||||
self._w.hide()
|
||||
self._main.showWindow()
|
||||
|
||||
def valider(self):
|
||||
@ -73,21 +69,25 @@ class CreaParking:
|
||||
Gestion validation de formulaire de creation de parking.
|
||||
:return:
|
||||
"""
|
||||
# try:
|
||||
if self._ui.lineEdit_nom.text() == "":
|
||||
self._main.activity("Erreur lors de la creations du Parking. Nom Invalide.\n", self._main.lvl.FAIL)
|
||||
self.error("Nom Invalide!")
|
||||
else:
|
||||
try:
|
||||
l = []
|
||||
for i in range(0, self._ui.tableWidget.rowCount()):
|
||||
l.append(TypePlace(None, int(self._ui.tableWidget.item(i, 0).text()),
|
||||
int(self._ui.tableWidget.item(i, 1).text()),
|
||||
int(self._ui.tableWidget.item(i, 2).text()),
|
||||
float(self._ui.tableWidget.item(i, 3).text()),
|
||||
int(self._ui.tableWidget.item(i, 4).text())))
|
||||
float(self._ui.tableWidget.item(i, 4).text()),
|
||||
int(self._ui.tableWidget.item(i, 3).text())))
|
||||
p = Parking(None, self._ui.lineEdit_nom.text(), l)
|
||||
self._main.activity("Ajout:" + str(p), self._main.lvl.INFO)
|
||||
self._w.hide()
|
||||
self._main.showWindow()
|
||||
#except Exception as e:
|
||||
# self._main.activity("Erreur lors de la creations du Parking \n" + str(e), self._main.lvl.FAIL)
|
||||
# self.error()
|
||||
except Exception as e:
|
||||
self._main.activity("Erreur lors de la creations du Parking \n" + str(e), self._main.lvl.FAIL)
|
||||
self.error("Verifiez que votre saisie est valide !")
|
||||
|
||||
def showWindow(self):
|
||||
"""
|
||||
@ -95,16 +95,15 @@ class CreaParking:
|
||||
:return:
|
||||
"""
|
||||
self._w.show()
|
||||
self.__child = None # supprime l'eventuel widget enfant
|
||||
self._w.focusWidget() # reprend le focus sur la fenetre
|
||||
|
||||
def error(self):
|
||||
def error(self, msg):
|
||||
"""
|
||||
Qdialog message erreur
|
||||
:return:
|
||||
"""
|
||||
QtGui.QMessageBox.warning(self._w,
|
||||
"Erreur ...",
|
||||
"Erreur lors de la création du parking ...")
|
||||
self._w.hide()
|
||||
self._main.showWindow()
|
||||
"Erreur lors de la création du parking ...\n" +
|
||||
msg
|
||||
)
|
@ -36,6 +36,9 @@ class Main:
|
||||
self.__ui.btn_supprimer.clicked.connect(self.rmParking)
|
||||
self.__ui.btn_details.clicked.connect(self.detailsPlacesParking)
|
||||
self.__ui.btn_borne.clicked.connect(self.afficherBornes)
|
||||
self.__ui.btn_effectuer_entretien.clicked.connect(self.doEntretien)
|
||||
self.__ui.btn_effectuer_livraison.clicked.connect(self.doLivraison)
|
||||
self.__ui.btn_effectuer_maintenance.clicked.connect(self.doMaintenance)
|
||||
self.__ui.actionNouveau_2.triggered.connect(self.nouveau)
|
||||
self.__ui.actionSauvegarder.triggered.connect(self.sauver)
|
||||
self.__ui.actionCharger.triggered.connect(self.charger)
|
||||
@ -84,6 +87,7 @@ class Main:
|
||||
self.__ui.placesSuperAbo.clear()
|
||||
if self.__ui.comboBox.count() > 1:
|
||||
p = Parking.getAllActif()
|
||||
self.activity("Parking selectionné : " + str(p[self.__ui.comboBox.currentIndex() - 1]), self.lvl.INFO)
|
||||
self.__ui.nom.setText(p[self.__ui.comboBox.currentIndex() - 1].nom)
|
||||
self.__ui.placesParNiveau.setText(str(p[self.__ui.comboBox.currentIndex() - 1].nbPlaces))
|
||||
self.__ui.placesDispo.setText(
|
||||
@ -101,24 +105,60 @@ class Main:
|
||||
self.__ui.comboBox_livraison.clear()
|
||||
self.__ui.comboBox_entretien.clear()
|
||||
self.__ui.comboBox_maintenance.clear()
|
||||
self.__serviceLivraisons = []
|
||||
self.__serviceEntretien = []
|
||||
self.__serviceMaintenance = []
|
||||
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))
|
||||
self.__serviceLivraisons.append(s)
|
||||
self.__ui.comboBox_livraison.addItem(str(s.info))
|
||||
if s.typeService == TypeService.ENTRETIEN:
|
||||
self.__ui.comboBox_entretien.addItem(str(s.id))
|
||||
self.__serviceEntretien.append(s)
|
||||
self.__ui.comboBox_entretien.addItem(str(s.info))
|
||||
if s.typeService == TypeService.MAINTENANCE:
|
||||
self.__ui.comboBox_maintenance.addItem(str(s.id))
|
||||
|
||||
self.__serviceMaintenance.append(s)
|
||||
self.__ui.comboBox_maintenance.addItem(str(s.info))
|
||||
#Onglet Stats
|
||||
|
||||
|
||||
def doMaintenance(self):
|
||||
if len(self.__serviceMaintenance) > 0:
|
||||
try:
|
||||
s = self.__serviceMaintenance[self.__ui.comboBox_maintenance.currentIndex()]
|
||||
s.doService()
|
||||
self.activity("Livraision reussit : " + str(s), self.lvl.INFO)
|
||||
except Exception as e:
|
||||
self.activity("Livraision echoue : " + str(e), self.lvl.FAIL)
|
||||
self.error("Livraision echoué.")
|
||||
self.selectParking()
|
||||
|
||||
def doEntretien(self):
|
||||
if len(self.__serviceEntretien) > 0:
|
||||
try:
|
||||
s = self.__serviceEntretien[self.__ui.comboBox_entretien.currentIndex()]
|
||||
s.doService()
|
||||
self.activity("Entretien reussit : " + str(s), self.lvl.INFO)
|
||||
except Exception as e:
|
||||
self.activity("Entretien echoue " + str(e), self.lvl.FAIL)
|
||||
self.error("Entretien echoué.")
|
||||
self.selectParking()
|
||||
|
||||
def doLivraison(self):
|
||||
if len(self.__serviceLivraisons) > 0:
|
||||
try:
|
||||
s = self.__serviceLivraisons[self.__ui.comboBox_livraison.currentIndex()]
|
||||
s.doService()
|
||||
self.activity("Livraison reussit : " + str(s), self.lvl.INFO)
|
||||
except Exception as e:
|
||||
self.activity("Livraison echoue : " + str(e), self.lvl.FAIL)
|
||||
self.error("Livraison echoué.")
|
||||
self.selectParking()
|
||||
|
||||
def creerParking(self):
|
||||
self.__view.hide()
|
||||
self.__widgetCourant = CreaParking(self)
|
||||
|
||||
|
||||
|
||||
def rmParking(self):
|
||||
if self.__ui.comboBox.currentIndex() != 0:
|
||||
result = QtGui.QMessageBox.question(self.__view,
|
||||
@ -128,7 +168,12 @@ class Main:
|
||||
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
|
||||
|
||||
if result == QtGui.QMessageBox.Yes:
|
||||
try:
|
||||
Parking.remove(Parking.parkings[self.__ui.comboBox.currentIndex() - 1])
|
||||
self.activity("Supression parking reussit", self.lvl.INFO)
|
||||
except Exception as e:
|
||||
self.activity("Suppression parking echoue : " + str(e), self.lvl.FAIL)
|
||||
self.error("Suppression parking echoué.")
|
||||
self.__view.hide()
|
||||
self.showWindow()
|
||||
|
||||
@ -159,21 +204,42 @@ class Main:
|
||||
def charger(self):
|
||||
path = QtGui.QFileDialog.getOpenFileName(self.__view, "Charger", ".")
|
||||
if path:
|
||||
try:
|
||||
connexionBDD.charger(path)
|
||||
self.activity("Le chargement a reussit", self.lvl.INFO)
|
||||
except Exception as e:
|
||||
self.activity("Le chargement a echoue : " + str(e), self.lvl.FAIL)
|
||||
self.error("Le chargement a echoué.")
|
||||
self.majListeParking()
|
||||
|
||||
def sauver(self):
|
||||
path = QtGui.QFileDialog.getSaveFileName(self.__view, "Sauvegarder", ".")
|
||||
if path:
|
||||
try:
|
||||
connexionBDD.sauver(path)
|
||||
self.activity("La sauvegarde a reussit", self.lvl.INFO)
|
||||
except Exception as e:
|
||||
self.activity("La sauvegarde a echoue : " + str(e), self.lvl.FAIL)
|
||||
self.error("La sauvegarde a echoué.")
|
||||
self.majListeParking()
|
||||
|
||||
def quitter(self):
|
||||
self.__view.close()
|
||||
|
||||
def showWindow(self):
|
||||
self.activity("Chargement de la fenetre principal", self.lvl.INFO)
|
||||
self.majListeParking()
|
||||
self.__view.show()
|
||||
self.__widgetCourant = None # supprime eventuel widget
|
||||
Borne.bornes = []
|
||||
self.__view.focusWidget() # reprend le focus sur la fenetre principal
|
||||
|
||||
def error(self, msg):
|
||||
"""
|
||||
Qdialog message erreur
|
||||
:return:
|
||||
"""
|
||||
QtGui.QMessageBox.warning(self._w,
|
||||
"Erreur ...",
|
||||
msg
|
||||
)
|
@ -48,6 +48,7 @@ class Log(object):
|
||||
"""
|
||||
Log Manager
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
Define 3 differents log :
|
||||
|
@ -1,10 +1,12 @@
|
||||
import random
|
||||
import string
|
||||
|
||||
from src.m.connexionBDD import connexionBDD
|
||||
|
||||
|
||||
__author__ = 'sidya'
|
||||
|
||||
|
||||
class Client:
|
||||
def __init__(self, id, nom=None, prenom=None, adresse=None, typeAbonnement=None):
|
||||
if id is None:
|
||||
@ -66,7 +68,7 @@ class Client:
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def adr(self,nom, prenom, adresse, typeAbonnement):
|
||||
def adr(self):
|
||||
return self.__adresse
|
||||
|
||||
@property
|
||||
@ -78,9 +80,11 @@ class Client:
|
||||
" id = " + str(self.__id) + ", " \
|
||||
" prenom = " + str(self.__prenom) + ", " \
|
||||
" nom = " + str(self.__nom) + ", " \
|
||||
" adresse = " + str(self.__adresse) + ", " \
|
||||
" adresse = " + str(
|
||||
self.__adresse) + ", " \
|
||||
" typeAbonnement = " + str(self.__typeAbonnement) + "]"
|
||||
|
||||
|
||||
class TypeAbonnement:
|
||||
ABONNE = 0
|
||||
SUPER_ABONNE = 1
|
@ -1,20 +1,22 @@
|
||||
import random
|
||||
import string
|
||||
import time
|
||||
from src.m.Voiture import Voiture
|
||||
from src.m.connexionBDD import connexionBDD
|
||||
import random
|
||||
import string
|
||||
import time
|
||||
|
||||
from src.m.Voiture import Voiture
|
||||
from src.m.connexionBDD import connexionBDD
|
||||
from src.m.Voiture import Voiture
|
||||
from src.m.connexionBDD import connexionBDD
|
||||
|
||||
|
||||
__author__ = 'sidya'
|
||||
|
||||
|
||||
|
||||
class Parking:
|
||||
parkings = []
|
||||
|
||||
@staticmethod
|
||||
def get(id):
|
||||
if len(Parking.parkings) == 0:
|
||||
@ -54,10 +56,15 @@ class Parking:
|
||||
self.__id = c.lastId()
|
||||
# Crea des places
|
||||
n = 0
|
||||
placeParNiveau = {}
|
||||
for typePlace in listeTypePlace:
|
||||
for i in range(typePlace.nombre) :
|
||||
print(Place(None,self,typePlace,n,1,True,False))
|
||||
n += 1
|
||||
try:
|
||||
i = placeParNiveau[typePlace.niveau]
|
||||
except KeyError:
|
||||
i = 0
|
||||
placeParNiveau[typePlace.niveau] = i + typePlace.nombre
|
||||
for i in range(placeParNiveau[typePlace.niveau]):
|
||||
Place(None, self, typePlace, i, True, False)
|
||||
else:
|
||||
self.__id = id
|
||||
self.parkings.append(self)
|
||||
@ -91,19 +98,18 @@ class Parking:
|
||||
return Place.placeValide(self.__id, voiture)
|
||||
|
||||
def addPlaceSuperAbo(self, parking):
|
||||
return Place(None, parking, None, None, None, True)
|
||||
return Place(None, parking, None, None, False, True)
|
||||
|
||||
def __str__(self):
|
||||
return "[Parking : nom = " + self.__nom + "]"
|
||||
|
||||
|
||||
class Place:
|
||||
def __init__(self, id=None, parking=None, typePlace=None, numero=None, niveau=None,estLibre=True, estSuperAbo=False):
|
||||
def __init__(self, id=None, parking=None, typePlace=None, numero=None, estLibre=True, estSuperAbo=False):
|
||||
if id is None:
|
||||
self.__parking = parking
|
||||
self.__typePlace = typePlace
|
||||
self.__numero = numero
|
||||
self.__niveau = niveau
|
||||
self.__estLibre = estLibre
|
||||
self.__estSuperAbo = estSuperAbo
|
||||
if self.__typePlace is None:
|
||||
@ -135,6 +141,7 @@ class Place:
|
||||
def id(self):
|
||||
return self.__id
|
||||
|
||||
|
||||
def prendre(self):
|
||||
"""
|
||||
Rend la place indisponible
|
||||
@ -157,17 +164,22 @@ class Place:
|
||||
raise Exception("Impossible de liberer une place vide")
|
||||
self.__estLibre = True
|
||||
c = connexionBDD()
|
||||
c.execute("UPDATE place SET estLibre = 1 WHERE idPlace ='"+str(self.__id)+"'")
|
||||
c.execute(
|
||||
"UPDATE place SET estLibre = 1, fin ='" + str(time.time()) + "' WHERE idPlace ='" + str(self.__id) + "'")
|
||||
c.seDeconnecter()
|
||||
|
||||
@property
|
||||
def identification(self):
|
||||
return TypePlace(self.__typePlace).niveau + ":" + self.__numero
|
||||
return str(chr(self.__typePlace.niveau + ord('A')) + ":" + str(self.__numero))
|
||||
|
||||
@property
|
||||
def estlibre(self):
|
||||
return self.__estLibre
|
||||
|
||||
@property
|
||||
def typePlace(self):
|
||||
return self.__typePlace
|
||||
|
||||
@staticmethod
|
||||
def nbPlaceParking(idParking):
|
||||
c = connexionBDD()
|
||||
@ -212,14 +224,12 @@ class Place:
|
||||
return "[Place : " \
|
||||
"Parking = " + str(self.__parking) + "," \
|
||||
"typePlace = " + str(self.__typePlace) + "," \
|
||||
"numero = " + str(self.__numero) + "," \
|
||||
"numero = " + str(
|
||||
self.__numero) + "," \
|
||||
"estLibre = " + str(self.__estLibre) + "," \
|
||||
"estSuperAbo = " + str(self.__estSuperAbo) + "]" \
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\
|
||||
\
|
||||
class TypePlace:
|
||||
def __init__(self, id, longueur=None, hauteur=None, nombre=None, prix=None, niveau=None):
|
||||
if id is None:
|
||||
@ -275,10 +285,12 @@ class TypePlace:
|
||||
return "[TypePlace : " \
|
||||
"id = " + str(self.__id) + "," \
|
||||
"longueur = " + str(self.__longueur) + "," \
|
||||
"hauteur = " + str(self.__hauteur) + "," \
|
||||
"hauteur = " + str(
|
||||
self.__hauteur) + "," \
|
||||
"nombre = " + str(self.__nombre) + "," \
|
||||
"prix = " + str(self.__prix) + "," \
|
||||
"niveau = " + str(self.__niveau) + "]"
|
||||
"niveau = " + str(
|
||||
self.__niveau) + "]"
|
||||
|
||||
|
||||
class Placement:
|
||||
@ -327,16 +339,22 @@ class Placement:
|
||||
def place(self):
|
||||
return self.__place
|
||||
|
||||
@property
|
||||
def voiture(self):
|
||||
return self.__voiture
|
||||
|
||||
def end(self):
|
||||
self.__fin = time.time()
|
||||
c = connexionBDD()
|
||||
c.execute("UPDATE placement SET fin='" + str(self.__fin) + "' WHERE idPlacement='" + str(id) + "'")
|
||||
c.seDeconnecter()
|
||||
self.__place.liberer()
|
||||
|
||||
def __str__(self):
|
||||
return "[Placement : " \
|
||||
"id = " + str(self.__id) + "," \
|
||||
"Voiture = " + str(self.__voiture) + "," \
|
||||
"Place = " + str(self.__place) + "," \
|
||||
"Debut = " + str(self.__debut) +"," \
|
||||
"Debut = " + str(
|
||||
self.__debut) + "," \
|
||||
"Fin = " + str(self.__fin) + "]"
|
@ -1,10 +1,13 @@
|
||||
import time
|
||||
|
||||
from src.m.Client import Client
|
||||
from src.m.Parking import Placement
|
||||
from src.m.connexionBDD import connexionBDD
|
||||
|
||||
|
||||
__author__ = 'sidya'
|
||||
|
||||
|
||||
class Service:
|
||||
@staticmethod
|
||||
def getAllEnCours(parking):
|
||||
@ -21,6 +24,19 @@ class Service:
|
||||
print("l = " + str(l))
|
||||
return l
|
||||
|
||||
@staticmethod
|
||||
def getAllServicePlacement(placement):
|
||||
c = connexionBDD()
|
||||
r = c.execute("SELECT * FROM service WHERE idPlacement ='" + str(placement.id) + "'")
|
||||
rows = r.fetchall()
|
||||
c.seDeconnecter()
|
||||
l = []
|
||||
for row in rows:
|
||||
l.append(Service(row["idService"], Client(row["idClient"]), Placement(row["idPlacement"]),
|
||||
row["typeService"], row["dateDemande"], row["dateService"], row["dateRealisation"]))
|
||||
print("l = " + str(l))
|
||||
return l
|
||||
|
||||
def __init__(self, id, client=None, placement=None, typeService=None,
|
||||
dateService=None, dateDemande=time.time(), dateRealisation=None):
|
||||
if id is None:
|
||||
@ -32,7 +48,8 @@ class Service:
|
||||
self.__dateRealisation = dateRealisation
|
||||
c = connexionBDD()
|
||||
c.execute("INSERT INTO service (idClient,idPlacement, typeService, dateDemande) VALUES (?,?,?,?)",
|
||||
(str(self.__client.id), str(self.__placement.id), str(self.__typeService), str(self.__dateDemande)))
|
||||
(str(self.__client.id), str(self.__placement.id), str(self.__typeService),
|
||||
str(self.__dateDemande)))
|
||||
self.__id = c.lastId()
|
||||
c.seDeconnecter()
|
||||
else:
|
||||
@ -59,13 +76,37 @@ class Service:
|
||||
def typeService(self):
|
||||
return self.__typeService
|
||||
|
||||
@property
|
||||
def placement(self):
|
||||
return self.__placement
|
||||
|
||||
@property
|
||||
def info(self):
|
||||
str = "Place : " + self.__placement.place.identification + "Imma : " + self.__placement.voiture.immatriculation
|
||||
if self.typeService == TypeService.LIVRAISON:
|
||||
str += "Date : " + self.__dateService
|
||||
return str
|
||||
|
||||
@property
|
||||
def estRealise(self):
|
||||
return self.__dateRealisation is None or self.__dateRealisation == "NULL"
|
||||
|
||||
def doService(self):
|
||||
self.__dateRealisation = time.time()
|
||||
c = connexionBDD()
|
||||
c.execute("UPDATE service SET dateRealisation = '" + str(self.__dateRealisation) + "' WHERE idService='" + str(
|
||||
self.__id) + "'")
|
||||
c.seDeconnecter()
|
||||
|
||||
def __str__(self):
|
||||
return "[Service : " \
|
||||
"id = " + str(self.__id) + "," \
|
||||
"Client = " + str(self.__client) + "," \
|
||||
"TypeService = " + str(self.__typeService) +"," \
|
||||
"TypeService = " + str(
|
||||
self.__typeService) + "," \
|
||||
"DateDemande = " + str(self.__dateDemande) + "," \
|
||||
"DateService = " + str(self.__dateService) +"," \
|
||||
"DateService = " + str(
|
||||
self.__dateService) + "," \
|
||||
"DateRealisation = " + str(self.__dateRealisation) + "]"
|
||||
|
||||
|
||||
|
@ -1,18 +1,24 @@
|
||||
from src.m.Client import Client
|
||||
from src.m.connexionBDD import connexionBDD
|
||||
|
||||
__author__ = 'sidya'
|
||||
|
||||
|
||||
class Voiture:
|
||||
def __init__(self, id, idClient=None, longueur=None, hauteur=None, imma=None, estDansParking=False):
|
||||
def __init__(self, id, client=None, longueur=None, hauteur=None, imma=None):
|
||||
if id is None:
|
||||
self.__idClient = idClient
|
||||
if client is None:
|
||||
self.__client = "NULL"
|
||||
cl = "NULL"
|
||||
else:
|
||||
self.__client = client
|
||||
cl = self.__client.id
|
||||
self.__longueur = longueur
|
||||
self.__hauteur = hauteur
|
||||
self.__imma = imma
|
||||
self.__estDansParking = estDansParking
|
||||
c = connexionBDD()
|
||||
c.execute("INSERT INTO voiture (longueur, hauteur, imma, estDansParking) VALUES (?,?,?,?)",
|
||||
(self.__longueur, self.__hauteur, self.__imma, int(self.__estDansParking)))
|
||||
c.execute("INSERT INTO voiture (idClient,longueur, hauteur, imma) VALUES (?,?,?,?)",
|
||||
(cl, self.__longueur, self.__hauteur, self.__imma))
|
||||
self.__id = c.lastId()
|
||||
c.seDeconnecter()
|
||||
else:
|
||||
@ -23,11 +29,19 @@ class Voiture:
|
||||
raise IndexError("Invalid id")
|
||||
c.seDeconnecter()
|
||||
self.__id = id
|
||||
self.__idClient = row["idClient"]
|
||||
try:
|
||||
self.__client = Client(row["idClient"])
|
||||
except IndexError:
|
||||
self.__client = "NULL"
|
||||
self.__longueur = row["longueur"]
|
||||
self.__hauteur = row["hauteur"]
|
||||
self.__imma = row["imma"]
|
||||
self.__estDansParking = row["estDansParking"]
|
||||
|
||||
def setClient(self, client):
|
||||
self.__client = client
|
||||
c = connexionBDD()
|
||||
c.execute("UPDATE voiture SET idClient = '" + str(client.id) + "' WHERE idVoiture='" + str(self.id) + "'")
|
||||
c.seDeconnecter()
|
||||
|
||||
|
||||
@property
|
||||
@ -47,13 +61,14 @@ class Voiture:
|
||||
return self.__imma
|
||||
|
||||
@property
|
||||
def estDansParking(self):
|
||||
return self.__estDansParking == True
|
||||
def client(self):
|
||||
return self.__client
|
||||
|
||||
def __str__(self):
|
||||
return "[Voiture :" \
|
||||
" id = " + str(self.__id) + ", " \
|
||||
" longueur = " + str(self.__longueur) + ", " \
|
||||
" client = " + str(self.__client) + ", " \
|
||||
" longueur = " + str(
|
||||
self.__longueur) + ", " \
|
||||
" hauteur = " + str(self.__hauteur) + ", " \
|
||||
" imma = " + str(self.__imma) + ", " \
|
||||
" estDansParking = " + str(self.__estDansParking)+"]"
|
||||
" imma = " + str(self.__imma) + "]"
|
@ -4,9 +4,11 @@ __author__ = 'sidya'
|
||||
|
||||
import sqlite3
|
||||
|
||||
|
||||
class connexionBDD:
|
||||
__chemin = "m/BDDprojetPython.sq3"
|
||||
__sql = "m/table.sql"
|
||||
|
||||
def __init__(self):
|
||||
try:
|
||||
with open(self.__chemin):
|
||||
|
@ -59,8 +59,7 @@ CREATE TABLE voiture (
|
||||
idClient VARCHAR(10),
|
||||
hauteur INTEGER,
|
||||
longueur INTEGER,
|
||||
imma VARCHAR(10),
|
||||
estDansParking INTEGER(1)
|
||||
imma VARCHAR(10)
|
||||
);
|
||||
|
||||
|
||||
|
@ -1,8 +1,5 @@
|
||||
__author__ = 'sidya'
|
||||
|
||||
from nose.tools import assert_equal
|
||||
|
||||
from src.m.Parking import Parking, TypePlace, Place
|
||||
|
||||
class TestClient:
|
||||
def TestClient(self):
|
||||
|
@ -4,6 +4,7 @@ from nose.tools import assert_equal
|
||||
|
||||
from src.m.Parking import Parking, TypePlace, Place
|
||||
|
||||
|
||||
class TestParking:
|
||||
def TestParking(self):
|
||||
p = Parking(None, "test", [TypePlace(None, 220, 200, 4, 2.5, 1), TypePlace(None, 200, 130, 5, 2.5, 1)])
|
||||
@ -15,6 +16,7 @@ class TestParking :
|
||||
def TestRecherchePlace(self):
|
||||
pass
|
||||
|
||||
|
||||
class TestPlace:
|
||||
def TestPlace(self):
|
||||
t1 = TypePlace(None, 220, 200, 4, 2.5, 1)
|
||||
|
@ -1,9 +1,5 @@
|
||||
from src.m.Service import Service
|
||||
|
||||
__author__ = 'sidya'
|
||||
|
||||
from nose.tools import assert_equal
|
||||
|
||||
|
||||
class TestService:
|
||||
def TestService(self):
|
||||
|
@ -5,7 +5,6 @@ __author__ = 'sidya'
|
||||
from nose.tools import assert_equal
|
||||
|
||||
|
||||
|
||||
class TestVoiture:
|
||||
def TestVoiture(self):
|
||||
v = Voiture(None, None, 120, 100, "IMMA")
|
||||
|
@ -8,9 +8,9 @@ __author__ = 'sidya'
|
||||
|
||||
|
||||
class Camera:
|
||||
@classmethod
|
||||
def donnerVoiture(self):
|
||||
@staticmethod
|
||||
def donnerVoiture():
|
||||
v = Voiture(None, None, random.randint(150, 300), random.randint(100, 200), ''.join(
|
||||
random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in
|
||||
range(random.randint(1, 10))),False)
|
||||
range(random.randint(5, 10))))
|
||||
return v
|
||||
|
@ -17,12 +17,14 @@ except AttributeError:
|
||||
|
||||
try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||
except AttributeError:
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig)
|
||||
|
||||
|
||||
class Ui_Borne(object):
|
||||
def setupUi(self, Borne):
|
||||
Borne.setObjectName(_fromUtf8("Borne"))
|
||||
@ -195,7 +197,8 @@ class Ui_Borne(object):
|
||||
def retranslateUi(self, Borne):
|
||||
Borne.setWindowTitle(_translate("Borne", "Borne", None))
|
||||
self.btn_Voiture.setText(_translate("Borne", "Detection Arrivee Voiture", None))
|
||||
self.nomParking.setText(_translate("Borne", "<html><head/><body><p align=\"center\">NomParking</p></body></html>", None))
|
||||
self.nomParking.setText(
|
||||
_translate("Borne", "<html><head/><body><p align=\"center\">NomParking</p></body></html>", None))
|
||||
self.box_id.setTitle(_translate("Borne", "Identification", None))
|
||||
self.label.setText(_translate("Borne", "Carte Membre ID ", None))
|
||||
self.btn_validerID.setText(_translate("Borne", "Valider", None))
|
||||
@ -211,7 +214,8 @@ class Ui_Borne(object):
|
||||
self.numeroTicketLabel.setText(_translate("Borne", "Numero Ticket :", None))
|
||||
self.btn_recuperer.setText(_translate("Borne", "Récupérer Véhicule", None))
|
||||
self.pushButton.setText(_translate("Borne", "Payer", None))
|
||||
self.label_aff.setText(_translate("Borne", "<html><head/><body><p align=\"center\">TextLabel</p></body></html>", None))
|
||||
self.label_aff.setText(
|
||||
_translate("Borne", "<html><head/><body><p align=\"center\">TextLabel</p></body></html>", None))
|
||||
self.box_garer.setTitle(_translate("Borne", "Se garer", None))
|
||||
self.btn_garer.setText(_translate("Borne", "Garer Véhicule", None))
|
||||
self.box_service.setTitle(_translate("Borne", "Service (Abonnée seulement)", None))
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'creationParking.ui'
|
||||
#
|
||||
# Created: Sat Jan 17 15:11:03 2015
|
||||
# Created: Thu Feb 5 00:32:25 2015
|
||||
# by: PyQt4 UI code generator 4.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
@ -17,12 +17,14 @@ except AttributeError:
|
||||
|
||||
try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||
except AttributeError:
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig)
|
||||
|
||||
|
||||
class Ui_CreaParking(object):
|
||||
def setupUi(self, CreaParking):
|
||||
CreaParking.setObjectName(_fromUtf8("CreaParking"))
|
||||
@ -39,20 +41,8 @@ class Ui_CreaParking(object):
|
||||
self.btn_valider = QtGui.QPushButton(self.layoutWidget)
|
||||
self.btn_valider.setObjectName(_fromUtf8("btn_valider"))
|
||||
self.horizontalLayout_2.addWidget(self.btn_valider)
|
||||
self.layoutWidget1 = QtGui.QWidget(CreaParking)
|
||||
self.layoutWidget1.setGeometry(QtCore.QRect(200, 230, 275, 25))
|
||||
self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1"))
|
||||
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.layoutWidget1)
|
||||
self.horizontalLayout_3.setMargin(0)
|
||||
self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
|
||||
self.label_4 = QtGui.QLabel(self.layoutWidget1)
|
||||
self.label_4.setObjectName(_fromUtf8("label_4"))
|
||||
self.horizontalLayout_3.addWidget(self.label_4)
|
||||
self.nbPlacesTotal = QtGui.QLabel(self.layoutWidget1)
|
||||
self.nbPlacesTotal.setObjectName(_fromUtf8("nbPlacesTotal"))
|
||||
self.horizontalLayout_3.addWidget(self.nbPlacesTotal)
|
||||
self.tableWidget = QtGui.QTableWidget(CreaParking)
|
||||
self.tableWidget.setGeometry(QtCore.QRect(30, 100, 521, 121))
|
||||
self.tableWidget.setGeometry(QtCore.QRect(30, 100, 521, 141))
|
||||
self.tableWidget.setObjectName(_fromUtf8("tableWidget"))
|
||||
self.tableWidget.setColumnCount(5)
|
||||
self.tableWidget.setRowCount(0)
|
||||
@ -72,21 +62,21 @@ class Ui_CreaParking(object):
|
||||
self.btn_rmRow = QtGui.QPushButton(CreaParking)
|
||||
self.btn_rmRow.setGeometry(QtCore.QRect(570, 170, 41, 27))
|
||||
self.btn_rmRow.setObjectName(_fromUtf8("btn_rmRow"))
|
||||
self.layoutWidget2 = QtGui.QWidget(CreaParking)
|
||||
self.layoutWidget2.setGeometry(QtCore.QRect(180, 20, 291, 56))
|
||||
self.layoutWidget2.setObjectName(_fromUtf8("layoutWidget2"))
|
||||
self.horizontalLayout = QtGui.QHBoxLayout(self.layoutWidget2)
|
||||
self.layoutWidget1 = QtGui.QWidget(CreaParking)
|
||||
self.layoutWidget1.setGeometry(QtCore.QRect(180, 20, 291, 56))
|
||||
self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1"))
|
||||
self.horizontalLayout = QtGui.QHBoxLayout(self.layoutWidget1)
|
||||
self.horizontalLayout.setMargin(0)
|
||||
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
|
||||
self.verticalLayout = QtGui.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
|
||||
self.label = QtGui.QLabel(self.layoutWidget2)
|
||||
self.label = QtGui.QLabel(self.layoutWidget1)
|
||||
self.label.setObjectName(_fromUtf8("label"))
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
self.horizontalLayout.addLayout(self.verticalLayout)
|
||||
self.verticalLayout_2 = QtGui.QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
|
||||
self.lineEdit_nom = QtGui.QLineEdit(self.layoutWidget2)
|
||||
self.lineEdit_nom = QtGui.QLineEdit(self.layoutWidget1)
|
||||
self.lineEdit_nom.setObjectName(_fromUtf8("lineEdit_nom"))
|
||||
self.verticalLayout_2.addWidget(self.lineEdit_nom)
|
||||
self.horizontalLayout.addLayout(self.verticalLayout_2)
|
||||
@ -103,8 +93,6 @@ class Ui_CreaParking(object):
|
||||
CreaParking.setWindowTitle(_translate("CreaParking", "Creation Parking", None))
|
||||
self.btn_annuler.setText(_translate("CreaParking", "Annuler", None))
|
||||
self.btn_valider.setText(_translate("CreaParking", "Valider", None))
|
||||
self.label_4.setText(_translate("CreaParking", "Nombre Places Total : ", None))
|
||||
self.nbPlacesTotal.setText(_translate("CreaParking", "TextLabel", None))
|
||||
item = self.tableWidget.horizontalHeaderItem(0)
|
||||
item.setText(_translate("CreaParking", "Hauteur (cm)", None))
|
||||
item = self.tableWidget.horizontalHeaderItem(1)
|
||||
|
@ -17,12 +17,14 @@ except AttributeError:
|
||||
|
||||
try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||
except AttributeError:
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig)
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName(_fromUtf8("MainWindow"))
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'creationParking.ui'
|
||||
#
|
||||
# Created: Sat Jan 17 15:11:03 2015
|
||||
# Created: Thu Feb 5 00:32:25 2015
|
||||
# by: PyQt4 UI code generator 4.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
@ -39,20 +39,8 @@ class Ui_CreaParking(object):
|
||||
self.btn_valider = QtGui.QPushButton(self.layoutWidget)
|
||||
self.btn_valider.setObjectName(_fromUtf8("btn_valider"))
|
||||
self.horizontalLayout_2.addWidget(self.btn_valider)
|
||||
self.layoutWidget1 = QtGui.QWidget(CreaParking)
|
||||
self.layoutWidget1.setGeometry(QtCore.QRect(200, 230, 275, 25))
|
||||
self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1"))
|
||||
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.layoutWidget1)
|
||||
self.horizontalLayout_3.setMargin(0)
|
||||
self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
|
||||
self.label_4 = QtGui.QLabel(self.layoutWidget1)
|
||||
self.label_4.setObjectName(_fromUtf8("label_4"))
|
||||
self.horizontalLayout_3.addWidget(self.label_4)
|
||||
self.nbPlacesTotal = QtGui.QLabel(self.layoutWidget1)
|
||||
self.nbPlacesTotal.setObjectName(_fromUtf8("nbPlacesTotal"))
|
||||
self.horizontalLayout_3.addWidget(self.nbPlacesTotal)
|
||||
self.tableWidget = QtGui.QTableWidget(CreaParking)
|
||||
self.tableWidget.setGeometry(QtCore.QRect(30, 100, 521, 121))
|
||||
self.tableWidget.setGeometry(QtCore.QRect(30, 100, 521, 141))
|
||||
self.tableWidget.setObjectName(_fromUtf8("tableWidget"))
|
||||
self.tableWidget.setColumnCount(5)
|
||||
self.tableWidget.setRowCount(0)
|
||||
@ -72,21 +60,21 @@ class Ui_CreaParking(object):
|
||||
self.btn_rmRow = QtGui.QPushButton(CreaParking)
|
||||
self.btn_rmRow.setGeometry(QtCore.QRect(570, 170, 41, 27))
|
||||
self.btn_rmRow.setObjectName(_fromUtf8("btn_rmRow"))
|
||||
self.layoutWidget2 = QtGui.QWidget(CreaParking)
|
||||
self.layoutWidget2.setGeometry(QtCore.QRect(180, 20, 291, 56))
|
||||
self.layoutWidget2.setObjectName(_fromUtf8("layoutWidget2"))
|
||||
self.horizontalLayout = QtGui.QHBoxLayout(self.layoutWidget2)
|
||||
self.layoutWidget1 = QtGui.QWidget(CreaParking)
|
||||
self.layoutWidget1.setGeometry(QtCore.QRect(180, 20, 291, 56))
|
||||
self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1"))
|
||||
self.horizontalLayout = QtGui.QHBoxLayout(self.layoutWidget1)
|
||||
self.horizontalLayout.setMargin(0)
|
||||
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
|
||||
self.verticalLayout = QtGui.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
|
||||
self.label = QtGui.QLabel(self.layoutWidget2)
|
||||
self.label = QtGui.QLabel(self.layoutWidget1)
|
||||
self.label.setObjectName(_fromUtf8("label"))
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
self.horizontalLayout.addLayout(self.verticalLayout)
|
||||
self.verticalLayout_2 = QtGui.QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
|
||||
self.lineEdit_nom = QtGui.QLineEdit(self.layoutWidget2)
|
||||
self.lineEdit_nom = QtGui.QLineEdit(self.layoutWidget1)
|
||||
self.lineEdit_nom.setObjectName(_fromUtf8("lineEdit_nom"))
|
||||
self.verticalLayout_2.addWidget(self.lineEdit_nom)
|
||||
self.horizontalLayout.addLayout(self.verticalLayout_2)
|
||||
@ -103,8 +91,6 @@ class Ui_CreaParking(object):
|
||||
CreaParking.setWindowTitle(_translate("CreaParking", "Creation Parking", None))
|
||||
self.btn_annuler.setText(_translate("CreaParking", "Annuler", None))
|
||||
self.btn_valider.setText(_translate("CreaParking", "Valider", None))
|
||||
self.label_4.setText(_translate("CreaParking", "Nombre Places Total : ", None))
|
||||
self.nbPlacesTotal.setText(_translate("CreaParking", "TextLabel", None))
|
||||
item = self.tableWidget.horizontalHeaderItem(0)
|
||||
item.setText(_translate("CreaParking", "Hauteur (cm)", None))
|
||||
item = self.tableWidget.horizontalHeaderItem(1)
|
||||
@ -119,4 +105,3 @@ class Ui_CreaParking(object):
|
||||
self.btn_rmRow.setText(_translate("CreaParking", "-", None))
|
||||
self.label.setText(_translate("CreaParking", "Nom :", None))
|
||||
|
||||
|
||||
|
@ -39,39 +39,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>230</y>
|
||||
<width>275</width>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Nombre Places Total : </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="nbPlacesTotal">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QTableWidget" name="tableWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>100</y>
|
||||
<width>521</width>
|
||||
<height>121</height>
|
||||
<height>141</height>
|
||||
</rect>
|
||||
</property>
|
||||
<column>
|
||||
|
Reference in New Issue
Block a user