Exemplo n.º 1
0
 def __init__(self):
     QtGui.QDialog.__init__(self) # calls QDialog constructor
     self.parser = HTMLDocsParser() # creates instance of HTMLDocsParser class
     self.ui = Ui_Dialog() # creates instance of Ui_Dialog class, sets to var ui
     self.ui.setupUi(self) # calls setupUi method in Ui_Dialog class to setup UI
     self.setWindowTitle("Parameter Dialog") # sets title of dialog box
     self.ui.SendButton_1.clicked.connect(self.ProcessSendButton) # connects button to method
Exemplo n.º 2
0
class Parameter(QtGui.QDialog):

    #
    # Initializes Parameter class
    #
    def __init__(self):
        QtGui.QDialog.__init__(self) # calls QDialog constructor
        self.parser = HTMLDocsParser() # creates instance of HTMLDocsParser class
        self.ui = Ui_Dialog() # creates instance of Ui_Dialog class, sets to var ui
        self.ui.setupUi(self) # calls setupUi method in Ui_Dialog class to setup UI
        self.setWindowTitle("Parameter Dialog") # sets title of dialog box
        self.ui.SendButton_1.clicked.connect(self.ProcessSendButton) # connects button to method

    # 
    # Button method
    #
    def ProcessSendButton(self):
        field1 = self.ui.input_1
        field2 = self.ui.input_2
        field3 = self.ui.input_3
        field4 = self.ui.input_4
        field5 = self.ui.input_5
        field6 = self.ui.input_6
        field7 = self.ui.input_7
        field8 = self.ui.input_8
        field9 = self.ui.input_9
        field10 = self.ui.input_10

        input1 = str(field1.toPlainText()).strip()
        input2 = str(field2.toPlainText()).strip()
        input3 = str(field3.toPlainText()).strip()
        input4 = str(field4.toPlainText()).strip()
        input5 = str(field5.toPlainText()).strip()
        input6 = str(field6.toPlainText()).strip()
        input7 = str(field7.toPlainText()).strip()
        input8 = str(field8.toPlainText()).strip()
        input9 = str(field9.toPlainText()).strip()
        input10 = str(field10.toPlainText()).strip()

        input_list = [input1, input2, input3, input4, input5, input6, input7, input8, input9, input10]

        i = 0
        param_list = []
        while input_list[i] != '':
            dataType = dataTypesNew[i]
            if dataType == '--string':
                param_list.append(dataType+'=\"'+stringLen[i]+':'+input_list[i]+'\"') 
            else:
                param_list.append(dataType+'='+input_list[i]) # --byte=4
            i += 1
        param_string = ' '.join(param_list)
        # print param_string
        prog = '../cmdUtil/cmdUtil'
        launch_string = prog + ' --host=' + pageAddress + ' --port=' + str(pagePort) + ' --pktid=' + str(pagePktId) + ' --endian=' + pageEndian + ' --cmdcode=' + cmdCode + ' ' + param_string.strip()
        # print launch_string
        cmd_args = shlex.split(launch_string)
        subprocess.Popen(cmd_args)
        self.ui.status_box.setText('Command sent!')
Exemplo n.º 3
0
class Parameter(QtGui.QDialog):

    #
    # Initializes Parameter class
    #
    def __init__(self):
        QtGui.QDialog.__init__(self) # calls QDialog constructor
        self.parser = HTMLDocsParser() # creates instance of HTMLDocsParser class
        self.ui = Ui_Dialog() # creates instance of Ui_Dialog class, sets to var ui
        self.ui.setupUi(self) # calls setupUi method in Ui_Dialog class to setup UI
        self.setWindowTitle("Parameter Dialog") # sets title of dialog box
        self.ui.SendButton_1.clicked.connect(self.ProcessSendButton) # connects button to method

    # 
    # Button method
    #
    def ProcessSendButton(self):
        field1 = self.ui.input_1
        field2 = self.ui.input_2
        field3 = self.ui.input_3
        field4 = self.ui.input_4
        field5 = self.ui.input_5
        field6 = self.ui.input_6
        field7 = self.ui.input_7
        field8 = self.ui.input_8
        field9 = self.ui.input_9
        field10 = self.ui.input_10

        input1 = str(field1.toPlainText()).strip()
        input2 = str(field2.toPlainText()).strip()
        input3 = str(field3.toPlainText()).strip()
        input4 = str(field4.toPlainText()).strip()
        input5 = str(field5.toPlainText()).strip()
        input6 = str(field6.toPlainText()).strip()
        input7 = str(field7.toPlainText()).strip()
        input8 = str(field8.toPlainText()).strip()
        input9 = str(field9.toPlainText()).strip()
        input10 = str(field10.toPlainText()).strip()

        input_list = [input1, input2, input3, input4, input5, input6, input7, input8, input9, input10]

        i = 0
        param_list = []
        while input_list[i] != '':
            dataType = dataTypesNew[i]
            if dataType == '--string':
                param_list.append(dataType+'=\"'+stringLen[i]+':'+input_list[i]+'\"') 
            else:
                param_list.append(dataType+'='+input_list[i]) # --byte=4
            i += 1
        param_string = ' '.join(param_list)
        # print param_string
        prog = '../cmdUtil/cmdUtil'
        launch_string = prog + ' --host=' + pageAddress + ' --port=' + str(pagePort) + ' --pktid=' + str(pagePktId) + ' --endian=' + pageEndian + ' --cmdcode=' + cmdCode + ' ' + param_string.strip()
        # print launch_string
        cmd_args = shlex.split(launch_string)
        subprocess.Popen(cmd_args)
        self.ui.status_box.setText('Command sent!')
Exemplo n.º 4
0
 def __init__(self):
     QtGui.QDialog.__init__(self) # calls QDialog constructor
     self.parser = HTMLDocsParser() # creates instance of HTMLDocsParser class
     self.ui = Ui_Dialog() # creates instance of Ui_Dialog class, sets to var ui
     self.ui.setupUi(self) # calls setupUi method in Ui_Dialog class to setup UI
     self.setWindowTitle("Parameter Dialog") # sets title of dialog box
     self.ui.SendButton_1.clicked.connect(self.ProcessSendButton) # connects button to method