Exemplo n.º 1
0
    def __init__(self, master=None):
        self.root = master
        self.root.title('JMProj_Detail')
        self.mFrame = tk.Frame
        self.mFrame = tk.Frame.__init__(self, self.root)
        self.currWidget = None
        self.jmscdObj = jmscd.JMScriptItems()
        self._currCyclIter_ = 0
        self._chkBtVar_ = tk.BooleanVar()
        self._chkBtVar_.set(False)
        self._incrOnGenVar_ = tk.BooleanVar()
        self._incrOnGenVar_.set(False)
        self._volatilPrm_ = tk.BooleanVar()
        self._volatilPrm_.set(True)
        self._selctdItemsLst_ = []
        self._selctdKey_ = None
        self._txtBegin_ = 0.0
        self._txtEnd_ = tk.END
        #self.mFrame = tk.Frame
        #self.pack()
        #self.createWidgets()
        ###############
        self.xmlMsgLst = []

        self._varIfCutUrlInSmpl_ = tk.BooleanVar()
        self._varIfCutUrlInSmpl_.set(False)
        self._varRbSmplThruNum_ = tk.StringVar()
        self._varRbSmplThruNum_.set("Controller")
        self._varCbIfNotRstrUnqInSmpl_ = tk.BooleanVar()
        self._varCbIfNotRstrUnqInSmpl_.set(False)
        self.styles = {}

        self._initText_ = """Перед работой с прилож.\n
		ознакомтесь с инструкцией.\n
		Еще какой-нибудь текст добавиться,\n
		далее будет видно."""
        self.excptHandl = excpt.ExceptHandler()
        tk.Tk.report_callback_exception = self.excptHandl.tkinter_callback_except
        self.logger = None
        self._loggerInit_()
        self._consHandlerInit_()
        self.excptHandl.logger = self.logger
        self._logOffset_ = 0
Exemplo n.º 2
0
    def __init__(self, fenetre, **kwargs):
        Frame.__init__(self, fenetre, width=100, height=100, **kwargs)
        self.pack(fill=BOTH, expand=True)

        #initialisation
        self.listefield1 = [
            1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
            20
        ]
        self.listefield2 = [1, 2, 3, 4, 1, 2, 3, 4]
        self.listefield3 = [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 4]
        self.listefield4 = [1, 2, 3, 4, 1, 2, 3, 4]
        self.listefield5 = [1, 2, 3, 4, 1, 2, 3, 4, 3]
        self.value_input_zsro = StringVar()
        self.value_input_pfsro = StringVar()
        self.value_input_zpbo = StringVar()
        self.value_input_pfpbo = StringVar()
        self.value_input_piq = StringVar()
        self.value_input_zsro.set("Charger la Zone Arrière SRO")
        self.value_input_pfsro.set("Charger les emplacements SRO")
        self.value_input_zpbo.set("Charger la Zone arrière PBO")
        self.value_input_pfpbo.set("Charger les emplacements PBO")
        self.value_input_piq.set("Charger le Piq_BAL")
        self.varcombo1 = tix.StringVar()
        self.varcombo2 = tix.StringVar()
        self.varcombo3 = tix.StringVar()
        self.varcombo4 = tix.StringVar()
        self.varcombo5 = tix.StringVar()
        self.champs_choisi1 = StringVar()
        self.champs_choisi2 = StringVar()
        self.champs_choisi3 = StringVar()
        self.champs_choisi4 = StringVar()
        self.champs_choisi5 = StringVar()
        self.path1 = StringVar()
        self.path2 = StringVar()
        self.path3 = StringVar()
        self.path4 = StringVar()
        self.path5 = StringVar()
        self.coherence = coherence()

        # création des Frames dans la fenêtre principale
        self.Frame1 = Frame(self, relief=GROOVE)
        self.Frame2 = Frame(self, relief=GROOVE)
        self.Frame3 = Frame(self, relief=GROOVE)
        self.Frame4 = Frame(self, relief=GROOVE)
        self.Frame5 = Frame(self, relief=GROOVE)
        # Placement des frames
        self.Frame1.place(x=20, y=00, width=650, height=40)
        self.Frame2.place(x=20, y=40, width=650, height=40)
        self.Frame3.place(x=20, y=80, width=650, height=40)
        self.Frame4.place(x=20, y=120, width=650, height=40)
        self.Frame5.place(x=20, y=160, width=650, height=40)
        #Frame exécution
        self.Frame6 = Frame(self, relief=GROOVE)
        self.Frame6.place(x=180, y=200, width=100, height=40)
        # ----------------------------------------------------------------------------------------------------------------------
        #                                               FRAME 1 constructeur
        # ----------------------------------------------------------------------------------------------------------------------
        self.entree1 = Entry(
            self.Frame1,
            textvariable=self.value_input_zsro)  # création de l'entrer
        self.entree1.pack(
            side=LEFT, fill=X, padx=5, expand=True
        )  # afficher le champ et le placer (expend true (si plus grand va s'adapter))
        self.combo1 = tix.ComboBox(self.Frame1,
                                   editable=1,
                                   dropdown=1,
                                   variable=self.varcombo1,
                                   command=self.Affiche1)
        self.combo1.entry.config(
            state='readonly')  ## met la zone de texte en lecture seule

        # bouton1 parcourir
        self.bouton1 = Button(self.Frame1,
                              text="Parcourir...",
                              command=self.chose_file1)  # création de bouton
        self.bouton1.pack(side=RIGHT, padx=5,
                          pady=5)  # afficher le bouton et le placer

        # ----------------------------------------------------------------------------------------------------------------------
        #                                               FRAME 2 constructeur
        # ----------------------------------------------------------------------------------------------------------------------
        self.entree2 = Entry(
            self.Frame2,
            textvariable=self.value_input_pfsro)  # création de l'entrer
        self.entree2.pack(
            side=LEFT, fill=X, padx=5, expand=True
        )  # afficher le champ et le placer (expend true (si plus grand va s'adapter))
        # liste déroulante
        self.combo2 = tix.ComboBox(self.Frame2,
                                   editable=1,
                                   dropdown=1,
                                   variable=self.varcombo2,
                                   command=self.Affiche2)
        self.combo2.entry.config(
            state='readonly')  ## met la zone de texte en lecture seule

        # bouton parcourir
        self.bouton2 = Button(self.Frame2,
                              text="Parcourir...",
                              command=self.chose_file2)  # création de bouton
        self.bouton2.pack(side=RIGHT, padx=5,
                          pady=5)  # afficher le bouton et le placer

        #-----------------------------------------------------------------------------------------------------------------------
        #                                               FRAME 3 constructeur
        #-----------------------------------------------------------------------------------------------------------------------
        self.entree3 = Entry(
            self.Frame3,
            textvariable=self.value_input_zpbo)  # création de l'entrer
        self.entree3.pack(
            side=LEFT, fill=X, padx=5, expand=True
        )  # afficher le champ et le placer (expend true (si plus grand va s'adapter))

        # liste déroulante

        self.combo3 = tix.ComboBox(self.Frame3,
                                   editable=1,
                                   dropdown=1,
                                   variable=self.varcombo3,
                                   command=self.Affiche3)
        self.combo3.entry.config(
            state='readonly')  ## met la zone de texte en lecture seule

        # bouton parcourir
        self.bouton3 = Button(self.Frame3,
                              text="Parcourir...",
                              command=self.chose_file3)  # création de bouton
        self.bouton3.pack(side=RIGHT, padx=5,
                          pady=5)  # afficher le bouton et le placer

        # -----------------------------------------------------------------------------------------------------------------------
        #                                               FRAME 4 constructeur
        # -----------------------------------------------------------------------------------------------------------------------
        self.entree4 = Entry(
            self.Frame4,
            textvariable=self.value_input_pfpbo)  # création de l'entrer
        self.entree4.pack(
            side=LEFT, fill=X, padx=5, expand=True
        )  # afficher le champ et le placer (expend true (si plus grand va s'adapter))
        # liste déroulante
        self.combo4 = tix.ComboBox(self.Frame4,
                                   editable=1,
                                   dropdown=1,
                                   variable=self.varcombo4,
                                   command=self.Affiche4)
        self.combo4.entry.config(
            state='readonly')  ## met la zone de texte en lecture seule

        # bouton parcourir
        self.bouton4 = Button(self.Frame4,
                              text="Parcourir...",
                              command=self.chose_file4)  # création de bouton
        self.bouton4.pack(side=RIGHT, padx=5,
                          pady=5)  # afficher le bouton et le placer
        # ----------------------------------------------------------------------------------------------------------------------
        #                                               FRAME 5 constructeur
        # ----------------------------------------------------------------------------------------------------------------------
        self.entree5 = Entry(
            self.Frame5,
            textvariable=self.value_input_piq)  # création de l'entrer
        self.entree5.pack(
            side=LEFT, fill=X, padx=5, expand=True
        )  # afficher le champ et le placer (expend true (si plus grand va s'adapter))

        # liste déroulante

        self.combo5 = tix.ComboBox(self.Frame5,
                                   editable=1,
                                   dropdown=1,
                                   variable=self.varcombo5,
                                   command=self.Affiche5)
        self.combo5.entry.config(
            state='readonly')  ## met la zone de texte en lecture seule

        # bouton parcourir
        self.bouton5 = Button(self.Frame5,
                              text="Parcourir...",
                              command=self.chose_file5)  # création de bouton
        self.bouton5.pack(side=RIGHT, padx=5,
                          pady=5)  # afficher le bouton et le placer

        # -----------------------------------------------------------------------------------------------------------------------
        #                                               FRAME 6 fonction
        # -----------------------------------------------------------------------------------------------------------------------
        # bouton parcourir

        self.bouton6 = Button(self.Frame6,
                              text="Executer")  # création de bouton
        self.bouton6.pack(side=RIGHT, padx=5,
                          pady=5)  # afficher le bouton et le placer
