Lines Matching refs:self
64 def __init__(self, db, row, parent_item): argument
65 self.db = db
66 self.row = row
67 self.parent_item = parent_item
68 self.query_done = False;
69 self.child_count = 0
70 self.child_items = []
71 self.data = ["", "", "", "", "", "", ""]
72 self.comm_id = 0
73 self.thread_id = 0
74 self.call_path_id = 1
75 self.branch_count = 0
76 self.time = 0
78 self.setUpRoot()
80 def setUpRoot(self): argument
81 self.query_done = True
82 query = QSqlQuery(self.db)
89 child_item = TreeItem(self.db, self.child_count, self)
90 self.child_items.append(child_item)
91 self.child_count += 1
94 def setUpLevel1(self, comm_id, comm): argument
95 self.query_done = True;
96 self.comm_id = comm_id
97 self.data[0] = comm
98 self.child_items = []
99 self.child_count = 0
100 query = QSqlQuery(self.db)
105 child_item = TreeItem(self.db, self.child_count, self)
106 self.child_items.append(child_item)
107 self.child_count += 1
110 def setUpLevel2(self, comm_id, thread_id, pid, tid): argument
111 self.comm_id = comm_id
112 self.thread_id = thread_id
113 self.data[0] = str(pid) + ":" + str(tid)
115 def getChildItem(self, row): argument
116 return self.child_items[row]
118 def getParentItem(self): argument
119 return self.parent_item
121 def getRow(self): argument
122 return self.row
124 def timePercent(self, b): argument
125 if not self.time:
127 x = (b * Decimal(100)) / self.time
130 def branchPercent(self, b): argument
131 if not self.branch_count:
133 x = (b * Decimal(100)) / self.branch_count
136 def addChild(self, call_path_id, name, dso, count, time, branch_count): argument
137 child_item = TreeItem(self.db, self.child_count, self)
138 child_item.comm_id = self.comm_id
139 child_item.thread_id = self.thread_id
149 child_item.data[4] = self.timePercent(time)
151 child_item.data[6] = self.branchPercent(branch_count)
152 self.child_items.append(child_item)
153 self.child_count += 1
155 def selectCalls(self): argument
156 self.query_done = True;
157 query = QSqlQuery(self.db)
162 … parent_call_path_id = ' + str(self.call_path_id) + ' AND comm_id = ' + str(self.comm_id) + ' AND …
181 self.addChild(last_call_path_id, name, dso, count, time, branch_count)
191 self.addChild(last_call_path_id, name, dso, count, time, branch_count)
195 if total_branch_count > self.branch_count:
196 self.branch_count = total_branch_count
197 if self.branch_count:
198 for child_item in self.child_items:
199 child_item.data[6] = self.branchPercent(child_item.branch_count)
200 if total_time > self.time:
201 self.time = total_time
202 if self.time:
203 for child_item in self.child_items:
204 child_item.data[4] = self.timePercent(child_item.time)
206 def childCount(self): argument
207 if not self.query_done:
208 self.selectCalls()
209 return self.child_count
211 def columnCount(self): argument
214 def columnHeader(self, column): argument
218 def getData(self, column): argument
219 return self.data[column]
223 def __init__(self, db, parent=None): argument
224 super(TreeModel, self).__init__(parent)
225 self.db = db
226 self.root = TreeItem(db, 0, None)
228 def columnCount(self, parent): argument
229 return self.root.columnCount()
231 def rowCount(self, parent): argument
235 parent_item = self.root
238 def headerData(self, section, orientation, role): argument
246 return self.root.columnHeader(section)
248 def parent(self, child): argument
250 if child_item is self.root:
253 return self.createIndex(parent_item.getRow(), 0, parent_item)
255 def index(self, row, column, parent): argument
259 parent_item = self.root
261 return self.createIndex(row, column, child_item)
263 def data(self, index, role): argument
274 def __init__(self, db, dbname, parent=None): argument
275 super(MainWindow, self).__init__(parent)
277 self.setObjectName("MainWindow")
278 self.setWindowTitle("Call Graph: " + dbname)
279 self.move(100, 100)
280 self.resize(800, 600)
281 style = self.style()
283 self.setWindowIcon(icon);
285 self.model = TreeModel(db)
287 self.view = QTreeView()
288 self.view.setModel(self.model)
290 self.setCentralWidget(self.view)