예제 #1
0
def main():
    root = theme().addColor()
    root.title('VSG VSA Frequency Sweep')

    ### Create Sections
    root.entryCol = entryCol(root, entryDict)
    root.toppWind = listWindow(root)
    root.bottWind = listWindow(root)
    root.bottWind.stdOut()  #Stdout --> window
    root.buttnRow = buttonRow(root, 3)  #pylint: disable=unused-variable

    ### Define Sections
    root.entryCol.frame.config(width=50)
    root.toppWind.listWindow.config(height=20, width=40)
    root.toppWind.writeH("===Please Click Buttons Below===")

    root.bottWind.listWindow.config(height=7, width=66)
    root.buttnRow.button0.config(text='*IDN?', command=lambda: IDN(root))  #pylint: disable=E1101
    root.buttnRow.button1.config(text='Run', command=lambda: run(root))  #pylint: disable=E1101
    root.buttnRow.button2.config(text='Folder', command=lambda: openF(root))  #pylint: disable=E1101

    ### Grid Sections
    root.grid_rowconfigure(2, weight=1)
    root.entryCol.frame.grid(row=0, column=0, sticky="ns")
    root.toppWind.frame.grid(row=0, column=1, sticky='e')
    root.bottWind.frame.grid(row=1, column=0, columnspan=2, sticky='nsew')
    root.buttnRow.frame.grid(row=2, column=0, columnspan=2, sticky="nsew")
    root.mainloop()
예제 #2
0
def main():
    """Main Function"""
    # global root
    root = theme().addColor()
    root.title('Socket Test Program')
    root.resizable(0, 0)

    ###########################################################################
    ### guiBlox: Create Widgets
    ###########################################################################
    root.entryCol1 = entryCol(root, {'SMW-IP': '192.168.1.114'})
    root.entryCol2 = entryCol(root, {'FSW-IP': '192.168.1.109'})
    root.SCPI1 = listWindow(root).writeN('SYST:ERR?')
    root.SCPI2 = listWindow(root).writeN(FSW_SCPI)

    root.bottWind = listWindow(root)
    root.bottWind.stdOut()  #Stdout --> window
    root.btnRowTop = buttonRow(root, 2, makequit=0)  #pylint: disable=unused-variable
    root.btnRowBot = buttonRow(root, 5)  #pylint: disable=unused-variable
    clrBottom(root)

    ###########################################################################
    ### guiBlox: Customize Widgets
    ###########################################################################
    root.entryCol1.entry0.bind("<Double-Button-1>", IDN)  #pylint: disable=E1101
    root.entryCol2.entry0.bind("<Double-Button-1>", IDN)  #pylint: disable=E1101
    root.entryCol1.entry0.bind("<Button-3>", SYSTERR)  #pylint: disable=E1101
    root.entryCol2.entry0.bind("<Button-3>", SYSTERR)  #pylint: disable=E1101
    root.entryCol1.entry0.bind("<Double-Button-3>", SYSTNFO)  #pylint: disable=E1101
    root.entryCol2.entry0.bind("<Double-Button-3>", SYSTNFO)  #pylint: disable=E1101

    root.SCPI1.listWindow.config(width=SCPIWidth, height=SCPIHeigh)
    root.SCPI2.listWindow.config(width=SCPIWidth, height=SCPIHeigh)

    root.bottWind.listWindow.config(height=10, width=(2 * SCPIWidth + 2))
    root.btnRowTop.button0.config(text='Query', command=lambda: instr1(root))  #pylint: disable=E1101
    root.btnRowTop.button1.config(text='Query', command=lambda: instr2(root))  #pylint: disable=E1101

    root.btnRowBot.button0.config(text='write File',
                                  command=lambda: fwrite(root))  #pylint: disable=E1101
    root.btnRowBot.button1.config(text='open File', command=fopen)  #pylint: disable=E1101
    root.btnRowBot.button2.config(text='clear',
                                  command=lambda: clrBottom(root))  #pylint: disable=E1101
    root.btnRowBot.button3.config(text='MyIP', command=MyIp)  #pylint: disable=E1101
    root.btnRowBot.button4.config(text='FSWSave',
                                  command=lambda: SaveSetts(root))  #pylint: disable=E1101

    ###########################################################################
    ### guiBlox: Place Widgets
    ###########################################################################
    root.grid_rowconfigure(2, weight=1)
    root.entryCol1.frame.grid(row=0, column=0, sticky="ns")
    root.entryCol2.frame.grid(row=0, column=1, sticky="ns")
    root.SCPI1.frame.grid(row=1, column=0, sticky='ew')
    root.SCPI2.frame.grid(row=1, column=1, sticky='ew')
    root.btnRowTop.frame.grid(row=2, column=0, columnspan=3, sticky="nsew")
    root.bottWind.frame.grid(row=3, column=0, columnspan=3, sticky='nsew')
    root.btnRowBot.frame.grid(row=10, column=0, columnspan=3, sticky="nsew")

    root.mainloop()
