Initial circuits plugin work.
This commit is contained in:
parent
b5f21900eb
commit
f8a2ce3c59
50 changed files with 1451 additions and 97 deletions
35
plugins/circuits/src/Terminal.h
Normal file
35
plugins/circuits/src/Terminal.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
#include "CircuitElement.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
class Wire;
|
||||
|
||||
class Terminal : public CircuitElement
|
||||
{
|
||||
public:
|
||||
enum class TerminalType
|
||||
{
|
||||
INPUT,
|
||||
OUTPUT
|
||||
};
|
||||
|
||||
Terminal(TerminalType type, const std::string& label = {});
|
||||
|
||||
Wire* getConnection() const;
|
||||
|
||||
Type getType() const override
|
||||
{
|
||||
return mType == TerminalType::INPUT ? Type::INPUT_TERMINAL : Type::OUTPUT_TERMINAL;
|
||||
}
|
||||
|
||||
void setConnection(Wire* connection);
|
||||
|
||||
private:
|
||||
std::string mLabel;
|
||||
bool mValue{ false };
|
||||
TerminalType mType;
|
||||
Wire* mConnection{ nullptr };
|
||||
};
|
||||
using TerminalPtr = std::unique_ptr<Terminal>;
|
Loading…
Add table
Add a link
Reference in a new issue