Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/validation-report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validation & the Config Summary

The firmware validates almost nothing, so the application is the safety layer. Two File-menu commands report on the open document: **Check Channels** runs the validation rules and lists every finding with a severity, and **Config Summary…** produces a printable MoTeC-style Channel Summary Report of everything the configuration defines.
The firmware validates almost nothing, so the application is the safety layer. Two File-menu commands report on the open document: **Check Channels** runs the validation rules and lists every finding with a severity, and **Config Summary…** produces a printable Channel Summary Report of everything the configuration defines.

## Check Channels

Expand Down Expand Up @@ -53,7 +53,7 @@ A message marked **Hidden** or **Protect Communication** withholds its detail fr

## Config Summary…

To produce a report of the whole configuration, choose File → Config Summary…. The window shows a column-aligned Channel Summary Report in the style of the MoTeC tools, with these sections:
To produce a report of the whole configuration, choose File → Config Summary…. The window shows a column-aligned Channel Summary Report with these sections:
- **Summary Information** — file name, title, date, application version, and whether the document has unsaved changes.
- **Configuration Comments** — the document's comment text.
- **CAN Bus Setup** — per-bus mode, bit rate, FD data rate and termination.
Expand Down
6 changes: 3 additions & 3 deletions firmware/include/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* documented on MathConfig below.
*
* v19 replaces the single configuration password with THREE per-function access
* keys, mirroring MoTeC's "Online > Set Access Passwords": one for sending a
* keys, exposed in the GUI as "Online > Set Access Passwords": one for sending a
* configuration, one for getting one back, one for revealing and editing
* protected communications. Each is a 4-byte key the host folds out of a typed
* password (PBKDF2, fixed application salt) and proves by challenge-response;
Expand Down Expand Up @@ -147,7 +147,7 @@
* alongside the config it names. (v7 also moved the config tables into a
* flash-resident image so they no longer occupy RAM — that is internal to the
* firmware and does not change the wire format.)
* v6 adds a Constants table (0x14/0x15): a MoTeC-style calculation that writes
* v6 adds a Constants table (0x14/0x15): a calculation that writes
* a fixed value to a generated channel every evaluation pass. Each entry names
* a destination signal slot and the constant float; the engine applies them
* before math so downstream calculations see them.
Expand All @@ -161,7 +161,7 @@
* message has not been received within that timeout (0 = feature off).
* v3 unifies receive and transmit into ONE message table (direction is a flag
* on each message; transmit messages carry a period), and adds up/down
* counters (0x10/0x11) and timers (0x12/0x13) as MoTeC-style calculations.
* counters (0x10/0x11) and timers (0x12/0x13) as calculations.
* v2 added CONTROL_CAN / STREAM_VALUES and framed all device output (telemetry
* + logs); those are unchanged.
*
Expand Down
2 changes: 1 addition & 1 deletion gui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ __pycache__/
.claude/
CMakeLists.txt.user

# Proprietary-tool exports kept locally as fixtures (MoTeC log etc.)
# Proprietary-tool exports kept locally as fixtures
reference files/
15 changes: 7 additions & 8 deletions gui/DESIGN.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# CAN Triple Device Manager — Design

A Qt 6 (C++/Widgets) desktop application for configuring the CAN Triple gateway
(STM32G473CBT6, 3× CAN) over the ST-Link virtual COM port. Layout and
navigation deliberately mirror **MoTeC C125 Dash Manager** (verified against
the real application, v6.51, on this machine).
(STM32G473CBT6, 3× CAN) over the ST-Link virtual COM port, with a classic
dash-manager layout and navigation.

## 1. Serial link (as implemented by the firmware in `../src`)

Expand Down Expand Up @@ -485,8 +484,8 @@ rather than its extension, so a `.ct3s` can never be parsed as JSON.
door, no copy held anywhere. A lost password is a lost configuration, and the
save dialog says so before the fact.

This mirrors MoTeC's "Hide setup information" / "Require access password for use"
pair on a locked comms template, for the same reasons.
This is the classic "Hide setup information" / "Require access password for use"
pairing on a locked comms template, for the same reasons.

**File layout** — all multi-byte integers LITTLE-ENDIAN.

Expand Down Expand Up @@ -877,7 +876,7 @@ that password either, which is the trade its author made.

- **File**: New, Open…, Save, Save As…, **Save Secure Config…** (the binary
`.ct3s`), Check Channels (live validation report with unused-channel cleanup),
Config Summary… (MoTeC-style Channel Summary Report via
Config Summary… (Channel Summary Report via
`src/model/config_report.*` — usage analysis incl. incomplete/unused channels,
print / PDF / text export), Reveal / Conceal Protected Communications,
recent files, Exit. Document = one config file: `*.ct3` indented JSON by
Expand Down Expand Up @@ -1238,7 +1237,7 @@ that password either, which is the trade its author made.
Configuration, Monitor Channels **F3** (live grid from value stream),
CAN Viewer (raw frame monitor + inject-frame form; buffers up to 10M frames
and exports them as a Vector ASCII `.asc` log via "Save to File…" — classic
frames as the MoTeC-style line, CAN FD frames as Vector `CANFD` lines carrying
frames as standard lines, CAN FD frames as Vector `CANFD` lines carrying
real BRS and ESI), Load Device Config from Flash, Clear Device Config, Device
Status, **Upload Configuration…**, **Set Access Passwords…** and **Fleet
Identity…**. All three need a connection: the uploader has a device to check
Expand All @@ -1261,7 +1260,7 @@ that password either, which is the trade its author made.
- **Tools → Connection Settings…** — COM port list (ST-Link VCP highlighted),
baud (default 7,372,800), Connect/Disconnect.

## 3. Channel & scaling model (MoTeC semantics, mapped to firmware)
## 3. Channel & scaling model (mapped to firmware)

**Signal record.** `CanSignalConfig` is **64 bytes** and `MAX_SIGNALS` is
**1000**. The history is worth knowing, because the record has been both ways:
Expand Down
2 changes: 1 addition & 1 deletion gui/FIRMWARE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ firmware unlocks a cleaner protocol; none block basic use.

3. **No periodic transmit composer.** The routing engine can receive, parse,
route, and inject, but there is no engine that *composes* frames from
signal values and transmits them cyclically — MoTeC-style "Transmit
signal values and transmits them cyclically — "Transmit
Message" sections have nothing to run on. Suggest a `TransmitMessageConfig`
table (can_id, bus, rate, signal packing list) serviced from
`events_100Hz`/`events_50Hz`. *GUI behavior: transmit sections can be
Expand Down
12 changes: 6 additions & 6 deletions gui/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# CAN Triple Device Manager

A Windows desktop configurator for the [CAN Triple](https://github.com/mitchdetailed/CAN_Triple)
gateway (STM32G473CBT6, 3× CAN), styled after **MoTeC C125 Dash Manager** —
same layout and navigation for communications, messages, and channels.
gateway (STM32G473CBT6, 3× CAN), with a classic dash-manager layout and
navigation for communications, messages, and channels.

Talks to the device over the ST-Link virtual COM port (USART1, PB6/PB7,
7,372,800 baud — ST-Link **V3** required for that rate). Built and released
Expand Down Expand Up @@ -62,7 +62,7 @@ rules, 8 integrators, and
Counters**, **Constants**, and **Tables** grid editors, each mapping onto the
matching firmware table. A constant is a custom channel carrying a fixed value
the firmware writes every evaluation pass. **Tables** are
MoTeC-style lookups — 8× 2x16 (one axis, up to 16 sites) and 8× **8x8**
lookup tables — 8× 2x16 (one axis, up to 16 sites) and 8× **8x8**
(X + Y axes, up to 8 sites each, 64 cells) — with each axis Interpolated or
Discrete (centered); the looked-up value drives a generated output channel.
- **Online** — Send Configuration (F5, chunked + read-back verified, applies
Expand All @@ -73,7 +73,7 @@ rules, 8 integrators, and
Passwords…** and **Fleet Identity…**. Get also reads the buses' modes, rates
and termination back off the device via `CMD_READ_CAN_SETUP`, so the document
reflects what the buses are actually running, not an assumption.
- **Online → Set Access Passwords…** — MoTeC-style function passwords held
- **Online → Set Access Passwords…** — function passwords held
**in the device**: Send a Configuration, Get a Configuration, and **Protected
Comms with four slots** (any slot opens, so one unit can accept sealed
configurations from several suppliers; only Slot 1 also updates the open
Expand Down Expand Up @@ -139,7 +139,7 @@ rules, 8 integrators, and
and when); the firmware validates almost nothing, so the GUI enforces the
rules (see `FIRMWARE-NOTES.md`). Also lists **unused channels** (orphans left
after removing messages) and offers **Remove Unused Channels** cleanup.
- **File → Config Summary…** — MoTeC-style Channel Summary Report: summary
- **File → Config Summary…** — Channel Summary Report: summary
info, comments, bus setup, used channels, channels by function (per-message
Generates/From and Uses/For tables with the DBC extraction detail, compound
Id[n] groups, calculations), incomplete channels, unused channels — with
Expand Down Expand Up @@ -201,7 +201,7 @@ Firmware: `pio run` (and `pio run -t upload`) inside `firmware/` — see

## Documents

- `DESIGN.md` — UI inventory, protocol spec, MoTeC→firmware mapping rules.
- `DESIGN.md` — UI inventory, protocol spec, UI→firmware mapping rules.
- `FIRMWARE-NOTES.md` — firmware findings the GUI works around (flash sizing,
unimplemented commands, Motorola extraction, UART burst limits…), with
suggested fixes.
Expand Down
6 changes: 3 additions & 3 deletions gui/help/pages/validation-report.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h1>Validation &amp; the Config Summary</h1>
<p>The firmware validates almost nothing, so the application is the safety
layer. Two File-menu commands report on the open document: <b>Check
Channels</b> runs the validation rules and lists every finding with a
severity, and <b>Config Summary…</b> produces a printable MoTeC-style Channel
severity, and <b>Config Summary…</b> produces a printable Channel
Summary Report of everything the configuration defines.</p>

<h2>Check Channels</h2>
Expand Down Expand Up @@ -138,8 +138,8 @@ <h2>Marked messages in the report</h2>
<h2>Config Summary…</h2>

<p>To produce a report of the whole configuration, choose File → Config
Summary…. The window shows a column-aligned Channel Summary Report in the
style of the MoTeC tools, with these sections:</p>
Summary…. The window shows a column-aligned Channel Summary Report
with these sections:</p>

<ul>
<li><b>Summary Information</b> — file name, title, date, application version,
Expand Down
2 changes: 1 addition & 1 deletion gui/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
namespace {

// Dev helper (--screenshots <dir>): renders the main dialogs with sample data
// and saves PNGs, for checking layout against the MoTeC reference.
// and saves PNGs, for checking layout against the reference screenshots.
void saveScreenshots(const QString &dir)
{
QDir().mkpath(dir);
Expand Down
2 changes: 1 addition & 1 deletion gui/src/model/access_keys.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Access passwords — the three function locks behind "Online > Set Access
// Passwords", modelled on the same screen in MoTeC Dash Manager.
// Passwords".
//
// Send a Configuration — the device refuses a Send without it.
// Get a Configuration — the device refuses a Get without it.
Expand Down
2 changes: 1 addition & 1 deletion gui/src/model/channel.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// A channel in the MoTeC sense: a named quantity with fixed base resolution,
// A channel: a named quantity with fixed base resolution,
// units, and range. Scaling on comms rows converts raw CAN values into
// base-resolution counts; the channel defines what those counts mean.
#pragma once
Expand Down
2 changes: 1 addition & 1 deletion gui/src/model/comms_types.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Document model for communications sections (MoTeC-style messages) and the
// Document model for communications sections (messages) and the
// channel rows inside them. JSON (de)serialization lives in configuration.cpp.
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion gui/src/model/config_report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ QString conditionOpName(int op)
// ------------------------------------------------------------- rendering

// Report accumulated as lines with a style tag, rendered to plain text (dashed
// heading rules, like the MoTeC report) or HTML (bold/underline headings in a
// heading rules) or HTML (bold/underline headings in a
// courier <pre> block).
class ReportBuilder {
public:
Expand Down
2 changes: 1 addition & 1 deletion gui/src/model/config_report.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Channel usage analysis and the MoTeC-style "Channel Summary Report"
// Channel usage analysis and the "Channel Summary Report"
// (File > Config Summary). Pure model code — the dialog only renders what
// this produces, so the report content is unit-tested.
#pragma once
Expand Down
4 changes: 2 additions & 2 deletions gui/src/model/secure_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
// password is a lost configuration, and the save dialog says so before
// the fact.
//
// This mirrors MoTeC's "Hide setup information" / "Require access password for
// use" pair on a locked comms template, for the same reasons.
// This is the classic "Hide setup information" / "Require access password for
// use" pairing on a locked comms template, for the same reasons.
//
// ---------------------------------------------------------------------------
// File layout — all multi-byte integers LITTLE-ENDIAN
Expand Down
6 changes: 3 additions & 3 deletions gui/src/protocol/asc_log.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Vector ASCII (.asc) CAN-log formatting, shared by the CAN Viewer's
// "Save to File" export and its host tests. Matches the MoTeC CAN Inspector
// layout so the files open in the same tools.
// "Save to File" export and its host tests. Matches the conventional Vector
// layout so the files open in common CAN tools.
#pragma once

#include <QString>
Expand All @@ -13,7 +13,7 @@ namespace ct {

// The six-line .asc header block (each line terminated by '\n'), time-stamped
// `when`. Day/month names are forced to the C locale so the output is stable
// and matches MoTeC regardless of the host's regional settings.
// and stays identical regardless of the host's regional settings.
QString ascHeader(const QDateTime &when);

// One .asc data line (no trailing newline) for a monitor-stream frame. The
Expand Down
4 changes: 2 additions & 2 deletions gui/src/ui/access_passwords_dialog.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// "Set Access Passwords" — Online > Set Access Passwords…, laid out like the
// same screen in MoTeC Dash Manager: a list of protected functions, a Set…
// "Set Access Passwords" — Online > Set Access Passwords…:
// a list of protected functions, a Set…
// button, and a tick against the ones that have a password.
//
// ┌ Function Passwords ────────────────────────────────┐
Expand Down
4 changes: 2 additions & 2 deletions gui/src/ui/communications_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace ct {
namespace {

// The Section column: normally the direction, a padlock for a message the
// viewer may not read. MoTeC's own list does exactly this, and the substitution
// viewer may not read. The substitution
// is deliberate — the row's job for a concealed message is to say "locked",
// which is also why opening it asks for a password. The direction is not itself
// the secret (the Config Summary report still names it, see
Expand Down Expand Up @@ -662,7 +662,7 @@ void CommunicationsDialog::updateChannelPane(int busIndex)
tab.channelList->addItem(tr("(relay — forwards whole frames, no channels)"));
return;
}
// One line and nothing else, which is what MoTeC shows and what the flag is
// One line and nothing else, which is what the flag is
// for. Channel NAMES are not the secret and stay visible everywhere they are
// USED — the Channel Editor, math and condition inputs, transmit rows — but
// this pane is the one place they would be listed BY MESSAGE, and that
Expand Down
2 changes: 1 addition & 1 deletion gui/src/ui/config_summary_dialog.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// File > Config Summary — the MoTeC-style Channel Summary Report viewer,
// File > Config Summary — the Channel Summary Report viewer,
// with Print / Save PDF / Save Text export.
#pragma once

Expand Down
1 change: 0 additions & 1 deletion gui/src/ui/counters_dialog.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// "Up / Down Counters" (Calculations menu) — grid editor for
// Configuration::counterRows, mapping 1:1 onto the firmware counter table.
// Mirrors MoTeC's Up/Down Counters dialog.
#pragma once

#include <QDialog>
Expand Down
2 changes: 1 addition & 1 deletion gui/src/ui/edit_channel_dialog.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Implementation of the MoTeC-style "Edit Custom Channel" dialog.
// Implementation of the "Edit Custom Channel" dialog.
#include "edit_channel_dialog.h"

#include <QComboBox>
Expand Down
5 changes: 2 additions & 3 deletions gui/src/ui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,8 @@ bool MainWindow::onSaveSecureConfig()

// A document with no Protected Comms password can set one right here.
//
// MoTeC's Save Communications Setup dialog does exactly this rather than
// sending you elsewhere, and it is right to. The two places a password can
// be set are not interchangeable: Online → Set Access Passwords writes a key
// Offering it here rather than sending you elsewhere is deliberate. The two
// places a password can be set are not interchangeable: Online → Set Access Passwords writes a key
// into HARDWARE and therefore needs a device on the bench, while this writes
// a verifier into the DOCUMENT and needs nothing. Requiring the former
// before the latter would make "build a protected configuration at my desk"
Expand Down
2 changes: 1 addition & 1 deletion gui/src/ui/main_window.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Main window — menu shell mirroring MoTeC Dash Manager: File, Connections,
// Main window — menu shell: File, Connections,
// Calculations, Online, Tools, Help. Offline-first document workflow with
// explicit Send/Get Configuration.
#pragma once
Expand Down
2 changes: 1 addition & 1 deletion gui/src/ui/math_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ MathDialog::MathDialog(Configuration *config, QWidget *parent)
m_tree->setColumnWidth(5, 130);
topLayout->addWidget(m_tree, 1);

// MoTeC-style vertical button stack on the right
// Vertical button stack on the right
auto *buttonColumn = new QVBoxLayout;
m_addButton = new QPushButton(tr("Add…"), this);
m_changeButton = new QPushButton(tr("Change…"), this);
Expand Down
6 changes: 3 additions & 3 deletions gui/src/ui/section_editor_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ void SectionEditorDialog::updateTxModeControls()
m_txModeCombo->setVisible(show);
}

// Presents the address in the MoTeC width for the ID format:
// Presents the address in the conventional width for the ID format:
// standard -> 0x%03X, extended -> 0x%08X.
void SectionEditorDialog::reformatAddress()
{
Expand Down Expand Up @@ -798,7 +798,7 @@ void SectionEditorDialog::onAddressEdited()
m_addressDecLabel->setText(tr("= %1 decimal").arg(value));
}

// Same MoTeC width convention as the address: standard -> 0x%03X, extended ->
// Same width convention as the address: standard -> 0x%03X, extended ->
// 0x%08X. Used for the relay's match mask.
void SectionEditorDialog::reformatBitmask()
{
Expand Down Expand Up @@ -2092,7 +2092,7 @@ void SectionEditorDialog::onMessageTypeToggled()
m_section.rows.clear();
m_section.identifiers.clear();
if (wantCompound) {
// Pre-create empty identifier slots like MoTeC's numbered table.
// Pre-create empty identifier slots for the numbered table.
for (int i = 0; i < 16; ++i)
m_section.identifiers.append(CompoundIdentifier{});
}
Expand Down
2 changes: 1 addition & 1 deletion gui/src/ui/timers_dialog.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Calculations > Timers — grid editor for Configuration::timerRows.
// Mirrors MoTeC's Timers dialog (Start/Stop tab + Settings tab).
// Two tabs: Start/Stop and Settings.
#include "timers_dialog.h"

#include <QButtonGroup>
Expand Down
2 changes: 1 addition & 1 deletion gui/src/ui/timers_dialog.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// "Timers" (Calculations menu) — grid editor for Configuration::timerRows,
// mapping 1:1 onto the firmware timer table. Mirrors MoTeC's Timers dialog.
// mapping 1:1 onto the firmware timer table.
#pragma once

#include <QDialog>
Expand Down
2 changes: 1 addition & 1 deletion gui/test/test_roundtrip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ static MonitorStreamPayload makeFrame(quint32 ms, quint8 bus, quint8 dir, quint3

static void testAscLog()
{
// Header matches the MoTeC reference layout, in the C locale.
// Header matches the reference layout, in the C locale.
const QDateTime when(QDate(2025, 7, 8), QTime(7, 39, 10));
const QString header = ascHeader(when);
CHECK(header == QStringLiteral(
Expand Down
Loading