Exemplo n.º 3
0
    def updateProof(self):
        sv = tix.StringVar()
        sv.set(str(self.currentSequent))
        self.sequentEntry.config(textvariable=sv)

        self.proofWidget.wrapProof(self.currentProof)
Exemplo n.º 4
0
    def _createWidgets_(self):
        self.fsFrame = tk.Frame(self.mFrame)
        self.tk_setPalette(background = '#F2D7D5') ##F2D7D5
        self.btQuit = tk.Button(self.mFrame)
        self.btQuit.config(text = 'Завершить', command = self.root.destroy)
        self.btQuit.pack(side =tk.BOTTOM)
        ##self.loadFrame = tk.LabelFrame(self.fsFrame)
        ##self.listBMsg = tk.Listbox(self.loadFrame, relief='flat')

        self.topElemsFrame = tk.Frame(self.fsFrame)
        self.btnLstFrame = tk.LabelFrame(self.topElemsFrame)
        self.smplUnqOptFrame = tk.Frame(self.topElemsFrame)
        
        self.smplUnqOptLabelF = tk.LabelFrame(self.smplUnqOptFrame)
        
        self._lbSmplUnqOptLabelF_ = self.getSubWgts(self.smplUnqOptLabelF, tk._dummyLabel)
        self._lbSmplUnqOptLabelF_.config(text = "Уник. сэмпл.")
        self._frSmplUnqOptLabelF_ = self.getSubWgts(self.smplUnqOptLabelF, tk._dummyFrame)
        
        self.cbIfCutUrl = tk.Checkbutton(self._frSmplUnqOptLabelF_, text = "Сократ. Url в назв. сэмпл.", variable = self._varIfCutUrlInSmpl_)
        
        self.smplThruNum = tk.LabelFrame(self._frSmplUnqOptLabelF_)
        self._lbSmplThruNum_ = self.getSubWgts(self.smplThruNum, tk._dummyLabel)
        self._lbSmplThruNum_.config(text = "Скозн. нумер.")
        self._frSmplThruNum_ = self.getSubWgts(self.smplThruNum, tk._dummyFrame)
        self.smplThruNumCntrl = tk.Radiobutton(self._frSmplThruNum_, text = "Контроллер", variable = self._varRbSmplThruNum_, value = "Controller")
        self.smplThruNumThGr = tk.Radiobutton(self._frSmplThruNum_, text = "ТредГрупп", variable = self._varRbSmplThruNum_, value = "ThreadGroup")
        self.smplThruNumTstPl = tk.Radiobutton(self._frSmplThruNum_, text = "ТестПлан", variable = self._varRbSmplThruNum_, value = "TestPlan")
        self.smplThruNumCntrl.pack(side = tk.TOP, anchor = tk.W)
        self.smplThruNumThGr.pack(side = tk.TOP, anchor = tk.W)
        self.smplThruNumTstPl.pack(side = tk.TOP, anchor = tk.W)
        
        self.cbIfNotRstrUnqInSmpl = tk.Checkbutton(self._frSmplUnqOptLabelF_, text = "Не восст. ориг. назв. сэмпл.", variable = self._varCbIfNotRstrUnqInSmpl_)
        
        self.cbIfCutUrl.pack(side = tk.TOP, anchor = tk.W)
        self.smplThruNum.pack(side = tk.TOP, anchor = tk.W)
        self.cbIfNotRstrUnqInSmpl.pack(side = tk.TOP, anchor = tk.W)
        
        self.smplUnqOptLabelF.pack(anchor = tk.E)
        self.smplUnqOptFrame.config(width = self.smplThruNum.winfo_reqwidth(), padx = 100)
        
        self.paramVolatilFrame = tk.Frame(self.topElemsFrame)
        self.update_idletasks()
        leftCornerWidth = self._frSmplUnqOptLabelF_.winfo_reqwidth() + int(self.smplUnqOptLabelF.cget("borderwidth")) * 2
        leftCornerHeight = self.smplUnqOptLabelF.winfo_reqheight() + 2
        self.paramVolatilFrame.config(width = leftCornerWidth + 202, height = leftCornerHeight)
        self.paramVolatilFrame.pack_propagate(0)
        
        self.paramVolatilLabel = tk.LabelFrame(self.paramVolatilFrame)
        self._lbParamVolatilLabel_ = self.getSubWgts(self.paramVolatilLabel, tk._dummyLabel)
        self._lbParamVolatilLabel_.config(text = "Статистика")
        self._frParamVolatilLabel_ = self.getSubWgts(self.paramVolatilLabel, tk._dummyFrame)
        
        self.frBtGetVolatilPrm = tk.Frame(self._frParamVolatilLabel_)
        self.btBtGetVolatilPrm = tk.Button(self.frBtGetVolatilPrm, text="Получ. стат. по парам.")

        self.rBtGetVolatilPrm = tk.Radiobutton(self.frBtGetVolatilPrm, text = 'Волатил.   ', variable = self._volatilPrm_, value = True)
        self.rBtGetNonVolatilPrm = tk.Radiobutton(self.frBtGetVolatilPrm, text = 'Не волатил.', variable = self._volatilPrm_, value = False)
        self.btBtGetVolatilPrm.config(relief='groove')
        self.btBtGetVolatilPrm.config(command = self.prcdfGetVolatilPrms)
        self.frBtGetVolatilPrm.pack(side = tk.TOP, anchor = tk.W)
        self.btBtGetVolatilPrm.pack(side = tk.LEFT)
        self.rBtGetVolatilPrm.pack(side = tk.TOP, anchor = tk.W)
        self.rBtGetNonVolatilPrm.pack(side = tk.TOP, anchor = tk.W)

        self.paramVolatilLabel.pack(anchor = tk.W)

        ##self.msgsToAscFrame = tk.Listbox(self.loadFrame, relief='flat', selectmode='multiple')
        ##self.vScroll = tk.Scrollbar(self.loadFrame, orient=tk.VERTICAL)
        ##self.msgsToAscFrame.config( yscrollcommand=self.vScroll.set)
        self.consFrame = tk.LabelFrame(self.mFrame)
        #self.varsFrame = tk.LabelFrame(self.fsFrame)

        ##self.btnCollctnFrame = tk.LabelFrame(self.fsFrame)
        
        self.mCllctnFrame = tk.Frame(self.mFrame)
        
        self._lbBtnLstFrame_ = self.getSubWgts(self.btnLstFrame, tk._dummyLabel)
        self._lbBtnLstFrame_.config(text = 'Раб. с исх. Xml-дер.')
        self._frBtnLstFrame_ = self.getSubWgts(self.btnLstFrame, tk._dummyFrame)
        
        self.varsFrame = tk.Frame(self._frBtnLstFrame_, borderwidth=2, bg = 'blue')
        self.vrSPathFrame = tk.Label(self.varsFrame)
        self.vrFnameFrame = tk.Label(self.varsFrame)
        self.vrUnqFNmFrame = tk.Label(self.varsFrame)
        #self.vrPileCllctnFrame = tk.Label(self.varsFrame)
        self.vrRestreFNmFrame = tk.Label(self.varsFrame)
        
        self._btnLstFrame_ = tk.Frame(self._frBtnLstFrame_, borderwidth = 2)
        
        self.btCatchJMXFiles = tk.Button(self._btnLstFrame_, text="Собрать все \n.jmx файлы", fg="green")
        
	#self.btCatchJMXFiles.config(command = self.testFrame)
        self.btCatchJMXFiles.config(command = self.prcdCatchJMXFiles)
        self.btCatchJMXFiles.config(relief='raised')
        self.btCatchJMXFiles.pack(fill = 'x')
        #self.jmscdObj.setFName = 'toParce.jmx'

        self.btGetJMXMkTree = tk.Button(self._btnLstFrame_, text="Получить дерево из \n.jmx файла", fg="green")
        self.btGetJMXMkTree.config(command = self.prcdGetJMXMkTree)
        self.btGetJMXMkTree.config(relief='raised')
        self.btGetJMXMkTree.pack(fill = 'x')
        
        self.btTreeUnqNms = tk.Button(self._btnLstFrame_, text="Сген. колл. \nс уник. именами")
        self.btTreeUnqNms.config(command = self.prcdTreeUnqNms)
        self.btTreeUnqNms.config(relief='raised', state = tk.DISABLED)
        self.btTreeUnqNms.pack(fill = 'x')
        
        self.btRstrOrigNms = tk.Button(self._btnLstFrame_, text="Восст. ориг. имена\nдля получен. колл.")
        self.btRstrOrigNms.config(command = self.prcdRstrOrigNms)
        self.btRstrOrigNms.config(relief='raised')
        self.btRstrOrigNms.pack(fill = 'x')
        
        self.vrSPathLabel = tk.Label(self.vrSPathFrame)
        self.vrSPathValue = tk.Entry(self.vrSPathFrame, bg='white')
        self.vrSPathLabel.config(text='Каталог с (*.jmx)  файл.:', justify = tk.LEFT)
        self.vrSPathValue.config(justify = tk.LEFT)
        self.vrSPathValue.insert(0, self.jmscdObj.setPATH)
        self.vrSPathLabel.pack(side = tk.LEFT)
        self.vrSPathValue.pack(side = tk.LEFT)
        self.vrSPathFrame.pack(side = tk.TOP)
        
        self.vrFnameLabel = tk.Label(self.vrFnameFrame)
        self.vrFnameValue = tk.Entry(self.vrFnameFrame, bg='white')
        self.vrFnameLabel.config(text='Файл(*.jmx) для парам.:', justify = tk.LEFT)
        self.vrFnameValue.config(justify = tk.LEFT)
        self.vrFnameValue.insert(0, self.jmscdObj.setFName)
        self.vrFnameLabel.pack(side = tk.LEFT)
        self.vrFnameValue.pack(side = tk.LEFT)
        self.vrFnameFrame.pack(side=tk.TOP)
        
        self.vrUnqFNmLabel = tk.Label(self.vrUnqFNmFrame)
        self.vrUnqFNmValue = tk.Entry(self.vrUnqFNmFrame, bg = 'white')
        self.vrUnqFNmLabel.config(text='Файл(*.jmx), униф. элм.:', justify = tk.LEFT)
        self.vrUnqFNmValue.config(justify = tk.LEFT)
        self.vrUnqFNmValue.insert(0, self.jmscdObj.outFileUniqueNames)
        self.vrUnqFNmLabel.pack(side = tk.LEFT)
        self.vrUnqFNmValue.pack(side = tk.LEFT)
        self.vrUnqFNmFrame.pack(side=tk.TOP)
        
        self.vrRestreFNmLabel = tk.Label(self.vrRestreFNmFrame)
        self.vrRestreFNmValue = tk.Entry(self.vrRestreFNmFrame, bg = 'white')
        self.vrRestreFNmLabel.config(text='Файл(*.jmx), восcт. элм.:', justify = tk.LEFT)
        self.vrRestreFNmValue.config(justify = tk.LEFT)
        self.vrRestreFNmValue.insert(0, self.jmscdObj.outFileRestrdOrig)
        self.vrRestreFNmLabel.pack(side = tk.LEFT)
        self.vrRestreFNmValue.pack(side = tk.LEFT)
        self.vrRestreFNmFrame.pack(side=tk.TOP)
        
        self._btnLstFrame_.pack(side = tk.TOP)
        self.varsFrame.pack(side=tk.TOP)
        ##
        
        
        self.frPileOptns = tk.LabelFrame(self.mCllctnFrame)
        self._lbFrPileOptns_ = self.getSubWgts(self.frPileOptns, tk._dummyLabel)
        self._lbFrPileOptns_.config(text = 'Получ. осн. колл.')
        self._frPileOptns_ = self.getSubWgts(self.frPileOptns, tk._dummyFrame)
        self.scrollPileMCllt = tk.Scrollbar(self._frPileOptns_, orient = tk.VERTICAL)
        self.scrollPileMCllt.pack(side = tk.RIGHT, fill = 'y')
        self.lsbxPileMCllct = tk.Listbox(self._frPileOptns_, height = 4, width = 34, yscrollcommand = self.scrollPileMCllt.set)

        for itm in range(4):
            self.lsbxPileMCllct.insert(tk.END, '--')
            
        self.btPileMCllct = tk.Button(self._frPileOptns_, text="Аккумул. раб. коллекц.")
        self.btPileMCllct.config(command = self.prcdPileMCllct, relief='groove')
        self.lsbxPileMCllct.pack(side = tk.TOP)
        self.btPileMCllct.pack(side = tk.TOP)
        self.frPileOptns.pack(side = tk.LEFT)
        
        self.scrollPileMCllt.config(command = self.lsbxPileMCllct.yview)
        
        self.frOutRslts = tk.LabelFrame(self.mCllctnFrame)
        self._lbFrOutRslts_ = self.getSubWgts(self.frOutRslts, tk._dummyLabel)
        self._lbFrOutRslts_.config(text = 'Текущ. знач.')
        self._frOutRslts_ = self.getSubWgts(self.frOutRslts, tk._dummyFrame)
        self.entStrVar = tk.StringVar(self._frOutRslts_)
        #self.entStrVar.set(self.jmscdObj.entityNames[2]) # default value
        self.lstWrkEnts = tk.OptionMenu(self._frOutRslts_, variable = self.entStrVar)
        for ent in self.jmscdObj.entityNames:
            self.lstWrkEnts.add_command(ent)
        self.entStrVar.set(self.jmscdObj.entityNames[2])
        #self.lstWrkEnts = tk.Listbox(self.mCllctnFrame)
        
        ##Опция выбора сущности на данный момент выключена
        ####self.lstWrkEnts.pack(side = tk.TOP)
        self.tstOutText = tk.Text(self._frOutRslts_, state = tk.DISABLED, bg='#FFEFD5')#, width=64)
        self.tstOutText.pack(side = tk.TOP)
        self.txtWdgtDelete(False)
        self.txtWdgtInsert(self._initText_)
        #
        self.frWrInfExtCntrlElm = tk.Frame(self._frOutRslts_)
        self.btWriteChngsToF = tk.Button(self.frWrInfExtCntrlElm, text='Запис. изм.\nв файл')
        self.btWriteChngsToF.config(command = self.prcdWrtXmlTree)
        self.btUpdateXMLTree = tk.Button(self.frWrInfExtCntrlElm, text='Обнов. \nxml-дерево')
        self.btUpdateXMLTree.config(command = self.prcdUpdtXMLTree, state = tk.DISABLED)
        self.btUpdateXMLTree.pack(side = tk.LEFT)
        self.btWriteChngsToF.pack(side = tk.LEFT)
        self.frWrInfExtCntrlElm.pack(side = tk.BOTTOM)
        #
        self.frOutRslts.pack(side = tk.LEFT)

        ###
        
        self.frGetCollctnData = tk.Frame(self.mCllctnFrame)
        #
        self.frGetListKeys = tk.LabelFrame(self.frGetCollctnData)
        self._frGetListKeys_ = self.getSubWgts(self.frGetListKeys, tk._dummyFrame)
        self.frBtGetLstKeys = tk.Frame(self._frGetListKeys_)
        self.btGetListKeys = tk.Button(self.frBtGetLstKeys, text="Список получ. ключей:")
        self.varRBtLstKeys = tk.IntVar()
        self.varRBtLstKeys.set(1)
        self.rBtLstKeysPrms = tk.Radiobutton(self.frBtGetLstKeys, text = 'Парам. ', variable = self.varRBtLstKeys, value = 1)
        self.rBtLstKeysLnks = tk.Radiobutton(self.frBtGetLstKeys, text = 'Ссылки', variable = self.varRBtLstKeys, value = 2)
        self.btGetListKeys.config(relief='groove')
        self.btGetListKeys.config(command = self.prcdfGetListKeys)
        self._lbGetListKeys_ = self.getSubWgts(self.frGetListKeys, tk._dummyLabel)
        self._lbGetListKeys_.config(text = 'Раб. с осн. коллекц.')
        self.frBtGetLstKeys.pack(side = tk.TOP, anchor = tk.W)
        self.btGetListKeys.pack(side = tk.LEFT)
        self.rBtLstKeysPrms.pack(side = tk.TOP, anchor = tk.E)
        self.rBtLstKeysLnks.pack(side = tk.TOP, anchor = tk.E)
        self.frGetListKeys.pack(side = tk.TOP, fill = 'x')
        #
        self.frGetDictData = tk.Frame(self._frGetListKeys_)
        self.frGetDictData.config(borderwidth = 2, bg = 'green')
        ##
        self.frGetDataDictItem = tk.Frame(self.frGetDictData)
        self.vlGetDataDictItem = tk.Entry(self.frGetDataDictItem, bg='white')
        self.vlGetDataDictItem.insert(0, '<знач.ключа>')
        self.btGetDataDictItem = tk.Button(self.frGetDataDictItem, text="Все знач.\nпо задан. ключу:")
        self.btGetDataDictItem.config(command = self.prcdGetDataDictItem)
        self.btGetDataDictItem.config(relief='groove')
        self.btGetDataDictItem.pack(side= tk.LEFT)
        self.vlGetDataDictItem.pack(side = tk.RIGHT, fill = 'y')
        self.frGetDataDictItem.pack(side = tk.TOP)
        ##
        self.frGetScrLstByNm = tk.Frame(self.frGetDictData)
        self.btGetScrLstByNm = tk.Button(self.frGetScrLstByNm, text="Все контрлр.\nпо задан. ключу:")
        self.btGetScrLstByNm.config(command = self.prcdGetScrLstByNm)
        self.btGetScrLstByNm.config(relief='groove')
        self.vlGetScrLstByNm = tk.Entry(self.frGetScrLstByNm, bg='white')
        self.vlGetScrLstByNm.insert(0, '<знач.ключа>')
        self.chkBtVar = tk.BooleanVar(self.frGetScrLstByNm)
        self.chkBtVar.set(False)
        self.chkGetScrLstByNm = tk.Checkbutton(self.frGetScrLstByNm, text='Вывод сэмплр.', variable=self.chkBtVar)
        self.btGetScrLstByNm.pack(side= tk.LEFT)
        self.vlGetScrLstByNm.pack(side = tk.TOP)
        self.chkGetScrLstByNm.pack(side = tk.LEFT)
        self.frGetScrLstByNm.pack(side = tk.TOP)
        ##
        self.frGetScrFncByKeyVal = tk.Frame(self.frGetDictData)
        self.btGetScrFncByKeyVal = tk.Button(self.frGetScrFncByKeyVal, text="Все контрлр.\nпо  паре  кл.-зн.:")
        self.btGetScrFncByKeyVal.config(command = self.prcdGetScrFncByKeyVal)
        self.btGetScrFncByKeyVal.config(relief='groove')
        self.vlGetScrFncByKeyVal = tk.Entry(self.frGetScrFncByKeyVal, bg='white')
        self.vlGetScrFncByKeyVal.insert(0, '<знач.ключа>')
        self.vrGetScrFncByKeyVal = tk.Entry(self.frGetScrFncByKeyVal, bg='white')
        self.vrGetScrFncByKeyVal.insert(0, '<знач.парам.>')
        self.chkKeyVlVar = tk.BooleanVar(self.frGetScrFncByKeyVal)
        self.chkKeyVlVar.set(False)
        self.chkGetScrFncByKeyVal = tk.Checkbutton(self.frGetScrFncByKeyVal, text='Вывод сэмплр.', variable=self.chkKeyVlVar)
        self.btGetScrFncByKeyVal.pack(side= tk.LEFT, fill='y')
        self.vlGetScrFncByKeyVal.pack(side = tk.TOP)
        self.vrGetScrFncByKeyVal.pack(side = tk.TOP)
        self.chkGetScrFncByKeyVal.pack(side = tk.LEFT)
        self.frGetScrFncByKeyVal.pack(side = tk.TOP, fill='x')
        ##
        self.frGetValByKSF = tk.Frame(self.frGetDictData)
        self.frGetValByKSF.config(borderwidth = 1, bg = 'red')
        self.blnMsg = tk.Balloon(self.frGetValByKSF, initwait = 350, bg='yellow')
        self.blnMsgText = 'Внимание!\nНазвания контроллеров и сэмплеров (возможно) были изменены,\nследует сверять в jmeter по файлу "(*.jmx) униф. эл"'
        self.blnMsg.bind_widget(self.frGetValByKSF, msg = self.blnMsgText)
        self.btGetValByKSF = tk.Button(self.frGetValByKSF, text="Значен. для\n кл.-кнтр.-смпл.:")
        self.btGetValByKSF.config(command = self.prcdGetValByKSF)
        self.btGetValByKSF.config(relief='groove')
        self.vlGetValByKSF = tk.Entry(self.frGetValByKSF, bg='white')
        self.vlGetValByKSF.insert(0, '<знач.ключа>')
        self.ctGetValByKSF = tk.Entry(self.frGetValByKSF, bg='white')
        self.ctGetValByKSF.insert(0, '<назв. контрлр.>')
        self.smGetValByKSF = tk.Entry(self.frGetValByKSF, bg='white')
        self.smGetValByKSF.insert(0, '<назв. сэмплр.>')
        self.btGetValByKSF.pack(side= tk.LEFT, fill='y')
        self.vlGetValByKSF.pack(side = tk.TOP)
        self.ctGetValByKSF.pack(side = tk.TOP)
        self.smGetValByKSF.pack(side = tk.TOP)
        self.frGetValByKSF.pack(side = tk.TOP, fill='x')
        ##
        self.frSetValsToSlctn = tk.Frame(self._frGetListKeys_, pady = 2)
        self.btSetValsToSlctn = tk.Button(self.frSetValsToSlctn, text = 'Установ.\n для дан.\n элемен.\n словар.')
        self.btSetValsToSlctn.config(command = self.prcdSetValsToSlctn, state = tk.DISABLED, relief = "groove")
        self.lblSetValsToSlctn = tk.Label(self.frSetValsToSlctn, text = ' <==> ')
        self.entSetValsToSlctn = tk.Entry(self.frSetValsToSlctn, bg='white')
        self.entSetValsToSlctn.insert(0, '*новое знач.*')
        self.btSetValsToSlctn.pack(side = tk.LEFT, anchor=tk.W)
        self.lblSetValsToSlctn.pack(side = tk.LEFT)
        self.entSetValsToSlctn.pack(side = tk.RIGHT, anchor=tk.E)
        ###
        self.frGetDictData.pack(side = tk.TOP)
        self.frSetValsToSlctn.pack(side = tk.TOP, anchor = tk.W)
        #
        self.frGetCollctnData.pack(side = tk.LEFT)

        #for lstEntr in self.jmscdObj.entityNames:
        #    self.lstWrkEnts.insert(tk.END, lstEntr)
        
        self.fsFrame.pack(side="top", fill='x')
        self.mCllctnFrame.pack(side=tk.LEFT, fill='x')
        ##self.loadFrame.pack(side="top", fill='x')
        self.smplUnqOptFrame.pack(side = tk.RIGHT, anchor = tk.E)
        self.btnLstFrame.pack(side = tk.RIGHT)
        self.paramVolatilFrame.pack(side = tk.RIGHT)
        self.topElemsFrame.pack(side="top", fill='y')
