def addValue(self, type_, val): if self.type != type_: self.type = type_ if type_ == "int": self.values.append(int(val)) elif type_ == "bool": self.values.append(cpp2py(val)) elif type_ == "float" or self.type == "double": self.values.append(float(val))
def _setProgress(self): if not self._elaborationDone or not self._inSimulatorControl: return if not cpp2py(self._elaborationDone.value) and not cpp2py(self._inSimulatorControl.value): self.ui.progress.setValue(0) self.ui.progress.setFormat("Elaboration") elif cpp2py(self._elaborationDone.value) and cpp2py(self._inSimulatorControl.value): self.ui.progress.setValue(1) self.ui.progress.setFormat("Simulation") elif cpp2py(self._elaborationDone.value) and not cpp2py(self._inSimulatorControl.value): self.ui.progress.setValue(2) self.ui.progress.setFormat("Finished") else: self.ui.progress.setValue(0) self.ui.progress.setFormat("")
def update(self): if not self.ctx_found and self.ctx is None: self.__findSimContext() if self.ctx is None: return else: # don't try to analyze if elaboration is not done if not cpp2py(self.ctx["m_elaboration_done"].value): return # prepare for easy information collection object_vec = self.ctx["m_child_objects"] # find all relevant information self.__findSysCObjects(object_vec, self.object_type, self.sysc_objects) # if there are no objects to draw than skip the drawing part # this might happen if you set the breakpoint before any objects are # created. This is actually catched above, but there might also be a # design with no objects. if len(self.sysc_objects.keys()) == 0: return clusters = {} nodes = {} # build pydot hierachy and add all subgraphs and nodes to the main # graph self.__buildHierachy(self.sysc_objects, clusters, nodes) for sptr in clusters: self.block_diagram.add_subgraph(clusters[sptr]) for sptr in nodes: self.block_diagram.add_node(nodes[sptr]) self._file_obj.write(self.block_diagram.create_svg()) self.signalproxy.inferiorStoppedNormally.disconnect(self.update) self.showDiagram()
def _setProgress(self): if not self._elaborationDone or not self._inSimulatorControl: return if not cpp2py(self._elaborationDone.value) and not cpp2py( self._inSimulatorControl.value): self.ui.progress.setValue(0) self.ui.progress.setFormat("Elaboration") elif cpp2py(self._elaborationDone.value) and cpp2py( self._inSimulatorControl.value): self.ui.progress.setValue(1) self.ui.progress.setFormat("Simulation") elif cpp2py(self._elaborationDone.value) and not cpp2py( self._inSimulatorControl.value): self.ui.progress.setValue(2) self.ui.progress.setFormat("Finished") else: self.ui.progress.setValue(0) self.ui.progress.setFormat("")
def _setWriteCheck(self, v): self.ui.writeCheckBox.setChecked(cpp2py(v))