|
wiRedPanda
Logic Circuit Simulator
|
QStandardItemModel subclass that makes all cells non-editable. More...
#include <SignalModel.h>
Classes | |
| class | BulkEditGuard |
Public Member Functions | |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| int | inputRows () const |
| Returns the number of input rows (the output rows follow them). | |
| bool | isInputRow (int row) const |
Returns true if row is an input row (row < inputRows()). | |
| void | setInputRows (int inputRows) |
| Records how many leading rows are inputs (the rest are outputs). | |
| void | setValue (int row, int col, int value) |
| Sets the logic value (0/1) of the cell at (row, col). | |
| SignalModel (int rows, int columns, QObject *parent=nullptr) | |
| Constructs the model. | |
| int | value (int row, int col) const |
| Returns the logic value (0/1) of the cell at (row, col). | |
Static Public Attributes | |
| static constexpr int | kMaxColumns = 2048 |
QStandardItemModel subclass that makes all cells non-editable.
All editing is done programmatically via BewavedDolphin::setCellValue(). The model enforces read-only at the Qt item level so the table view never opens an inline editor.
Definition at line 20 of file SignalModel.h.
| SignalModel::SignalModel | ( | int | rows, |
| int | columns, | ||
| QObject * | parent = nullptr ) |
Constructs the model.
| inputs | Number of input signal rows (stored for reference). |
| rows | Total number of signal rows. |
| columns | Number of time-step columns. |
| parent | Optional parent object. |
Definition at line 6 of file SignalModel.cpp.
Referenced by SignalModel::BulkEditGuard::BulkEditGuard().
|
override |
Definition at line 11 of file SignalModel.cpp.
|
inline |
Returns the number of input rows (the output rows follow them).
Definition at line 55 of file SignalModel.h.
Referenced by DolphinClipboard::paste(), and setInputRows().
|
inline |
Returns true if row is an input row (row < inputRows()).
Definition at line 58 of file SignalModel.h.
| void SignalModel::setInputRows | ( | int | inputRows | ) |
Records how many leading rows are inputs (the rest are outputs).
Definition at line 28 of file SignalModel.cpp.
References inputRows().
| void SignalModel::setValue | ( | int | row, |
| int | col, | ||
| int | value ) |
Sets the logic value (0/1) of the cell at (row, col).
Definition at line 18 of file SignalModel.cpp.
References value().
Referenced by DolphinEdits::applyToCells(), DolphinEdits::clearInputs(), DolphinEdits::clockWave(), DolphinEdits::combinational(), DolphinEdits::growInputColumns(), DolphinClipboard::paste(), and BewavedDolphin::saveToTxt().
| int SignalModel::value | ( | int | row, |
| int | col ) const |
Returns the logic value (0/1) of the cell at (row, col).
Definition at line 23 of file SignalModel.cpp.
Referenced by DolphinEdits::applyToCells(), DolphinClipboard::copy(), DolphinExporter::csvText(), DolphinEdits::lastNonZeroColumn(), BewavedDolphin::saveToTxt(), setValue(), and DolphinExporter::writeTruthTableText().
|
staticconstexpr |
Maximum number of time-step columns a waveform may have. Single source of truth for the upper bound, shared by the file loaders, the runtime length, and the MCP cap. The minimum is intentionally context-specific (a saved file needs >= 2 columns; a runtime length allows >= 1) and is not centralized here.
Definition at line 38 of file SignalModel.h.
Referenced by DolphinSerializer::loadBinary(), DolphinSerializer::loadCSV(), DolphinFile::parseTerminal(), and BewavedDolphin::saveToTxt().