Exemplo n.º 5
0
Arquivo: app.py Projeto: GdonatasG/egz
    def refresh(self, bundle):
        # Nustatomas lango pavadinimas
        self._controller.title(Constants.TITLE_HOME)
        # Isvalomi pries tai lange buve elementai pasinaudojant elementu is klases WindowUtils (paveldejimas)
        self.clearWindow()

        infoLabel = tkx.Label(
            self,
            text=
            "Iveskite didesni uz 0 sveika skaiciu \nis kurio bus sugeneruotas jusu nurodyto dydzio teigiamu skaiciu masyvas"
        )
        infoLabel.pack()

        self._numberValue = tkx.StringVar(self)
        self._numberValue.trace("w", self.entryChangeListener)

        self._threadValue = tkx.StringVar(self)
        self._threadValue.trace("w", self.entryChangeListener)

        self._numberEntry = tkx.Entry(self, textvariable=self._numberValue)
        self._numberEntry.pack()

        threadInfoLabel = tkx.Label(
            self,
            text=
            "Iveskite sveika skaiciu, kuris nurodys pasirinktu giju kieki (maziausiai 1, daugiausiai 3)"
        )
        threadInfoLabel.pack()

        self._threadsEntry = tkx.Entry(self, textvariable=self._threadValue)
        self._threadsEntry.pack()

        typeInfoLabel = tkx.Label(
            self, text="Pasirinkite programos veiksmu vykdymo budus")
        typeInfoLabel.pack()

        self._choicesFrame = tkx.Frame(self)
        self._choicesFrame.pack()

        # CheckBoxes arba kitaip veiksmu vykdymo tipu pasarinkimas
        self._choices = ("Nuoseklus vykdymas", "Gijomis paremtas vykdymas")
        self._optionsMenuValue = []
        self._optionsMenuButtons = []
        for i in range(len(self._choices)):
            # Nustatoma mygtuko reiksme. 1 - pasirinkta, 0 - nepasirinkta
            self._optionsMenuValue.append(tkx.IntVar(value=1))
            self._optionsMenuValue[i].trace("w", self.entryChangeListener)
            self._optionsMenuButtons.append(
                tkx.Checkbutton(self._choicesFrame,
                                text=self._choices[i],
                                variable=self._optionsMenuValue[i],
                                onvalue=1,
                                offvalue=0))
            self._optionsMenuButtons[i].pack()

        self._buttonsFrame = tkx.Frame(self)
        self._buttonsFrame.pack()

        self._submitButton = tkx.Button(self._buttonsFrame, text="Vykdyti")
        self._submitButton.pack(
            side="left",
            anchor=tkx.NW,
            expand=True,
        )
        # Veiksmu vykdyma perkeliu i atskira Thread'a, kad neatsitiktu taip, jog esant dideliam duomenu kiekiui
        # programa taps "not responding"
        self._submitButton.config(
            command=lambda: threading.Thread(target=self.doActions).start(),
            state='disabled')

        self._clearButton = tkx.Button(self._buttonsFrame, text="Isvalyti")
        self._clearButton.pack(
            side="left",
            anchor=tkx.NW,
            expand=True,
        )
        self._clearButton.config(command=partial(self._actionClear))

        self._exitButton = tkx.Button(self._buttonsFrame, text="Uzdaryti")
        self._exitButton.pack(
            side="left",
            anchor=tkx.NW,
            expand=True,
        )
        self._exitButton.config(command=lambda: self._controller.exit())

        self._errorLabel = tkx.Label(self, text="")
        self._errorLabel.pack()

        self._progressLabel = tkx.Label(self, text="")
        self._progressLabel.pack()
