def __init__(self, rsg, name=None, msgType=None): typecheck(rsg, RosSystemGraph, "rsg") super(Topic, self).__init__(rsg) # Dumb placement - just get the enxt free altitudes self.posBand.altitude, self.negBand.altitude = rsg.nextFreeAltitudes() self.posBand.rank = self.posBand.altitude self.negBand.rank = self.posBand.altitude self.name = name self.msgType = msgType self.hz = 0 self.bw = 0
def __init__(self, rsg, name=None): typecheck(rsg, RosSystemGraph, "rsg") super(Node, self).__init__(rsg) # dumb placement - just get the next free index self.block.index = rsg.nextFreeNodeIndex() self.name = name self.location = None self.pid = None self.num_threads = 0 self.cpu_load_mean = 0 self.cpu_load_std = 0 self.cpu_load_max = 0 self.virt_mem_mean = 0 self.virt_mem_std = 0 self.virt_mem_max = 0 self.real_mem_mean = 0 self.real_mem_std = 0 self.real_mem_max = 0
def __init__(self, rsg, node, topic): typecheck(rsg, RosSystemGraph, "rsg") typecheck(node, Node, "node") typecheck(topic, Topic, "topic") super(Publisher, self).__init__(rsg, node, topic) # Dumb placement self.snap.order = max(filter(lambda x: isinstance(x, int), [pub.snap.order for pub in node.publishers] + [-1])) + 1 self.bandwidth = None self.msgType = None
def __init__(self, rsg, node, topic): typecheck(rsg, RosSystemGraph, "rsg") typecheck(node, Node, "node") typecheck(topic, Topic, "topic") super(Publisher, self).__init__(rsg, node, topic) # Dumb placement self.snap.order = max( filter(lambda x: isinstance(x, int), [pub.snap.order for pub in node.publishers] + [-1])) + 1 self.bandwidth = None self.msgType = None
def __init__(self, parent, flow_label): super(FlowItem, self).__init__(parent) qt_view.BandItemAttributes.__init__(self) self._flow_label = flow_label self._layout_manager = typecheck(parent, FabrikLayoutManagerWidget, "parent") self._view = parent.view() self._adapter = parent.adapter() self.origin_index, self.dest_index = flowlabel.parse_flowlabel(flow_label) self.origin_node_item = self._layout_manager.get_block_item(self.origin_index) self.dest_node_item = self._layout_manager.get_block_item(self.dest_index) # Qt Properties self.setContentsMargins(0, 50, 0, 50) self.setSizePolicy(QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)) self.setPreferredHeight(20) self.setMinimumHeight(20) self.setAcceptHoverEvents(True)
def __init__(self, parent, hook_label): super(HookItem, self).__init__(parent) qt_view.BandItemAttributes.__init__(self) self._hook_label = hook_label self._layout_manager = typecheck(parent, FabrikLayoutManagerWidget, "parent") self._view = parent.view() self._adapter = parent.adapter() originAltitude, destAltitude, self.latchIndex = hooklabel.parse_hooklabel(self._hook_label) # Deal with the parsed things. self.origin_band_item = self._layout_manager.get_band_item(originAltitude) self.dest_band_item = self._layout_manager.get_band_item(destAltitude) self._container = self.latch self.rank = self.origin_band_item.rank # Qt Properties self.setSizePolicy(QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)) self.setPreferredHeight(5) self.setMinimumHeight(5) self.setAcceptHoverEvents(True)