예제 #3
0
def main():
    """main"""
    root = theme().addColor()
    root.title('Rohde & Schwarz Options')
    root.resizable(0, 0)

    ###########################################################################
    ### guiBlox: Create Widgets
    ###########################################################################
    root.entryCol1 = entryCol(root, {'Instr': '10.0.0.10'})
    root.SCPI1 = listWindow(root).writeN('*IDN?\n*OPT?\nSYST:DFPR?\n')

    root.bottWind = listWindow(root)
    root.bottWind.stdOut()  #Stdout --> window
    root.btnRowTop = buttonRow(root, 1, makequit=0)  #pylint: disable=unused-variable
    root.btnRowBot = buttonRow(root, 3)  #pylint: disable=unused-variable
    clrBottom(root)

    ###########################################################################
    ### guiBlox: Customize Widgets
    ###########################################################################
    root.entryCol1.entry0.bind("<Double-Button-1>", IDN)  #pylint: disable=E1101
    root.entryCol1.entry0.bind("<Button-3>", SYSTERR)  #pylint: disable=E1101
    root.entryCol1.entry0.bind("<Double-Button-3>", SYSTNFO)  #pylint: disable=E1101

    root.SCPI1.listWindow.config(width=SCPIWidth, height=5)

    root.bottWind.listWindow.config(height=15, width=(SCPIWidth))
    root.btnRowTop.button0.config(text='Query', command=lambda: instr1(root))  #pylint: disable=E1101

    root.btnRowBot.button0.config(text='write File',
                                  command=lambda: fwrite(root))  #pylint: disable=E1101
    root.btnRowBot.button1.config(text='open File', command=lambda: fopen())  #pylint: disable=E1101
    root.btnRowBot.button2.config(text='clear',
                                  command=lambda: clrBottom(root))  #pylint: disable=E1101

    ###########################################################################
    ### guiBlox: Place Widgets
    ###########################################################################
    root.grid_rowconfigure(2, weight=1)
    root.entryCol1.frame.grid(row=0, column=0, sticky="ns")
    root.SCPI1.frame.grid(row=1, column=0, sticky='ew')
    root.btnRowTop.frame.grid(row=2, column=0, columnspan=2, sticky="nsew")
    root.bottWind.frame.grid(row=3, column=0, columnspan=2, sticky='nsew')
    root.btnRowBot.frame.grid(row=10, column=0, columnspan=2, sticky="nsew")

    root.mainloop()
예제 #4
0
def main():
    """docstring"""
    ### guiblox: Create Tk GUI object
    root = theme().addColor()  # Create GUI object
    root.title('guiblox Example')  # Opt: Specify title
    root.resizable(0, 0)  # Opt: Disables resizing
    root.geometry("600x300")  # Opt: specify x/y size
    # root.iconbitmap('guiblox.ico')                    # Opt: specify icon

    ###########################################################################
    ### guiBlox: Create Widgets
    ###########################################################################
    root.entryCol = entryCol(root, entryDict)  # Create entry fields Col
    root.toppWind = listWindow(root)  # Create top text box
    root.bottWind = listWindow(root)  # Create bottom text box
    root.bottWind.stdOut()  # Print --> bottWind
    root.buttnRow = buttonRow(root, 3)  # pylint: disable=unused-variable

    ###########################################################################
    ### guiblox: Customize behavior
    ###########################################################################
    root.entryCol.frame.config(width=100)
    root.entryCol.chg2Enum('entry2',
                           ['Opt1', 'Opt2'])  # Chg entry2 to pull down
    root.entryCol.entry2_enum.set('Opt1')  # entry2 default value
    root.entryCol.entry0.bind("<Double-Button-1>", IDN)

    root.toppWind.listWindow.config(height=10, width=40)
    root.bottWind.listWindow.config(height=5, width=66)
    root.buttnRow.button0.config(text='Get Data1',
                                 command=lambda: buttonfunc1(root))  #pylint: disable=E1101
    root.buttnRow.button1.config(text='clear',
                                 command=lambda: buttonfunc2(root))  #pylint: disable=E1101
    root.buttnRow.button2.config(text='Print Normal',
                                 command=lambda: buttonfunc3(root))  #pylint: disable=E1101

    ###########################################################################
    ### guiblox: draw elements
    ###########################################################################
    root.grid_rowconfigure(2, weight=1)
    root.entryCol.frame.grid(row=0, column=0, sticky="ns")
    root.toppWind.frame.grid(row=0, column=1, sticky='e')
    root.bottWind.frame.grid(row=1, column=0, columnspan=2)
    root.buttnRow.frame.grid(row=2, column=0, columnspan=2, sticky="nsew")
    root.mainloop()