Exemplo n.º 6
0
    def __init__(self, fenetre, **kwargs):
        Frame.__init__(self, fenetre, width=100, height=100, **kwargs)
        # Création de la fenêtre principale (main window)
        self.pack(fill=BOTH, expand=True)

        #initialisation
        self.liste1 = [
            1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
            20
        ]
        self.liste2 = [1, 2, 3, 4, 1, 2, 3, 4]
        self.liste3 = [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 4]
        self.liste4 = [1, 2, 3, 4, 1, 2, 3, 4]
        self.liste5 = [1, 2, 3, 4, 1, 2, 3, 4, 3]
        self.value_input1 = StringVar()
        self.value_input2 = StringVar()
        self.value_input3 = StringVar()
        self.value_input4 = StringVar()
        self.value_input5 = StringVar()
        self.value_input1.set("Charger un fichier")
        self.value_input2.set("Charger un fichier")
        self.value_input3.set("Charger un fichier")
        self.value_input4.set("Charger un fichier")
        self.value_input5.set("Charger un fichier")
        self.varcombo1 = tix.StringVar()
        self.varcombo2 = tix.StringVar()
        self.varcombo3 = tix.StringVar()
        self.varcombo4 = tix.StringVar()
        self.varcombo5 = tix.StringVar()
        self.champs_choisi1 = StringVar()
        self.champs_choisi2 = StringVar()
        self.champs_choisi3 = StringVar()
        self.champs_choisi4 = StringVar()
        self.champs_choisi5 = StringVar()
        self.path1 = StringVar()
        self.path2 = StringVar()
        self.path3 = StringVar()
        self.path4 = StringVar()
        self.path5 = StringVar()

        # création des Frames dans la fenêtre principale
        self.Frame1 = Frame(self, relief=GROOVE)
        self.Frame2 = Frame(self, relief=GROOVE)
        self.Frame3 = Frame(self, relief=GROOVE)
        self.Frame4 = Frame(self, relief=GROOVE)
        self.Frame5 = Frame(self, relief=GROOVE)
        # Placement des frames
        self.Frame1.place(x=20, y=00, width=650, height=40)
        self.Frame2.place(x=20, y=40, width=650, height=40)
        self.Frame3.place(x=20, y=80, width=650, height=40)
        self.Frame4.place(x=20, y=120, width=650, height=40)
        self.Frame5.place(x=20, y=160, width=650, height=40)
        #Frame exécution
        self.Frame6 = Frame(self, relief=GROOVE)
        self.Frame6.place(x=180, y=200, width=100, height=40)
        # ----------------------------------------------------------------------------------------------------------------------
        #                                               FRAME 1 constructeur
        # ----------------------------------------------------------------------------------------------------------------------
        self.entree1 = Entry(
            self.Frame1,
            textvariable=self.value_input1)  # création de l'entrer
        self.entree1.pack(
            side=LEFT, fill=X, padx=5, expand=True
        )  # afficher le champ et le placer (expend true (si plus grand va s'adapter))
        self.combo1 = tix.ComboBox(self.Frame1,
                                   editable=1,
                                   dropdown=1,
                                   variable=self.varcombo1,
                                   command=self.Affiche1)
        self.combo1.entry.config(
            state='readonly')  ## met la zone de texte en lecture seule
        for i in range(0, len(self.liste1)):
            self.combo1.insert(
                i,
                self.liste1[i])  # Liste est la liste qui récupère les champs
            i += 1
        self.combo1.pack(side=LEFT, padx=5, pady=5)
        # bouton1 parcourir
        self.bouton1 = Button(self.Frame1,
                              text="Parcourir...",
                              command=self.chose_file1)  # création de bouton
        self.bouton1.pack(side=RIGHT, padx=5,
                          pady=5)  # afficher le bouton et le placer

        # ----------------------------------------------------------------------------------------------------------------------
        #                                               FRAME 2 constructeur
        # ----------------------------------------------------------------------------------------------------------------------
        self.entree2 = Entry(
            self.Frame2,
            textvariable=self.value_input2)  # création de l'entrer
        self.entree2.pack(
            side=LEFT, fill=X, padx=5, expand=True
        )  # afficher le champ et le placer (expend true (si plus grand va s'adapter))
        # liste déroulante
        self.combo2 = tix.ComboBox(self.Frame2,
                                   editable=1,
                                   dropdown=1,
                                   variable=self.varcombo2,
                                   command=self.Affiche2)
        self.combo2.entry.config(
            state='readonly')  ## met la zone de texte en lecture seule
        for i in range(0, len(self.liste2)):
            self.combo2.insert(
                i,
                self.liste1[i])  # Liste est la liste qui récupère les champs
            i += 1
        self.combo2.pack(side=LEFT, padx=5, pady=5)
        # bouton parcourir
        self.bouton2 = Button(self.Frame2,
                              text="Parcourir...",
                              command=self.chose_file2)  # création de bouton
        self.bouton2.pack(side=RIGHT, padx=5,
                          pady=5)  # afficher le bouton et le placer

        #-----------------------------------------------------------------------------------------------------------------------
        #                                               FRAME 3 constructeur
        #-----------------------------------------------------------------------------------------------------------------------
        self.entree3 = Entry(
            self.Frame3,
            textvariable=self.value_input3)  # création de l'entrer
        self.entree3.pack(
            side=LEFT, fill=X, padx=5, expand=True
        )  # afficher le champ et le placer (expend true (si plus grand va s'adapter))

        # liste déroulante

        self.combo3 = tix.ComboBox(self.Frame3,
                                   editable=1,
                                   dropdown=1,
                                   variable=self.varcombo3,
                                   command=self.Affiche3)
        self.combo3.entry.config(
            state='readonly')  ## met la zone de texte en lecture seule
        for i in range(0, len(self.liste3)):
            self.combo3.insert(
                i,
                self.liste1[i])  # Liste est la liste qui récupère les champs
            i += 1
        self.combo3.pack(side=LEFT, padx=5, pady=5)
        # bouton parcourir
        self.bouton3 = Button(self.Frame3,
                              text="Parcourir...",
                              command=self.chose_file3)  # création de bouton
        self.bouton3.pack(side=RIGHT, padx=5,
                          pady=5)  # afficher le bouton et le placer

        # -----------------------------------------------------------------------------------------------------------------------
        #                                               FRAME 4 constructeur
        # -----------------------------------------------------------------------------------------------------------------------
        self.entree4 = Entry(
            self.Frame4,
            textvariable=self.value_input4)  # création de l'entrer
        self.entree4.pack(
            side=LEFT, fill=X, padx=5, expand=True
        )  # afficher le champ et le placer (expend true (si plus grand va s'adapter))
        # liste déroulante
        combo4 = tix.ComboBox(self.Frame4,
                              editable=1,
                              dropdown=1,
                              variable=self.varcombo4,
                              command=self.Affiche4)
        combo4.entry.config(
            state='readonly')  ## met la zone de texte en lecture seule
        for i in range(0, len(self.liste4)):
            combo4.insert(
                i,
                self.liste1[i])  # Liste est la liste qui récupère les champs
            i += 1
        combo4.pack(side=LEFT, padx=5, pady=5)
        # bouton parcourir
        self.bouton4 = Button(self.Frame4,
                              text="Parcourir...",
                              command=self.chose_file4)  # création de bouton
        self.bouton4.pack(side=RIGHT, padx=5,
                          pady=5)  # afficher le bouton et le placer
        # ----------------------------------------------------------------------------------------------------------------------
        #                                               FRAME 5 constructeur
        # ----------------------------------------------------------------------------------------------------------------------
        self.entree5 = Entry(
            self.Frame5,
            textvariable=self.value_input5)  # création de l'entrer
        self.entree5.pack(
            side=LEFT, fill=X, padx=5, expand=True
        )  # afficher le champ et le placer (expend true (si plus grand va s'adapter))

        # liste déroulante

        self.combo5 = tix.ComboBox(self.Frame5,
                                   editable=1,
                                   dropdown=1,
                                   variable=self.varcombo5,
                                   command=self.Affiche5)
        self.combo5.entry.config(
            state='readonly')  ## met la zone de texte en lecture seule
        for i in range(0, len(self.liste5)):
            self.combo5.insert(
                i,
                self.liste1[i])  # Liste est la liste qui récupère les champs
            i += 1
        self.combo5.pack(side=LEFT, padx=5, pady=5)

        # bouton parcourir
        self.bouton5 = Button(self.Frame5,
                              text="Parcourir...",
                              command=self.chose_file5)  # création de bouton
        self.bouton5.pack(side=RIGHT, padx=5,
                          pady=5)  # afficher le bouton et le placer

        # -----------------------------------------------------------------------------------------------------------------------
        #                                               FRAME 6 fonction
        # -----------------------------------------------------------------------------------------------------------------------
        # bouton parcourir

        self.bouton6 = Button(self.Frame6,
                              text="Executer")  # création de bouton
        self.bouton6.pack(side=RIGHT, padx=5,
                          pady=5)  # afficher le bouton et le placer
