Metadata-Version: 2.4
Name: win-can-tool
Version: 1.0.0
Summary: Windows CAN simulator and testing tool with GUI and CLI.
Author: Kurtis Fafard
License: MIT
Project-URL: Homepage, https://github.com/kfafard/win_can_tool
Project-URL: Source, https://github.com/kfafard/win_can_tool
Project-URL: Issues, https://github.com/kfafard/win_can_tool/issues
Keywords: CAN,J1939,NMEA2000,tractor,simulator,python-can,PyQt6
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: PyQt6
Requires-Dist: python-can

# CAN Simulator

A cross-platform CAN (Controller Area Network) message generator with both a GUI and CLI.

This tool is useful for:
- Testing CAN-based devices
- Developing CAN parsers
- Prototyping embedded systems
- Generating repeatable CAN traffic
- Teaching or debugging CAN messaging behavior

The simulator provides:
- Customizable CAN messages
- Support for extended (29-bit) and standard (11-bit) IDs
- J1939-style and NMEA-style demo messages
- Live-editable values (speed, heading, GNSS position, temperatures, etc.)
- User-defined raw CAN frames
- Start/Stop message scheduler
- JSON save/load support for profiles
- Multiple CAN backends (`virtual`, `socketcan`, Kvaser, PCAN, neoVI, etc.)

---

## Features

### ✔ GUI Mode
- Real-time editing of GNSS and engine-like values
- Add, edit, or delete raw CAN frames
- Enable/disable individual messages
- Switch between multiple predefined message profiles
- Save/load full simulator configurations
- Event log with timestamps

### ✔ CLI Mode

```bash
py -m can_sim.cli --interface virtual --channel vcan0 --profile "GNSS only"
````

Useful for:

* Automated testing
* Headless environments
* Generating consistent CAN traffic

---

## Installation

```bash
pip install PyQt6 python-can
```

Optional extras:

```bash
pip install filelock
```

---

## Running the GUI

```bash
py -m can_sim.gui
```

## Running the CLI

```bash
py -m can_sim.cli --interface virtual --channel vcan0
```

Common CAN backends:

```
--interface kvaser
--interface pcan
--interface socketcan
--interface virtual
--interface neovi
```

---

## Project Structure

```
can_sim/
    bus.py              # CAN bus interface wrapper
    cli.py              # Command-line entrypoint
    engine.py           # Background scheduler and message timing engine
    gui.py              # PyQt GUI interface
    profiles.py         # Demo message profiles and encoders
```

---

## Roadmap (future versions)

* Modular GUI (split into components)
* Multi-frame (fast-packet) NMEA messages
* J1939 transport protocol (TP.CM/TP.DT)
* Real-time charts/visualization widgets
* Multi-channel CAN output
* Profile editor UI
* Plugin system for custom message generators

---

## License

MIT
