@@ -1,36 +1,41 | |||||
1 |
#!/usr/bin/lppmon -e |
|
1 | #!/usr/bin/lppmon -e | |
|
2 | ||||
2 |
|
3 | |||
3 | class test(PySocExplorerEngine.socexplorerplugin): |
|
4 | class test(PySocExplorerEngine.socexplorerplugin): | |
4 | m_Layout = QtGui.QGridLayout() |
|
5 | m_Layout = QtGui.QGridLayout() | |
5 | m_CenterWidget = QtGui.QWidget() |
|
6 | m_CenterWidget = QtGui.QWidget() | |
6 | m_hexviewer = PySocExplorer.QHexEdit() |
|
7 | m_hexviewer = PySocExplorer.QHexEdit() | |
7 | m_addressQSPB = PySocExplorer.QHexSpinBox() |
|
8 | m_addressQSPB = PySocExplorer.QHexSpinBox() | |
8 | m_readQPB = QtGui.QPushButton("read") |
|
9 | m_readQPB = QtGui.QPushButton("read") | |
9 | m_writeQPB = QtGui.QPushButton("write") |
|
10 | m_writeQPB = QtGui.QPushButton("write") | |
10 |
|
11 | |||
11 | def postInstantiationTrigger(self): |
|
12 | def postInstantiationTrigger(self): | |
12 |
print |
|
13 | print("building GUI") | |
13 | self.setWidget(self.m_CenterWidget) |
|
14 | self.setWidget(self.m_CenterWidget) | |
14 | self.m_CenterWidget.setLayout(self.m_Layout) |
|
15 | self.m_CenterWidget.setLayout(self.m_Layout) | |
15 | self.m_Layout.addWidget(self.m_addressQSPB,0,0,1,1) |
|
16 | self.m_Layout.addWidget(self.m_addressQSPB, 0, 0, 1, 1) | |
16 | self.m_Layout.addWidget(self.m_readQPB,0,1,1,1) |
|
17 | self.m_Layout.addWidget(self.m_readQPB, 0, 1, 1, 1) | |
17 | self.m_Layout.addWidget(self.m_writeQPB,0,2,1,1) |
|
18 | self.m_Layout.addWidget(self.m_writeQPB, 0, 2, 1, 1) | |
18 | self.m_Layout.addWidget(self.m_hexviewer,1,0,1,-1) |
|
19 | self.m_Layout.addWidget(self.m_hexviewer, 1, 0, 1, -1) | |
|
20 | ||||
19 | def hello(self): |
|
21 | def hello(self): | |
20 |
print |
|
22 | print("hello") | |
|
23 | ||||
21 | def VID(self): |
|
24 | def VID(self): | |
22 | return 10 |
|
25 | return 10 | |
|
26 | ||||
23 | def PID(self): |
|
27 | def PID(self): | |
24 | return 100 |
|
28 | return 100 | |
|
29 | ||||
25 | def readData(self): |
|
30 | def readData(self): | |
26 | bufferQBA = QtCore.QByteArray() |
|
31 | bufferQBA = QtCore.QByteArray() | |
27 | buffer = self.parentPlugin().Read(self.m_addressQSPB.value,16*1024) |
|
32 | buffer = self.parentPlugin().Read(self.m_addressQSPB.value, 16*1024) | |
28 | for i in range(0,16*1024): |
|
33 | for i in range(0, 16*1024): | |
29 | bufferQBA.append(int(buffer[i])) |
|
34 | bufferQBA.append(int(buffer[i])) | |
30 | bufferQBA.append(int(buffer[i])) |
|
35 | bufferQBA.append(int(buffer[i])) | |
31 | bufferQBA.append(int(buffer[i])) |
|
36 | bufferQBA.append(int(buffer[i])) | |
32 | bufferQBA.append(int(buffer[i])) |
|
37 | bufferQBA.append(int(buffer[i])) | |
33 | self.m_hexviewer.setData(bufferQBA) |
|
38 | self.m_hexviewer.setData(bufferQBA) | |
34 |
|
39 | |||
35 |
|
40 | |||
36 |
|
41 |
General Comments 0
You need to be logged in to leave comments.
Login now