Exemplo n.º 7
0
    def __init__(self, root, server_filter):
        self.reports = []
        self.server_temp_counts = []
        self.path = ''
        self.server_cols_filter = server_filter
        self.dir_frame = ttk.Frame(root)
        self.dir_frame.grid()

        intro_txt = 'This little app helps to summarise multiple XML result files for IT Equipment(servers) exported from 6Sigma CFD simulation software.'
        self.introlbl = ttk.Label(self.dir_frame,
                                  justify="left",
                                  anchor="n",
                                  padding=(10, 2, 10, 6),
                                  text=intro_txt)
        self.introlbl.grid(row=0)

        self.top_frame = ttk.Frame(self.dir_frame)
        self.top_frame.grid(row=1)

        self.controls_frame = ttk.Frame(self.top_frame)
        self.controls_frame.grid(row=1, column=0, sticky='e')

        self.dir_path = tk.StringVar()
        self.folder_lbl = ttk.Label(self.controls_frame,
                                    justify="left",
                                    anchor="w",
                                    text='Result xml files location:')
        self.folder_lbl.grid(row=1, column=0, sticky='e')
        self.path_entry = ttk.Entry(self.controls_frame,
                                    textvariable=self.dir_path,
                                    width=50)
        self.path_entry.grid(row=1, column=1, sticky='we', padx=(5, 5))
        self.browse_btn = ttk.Button(self.controls_frame,
                                     command=self.browse_dir,
                                     text='Browse')
        self.browse_btn.grid(row=1, column=2)

        self.temp_lbl = ttk.Label(self.controls_frame,
                                  justify="left",
                                  anchor="e",
                                  text='Max. server inlet temp. [degC]:')

        self.temp_spiner = tk.Spinbox(self.controls_frame,
                                      from_=15,
                                      to=40,
                                      increment=0.5,
                                      width=5)
        for i in range(0, (27 - 15) * 2):
            self.temp_spiner.invoke('buttonup')

        self.temp_lbl.grid(row=2, column=0, sticky='e')
        self.temp_spiner.grid(row=2, column=1, sticky='w', padx=(5, 5))

        self.navi_frame = ttk.Frame(self.top_frame)
        self.navi_frame.grid(row=1,
                             column=1,
                             padx=(10, 10),
                             pady=(0, 10),
                             sticky='w')

        self.calc_btn = ttk.Button(self.navi_frame,
                                   text='Calculate',
                                   command=self.gui_calc)
        self.calc_btn.grid(row=0, sticky='nsew')
        self.export_btn = ttk.Button(self.navi_frame,
                                     text='Export to CSV',
                                     command=self.gui_export_csv)
        self.export_btn.grid(row=1, sticky='nsew')
        self.export_btn = ttk.Button(self.navi_frame,
                                     text='Help',
                                     command=self.show_help)
        self.export_btn.grid(row=2, sticky='nsew')
        self.close_btn = ttk.Button(self.navi_frame,
                                    command=lambda: root.destroy(),
                                    text='Close')
        self.close_btn.grid(row=3, sticky='nsew')

        self.tree_headers()
        self.update_tree_views()

        self.botom_frame = ttk.Frame(self.dir_frame)
        self.botom_frame.grid(row=6)

        status_txt = "Browse for folder containing multiple XML files (only 6Sigma 'IT Equipment' PropertyTable export files will be filtered off for analysis), set max. temp SLA threshold. Then click 'Calculate'"
        self.status_lbl = PixelLabel(self.botom_frame,
                                     1,
                                     borderwidth=1,
                                     relief='sunken',
                                     background='#D9D9D9',
                                     text=status_txt)
        self.status_lbl.grid(row=3, sticky='w', column=0)
        # self.status_lbl.grid(row=3,sticky='nsew',columnspan=1,wraplenght='4i')

        self.brag = ttk.Label(self.botom_frame,
                              text="about",
                              borderwidth=1,
                              relief='sunken',
                              background='#D9D9D9',
                              width=6)
        self.brag.grid(row=3, column=1, sticky='e')

        self.status_lbl.resize(root, self.brag)

        # root.tk.call("load", "", "Tix")
        self.baloon = tk.Balloon()
        self.baloon.bind_widget(
            self.brag,
            balloonmsg='ver1.2 created in Warsaw by [email protected]')
