Beispiel #1
0
    def __init__(self,
                 interface,
                 channel,
                 changeable_bitrate=False,
                 device_number=None):
        TreeNode.__init__(self)

        self.interface = interface
        self.channel = channel
        self.changeable_bitrate = changeable_bitrate
        self.device_number = device_number

        self.bitrate = default_bitrate
        self.separator = " - "

        if self.interface is not None:
            name = self._generate_fields_name()
        else:
            name = "Offline"

        self.fields = Columns(name=name,
                              nickname="-",
                              bitrate=bitrates[self.bitrate],
                              transmit="")

        self._checked = Columns.fill(Qt.Unchecked)

        self.bus = epyqlib.busproxy.BusProxy(
            transmit=self.checked(Columns.indexes.transmit))
Beispiel #2
0
    def __init__(self, interface, channel, changeable_bitrate=False):
        TreeNode.__init__(self)

        self.interface = interface
        self.channel = channel
        self.changeable_bitrate = changeable_bitrate

        self.bitrate = default_bitrate
        self.separator = ' - '

        if self.interface is not None:
            name = '{}{}{}'.format(self.interface, self.separator,
                                   self.channel)
        else:
            name = 'Offline'

        self.fields = Columns(name=name,
                              nickname='-',
                              bitrate=bitrates[self.bitrate],
                              transmit='')

        self._checked = Columns.fill(Qt.Unchecked)

        self.bus = epyqlib.busproxy.BusProxy(
            transmit=self.checked(Columns.indexes.transmit))
Beispiel #3
0
    def __init__(self, device):
        TreeNode.__init__(self)

        self.fields = Columns(name=device.name, nickname="-", bitrate="", transmit="")

        self._checked = Columns.fill(Qt.Unchecked)

        self.device = device
        self.device.bus.transmit = self._checked.transmit == Qt.Checked
        self.name = ""
Beispiel #4
0
    def __init__(self, signal, frame, tx=False, connect=None, tree_parent=None, parent=None):
        epyqlib.canneo.Signal.__init__(self, signal=signal, frame=frame, connect=connect, parent=parent)
        TreeNode.__init__(self, tx=tx, parent=tree_parent)

        self.fields = Columns(id=self.start_bit,
                              name=self.name,
                              length='{} b'.format(self.signal_size),
                              value='-',
                              dt='-',
                              count='')
        self.last_time = None
Beispiel #5
0
    def __init__(
        self,
        message=None,
        tx=False,
        frame=None,
        multiplex_value=None,
        signal_class=SignalNode,
        mux_frame=None,
        parent=None,
        **kwargs,
    ):
        epyqlib.canneo.Frame.__init__(
            self,
            frame=frame,
            multiplex_value=multiplex_value,
            signal_class=signal_class,
            mux_frame=mux_frame,
            parent=parent,
            **kwargs,
        )
        TreeNode.__init__(self, parent)

        self.fields = Columns()
        self.last_time = None

        self.tx = tx
        self._send_checked = False

        self.count = {
            "tx": 0,
            "rx": 0,
        }

        for signal in self.signals:
            signal.tx = self.tx
            self.append_child(signal)

        identifier = epyqlib.canneo.format_identifier(self.id, self.extended)

        if self.mux_name is None:
            name = self.name
        else:
            name = "{} - {}".format(self.name, self.mux_name)

        count = self.count["tx"] if self.tx else self.count["rx"]

        self.fields = Columns(
            id=identifier,
            name=name,
            length="{} B".format(self.size),
            value="-",
            dt="-",
            count=str(count),
        )
Beispiel #6
0
    def __init__(self, tx, neo=None, bus=None, parent=None):
        TreeNode.__init__(self)
        epyqlib.canneo.QtCanListener.__init__(self, parent=parent)

        self.bus = bus

        self.tx = tx
        self.rx = not self.tx
        self.neo = neo
        self.messages = {}

        if self.rx:
            self.message_received_signal.connect(self.message_received)

        if self.tx:
            for frame in self.neo.frames:
                self.add_message_node(node=frame)

        if self.bus is not None:
            self.remapper = epyqlib.canneo.QtCanListener(
                receiver=self.message_sent)
            self.bus.tx_notifier.add(self.remapper)
            self.sent_messages = {}

        # TODO: this should probably be done in the view but this is easier for now
        #       Tx can't be added to later (yet)
        #       Rx will add in order received
        self.children.sort(key=lambda c: c.name)

        self.fields = Columns(id='',
                      name='',
                      length='',
                      value='',
                      dt='',
                      count='')

        self.update_timer = QTimer()
        # 81 seems to provide nice variation in the count on 10ms messages
        # but is still a bit of a 'random' selection.
        # TODO: pick a number based on the cycle times in the .sym
        self.update_timer.setInterval(81)
        self.update_timer.timeout.connect(self.gui_update)
        self.update_timer.start()
Beispiel #7
0
    def __init__(self, text, action=None):
        TreeNode.__init__(self)

        self.fields = Columns(name=text, action=action)
Beispiel #8
0
 def __init__(self):
     TreeNode.__init__(self)
Beispiel #9
0
 def append_child(self, child):
     TreeNode.append_child(self, child)