加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
maakCluster.py 38.38 KB
一键复制 编辑 原始数据 按行查看 历史
Dirk Jansen 提交于 2020-02-06 14:41 . Add files via upload
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
from login import hoofdMenu
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFont, QPixmap, QIcon
from PyQt5.QtWidgets import QDialog, QLabel,\
QGridLayout, QPushButton, QMessageBox, QComboBox
from sqlalchemy import (Table, Column, String, MetaData, create_engine, insert, select)
def windowSluit(self, m_email):
self.close()
hoofdMenu(m_email)
def insGelukt(mclusternr, momschr):
msg = QMessageBox()
msg.setStyleSheet("color: black; background-color: gainsboro")
msg.setWindowIcon(QIcon('./images/logos/logo.jpg'))
msg.setIcon(QMessageBox.Information)
msg.setText('Clusternummer: '+mclusternr+'\n"'+momschr+'" is aangemaakt!')
msg.setFont(QFont("Arial",10))
msg.setWindowTitle('Clusters aanmaken')
msg.exec_()
def insMislukt():
msg = QMessageBox()
msg.setStyleSheet("color: black; background-color: gainsboro")
msg.setWindowIcon(QIcon('./images/logos/logo.jpg'))
msg.setIcon(QMessageBox.Critical)
msg.setText('Aanmaak van clusternummer is mislukt!')
msg.setFont(QFont("Arial",10))
msg.setWindowTitle('Clusters aanmaken')
msg.exec_()
def ongKeuze():
msg = QMessageBox()
msg.setStyleSheet("color: black; background-color: gainsboro")
msg.setWindowIcon(QIcon('./images/logos/logo.jpg'))
msg.setIcon(QMessageBox.Warning)
msg.setText('Ongeldige keuze')
msg.setFont(QFont("Arial",10))
msg.setWindowTitle('Clusters invoeren')
msg.exec_()
def kiesCluster(m_email):
class Widget(QDialog):
def __init__(self, parent=None):
super(Widget, self).__init__(parent)
self.setWindowTitle("Cluster selektie")
self.setWindowIcon(QIcon('./images/logos/logo.jpg'))
self.setFont(QFont('Arial', 10))
self.Keuze = QLabel()
k0Edit = QComboBox()
k0Edit.setFixedWidth(340)
k0Edit.setFont(QFont("Arial",10))
k0Edit.setStyleSheet("color: black; background-color: #F8F7EE")
k0Edit.addItem(' Keuze Clustergroepen')
k0Edit.addItem('AA-AL. Spoorstaven + lasmiddelen')
k0Edit.addItem('BA-BK. Telecominstallaties')
k0Edit.addItem('CA-CK. Overwegen + overwegbeveiliging')
k0Edit.addItem('DA-DK. Steenslag + grond aanvulling')
k0Edit.addItem('EA-EK. Wissel + baanconstrukties')
k0Edit.addItem('FA-FK. Ondergrondse infrastruktuur')
k0Edit.addItem('GA-GK. Treinbeheersing + seinen')
k0Edit.addItem('HA-HK. Bovenleiding + draagconstruktie')
k0Edit.addItem('JA-JK. Voedingen + Onderstations')
k0Edit.activated[str].connect(self.k0Changed)
grid = QGridLayout()
grid.setSpacing(20)
lbl = QLabel()
pixmap = QPixmap('./images/logos/verbinding.jpg')
lbl.setPixmap(pixmap)
grid.addWidget(lbl , 0, 0, 1, 2)
grid.addWidget(k0Edit, 1, 1)
self.setLayout(grid)
self.setGeometry(500, 300, 150, 150)
grid.addWidget(QLabel('\u00A9 2017 all rights reserved dj.jansen@casema.nl'), 3, 0, 1, 2, Qt.AlignCenter)
logo = QLabel()
pixmap = QPixmap('./images/logos/logo.jpg')
logo.setPixmap(pixmap)
grid.addWidget(logo , 0, 1, 1, 1, Qt.AlignRight)
applyBtn = QPushButton('Subgroep')
applyBtn.clicked.connect(self.accept)
grid.addWidget(applyBtn, 2, 1, 1, 1, Qt.AlignRight)
applyBtn.setFont(QFont("Arial",10))
applyBtn.setFixedWidth(100)
applyBtn.setStyleSheet("color: black; background-color: gainsboro")
cancelBtn = QPushButton('Sluiten')
cancelBtn.clicked.connect(lambda: windowSluit(self, m_email))
grid.addWidget(cancelBtn, 2, 1, 1, 1, Qt.AlignCenter)
cancelBtn.setFont(QFont("Arial",10))
cancelBtn.setFixedWidth(100)
cancelBtn.setStyleSheet("color: black; background-color: gainsboro")
def k0Changed(self, text):
self.Keuze.setText(text)
def returnk0(self):
return self.Keuze.text()
@staticmethod
def getData(parent=None):
dialog = Widget(parent)
dialog.exec_()
return [dialog.returnk0()]
window = Widget()
data = window.getData()
keuze = ''
if not data[0]:
ongKeuze()
kiesCluster(m_email)
elif data[0][0] == '0':
keuze = ''
elif data[0]:
keuze = data[0][0]
if keuze == 'A':
kiesSubClusterA(keuze, m_email)
elif keuze == 'B':
kiesSubClusterB(keuze, m_email)
elif keuze == 'C':
kiesSubClusterC(keuze, m_email)
elif keuze == 'D':
kiesSubClusterD(keuze, m_email)
elif keuze == 'E':
kiesSubClusterE(keuze, m_email)
elif keuze == 'F':
kiesSubClusterF(keuze, m_email)
elif keuze == 'G':
kiesSubClusterG(keuze, m_email)
elif keuze == 'H':
kiesSubClusterH(keuze, m_email)
elif keuze == 'J':
kiesSubClusterJ(keuze, m_email)
def kiesSubClusterA(keuze, m_email):
class Widget(QDialog):
def __init__(self, parent=None):
super(Widget, self).__init__(parent)
self.setWindowTitle("Cluster selektie")
self.setWindowIcon(QIcon('./images/logos/logo.jpg'))
self.setFont(QFont('Arial', 10))
self.Keuze = QLabel()
k0Edit = QComboBox()
k0Edit.setFixedWidth(340)
k0Edit.setFont(QFont("Arial",10))
k0Edit.setStyleSheet("color: black; background-color: #F8F7EE")
k0Edit.addItem(' Subgroep Spoorstaven-lasmiddelen')
k0Edit.addItem('AA. Spoorbaan UIC54 recht op hout')
k0Edit.addItem('AB. Spoorbaan UIC54 recht op beton')
k0Edit.addItem('AC. Spoorbaan UIC60 recht op hout')
k0Edit.addItem('AD. Spoorbaan UIC60 recht op beton')
k0Edit.addItem('AE. Spoorbaan NP46 recht op hout')
k0Edit.addItem('AF. Spoorbaan NP46 recht op beton')
k0Edit.addItem('AG. Spoorbaan UIC54 verk. op hout')
k0Edit.addItem('AH. Spoorbaan UIC54 veranting op beton')
k0Edit.addItem('AI. Spoorbaan UIC60 verkanting op hout')
k0Edit.addItem('AJ. Spoorbaan UIC60 verkanting op beton')
k0Edit.addItem('AK. Spoorbaan NP46 verkanting op hout')
k0Edit.addItem('AL. Spoorbaan NP46 verkanting op beton')
k0Edit.activated[str].connect(self.k0Changed)
grid = QGridLayout()
grid.setSpacing(20)
lbl = QLabel()
pixmap = QPixmap('./images/logos/verbinding.jpg')
lbl.setPixmap(pixmap)
grid.addWidget(lbl , 0, 0, 1, 2)
grid.addWidget(k0Edit, 1, 1)
self.setLayout(grid)
self.setGeometry(500, 300, 150, 150)
grid.addWidget(QLabel('\u00A9 2017 all rights reserved dj.jansen@casema.nl'), 3, 0, 1, 2, Qt.AlignCenter)
logo = QLabel()
pixmap = QPixmap('./images/logos/logo.jpg')
logo.setPixmap(pixmap)
grid.addWidget(logo , 0, 1, 1, 1, Qt.AlignRight)
applyBtn = QPushButton('Maak cluster')
applyBtn.clicked.connect(self.accept)
grid.addWidget(applyBtn, 2, 1, 1, 1, Qt.AlignRight)
applyBtn.setFont(QFont("Arial",10))
applyBtn.setFixedWidth(110)
applyBtn.setStyleSheet("color: black; background-color: gainsboro")
cancelBtn = QPushButton('Sluiten')
cancelBtn.clicked.connect(lambda: windowSluit(self, m_email))
grid.addWidget(cancelBtn, 2, 1, 1, 1,Qt.AlignCenter)
cancelBtn.setFont(QFont("Arial",10))
cancelBtn.setFixedWidth(100)
cancelBtn.setStyleSheet("color: black; background-color: gainsboro")
def k0Changed(self, text):
self.Keuze.setText(text)
def returnk0(self):
return self.Keuze.text()
@staticmethod
def getData(parent=None):
dialog = Widget(parent)
dialog.exec_()
return [dialog.returnk0()]
window = Widget()
data = window.getData()
keuze1 = ''
momschr = ''
if not data[0]:
ongKeuze()
kiesCluster(m_email)
elif data[0][0] == '0':
keuze1 = ''
elif data[0]:
keuze1 = data[0][1]
momschr = data[0][4:]
keuze = keuze+keuze1
maakCluster(keuze, momschr)
def kiesSubClusterB(keuze, m_email):
class Widget(QDialog):
def __init__(self, parent=None):
super(Widget, self).__init__(parent)
self.setWindowTitle("Cluster selektie")
self.setWindowIcon(QIcon('./images/logos/logo.jpg'))
self.setFont(QFont('Arial', 10))
self.Keuze = QLabel()
k0Edit = QComboBox()
k0Edit.setFixedWidth(340)
k0Edit.setFont(QFont("Arial",10))
k0Edit.setStyleSheet("color: black; background-color: #F8F7EE")
k0Edit.addItem(' Subgroep Telecominstallaties')
k0Edit.addItem('BA. Treininformatie telecom')
k0Edit.addItem('BB. Verkeersleiding telecom')
k0Edit.addItem('BC. Perron informatie telecom')
k0Edit.addItem('BD. Lassen en pupiniseren telecomkabels')
k0Edit.addItem('BE. Relaishuis telecomrekken bedraden')
k0Edit.addItem('BF. Vrije baan telecominstallaties')
k0Edit.addItem('BG. Treinbeheersing telecom ATB')
k0Edit.addItem('BH. Omroepinformatie telecom')
k0Edit.addItem('BI. Onderhoud telecom stations')
k0Edit.addItem('BJ. Subgroep 10 telecom')
k0Edit.addItem('BK. Subgroep 11 telecom')
k0Edit.activated[str].connect(self.k0Changed)
grid = QGridLayout()
grid.setSpacing(20)
lbl = QLabel()
pixmap = QPixmap('./images/logos/verbinding.jpg')
lbl.setPixmap(pixmap)
grid.addWidget(lbl , 0, 0, 1, 2)
grid.addWidget(k0Edit, 1, 1)
self.setLayout(grid)
self.setGeometry(500, 300, 150, 150)
grid.addWidget(QLabel('\u00A9 2017 all rights reserved dj.jansen@casema.nl'), 3, 0, 1, 2, Qt.AlignCenter)
logo = QLabel()
pixmap = QPixmap('./images/logos/logo.jpg')
logo.setPixmap(pixmap)
grid.addWidget(logo , 0, 1, 1, 1, Qt.AlignRight)
applyBtn = QPushButton('Maak cluster')
applyBtn.clicked.connect(self.accept)
grid.addWidget(applyBtn, 2, 1, 1, 1, Qt.AlignRight)
applyBtn.setFont(QFont("Arial",10))
applyBtn.setFixedWidth(110)
applyBtn.setStyleSheet("color: black; background-color: gainsboro")
cancelBtn = QPushButton('Sluiten')
cancelBtn.clicked.connect(lambda: windowSluit(self, m_email))
grid.addWidget(cancelBtn, 2, 1, 1, 1,Qt.AlignCenter)
cancelBtn.setFont(QFont("Arial",10))
cancelBtn.setFixedWidth(100)
cancelBtn.setStyleSheet("color: black; background-color: gainsboro")
def k0Changed(self, text):
self.Keuze.setText(text)
def returnk0(self):
return self.Keuze.text()
@staticmethod
def getData(parent=None):
dialog = Widget(parent)
dialog.exec_()
return [dialog.returnk0()]
window = Widget()
data = window.getData()
keuze1 = ''
momschr = ''
if not data[0]:
ongKeuze()
kiesCluster(m_email)
elif data[0][0] == '0':
keuze1 = ''
elif data[0]:
keuze1 = data[0][1]
momschr = data[0][4:]
keuze = keuze+keuze1
maakCluster(keuze, momschr)
def kiesSubClusterC(keuze, m_email):
class Widget(QDialog):
def __init__(self, parent=None):
super(Widget, self).__init__(parent)
self.setWindowTitle("Cluster selektie")
self.setWindowIcon(QIcon('./images/logos/logo.jpg'))
self.setFont(QFont('Arial', 10))
self.Keuze = QLabel()
k0Edit = QComboBox()
k0Edit.setFixedWidth(340)
k0Edit.setFont(QFont("Arial",10))
k0Edit.setStyleSheet("color: black; background-color: #F8F7EE")
k0Edit.addItem(' Subgroep Overwegen-overwegbeveiliging')
k0Edit.addItem('CA. AHOB installatie overwegen')
k0Edit.addItem('CB. AKI installatie overwegen')
k0Edit.addItem('CC. Relaiskasten overweg')
k0Edit.addItem('CD. Borden en bebakening overwegen')
k0Edit.addItem('CE. Voeding overwegen')
k0Edit.addItem('CF. Aankondiging overwegen')
k0Edit.addItem('CG. Overweg beplating')
k0Edit.addItem('CH. Sugroep overwegen H')
k0Edit.addItem('CI. Subgroep overwegen I')
k0Edit.addItem('CJ. Subgroep overwegen J')
k0Edit.addItem('CK. Subgroep overwegen K')
k0Edit.activated[str].connect(self.k0Changed)
grid = QGridLayout()
grid.setSpacing(20)
lbl = QLabel()
pixmap = QPixmap('./images/logos/verbinding.jpg')
lbl.setPixmap(pixmap)
grid.addWidget(lbl , 0, 0, 1, 2)
grid.addWidget(k0Edit, 1, 1)
self.setLayout(grid)
self.setGeometry(500, 300, 150, 150)
grid.addWidget(QLabel('\u00A9 2017 all rights reserved dj.jansen@casema.nl'), 3, 0, 1, 2, Qt.AlignCenter)
logo = QLabel()
pixmap = QPixmap('./images/logos/logo.jpg')
logo.setPixmap(pixmap)
grid.addWidget(logo , 0, 1, 1, 1, Qt.AlignRight)
applyBtn = QPushButton('Maak cluster')
applyBtn.clicked.connect(self.accept)
grid.addWidget(applyBtn, 2, 1, 1, 1, Qt.AlignRight)
applyBtn.setFont(QFont("Arial",10))
applyBtn.setFixedWidth(110)
applyBtn.setStyleSheet("color: black; background-color: gainsboro")
cancelBtn = QPushButton('Sluiten')
cancelBtn.clicked.connect(lambda: windowSluit(self, m_email))
grid.addWidget(cancelBtn, 2, 1, 1, 1,Qt.AlignCenter)
cancelBtn.setFont(QFont("Arial",10))
cancelBtn.setFixedWidth(100)
cancelBtn.setStyleSheet("color: black; background-color: gainsboro")
def k0Changed(self, text):
self.Keuze.setText(text)
def returnk0(self):
return self.Keuze.text()
@staticmethod
def getData(parent=None):
dialog = Widget(parent)
dialog.exec_()
return [dialog.returnk0()]
window = Widget()
data = window.getData()
keuze1 = ''
momschr = ''
if not data[0]:
ongKeuze()
kiesCluster(m_email)
elif data[0][0] == '0':
keuze1 = ''
elif data[0]:
keuze1 = data[0][1]
momschr = data[0][4:]
keuze = keuze+keuze1
maakCluster(keuze, momschr)
def kiesSubClusterD(keuze, m_email):
class Widget(QDialog):
def __init__(self, parent=None):
super(Widget, self).__init__(parent)
self.setWindowTitle("Cluster selektie")
self.setWindowIcon(QIcon('./images/logos/logo.jpg'))
self.setFont(QFont('Arial', 10))
self.Keuze = QLabel()
k0Edit = QComboBox()
k0Edit.setFixedWidth(340)
k0Edit.setFont(QFont("Arial",10))
k0Edit.setStyleSheet("color: black; background-color: #F8F7EE")
k0Edit.addItem(' Subgroep Onderbouw')
k0Edit.addItem('DA. Subgroep Onderbouw A')
k0Edit.addItem('DB. Subgroep Onderbouw B')
k0Edit.addItem('DC. Subgroep Onderbouw C')
k0Edit.addItem('DD. Subgroep Onderbouw D')
k0Edit.addItem('DE. Subgroep Onderbouw E')
k0Edit.addItem('DF. Subgroep Onderbouw F')
k0Edit.addItem('DG. Subgroep Onderbouw G')
k0Edit.addItem('DH. Subgroep Onderbouw H')
k0Edit.addItem('DI. Subgroep Onderbouw I')
k0Edit.addItem('DJ. Subgroep Onderbouw J')
k0Edit.addItem('DK. Subgroep Onderbouw K')
k0Edit.activated[str].connect(self.k0Changed)
grid = QGridLayout()
grid.setSpacing(20)
lbl = QLabel()
pixmap = QPixmap('./images/logos/verbinding.jpg')
lbl.setPixmap(pixmap)
grid.addWidget(lbl , 0, 0, 1, 2)
grid.addWidget(k0Edit, 1, 1)
self.setLayout(grid)
self.setGeometry(500, 300, 150, 150)
grid.addWidget(QLabel('\u00A9 2017 all rights reserved dj.jansen@casema.nl'), 3, 0, 1, 2, Qt.AlignCenter)
logo = QLabel()
pixmap = QPixmap('./images/logos/logo.jpg')
logo.setPixmap(pixmap)
grid.addWidget(logo , 0, 1, 1, 1, Qt.AlignRight)
applyBtn = QPushButton('Maak cluster')
applyBtn.clicked.connect(self.accept)
grid.addWidget(applyBtn, 2, 1, 1, 1, Qt.AlignRight)
applyBtn.setFont(QFont("Arial",10))
applyBtn.setFixedWidth(110)
applyBtn.setStyleSheet("color: black; background-color: gainsboro")
cancelBtn = QPushButton('Sluiten')
cancelBtn.clicked.connect(lambda: windowSluit(self, m_email))
grid.addWidget(cancelBtn, 2, 1, 1, 1,Qt.AlignCenter)
cancelBtn.setFont(QFont("Arial",10))
cancelBtn.setFixedWidth(100)
cancelBtn.setStyleSheet("color: black; background-color: gainsboro")
def k0Changed(self, text):
self.Keuze.setText(text)
def returnk0(self):
return self.Keuze.text()
@staticmethod
def getData(parent=None):
dialog = Widget(parent)
dialog.exec_()
return [dialog.returnk0()]
window = Widget()
data = window.getData()
keuze1 = ''
momschr = ''
if not data[0]:
ongKeuze()
kiesCluster(m_email)
elif data[0][0] == '0':
keuze1 = ''
elif data[0]:
keuze1 = data[0][1]
momschr = data[0][4:]
keuze = keuze+keuze1
maakCluster(keuze, momschr)
def kiesSubClusterE(keuze, m_email):
class Widget(QDialog):
def __init__(self, parent=None):
super(Widget, self).__init__(parent)
self.setWindowTitle("Cluster selektie")
self.setWindowIcon(QIcon('./images/logos/logo.jpg'))
self.setFont(QFont('Arial', 10))
self.Keuze = QLabel()
k0Edit = QComboBox()
k0Edit.setFixedWidth(340)
k0Edit.setFont(QFont("Arial",10))
k0Edit.setStyleSheet("color: black; background-color: #F8F7EE")
k0Edit.addItem(' Subgroep Wissel-Baanconstrukties')
k0Edit.addItem('EA. Subgroep Wissels + baan A')
k0Edit.addItem('EB. Subgroep Wissels + baan B')
k0Edit.addItem('EC. Subgroep Wissels + baan C')
k0Edit.addItem('ED. Subgroep Wissels + baan D')
k0Edit.addItem('EE. Subgroep Wissels + baan E')
k0Edit.addItem('EF. Subgroep Wissels + baan F')
k0Edit.addItem('EG. Subgroep Wissels + baan G')
k0Edit.addItem('EH. Subgroep Wissels + baan H')
k0Edit.addItem('EI. Subgroep Wissels + baan I')
k0Edit.addItem('EJ. Subgroep Wissels + baan J')
k0Edit.addItem('EK. Subgroep Wissels + baan K')
k0Edit.activated[str].connect(self.k0Changed)
grid = QGridLayout()
grid.setSpacing(20)
lbl = QLabel()
pixmap = QPixmap('./images/logos/verbinding.jpg')
lbl.setPixmap(pixmap)
grid.addWidget(lbl , 0, 0, 1, 2)
grid.addWidget(k0Edit, 1, 1)
self.setLayout(grid)
self.setGeometry(500, 300, 150, 150)
grid.addWidget(QLabel('\u00A9 2017 all rights reserved dj.jansen@casema.nl'), 3, 0, 1, 2, Qt.AlignCenter)
logo = QLabel()
pixmap = QPixmap('./images/logos/logo.jpg')
logo.setPixmap(pixmap)
grid.addWidget(logo , 0, 1, 1, 1, Qt.AlignRight)
applyBtn = QPushButton('Maak cluster')
applyBtn.clicked.connect(self.accept)
grid.addWidget(applyBtn, 2, 1, 1, 1, Qt.AlignRight)
applyBtn.setFont(QFont("Arial",10))
applyBtn.setFixedWidth(110)
applyBtn.setStyleSheet("color: black; background-color: gainsboro")
cancelBtn = QPushButton('Sluiten')
cancelBtn.clicked.connect(lambda: windowSluit(self, m_email))
grid.addWidget(cancelBtn, 2, 1, 1, 1,Qt.AlignCenter)
cancelBtn.setFont(QFont("Arial",10))
cancelBtn.setFixedWidth(100)
cancelBtn.setStyleSheet("color: black; background-color: gainsboro")
def k0Changed(self, text):
self.Keuze.setText(text)
def returnk0(self):
return self.Keuze.text()
@staticmethod
def getData(parent=None):
dialog = Widget(parent)
dialog.exec_()
return [dialog.returnk0()]
window = Widget()
data = window.getData()
keuze1 = ''
momschr = ''
if not data[0]:
ongKeuze()
kiesCluster(m_email)
elif data[0][0] == '0':
keuze1 = ''
elif data[0]:
keuze1 = data[0][1]
momschr = data[0][4:]
keuze = keuze+keuze1
maakCluster(keuze, momschr)
def kiesSubClusterF(keuze, m_email):
class Widget(QDialog):
def __init__(self, parent=None):
super(Widget, self).__init__(parent)
self.setWindowTitle("Cluster selektie")
self.setWindowIcon(QIcon('./images/logos/logo.jpg'))
self.setFont(QFont('Arial', 10))
self.Keuze = QLabel()
k0Edit = QComboBox()
k0Edit.setFixedWidth(340)
k0Edit.setFont(QFont("Arial",10))
k0Edit.setStyleSheet("color: black; background-color: #F8F7EE")
k0Edit.addItem(' Subgroep Ondergrondse Infrastruktuur')
k0Edit.addItem('FA. Subgroep Ondergr. infra A')
k0Edit.addItem('FB. Subgroep Ondergr. infra B')
k0Edit.addItem('FC. Subgroep Ondergr. infra C')
k0Edit.addItem('FD. Subgroep Ondergr. infra D')
k0Edit.addItem('FE. Subgroep Ondergr. infra E')
k0Edit.addItem('FF. Subgroep Ondergr. infra F')
k0Edit.addItem('FG. Subgroep Ondergr. infra G')
k0Edit.addItem('FH. Subgroep Ondergr. infra H')
k0Edit.addItem('FI. Subgroep Ondergr. infra I')
k0Edit.addItem('FJ. Subgroep Ondergr. infra J')
k0Edit.addItem('FK. Subgroep Ondergr. infra K')
k0Edit.activated[str].connect(self.k0Changed)
grid = QGridLayout()
grid.setSpacing(20)
lbl = QLabel()
pixmap = QPixmap('./images/logos/verbinding.jpg')
lbl.setPixmap(pixmap)
grid.addWidget(lbl , 0, 0, 1, 2)
grid.addWidget(k0Edit, 1, 1)
self.setLayout(grid)
self.setGeometry(500, 300, 150, 150)
grid.addWidget(QLabel('\u00A9 2017 all rights reserved dj.jansen@casema.nl'), 3, 0, 1, 2, Qt.AlignCenter)
logo = QLabel()
pixmap = QPixmap('./images/logos/logo.jpg')
logo.setPixmap(pixmap)
grid.addWidget(logo , 0, 1, 1, 1, Qt.AlignRight)
applyBtn = QPushButton('Maak cluster')
applyBtn.clicked.connect(self.accept)
grid.addWidget(applyBtn, 2, 1, 1, 1, Qt.AlignRight)
applyBtn.setFont(QFont("Arial",10))
applyBtn.setFixedWidth(110)
applyBtn.setStyleSheet("color: black; background-color: gainsboro")
cancelBtn = QPushButton('Sluiten')
cancelBtn.clicked.connect(lambda: windowSluit(self, m_email))
grid.addWidget(cancelBtn, 2, 1, 1, 1,Qt.AlignCenter)
cancelBtn.setFont(QFont("Arial",10))
cancelBtn.setFixedWidth(100)
cancelBtn.setStyleSheet("color: black; background-color: gainsboro")
def k0Changed(self, text):
self.Keuze.setText(text)
def returnk0(self):
return self.Keuze.text()
@staticmethod
def getData(parent=None):
dialog = Widget(parent)
dialog.exec_()
return [dialog.returnk0()]
window = Widget()
data = window.getData()
keuze1 = ''
momschr = ''
if not data[0]:
ongKeuze()
kiesCluster(m_email)
elif data[0][0] == '0':
keuze1 = ''
elif data[0]:
keuze1 = data[0][1]
momschr = data[0][4:]
keuze = keuze+keuze1
maakCluster(keuze, momschr)
def kiesSubClusterG(keuze, m_email):
class Widget(QDialog):
def __init__(self, parent=None):
super(Widget, self).__init__(parent)
self.setWindowTitle("Cluster selektie")
self.setWindowIcon(QIcon('./images/logos/logo.jpg'))
self.setFont(QFont('Arial', 10))
self.Keuze = QLabel()
k0Edit = QComboBox()
k0Edit.setFixedWidth(340)
k0Edit.setFont(QFont("Arial",10))
k0Edit.setStyleSheet("color: black; background-color: #F8F7EE")
k0Edit.addItem(' Subgroep Treinbeheersing-Seinen')
k0Edit.addItem('GA. Subgroep treinbeheersing + seinen A')
k0Edit.addItem('GB. Subgroep treinbeheersing + seinen B')
k0Edit.addItem('GC. Subgroep treinbeheersing + seinen C')
k0Edit.addItem('GD. Subgroep treinbeheersing + seinen D')
k0Edit.addItem('GE. Subgroep treinbeheersing + seinen E')
k0Edit.addItem('GF. Subgroep treinbeheersing + seinen F')
k0Edit.addItem('GG. Subgroep treinbeheersing + seinen G')
k0Edit.addItem('GH. Subgroep treinbeheersing + seinen H')
k0Edit.addItem('GI. Subgroep treinbeheersing + seinen I')
k0Edit.addItem('GJ. Subgroep treinbeheersing + seinen J')
k0Edit.addItem('GK. Subgroep treinbeheersing + seinen K')
k0Edit.activated[str].connect(self.k0Changed)
grid = QGridLayout()
grid.setSpacing(20)
lbl = QLabel()
pixmap = QPixmap('./images/logos/verbinding.jpg')
lbl.setPixmap(pixmap)
grid.addWidget(lbl , 0, 0, 1, 2)
grid.addWidget(k0Edit, 1, 1)
self.setLayout(grid)
self.setGeometry(500, 300, 150, 150)
grid.addWidget(QLabel('\u00A9 2017 all rights reserved dj.jansen@casema.nl'), 3, 0, 1, 2, Qt.AlignCenter)
logo = QLabel()
pixmap = QPixmap('./images/logos/logo.jpg')
logo.setPixmap(pixmap)
grid.addWidget(logo , 0, 1, 1, 1, Qt.AlignRight)
applyBtn = QPushButton('Maak cluster')
applyBtn.clicked.connect(self.accept)
grid.addWidget(applyBtn, 2, 1, 1, 1, Qt.AlignRight)
applyBtn.setFont(QFont("Arial",10))
applyBtn.setFixedWidth(110)
applyBtn.setStyleSheet("color: black; background-color: gainsboro")
cancelBtn = QPushButton('Sluiten')
cancelBtn.clicked.connect(lambda: windowSluit(self, m_email))
grid.addWidget(cancelBtn, 2, 1, 1, 1,Qt.AlignCenter)
cancelBtn.setFont(QFont("Arial",10))
cancelBtn.setFixedWidth(100)
cancelBtn.setStyleSheet("color: black; background-color: gainsboro")
def k0Changed(self, text):
self.Keuze.setText(text)
def returnk0(self):
return self.Keuze.text()
@staticmethod
def getData(parent=None):
dialog = Widget(parent)
dialog.exec_()
return [dialog.returnk0()]
window = Widget()
data = window.getData()
keuze1 = ''
momschr = ''
if not data[0]:
ongKeuze()
kiesCluster(m_email)
elif data[0][0] == '0':
keuze1 = ''
elif data[0]:
keuze1 = data[0][1]
momschr = data[0][4:]
keuze = keuze+keuze1
maakCluster(keuze, momschr)
def kiesSubClusterH(keuze, m_email):
class Widget(QDialog):
def __init__(self, parent=None):
super(Widget, self).__init__(parent)
self.setWindowTitle("Cluster selektie")
self.setWindowIcon(QIcon('./images/logos/logo.jpg'))
self.setFont(QFont('Arial', 10))
self.Keuze = QLabel()
k0Edit = QComboBox()
k0Edit.setFixedWidth(340)
k0Edit.setFont(QFont("Arial",10))
k0Edit.setStyleSheet("color: black; background-color: #F8F7EE")
k0Edit.addItem(' Subgroep Bovenleiding-Draagconstruktie')
k0Edit.addItem('HA. Subgroep Bvl + draagconstruktie A')
k0Edit.addItem('HB. Subgroep Bvl + draagconstruktie B')
k0Edit.addItem('HC. Subgroep Bvl + draagconstruktie C')
k0Edit.addItem('HD. Subgroep Bvl + draagconstruktie D')
k0Edit.addItem('HE. Subgroep Bvl + draagconstruktie E')
k0Edit.addItem('HF. Subgroep Bvl + draagconstruktie F')
k0Edit.addItem('HG. Subgroep Bvl + draagconstruktie G')
k0Edit.addItem('HH. Subgroep Bvl + draagconstruktie H')
k0Edit.addItem('HI. Subgroep Bvl + draagconstruktie I')
k0Edit.addItem('HJ. Subgroep Bvl + draagconstruktie J')
k0Edit.addItem('HK. Subgroep Bvl + draagconstruktie K')
k0Edit.activated[str].connect(self.k0Changed)
grid = QGridLayout()
grid.setSpacing(20)
lbl = QLabel()
pixmap = QPixmap('./images/logos/verbinding.jpg')
lbl.setPixmap(pixmap)
grid.addWidget(lbl , 0, 0, 1, 2)
grid.addWidget(k0Edit, 1, 1)
self.setLayout(grid)
self.setGeometry(500, 300, 150, 150)
grid.addWidget(QLabel('\u00A9 2017 all rights reserved dj.jansen@casema.nl'), 3, 0, 1, 2, Qt.AlignCenter)
logo = QLabel()
pixmap = QPixmap('./images/logos/logo.jpg')
logo.setPixmap(pixmap)
grid.addWidget(logo , 0, 1, 1, 1, Qt.AlignRight)
applyBtn = QPushButton('Maak cluster')
applyBtn.clicked.connect(self.accept)
grid.addWidget(applyBtn, 2, 1, 1, 1, Qt.AlignRight)
applyBtn.setFont(QFont("Arial",10))
applyBtn.setFixedWidth(110)
applyBtn.setStyleSheet("color: black; background-color: gainsboro")
cancelBtn = QPushButton('Sluiten')
cancelBtn.clicked.connect(lambda: windowSluit(self, m_email))
grid.addWidget(cancelBtn, 2, 1, 1, 1,Qt.AlignCenter)
cancelBtn.setFont(QFont("Arial",10))
cancelBtn.setFixedWidth(100)
cancelBtn.setStyleSheet("color: black; background-color: gainsboro")
def k0Changed(self, text):
self.Keuze.setText(text)
def returnk0(self):
return self.Keuze.text()
@staticmethod
def getData(parent=None):
dialog = Widget(parent)
dialog.exec_()
return [dialog.returnk0()]
window = Widget()
data = window.getData()
keuze1 = ''
momschr = ''
momschr = ''
if not data[0]:
ongKeuze()
kiesCluster(m_email)
elif data[0][0] == '0':
keuze1 = ''
elif data[0]:
keuze1 = data[0][1]
momschr = data[0][4:]
keuze = keuze+keuze1
maakCluster(keuze, momschr)
def kiesSubClusterJ(keuze, m_email):
class Widget(QDialog):
def __init__(self, parent=None):
super(Widget, self).__init__(parent)
self.setWindowTitle("Cluster selektie")
self.setWindowIcon(QIcon('./images/logos/logo.jpg'))
self.setFont(QFont('Arial', 10))
self.Keuze = QLabel()
k0Edit = QComboBox()
k0Edit.setFixedWidth(340)
k0Edit.setFont(QFont("Arial",10))
k0Edit.setStyleSheet("color: black; background-color: #F8F7EE")
k0Edit.addItem(' Subgroep Voedingen + Onderstations')
k0Edit.addItem('JA Subgroep Voedingen + Onderstations A')
k0Edit.addItem('JB. Subgroep Voedingen + Onderstations B')
k0Edit.addItem('JC. Subgroep Voedingen + Onderstations C')
k0Edit.addItem('JD. Subgroep Voedingen + Onderstations D')
k0Edit.addItem('JE. Subgroep Voedingen + Onderstations E')
k0Edit.addItem('JF. Subgroep Voedingen + Onderstations F')
k0Edit.addItem('JG. Subgroep Voedingen + Onderstations G')
k0Edit.addItem('JH. Subgroep Voedingen + Onderstations H')
k0Edit.addItem('JI. Subgroep Voedingen + Onderstations I')
k0Edit.addItem('JJ. Subgroep Voedingen + Onderstations J')
k0Edit.addItem('JK. Subgroep Voedingen + Onderstations K')
k0Edit.activated[str].connect(self.k0Changed)
grid = QGridLayout()
grid.setSpacing(20)
lbl = QLabel()
pixmap = QPixmap('./images/logos/verbinding.jpg')
lbl.setPixmap(pixmap)
grid.addWidget(lbl , 0, 0, 1, 2)
grid.addWidget(k0Edit, 1, 1)
self.setLayout(grid)
self.setGeometry(500, 300, 150, 150)
grid.addWidget(QLabel('\u00A9 2017 all rights reserved dj.jansen@casema.nl'), 3, 0, 1, 2, Qt.AlignCenter)
logo = QLabel()
pixmap = QPixmap('./images/logos/logo.jpg')
logo.setPixmap(pixmap)
grid.addWidget(logo , 0, 1, 1, 1, Qt.AlignRight)
applyBtn = QPushButton('Maak cluster')
applyBtn.clicked.connect(self.accept)
grid.addWidget(applyBtn, 2, 1, 1, 1, Qt.AlignRight)
applyBtn.setFont(QFont("Arial",10))
applyBtn.setFixedWidth(110)
applyBtn.setStyleSheet("color: black; background-color: gainsboro")
cancelBtn = QPushButton('Sluiten')
cancelBtn.clicked.connect(lambda: windowSluit(self, m_email))
grid.addWidget(cancelBtn, 2, 1, 1, 1,Qt.AlignCenter)
cancelBtn.setFont(QFont("Arial",10))
cancelBtn.setFixedWidth(100)
cancelBtn.setStyleSheet("color: black; background-color: gainsboro")
def k0Changed(self, text):
self.Keuze.setText(text)
def returnk0(self):
return self.Keuze.text()
@staticmethod
def getData(parent=None):
dialog = Widget(parent)
dialog.exec_()
return [dialog.returnk0()]
window = Widget()
data = window.getData()
keuze1 = ''
momschr = ''
if not data[0]:
ongKeuze()
kiesCluster(m_email)
elif data[0][0] == '0':
keuze1 = ''
elif data[0]:
keuze1 = data[0][1]
momschr = data[0][4:]
keuze = keuze+keuze1
maakCluster(keuze, momschr)
def maakCluster(keuze, momschr):
metadata = MetaData()
clusters = Table('clusters', metadata,
Column('clusterID', String, primary_key=True),
Column('omschrijving', String))
engine = create_engine('postgresql+psycopg2://postgres@localhost/bisystem')
con = engine.connect()
selcllast = select([clusters]).where(clusters.c.clusterID.like(keuze+'%')).order_by(clusters.c.clusterID.desc())
rpcllast = con.execute(selcllast).first()
if rpcllast:
mclusternr = keuze+('00000'+str(int(rpcllast[0][2:7])+1))[-5:]
else:
mclusternr = keuze+'00001'
inscl = insert(clusters).values(clusterID = mclusternr, omschrijving = momschr)
if mclusternr:
con.execute(inscl)
insGelukt(mclusternr, momschr)
else:
insMislukt()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化