Exemplo n.º 8
0
    def __init__(self, root):
        self.errors = None
        self.source_files = None

        self.main_frame = ttk.Frame(root)
        self.main_frame.grid()

        intro_txt = 'This little app merges data from multiple MS Excel files into one master spreadsheet.'
        self.introlbl = ttk.Label(self.main_frame,
                                  justify="left",
                                  anchor="n",
                                  padding=(10, 2, 10, 6),
                                  text=intro_txt)
        self.introlbl.grid(row=0)

        self.top_frame = ttk.Frame(self.main_frame)
        self.top_frame.grid(row=1)

        self.controls_frame = ttk.Frame(self.top_frame)
        self.controls_frame.grid(row=1, column=0, sticky='e')

        self.dir_path = tk.StringVar()
        self.folder_lbl = ttk.Label(self.controls_frame,
                                    justify="left",
                                    anchor="w",
                                    text='Source files path:')
        self.folder_lbl.grid(row=1, column=0, sticky='e')
        self.path_entry = ttk.Entry(self.controls_frame,
                                    textvariable=self.dir_path,
                                    width=50)
        self.path_entry.grid(row=1, column=1, sticky='we', padx=(5, 5))
        self.browse_btn = ttk.Button(self.controls_frame,
                                     command=self.browse_dir,
                                     text='Browse')
        self.browse_btn.grid(row=1, column=2)

        self.masterfile_path = tk.StringVar()
        self.folder_lbl = ttk.Label(self.controls_frame,
                                    justify="left",
                                    anchor="w",
                                    text='Master spreadsheet location:')
        self.folder_lbl.grid(row=2, column=0, sticky='e')
        self.path_entry = ttk.Entry(self.controls_frame,
                                    textvariable=self.masterfile_path,
                                    width=50)
        self.path_entry.grid(row=2, column=1, sticky='we', padx=(5, 5))
        self.browse_btn = ttk.Button(self.controls_frame,
                                     command=self.browse_file,
                                     text='Browse')
        self.browse_btn.grid(row=2, column=2)

        self.maxrows_lbl = ttk.Label(self.controls_frame,
                                     justify="left",
                                     anchor="e",
                                     text='Max row number:')
        self.maxrows_spiner = tk.Spinbox(self.controls_frame,
                                         from_=1,
                                         to=1000,
                                         increment=10,
                                         width=5)
        self.maxrows_lbl.grid(row=3, column=0, sticky='e')
        self.maxrows_spiner.grid(row=3, column=1, sticky='w', padx=(5, 5))

        self.maxcols_lbl = ttk.Label(self.controls_frame,
                                     justify="left",
                                     anchor="e",
                                     text='Max column number:')
        self.maxcols_spiner = tk.Spinbox(self.controls_frame,
                                         from_=1,
                                         to=1000,
                                         increment=10,
                                         width=5)
        self.maxcols_lbl.grid(row=4, column=0, sticky='e')
        self.maxcols_spiner.grid(row=4, column=1, sticky='w', padx=(5, 5))

        self.navi_frame = ttk.Frame(self.top_frame)
        self.navi_frame.grid(row=2, padx=(10, 10), pady=(20, 10), sticky='s')

        self.calc_btn = ttk.Button(self.navi_frame,
                                   text='Merge data',
                                   command=self.gui_calc)
        self.calc_btn.grid(row=1, column=1, sticky='nsew')
        self.close_btn = ttk.Button(self.navi_frame,
                                    command=lambda: root.destroy(),
                                    text='Close')
        self.close_btn.grid(row=1, column=3, sticky='nsew')
        self.help_btn = ttk.Button(self.navi_frame,
                                   text='Help',
                                   command=self.show_help)
        self.help_btn.grid(row=1, column=2, sticky='nsew')

        self.botom_frame = ttk.Frame(self.main_frame)
        self.botom_frame.grid(row=2)

        status_txt = "Prepare your master file first (read Help for more info)"
        self.status_lbl = PixelLabel(self.botom_frame,
                                     1,
                                     borderwidth=1,
                                     relief='sunken',
                                     background='#D9D9D9',
                                     text=status_txt)
        self.status_lbl.grid(row=3, sticky='w', column=0)
        # self.status_lbl.grid(row=3,sticky='nsew',columnspan=1,wraplenght='4i')

        self.brag = ttk.Label(self.botom_frame,
                              text="about",
                              borderwidth=1,
                              relief='sunken',
                              background='#D9D9D9',
                              width=6)
        self.brag.grid(row=3, column=1, sticky='e')

        self.status_lbl.resize(root, self.brag)

        # root.tk.call("load", "", "Tix")
        self.baloon = tk.Balloon()
        self.baloon.bind_widget(
            self.brag,
            balloonmsg='ver1.0 created in Warsaw by [email protected]')
