-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircuitelement.cpp
35 lines (33 loc) · 1.07 KB
/
circuitelement.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "circuitelement.h"
#include <QPainter>
#include <QStyleOptionGraphicsItem>
#include "delay_file.h"
#include "currentcircuit.h"
CircuitElement::CircuitElement(){
elementName = "";
delay = 0;
arrivalTime = 0;
}
CircuitElement::CircuitElement(std::string name, CircuitElementType type, std::string subcircuitType)
{
DelayFile delay_file{CurrentCircuit::delay_file_name};
elementName = name;
elementType = type;
this->subcircuitType = subcircuitType;
delay = delay_file.delay_of_element(name);
arrivalTime = 0;
}
bool CircuitElement::operator==(const CircuitElement& other)
{
if (this->elementName == other.elementName && this->elementType == other.elementType)
return true;
return false;
}
bool CircuitElement::isGate(){
if(this->elementType == CircuitElementType::WIRE || this->elementType == CircuitElementType::INPUT || this->elementType == CircuitElementType::OUTPUT || this->elementType == CircuitElementType::SUBCIRCUIT){
return false;
}
else{
return true;
}
}