move build system to cmake, add train overlord
This commit is contained in:
parent
ddd0b3a732
commit
a1f9fa172b
60 changed files with 338 additions and 997 deletions
28
src/common/items/signal.cpp
Normal file
28
src/common/items/signal.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include "signal.h"
|
||||
|
||||
Microcontroller *Signal::micro = nullptr;
|
||||
|
||||
Signal::Signal(uint8_t id, uint8_t address, uint8_t subaddress, uint8_t type, int8_t initalValue)
|
||||
: Item(address | (subaddress << 8), QString("Turnout ")+QString::number(id), initalValue),
|
||||
subaddress_(subaddress), signalId_(id), type_(type)
|
||||
{
|
||||
itemId_ = address | (subaddress << 8);
|
||||
name_ = QString("Signal ")+QString::number(id);
|
||||
}
|
||||
|
||||
void Signal::setValue(int8_t value)
|
||||
{
|
||||
Item::setValue(value);
|
||||
if(micro)
|
||||
micro->signalSetValue(signalId_, value);
|
||||
}
|
||||
|
||||
bool Signal::hasSlow()
|
||||
{
|
||||
return type_ & TYPE_HAS_SLOW;
|
||||
}
|
||||
|
||||
bool Signal::hasExpect()
|
||||
{
|
||||
return type_ & TYPE_HAS_EXPECT;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue