|
wiRedPanda
Logic Circuit Simulator
|
Disk I/O for the beWavedDolphin formats: opens the file, dispatches by extension (.dolphin = binary, .csv), and delegates the encoding to DolphinSerializer. More...
Functions | |
| DolphinSerializer::WaveformData | load (const QString &fileName, const int maxInputPorts) |
| DolphinSerializer::WaveformData | parseTerminal (QTextStream &in, const int maxInputPorts) |
| void | save (const SignalModel &model, const QString &fileName, int inputPorts) |
| Writes model to fileName atomically, choosing the format by extension. | |
Disk I/O for the beWavedDolphin formats: opens the file, dispatches by extension (.dolphin = binary, .csv), and delegates the encoding to DolphinSerializer.
Pure file ↔ model transfer — no dialogs, window state, or simulation. Loading returns the parsed data for BewavedDolphin to apply (setLength + run).
| DolphinSerializer::WaveformData DolphinFile::load | ( | const QString & | fileName, |
| int | maxInputPorts ) |
Reads fileName (.dolphin or .csv) and returns its input rows, clamped to maxInputPorts. Throws on a missing file or unsupported format.
Definition at line 43 of file DolphinFile.cpp.
References DolphinSerializer::loadBinary(), DolphinSerializer::loadCSV(), PANDACEPTION_WITH_CONTEXT, qCDebug, and Serialization::readDolphinHeader().
| DolphinSerializer::WaveformData DolphinFile::parseTerminal | ( | QTextStream & | in, |
| int | maxInputPorts ) |
Parses the terminal/automation stream protocol from in: a "rows,cols" header line followed by one comma-separated row of 0/1 values per input. rows is clamped to maxInputPorts; cols is validated against [1, SignalModel::kMaxColumns]. Returns the parsed input rows for the caller to apply. Throws on malformed input.
Definition at line 75 of file DolphinFile.cpp.
References DolphinSerializer::WaveformData::columns, DolphinSerializer::WaveformData::inputPorts, SignalModel::kMaxColumns, PANDACEPTION_WITH_CONTEXT, and DolphinSerializer::WaveformData::values.
| void DolphinFile::save | ( | const SignalModel & | model, |
| const QString & | fileName, | ||
| const int | inputPorts ) |
Writes model to fileName atomically, choosing the format by extension.
Definition at line 18 of file DolphinFile.cpp.
References PANDACEPTION_WITH_CONTEXT, qCDebug, DolphinSerializer::saveBinary(), DolphinSerializer::saveCSV(), and Serialization::writeDolphinHeader().