00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 from qt import *
00012 from qttable import QTable
00013
00014
00015 class GUIcreatePort(QDialog):
00016 def __init__(self,parent = None,name = None,modal = 0,fl = 0):
00017 QDialog.__init__(self,parent,name,modal,fl)
00018
00019 if not name:
00020 self.setName("GUIcreatePort")
00021
00022
00023 GUIcreatePortLayout = QGridLayout(self,1,1,11,6,"GUIcreatePortLayout")
00024
00025 self.cancelbutton = QPushButton(self,"cancelbutton")
00026
00027 GUIcreatePortLayout.addWidget(self.cancelbutton,4,4)
00028
00029 self.okbutton = QPushButton(self,"okbutton")
00030
00031 GUIcreatePortLayout.addWidget(self.okbutton,4,3)
00032 spacer2 = QSpacerItem(421,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
00033 GUIcreatePortLayout.addMultiCell(spacer2,4,4,0,2)
00034
00035 self.table = QTable(self,"table")
00036 self.table.setNumCols(self.table.numCols() + 1)
00037 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("Device Name"))
00038 self.table.setNumCols(self.table.numCols() + 1)
00039 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("Port Nr"))
00040 self.table.setNumCols(self.table.numCols() + 1)
00041 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("Port Type"))
00042 self.table.setNumCols(self.table.numCols() + 1)
00043 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("Port Way"))
00044 self.table.setNumCols(self.table.numCols() + 1)
00045 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("Port Speed"))
00046 self.table.setNumCols(self.table.numCols() + 1)
00047 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("PXI?"))
00048 self.table.setNumCols(self.table.numCols() + 1)
00049 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("OK?"))
00050 self.table.setNumCols(self.table.numCols() + 1)
00051 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("Phy"))
00052 self.table.setNumCols(self.table.numCols() + 1)
00053 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("MAC Adress"))
00054 self.table.setNumCols(self.table.numCols() + 1)
00055 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("IP Adress"))
00056 self.table.setNumCols(self.table.numCols() + 1)
00057 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("Sub net"))
00058 self.table.setNumCols(self.table.numCols() + 1)
00059 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("IP Name"))
00060 self.table.setNumCols(self.table.numCols() + 1)
00061 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("Bia"))
00062 self.table.setNumCols(self.table.numCols() + 1)
00063 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("PortID"))
00064 self.table.setNumCols(self.table.numCols() + 1)
00065 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("Modified"))
00066 self.table.setNumCols(self.table.numCols() + 1)
00067 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("Modify parameters"))
00068 self.table.setNumCols(self.table.numCols() + 1)
00069 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("Old IP"))
00070 self.table.setNumCols(self.table.numCols() + 1)
00071 self.table.horizontalHeader().setLabel(self.table.numCols() - 1,self.__tr("Save Satus"))
00072 self.table.setNumRows(0)
00073 self.table.setNumCols(18)
00074
00075 GUIcreatePortLayout.addMultiCellWidget(self.table,3,3,0,4)
00076
00077 self.removebutton = QPushButton(self,"removebutton")
00078
00079 GUIcreatePortLayout.addWidget(self.removebutton,2,0)
00080 spacer1 = QSpacerItem(351,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
00081 GUIcreatePortLayout.addMultiCell(spacer1,2,2,1,3)
00082
00083 self.addportbutton = QPushButton(self,"addportbutton")
00084
00085 GUIcreatePortLayout.addMultiCellWidget(self.addportbutton,1,1,0,4)
00086
00087 self.buttonGroup3 = QButtonGroup(self,"buttonGroup3")
00088
00089 self.textLabel2 = QLabel(self.buttonGroup3,"textLabel2")
00090 self.textLabel2.setGeometry(QRect(11,11,126,16))
00091
00092 self.textLabel2_2_2 = QLabel(self.buttonGroup3,"textLabel2_2_2")
00093 self.textLabel2_2_2.setGeometry(QRect(10,60,156,16))
00094
00095 self.porttype = QLineEdit(self.buttonGroup3,"porttype")
00096 self.porttype.setGeometry(QRect(10,80,150,22))
00097 self.porttype.setMaximumSize(QSize(200,32767))
00098
00099 self.textLabel2_2_3 = QLabel(self.buttonGroup3,"textLabel2_2_3")
00100 self.textLabel2_2_3.setGeometry(QRect(100,110,21,16))
00101
00102 self.textLabel2_2_3_2 = QLabel(self.buttonGroup3,"textLabel2_2_3_2")
00103 self.textLabel2_2_3_2.setGeometry(QRect(10,110,56,16))
00104
00105 self.textLabel2_2_2_2 = QLabel(self.buttonGroup3,"textLabel2_2_2_2")
00106 self.textLabel2_2_2_2.setGeometry(QRect(194,11,40,16))
00107
00108 self.textLabel2_2 = QLabel(self.buttonGroup3,"textLabel2_2")
00109 self.textLabel2_2.setGeometry(QRect(190,60,80,16))
00110
00111 self.admstatus = QCheckBox(self.buttonGroup3,"admstatus")
00112 self.admstatus.setGeometry(QRect(100,170,77,20))
00113
00114 self.buttonGroup1 = QButtonGroup(self.buttonGroup3,"buttonGroup1")
00115 self.buttonGroup1.setGeometry(QRect(190,110,100,80))
00116
00117 self.portwayOUT = QRadioButton(self.buttonGroup1,"portwayOUT")
00118 self.portwayOUT.setGeometry(QRect(30,40,40,20))
00119
00120 self.portwayIN = QRadioButton(self.buttonGroup1,"portwayIN")
00121 self.portwayIN.setGeometry(QRect(30,20,30,20))
00122
00123 self.portid = QLineEdit(self.buttonGroup3,"portid")
00124 self.portid.setGeometry(QRect(195,30,100,22))
00125 self.portid.setMaximumSize(QSize(200,32767))
00126
00127 self.portnumber = QSpinBox(self.buttonGroup3,"portnumber")
00128 self.portnumber.setGeometry(QRect(189,79,90,22))
00129 self.portnumber.setMaxValue(10000)
00130
00131 self.portspeed = QSpinBox(self.buttonGroup3,"portspeed")
00132 self.portspeed.setGeometry(QRect(10,130,80,22))
00133 self.portspeed.setMaximumSize(QSize(200,32767))
00134 self.portspeed.setMaxValue(100000)
00135
00136 self.devicename = QLineEdit(self.buttonGroup3,"devicename")
00137 self.devicename.setGeometry(QRect(11,31,150,22))
00138
00139 self.phy = QComboBox(0,self.buttonGroup3,"phy")
00140 self.phy.setGeometry(QRect(100,130,78,22))
00141
00142 self.pxibooting = QCheckBox(self.buttonGroup3,"pxibooting")
00143 self.pxibooting.setGeometry(QRect(10,170,77,20))
00144
00145 GUIcreatePortLayout.addMultiCellWidget(self.buttonGroup3,0,0,0,1)
00146
00147 self.buttonGroup2 = QButtonGroup(self,"buttonGroup2")
00148 self.buttonGroup2.setSizePolicy(QSizePolicy(4,0,0,0,self.buttonGroup2.sizePolicy().hasHeightForWidth()))
00149
00150 self.textLabel2_3_2_3_2 = QLabel(self.buttonGroup2,"textLabel2_3_2_3_2")
00151 self.textLabel2_3_2_3_2.setGeometry(QRect(10,140,50,16))
00152
00153 self.textLabel2_3_2_3 = QLabel(self.buttonGroup2,"textLabel2_3_2_3")
00154 self.textLabel2_3_2_3.setGeometry(QRect(10,110,50,16))
00155
00156 self.textLabel2_3_2_2 = QLabel(self.buttonGroup2,"textLabel2_3_2_2")
00157 self.textLabel2_3_2_2.setGeometry(QRect(10,80,80,16))
00158
00159 self.textLabel2_3_2 = QLabel(self.buttonGroup2,"textLabel2_3_2")
00160 self.textLabel2_3_2.setGeometry(QRect(10,50,60,16))
00161
00162 self.textLabel2_3 = QLabel(self.buttonGroup2,"textLabel2_3")
00163 self.textLabel2_3.setGeometry(QRect(10,20,70,16))
00164
00165 self.macadress = QLineEdit(self.buttonGroup2,"macadress")
00166 self.macadress.setGeometry(QRect(90,20,180,22))
00167
00168 self.ipadress = QLineEdit(self.buttonGroup2,"ipadress")
00169 self.ipadress.setGeometry(QRect(90,50,180,22))
00170
00171 self.subnetadress = QLineEdit(self.buttonGroup2,"subnetadress")
00172 self.subnetadress.setGeometry(QRect(90,80,180,22))
00173
00174 self.ipname = QLineEdit(self.buttonGroup2,"ipname")
00175 self.ipname.setGeometry(QRect(90,110,180,22))
00176
00177 self.bia = QLineEdit(self.buttonGroup2,"bia")
00178 self.bia.setGeometry(QRect(90,140,180,22))
00179
00180 GUIcreatePortLayout.addMultiCellWidget(self.buttonGroup2,0,0,2,4)
00181
00182 self.languageChange()
00183
00184 self.resize(QSize(645,548).expandedTo(self.minimumSizeHint()))
00185 self.clearWState(Qt.WState_Polished)
00186
00187 self.setTabOrder(self.table,self.devicename)
00188 self.setTabOrder(self.devicename,self.portid)
00189 self.setTabOrder(self.portid,self.porttype)
00190 self.setTabOrder(self.porttype,self.portnumber)
00191 self.setTabOrder(self.portnumber,self.portspeed)
00192 self.setTabOrder(self.portspeed,self.phy)
00193 self.setTabOrder(self.phy,self.portwayIN)
00194 self.setTabOrder(self.portwayIN,self.portwayOUT)
00195 self.setTabOrder(self.portwayOUT,self.pxibooting)
00196 self.setTabOrder(self.pxibooting,self.admstatus)
00197 self.setTabOrder(self.admstatus,self.macadress)
00198 self.setTabOrder(self.macadress,self.ipadress)
00199 self.setTabOrder(self.ipadress,self.subnetadress)
00200 self.setTabOrder(self.subnetadress,self.ipname)
00201 self.setTabOrder(self.ipname,self.bia)
00202 self.setTabOrder(self.bia,self.addportbutton)
00203 self.setTabOrder(self.addportbutton,self.removebutton)
00204 self.setTabOrder(self.removebutton,self.okbutton)
00205 self.setTabOrder(self.okbutton,self.cancelbutton)
00206
00207
00208 def languageChange(self):
00209 self.setCaption(self.__tr("Create Port(s)"))
00210 self.cancelbutton.setText(self.__tr("Cancel"))
00211 self.okbutton.setText(self.__tr("Ok"))
00212 self.table.horizontalHeader().setLabel(0,self.__tr("Device Name"))
00213 self.table.horizontalHeader().setLabel(1,self.__tr("Port Nr"))
00214 self.table.horizontalHeader().setLabel(2,self.__tr("Port Type"))
00215 self.table.horizontalHeader().setLabel(3,self.__tr("Port Way"))
00216 self.table.horizontalHeader().setLabel(4,self.__tr("Port Speed"))
00217 self.table.horizontalHeader().setLabel(5,self.__tr("PXI?"))
00218 self.table.horizontalHeader().setLabel(6,self.__tr("OK?"))
00219 self.table.horizontalHeader().setLabel(7,self.__tr("Phy"))
00220 self.table.horizontalHeader().setLabel(8,self.__tr("MAC Adress"))
00221 self.table.horizontalHeader().setLabel(9,self.__tr("IP Adress"))
00222 self.table.horizontalHeader().setLabel(10,self.__tr("Sub net"))
00223 self.table.horizontalHeader().setLabel(11,self.__tr("IP Name"))
00224 self.table.horizontalHeader().setLabel(12,self.__tr("Bia"))
00225 self.table.horizontalHeader().setLabel(13,self.__tr("PortID"))
00226 self.table.horizontalHeader().setLabel(14,self.__tr("Modified"))
00227 self.table.horizontalHeader().setLabel(15,self.__tr("Modify parameters"))
00228 self.table.horizontalHeader().setLabel(16,self.__tr("Old IP"))
00229 self.table.horizontalHeader().setLabel(17,self.__tr("Save Satus"))
00230 self.removebutton.setText(self.__tr("Remove"))
00231 self.addportbutton.setText(self.__tr("Add Port"))
00232 self.buttonGroup3.setTitle(self.__tr("General :"))
00233 self.textLabel2.setText(self.__tr("Device Name(s):"))
00234 self.textLabel2_2_2.setText(self.__tr("Port Type(s):"))
00235 self.textLabel2_2_3.setText(self.__tr("Phy:"))
00236 self.textLabel2_2_3_2.setText(self.__tr("Port Speed:"))
00237 self.textLabel2_2_2_2.setText(self.__tr("Port ID:"))
00238 self.textLabel2_2.setText(self.__tr("Port Number(s):"))
00239 self.admstatus.setText(self.__tr("Adm Status"))
00240 self.buttonGroup1.setTitle(self.__tr("Port Way :"))
00241 self.portwayOUT.setText(self.__tr("Out"))
00242 self.portwayIN.setText(self.__tr("In"))
00243 self.pxibooting.setText(self.__tr("PXI Booting"))
00244 self.buttonGroup2.setTitle(self.__tr("Network :"))
00245 self.textLabel2_3_2_3_2.setText(self.__tr("Bia:"))
00246 self.textLabel2_3_2_3.setText(self.__tr("IP Name:"))
00247 self.textLabel2_3_2_2.setText(self.__tr("Subnet Adress:"))
00248 self.textLabel2_3_2.setText(self.__tr("IP Adress:"))
00249 self.textLabel2_3.setText(self.__tr("MAC Adress:"))
00250
00251
00252 def __tr(self,s,c = None):
00253 return qApp.translate("GUIcreatePort",s,c)
00254
00255