Mohamed Salem cb60c2ad5d Steps 2-7: LDF loading, signal editing, Rx display, connection, BabyLIN backend, scheduler
Step 2 - LDF Loading:
- ldfparser integration (Python) / custom regex parser (C++)
- QTreeWidget with expandable signal rows, merged Value column
- Hex/Dec toggle, FreeFormat schedule entries, auto-reload
- Baud rate auto-detection from LDF

Step 3 - Signal Editing:
- Bit packing/unpacking (signal value ↔ frame bytes)
- ReadOnlyColumnDelegate for per-column editability
- Value clamping to signal width, recursion guard

Step 4 - Rx Panel:
- receive_rx_frame() API with timestamp, signal unpacking
- Change highlighting (yellow), auto-scroll toggle, clear button
- Dashboard view (in-place update per frame_id)

Step 5 - Connection Panel:
- ConnectionManager with state machine (Disconnected/Connecting/Connected/Error)
- Port scanning (pyserial / QSerialPort), connect/disconnect with UI mapping

Step 6 - BabyLIN Backend:
- BabyLinBackend wrapping Lipowsky BabyLIN_library.py DLL
- Mock mode for macOS/CI, device scan, SDF loading, signal access
- Frame callbacks, raw command access

Step 7 - Master Scheduler:
- QTimer-based schedule execution with start/stop/pause
- Frame sent callback with visual highlighting
- Mock Rx simulation, manual send, global rate override

Tests: Python 171 | C++ 124 (Steps 1-5 parity, Steps 6-7 Python-first)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 14:21:24 +02:00

84 lines
2.0 KiB
Plaintext

/*
* Sample LDF file for LIN Simulator testing.
* This defines a simple LIN 2.1 network with:
* - 1 master node (ECU_Master)
* - 2 slave nodes (Motor_Control, Door_Module)
* - 4 frames (2 master Tx, 2 slave Tx)
* - Multiple signal types (bool, integer)
* - 2 schedule tables
*/
LIN_description_file;
LIN_protocol_version = "2.1";
LIN_language_version = "2.1";
LIN_speed = 19200 kbps;
Nodes {
Master: ECU_Master, 5 ms, 0.1 ms;
Slaves: Motor_Control, Door_Module;
}
Signals {
MotorSpeed: 8, 0, ECU_Master, Motor_Control;
MotorDirection: 2, 0, ECU_Master, Motor_Control;
MotorEnable: 1, 0, ECU_Master, Motor_Control;
DoorLock: 1, 0, ECU_Master, Door_Module;
DoorWindow: 8, 0, ECU_Master, Door_Module;
MotorTemp: 8, 0, Motor_Control, ECU_Master;
MotorStatus: 2, 0, Motor_Control, ECU_Master;
DoorState: 1, 0, Door_Module, ECU_Master;
DoorPosition: 8, 0, Door_Module, ECU_Master;
}
Frames {
Motor_Command: 0x10, ECU_Master, 2 {
MotorEnable, 0;
MotorDirection, 1;
MotorSpeed, 8;
}
Door_Command: 0x11, ECU_Master, 2 {
DoorLock, 0;
DoorWindow, 8;
}
Motor_Status: 0x20, Motor_Control, 2 {
MotorStatus, 0;
MotorTemp, 8;
}
Door_Status: 0x21, Door_Module, 2 {
DoorState, 0;
DoorPosition, 8;
}
}
Node_attributes {
Motor_Control {
LIN_protocol = "2.1";
configured_NAD = 0x01;
product_id = 0x0001, 0x0001, 0;
response_error = MotorStatus;
P2_min = 50 ms;
ST_min = 0 ms;
}
Door_Module {
LIN_protocol = "2.1";
configured_NAD = 0x02;
product_id = 0x0001, 0x0002, 0;
response_error = DoorState;
P2_min = 50 ms;
ST_min = 0 ms;
}
}
Schedule_tables {
NormalSchedule {
Motor_Command delay 10 ms;
Door_Command delay 10 ms;
Motor_Status delay 10 ms;
Door_Status delay 10 ms;
}
FastSchedule {
Motor_Command delay 5 ms;
Motor_Status delay 5 ms;
}
}