Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Negative timestamps occur by using a Notifier to record CAN messages from multiple channels

未關閉
#1,944 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
python

研究方向

從重現中所示的 Logger.on_message_received 和 Notifier 進入點開始,然後在 Windows 上使用 python-can 4.2.0 重現從兩個已開啟匯流排記錄訊息的過程。完成的標準是:當訊息從多個通道抵達時,記錄的 CAN 日誌中的時間戳不會變成負數,並且保持一致。

由索引模型根據 Issue 內容生成。

描述

bug
Describe the bug

Negative time occurs when recording many channles CAN messages and channel changes

To Reproduce

创建自定义日志记录器

log_writer = can.Logger('test.asc')

def handle_message(msg):
print(msg)
log_writer.on_message_received(msg)

_can = Can_interface(driver_list=['kvaser', 'vector'])
buses = {
'1': _can.open_driver(3),
'2': _can.open_driver(4),
}
notifiers = list()
for channel, bus in buses.items():
# 注意:先添加过滤器,再添加处理函数
notifier = Notifier(bus, [])
notifier.add_listener(handle_message)
notifiers.append(notifier)

Expected behavior

I hope to record the CAN messages of different channels in a way that is consistent with the actual received message, and can be kept consistent with 'canoe'

Additional context

OS and version:win10
Python version:python 3.9.13
python-can version:4.2.0
python-can interface/s (if applicable): vector

Traceback and logs
def func():
    return "hello, world!"
主要語言
Python
星號
1.6k
分支
697
PR 合併指標
30 天內沒有已合併 PR

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

hardbyte/python-can 的其他 Issue

查看 hardbyte/python-can 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。