예제 #5
0
파일: IQConvert.py 프로젝트: mclim9/guiBlox
def main():
    """main"""
    # global root
    root = theme().addColor()
    root.title('Socket Test Program')
    root.resizable(0, 0)

    ### Create Sections
    root.files = entryCol(
        root, {
            'Input File': 'Input.txt',
            'Input Type': 'iq.tar',
            'Output File': 'Output.txt',
            'Output Type': 'iq.tar'
        })
    root.bottWind = listWindow(root)
    root.bottWind.stdOut()  #Stdout --> window
    root.buttnRow = buttonRow(root, 2)  #pylint: disable=unused-variable

    ### Define Sections
    widdy = 45
    root.files.chg2Enum('entry1', ['iq.tar', 'iqw', 'wv'])
    root.files.chg2Enum('entry3', ['iq.tar', 'iqw', 'wv'])

    root.files.entry0.bind("<Button-1>", getFilename)  #pylint: disable=E1101
    root.files.entry2.bind("<Button-1>", getFilename)  #pylint: disable=E1101
    root.files.entry0.config(width=widdy)  #pylint: disable=E1101
    root.files.entry1.config(width=widdy - 7)  #pylint: disable=E1101
    root.files.entry2.config(width=widdy)  #pylint: disable=E1101
    root.files.entry3.config(width=widdy - 7)  #pylint: disable=E1101

    root.bottWind.listWindow.config(height=5, width=50)
    root.buttnRow.button0.config(text='Convert', command=lambda: convert(root))  #pylint: disable=E1101
    root.buttnRow.button1.config(text='Convert', command=lambda: convert(root))  #pylint: disable=E1101

    ### Grid Sections
    root.files.frame.grid(row=0, column=0, sticky="ns")
    root.bottWind.frame.grid(row=3, column=0, sticky='ns')
    root.buttnRow.frame.grid(row=20, column=0, columnspan=3, sticky="nsew")
    root.mainloop()
예제 #6
0
def main():
    """main"""
    root = theme().addColor()
    root.title('Notebook Test Program')

    ###########################################################################
    ### guiBlox: Create Widgets
    ###########################################################################
    note = Notebook(root)
    tab1 = Frame(note)
    tab2 = Frame(note)
    tab3 = Frame(note)

    note.add(tab1, text="Tab1")
    note.add(tab2, text="Tab2")
    note.add(tab3, text="Tab3")

    ###########################################################################
    ### guiBlox: Place Widgets
    ###########################################################################
    note.grid(row=0, column=0, sticky="nsew")
    root.mainloop()
예제 #7
0
 def setUp(self):  #Run before each test
     from guiblox import theme
     self.GUI = theme().addColor()  #Create GUI object
     print("", end="")
예제 #8
0
entryDict['FSW IP']         = '192.168.1.109'
entryDict['Frequency']      = '28e9'
entryDict['SMW Power,RMS']  = '-5'
entryDict['Direction']      = 'UL'
entryDict['Freq Band']      = 'HIGH'
entryDict['Ch BW,MHz']      = '100'
entryDict['SubCarr,kHz']    = '60'
entryDict['RB']             = '132'
entryDict['RB Offset']      = '0'
entryDict['Modulation']     = 'QPSK'
entryDict['CC']             = '1'

###############################################################################
### GUIBlox Create items
###############################################################################
GUI = theme().addColor()                            #Create GUI object
GUI.title('Rohde&Schwarz FSW SMW 5GNR Utility')     #GUI Title
topWind  = listWindow(GUI)
botWind  = listWindow(GUI)
buttnRow = buttonRow(GUI, 6)                        #pylint: disable=unused-variable
entryCol = entryCol(GUI, entryDict)

###############################################################################
### GUI Functions
###############################################################################
class GUIData(object):
    """Class to store data"""
    def __init__(self):
        self.List1 = ['- Utility does not validate settings against 3GPP 5G',
                      '- Click *IDN? to validate IP Addresses',
                      '- Frequency & SMW Power labels are clickable',
예제 #9
0
        return self


class StdoutRedirector(object):
    """docstring"""
    def __init__(self, text_area):
        """docstring"""
        self.text_area = text_area

    def write(self, writeString):
        """redirecting stdout to this Text widget"""
        self.text_area.insert("end", writeString)
        self.text_area.see(END)
        self.text_area.master.update()

    def flush(self):
        """docstring"""
        sys.stdout = sys.__stdout__  #Send Stdout back to terminal


if __name__ == '__main__':
    root = theme().addColor()
    app = listWindow(root)  #pylint: disable=unused-variable
    app.stdOut()
    app.listWindow.config(width=20, height=7)
    for i in range(2):
        print(2355345)
        app.writeH('asdfasdf')
        app.writeN(1234)
    root.mainloop()