Exemplo n.º 9
0
        def __init__(self, master=None, cards=list()):
                if master is None :
                        self.main = tix.Tk()
                else :
                        self.main = master
                self.main.resizable(False, True)

                # left part : list of all the cards
                self._cards = list() # for mention only ; self.update fills it
                # self._cards represents all the stored cards
                # self.cards is self._cards after user-filtering
                # see update and below
                self.names = tix.ScrolledListBox(self.main)
                self.names.listbox.configure(width=30, bg="#ffffff")

                # right part : single-card details and picture
                # top : picture
                self.imglbl = tix.Label(self.main)
                self.flipped = False

                # bottom : filters
                self.rightpart = tix.Frame(self.main)

                self.sort = LabelFrame(self.rightpart, text="Trier par : ")
                self.sortby = tix.StringVar(self.sort, "foreign_name")
                self.sort_buttons = list()
                for i, (d,s) in enumerate(SORT_PARAMS) :
                        b = tix.Radiobutton(self.sort, text=d, value=s, variable=self.sortby)
                        b.grid(row=i, column=0, sticky="w")
                        self.sort_buttons.append(b)

                self.filter = LabelFrame(self.rightpart, text="Filtrer :")
                self.filter_query = tix.StringVar(self.filter)
                self.f_e = tix.Entry(self.filter, textvariable=self.filter_query, width=30)

                # buttons to add a card
                self.addacard = tix.Button(self.rightpart, text=" + ", command=self.search)
                self.askcode =  tix.Button(self.rightpart, text=" ? ", command=self.showsets)
                self.set_codes = None

                self.main.bind_all("<Control-s>", self.save)
                self.main.bind_all("<Control-o>", self.load)
                self.names.listbox.bind_all("<<ListboxSelect>>", self.display_card)
                self.main.bind_all("<KP_Add>", self.inc) # "+" from the numeric pad
                self.main.bind_all("<plus>", self.inc) # "+" from the alphabetic pad
                self.main.bind_all("<KP_Subtract>", self.dec) # idem
                self.main.bind_all("<minus>", self.dec)
                self.sortby.trace("w", lambda x,y,z:self.update(self.cards))
                self.filter_query.trace("w", lambda x,y,z:self.update())
                self.imglbl.bind("<Button-1>",self.switch_img)


                self.names.pack(side="left", fill="y")
                self.imglbl.pack(side="top", fill="x")
                self.rightpart.pack(side="top", fill="both", expand=True)
                self.sort.grid(row=0, column=0, sticky="nsew")
                self.f_e.pack()
                self.filter.grid(row=0, column=1, columnspan=3, sticky="nsew")
                self.addacard.grid(row=1, column=3)
                self.askcode.grid(row=1, column=2)
                # these were useful when there was no filter above to fill the place...
                self.rightpart.grid_rowconfigure(0, weight=1)
                self.rightpart.grid_columnconfigure(1, weight=1)

                self.update(cards)
    def __init__(self, master):
        tk.Frame.__init__(self, master)
        self.master = master
        self.isRunning = False
        self.Hz = []
        self.HP = []
        self.RPM = []
        self.Time = []
        self.Notes = []

        #master.title("Attritor Scrape")

        #print(Hz)

        pageLabel = tk.Label(master, text='HTML page')
        pageLabel.pack()
        self.pageVar = tk.StringVar()
        #pageVar.set('Feature Currently not Working')
        #pageEntry = tk.Entry(master,textvariable=pageVar, width = 50)
        #pageEntry.pack()
        """
        pages = [('VHM1','http://10.10.92.175/process_display_0.htm'),
                 ('VHM2','http://10.10.92.63/process_display_0.html'),
                 ('VS1','http://10.10.92.51/process_display_0.html'),
                 ('VS2','http://10.10.92.106/process_display_0.html'),
                ]
        pageVar.set('http://10.10.92.175/process_display_0.html')
        """
        pages = [
            ('VHM1', 'VHM1'),
            ('VHM2', 'VHM2'),
            ('VS1', 'VS1'),
            ('VS2', 'VS2'),
        ]
        self.pageVar.set('VHM1')
        for text, page in pages:
            b = tk.Radiobutton(master,
                               text=text,
                               variable=self.pageVar,
                               value=page)
            b.pack()

        filenameLabel = tk.Label(master, text='Filename')
        filenameLabel.pack()
        self.fileVar = tk.StringVar()
        fileEntry = tk.Entry(master, textvariable=self.fileVar, width=50)
        fileEntry.pack()

        sheetLabel = tk.Label(master, text='Sheet Name')
        sheetLabel.pack()
        sheetVar = tk.StringVar()
        sheetEntry = tk.Entry(master, textvariable=sheetVar, width=50)
        sheetEntry.pack()

        emailLabel = tk.Label(master, text='Email')
        emailLabel.pack()
        self.emailVar = tk.StringVar()
        emailEntry = tk.Entry(master, textvariable=self.emailVar, width=50)
        emailEntry.pack()

        runtimeLabel = tk.Label(master, text='Run Time')
        runtimeLabel.pack()
        self.runtimestartVar = tk.StringVar()
        self.runtimecurrentVar = tk.StringVar()
        runtimestartEntry = tk.Entry(master, textvariable=self.runtimestartVar)
        runtimestartEntry.pack()
        runtimecurrentEntry = tk.Entry(master,
                                       textvariable=self.runtimecurrentVar)
        runtimecurrentEntry.pack()
        self.NotesVar = tk.StringVar()
        notesLabel = tk.Label(master, text='Notes')
        notesLabel.pack()
        notesEntry = tk.Entry(master, textvariable=self.NotesVar)
        notesEntry.pack()

        recordbutton = tk.Button(
            master,
            text='Start Recording Data',
            command=lambda: self.runThread(self.pageVar.get()))
        recordbutton.pack()

        erasebutton = tk.Button(master,
                                text='Erase Stored Data',
                                command=lambda: self.eraseStoredData())
        erasebutton.pack()

        writeButton = tk.Button(master,
                                text='Write to Excel',
                                command=lambda: self.writeToExcel(
                                    self.fileVar.get(), sheetVar.get()))
        writeButton.pack()

        plotButton = tk.Button(master,
                               text='Plot HP vs Time',
                               command=lambda: self.plotData())
        plotButton.pack()

        stoprecordbutton = tk.Button(master,
                                     text='Stop Recording Data',
                                     command=lambda: self.stopThread())
        stoprecordbutton.pack()

        resetCountbutton = tk.Button(master,
                                     text='Reset Count',
                                     command=lambda: self.resetCount())
        resetCountbutton.pack()

        subject = 'Attritor Data'
        text = 'Test'
        #emailgetter = lambda y: ['*****@*****.**'] if (emailVar.get() is not '') else [emailVar.get()]
        #emailgetter = self.getEmail()
        emailButton = tk.Button(
            master,
            text='Send Email',
            command=lambda: send_mail(
                '*****@*****.**',
                self.getEmail(),
                subject,
                text,
                files=[self.writeToExcel(self.fileVar.get(), sheetVar.get())],
                username='******',
                password='******'))
        emailButton.pack()

        importFileButton = tk.Button(master,
                                     text='Import Files',
                                     command=lambda: self.importFiles())
        importFileButton.pack()

        plotAllDataButton = tk.Button(master,
                                      text='Plot All Data',
                                      command=lambda: self.plotData2())
        plotAllDataButton.pack()

        RunDataButton = tk.Button(master,
                                  text='RunData',
                                  command=lambda: self.updateRunData())
        RunDataButton.pack()

        #Print2Button = tk.Button(master, text = 'Print2', command = lambda: self.writeToExcel2(self.whileCount-30,-1,self.pageVar.get(),self.fileVar.get()))
        #Print2Button.pack()

        NotifyMeButton = tk.Button(master,
                                   text='Change Notification',
                                   command=lambda: self.changeNotifyToFalse())
        NotifyMeButton.pack()

        self.HP_Cut_Off = tk.StringVar()
        self.HP_Cut_Off.set('5.0')
        HP_Cut_OffLabel = tk.Label(master, text='Cut Off HP')
        HP_Cut_OffLabel.pack()
        HP_Cut_OffEntry = tk.Entry(master, textvariable=self.HP_Cut_Off)
        HP_Cut_OffEntry.pack()

        self.TotalRunTime = tk.StringVar()
        totalRunTimeLabel = tk.Label(master, text='Total Run Time')
        totalRunTimeLabel.pack()
        totalRunTimeEntry = tk.Entry(master, textvariable=self.TotalRunTime)
        totalRunTimeEntry.pack()

        self.PowderWeight = tk.StringVar()
        powderWeightLabel = tk.Label(master, text='Powder Weight (kg)')
        powderWeightLabel.pack()
        powderWeightEntry = tk.Entry(master, textvariable=self.PowderWeight)
        powderWeightEntry.pack()

        self.CumulativePower = tk.StringVar()
        CumulativePowerLabel = tk.Label(master, text='Total Power in Joules')
        CumulativePowerLabel.pack()
        CumulativePowerEntry = tk.Entry(master,
                                        textvariable=self.CumulativePower)
        CumulativePowerEntry.pack()

        self.powerStartTime = tk.StringVar()
        self.powerEndTime = tk.StringVar()
