wiRedPanda
Home
About
Download
Try out
API Docs
wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
SelectionCapabilities.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 <QList>
11
12
#include "
App/Core/Enums.h
"
13
14
class
GraphicElement
;
15
24
struct
SelectionCapabilities
{
25
// --- Feature flags (AND-reduced: true only if every selected element has the feature) ---
26
27
bool
hasAudioBox
=
false
;
28
bool
hasAudio
=
false
;
29
bool
hasColors
=
false
;
30
bool
hasDelay
=
false
;
31
bool
hasElements
=
false
;
32
bool
hasFrequency
=
false
;
33
bool
hasLabel
=
false
;
34
bool
hasOnlyInputs
=
false
;
35
bool
hasLatchedValue
=
false
;
36
bool
hasWirelessMode
=
false
;
37
bool
hasTrigger
=
false
;
38
bool
hasTruthTable
=
false
;
39
bool
hasVolume
=
false
;
40
41
// --- Embedded IC flags ---
42
43
bool
isFileBacked
=
false
;
44
bool
isEmbedded
=
false
;
45
46
// --- Mutability flags (derived from port count ranges across the selection) ---
47
48
bool
canChangeAppearance
=
false
;
49
bool
canChangeInputSize
=
false
;
50
bool
canChangeOutputSize
=
false
;
51
bool
canMorph
=
false
;
52
53
// --- Consensus flags (true when all selected elements share the same value) ---
54
55
bool
hasSameAudio
=
false
;
56
bool
hasSameColors
=
false
;
57
bool
hasSameDelay
=
false
;
58
bool
hasSameFrequency
=
false
;
59
bool
hasSameInputSize
=
false
;
60
bool
hasSameLabel
=
false
;
61
bool
hasSameOutputSize
=
false
;
62
bool
hasSameOutputValue
=
false
;
63
bool
hasSameTrigger
=
false
;
64
bool
hasSameType
=
false
;
65
bool
hasSameVolume
=
false
;
66
67
// --- Derived state ---
68
69
bool
sameCheckState
=
false
;
70
int
minimumInputs
= 0;
71
int
maximumInputs
= 0;
72
int
minimumOutputs
= 0;
73
int
maximumOutputs
= 0;
74
int
maxCurrentOutputSize
= 0;
75
ElementType
elementType
= ElementType::Unknown;
76
};
77
83
SelectionCapabilities
computeCapabilities
(
const
QList<GraphicElement *> &elements);
Enums.h
Central enumeration types for element types, groups, and signal status.
ElementType
Enums::ElementType ElementType
Definition
Enums.h:107
computeCapabilities
SelectionCapabilities computeCapabilities(const QList< GraphicElement * > &elements)
Computes the SelectionCapabilities for a list of selected elements.
Definition
SelectionCapabilities.cpp:10
GraphicElement
Abstract base class for all graphical circuit elements in wiRedPanda.
Definition
GraphicElement.h:59
SelectionCapabilities
Computed capabilities and consensus state of the current element selection.
Definition
SelectionCapabilities.h:24
SelectionCapabilities::hasSameDelay
bool hasSameDelay
Definition
SelectionCapabilities.h:57
SelectionCapabilities::minimumInputs
int minimumInputs
Definition
SelectionCapabilities.h:70
SelectionCapabilities::hasAudioBox
bool hasAudioBox
Definition
SelectionCapabilities.h:27
SelectionCapabilities::hasLatchedValue
bool hasLatchedValue
Definition
SelectionCapabilities.h:35
SelectionCapabilities::hasLabel
bool hasLabel
Definition
SelectionCapabilities.h:33
SelectionCapabilities::canChangeOutputSize
bool canChangeOutputSize
Definition
SelectionCapabilities.h:50
SelectionCapabilities::hasDelay
bool hasDelay
Definition
SelectionCapabilities.h:30
SelectionCapabilities::maximumInputs
int maximumInputs
Definition
SelectionCapabilities.h:71
SelectionCapabilities::hasSameAudio
bool hasSameAudio
Definition
SelectionCapabilities.h:55
SelectionCapabilities::hasSameColors
bool hasSameColors
Definition
SelectionCapabilities.h:56
SelectionCapabilities::hasSameOutputSize
bool hasSameOutputSize
Definition
SelectionCapabilities.h:61
SelectionCapabilities::hasElements
bool hasElements
Definition
SelectionCapabilities.h:31
SelectionCapabilities::maximumOutputs
int maximumOutputs
Definition
SelectionCapabilities.h:73
SelectionCapabilities::canChangeInputSize
bool canChangeInputSize
Definition
SelectionCapabilities.h:49
SelectionCapabilities::hasSameLabel
bool hasSameLabel
Definition
SelectionCapabilities.h:60
SelectionCapabilities::hasOnlyInputs
bool hasOnlyInputs
Definition
SelectionCapabilities.h:34
SelectionCapabilities::hasTruthTable
bool hasTruthTable
Definition
SelectionCapabilities.h:38
SelectionCapabilities::hasWirelessMode
bool hasWirelessMode
Definition
SelectionCapabilities.h:36
SelectionCapabilities::maxCurrentOutputSize
int maxCurrentOutputSize
Definition
SelectionCapabilities.h:74
SelectionCapabilities::hasAudio
bool hasAudio
Definition
SelectionCapabilities.h:28
SelectionCapabilities::hasSameFrequency
bool hasSameFrequency
Definition
SelectionCapabilities.h:58
SelectionCapabilities::hasSameType
bool hasSameType
Definition
SelectionCapabilities.h:64
SelectionCapabilities::hasFrequency
bool hasFrequency
Definition
SelectionCapabilities.h:32
SelectionCapabilities::sameCheckState
bool sameCheckState
Definition
SelectionCapabilities.h:69
SelectionCapabilities::canMorph
bool canMorph
Definition
SelectionCapabilities.h:51
SelectionCapabilities::hasTrigger
bool hasTrigger
Definition
SelectionCapabilities.h:37
SelectionCapabilities::elementType
ElementType elementType
Definition
SelectionCapabilities.h:75
SelectionCapabilities::hasSameTrigger
bool hasSameTrigger
Definition
SelectionCapabilities.h:63
SelectionCapabilities::hasColors
bool hasColors
Definition
SelectionCapabilities.h:29
SelectionCapabilities::hasSameInputSize
bool hasSameInputSize
Definition
SelectionCapabilities.h:59
SelectionCapabilities::canChangeAppearance
bool canChangeAppearance
Definition
SelectionCapabilities.h:48
SelectionCapabilities::hasSameVolume
bool hasSameVolume
Definition
SelectionCapabilities.h:65
SelectionCapabilities::hasVolume
bool hasVolume
Definition
SelectionCapabilities.h:39
SelectionCapabilities::hasSameOutputValue
bool hasSameOutputValue
Definition
SelectionCapabilities.h:62
SelectionCapabilities::isFileBacked
bool isFileBacked
Definition
SelectionCapabilities.h:43
SelectionCapabilities::isEmbedded
bool isEmbedded
Definition
SelectionCapabilities.h:44
SelectionCapabilities::minimumOutputs
int minimumOutputs
Definition
SelectionCapabilities.h:72
App
UI
SelectionCapabilities.h
Generated by
1.16.1