wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
DolphinEdits.h
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
7
8#pragma once
9
10#include <functional>
11
12#include <QModelIndexList>
13
14class SignalModel;
15
26namespace DolphinEdits {
27
29void applyToCells(SignalModel &model, const QModelIndexList &cells, const std::function<int(int)> &valueFn);
30
33void clockWave(SignalModel &model, const QModelIndexList &cells, int firstCol, int period);
34
37void combinational(SignalModel &model, int inputPorts, int columns);
38
40void clearInputs(SignalModel &model, int inputPorts);
41
43int lastNonZeroColumn(const SignalModel &model, int inputPorts);
44
47void growInputColumns(SignalModel &model, int inputPorts, int oldLength, int newLength);
48
49} // namespace DolphinEdits
QStandardItemModel subclass that makes all cells non-editable.
Definition SignalModel.h:21
Pure mutations of a SignalModel's value grid — the data side of the editor's commands (set/invert/cle...
void combinational(SignalModel &model, const int inputPorts, const int columns)
void clearInputs(SignalModel &model, const int inputPorts)
Sets every input cell (the first inputPorts rows, over the model's columns) to 0.
void applyToCells(SignalModel &model, const QModelIndexList &cells, const std::function< int(int)> &valueFn)
Sets each cell in cells to valueFn(currentValue).
void growInputColumns(SignalModel &model, const int inputPorts, const int oldLength, const int newLength)
int lastNonZeroColumn(const SignalModel &model, const int inputPorts)
Returns the index of the last column with any non-zero input value, or 0 if none.
void clockWave(SignalModel &model, const QModelIndexList &cells, const int firstCol, const int period)