Exemplo n.º 11
0
# FENETRE
#Accueil
fenetreAccueil = Tk()
fenetreAccueil.title("Premier pas dans l'eau")

# JOUR
lblJour = Label(fenetreAccueil, text="Jour :").pack()
# Permet de faire une saisie de nombre entre 1 et 31 sans que l'utilisateur ecrire dans le champ
jourSaisie = Spinbox(fenetreAccueil, from_=1, to=31, state="readonly")
jourSaisie.pack()

# MOIS
lblMois = Label(fenetreAccueil, text="Mois :").pack()
# Utilisation de Tix pour faire une liste deroulante
fenetreAccueil.tk.eval('package require Tix')
cbVar = tix.StringVar()
combo = tix.ComboBox(fenetreAccueil,dropdown=1, variable=cbVar)
combo.entry.config(state='readonly')  #Lecture seul dans la zone de text
combo.insert(0, 'Janvier')
combo.insert(1, 'Fevrier')
combo.insert(2, 'Mars')
combo.insert(3, 'Avril')
combo.insert(4, 'Mai')
combo.insert(5, 'Juin')
combo.insert(6, 'Juillet')
combo.insert(7, 'Aout')
combo.insert(8, 'Septembre')
combo.insert(9, 'Octobre')
combo.insert(10, 'Novembre')
combo.insert(11, 'Decembre')
combo.pack()