switch from spaces to tabs
This commit is contained in:
parent
57edc50b6b
commit
872488d174
30 changed files with 971 additions and 929 deletions
|
|
@ -20,64 +20,64 @@
|
|||
class Microcontroller : public QObject
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
static constexpr char AMP_RELAY = 0;
|
||||
static constexpr char SENSOR_TEMPERATURE = 1;
|
||||
static constexpr char SENSOR_DOOR = 0 ;
|
||||
static constexpr char AMP_RELAY = 0;
|
||||
static constexpr char SENSOR_TEMPERATURE = 1;
|
||||
static constexpr char SENSOR_DOOR = 0 ;
|
||||
|
||||
private:
|
||||
|
||||
static constexpr int TRAIN_LIST = 1;
|
||||
static constexpr int TURNOUT_LIST = 2;
|
||||
static constexpr int TRAIN_LIST = 1;
|
||||
static constexpr int TURNOUT_LIST = 2;
|
||||
|
||||
int listMode = 0;
|
||||
int listMode = 0;
|
||||
|
||||
//uint8_t _auxState = 0;
|
||||
//uint8_t _auxState = 0;
|
||||
|
||||
QIODevice* _port = nullptr;
|
||||
QIODevice* _port = nullptr;
|
||||
|
||||
std::vector< std::shared_ptr<Item> > itemList;
|
||||
std::vector< std::shared_ptr<Item> > itemList;
|
||||
|
||||
QScopedPointer<QEventLoop> loop;
|
||||
QString _buffer;
|
||||
QScopedPointer<QEventLoop> loop;
|
||||
QString _buffer;
|
||||
|
||||
void processMicroReturn();
|
||||
void processList(const QString& buffer);
|
||||
void processItemState(const QString& buffer);
|
||||
std::shared_ptr<Item> processTrainLine(const QString& buffer);
|
||||
std::shared_ptr<Item> processTurnoutLine(const QString& buffer);
|
||||
void processMicroReturn();
|
||||
void processList(const QString& buffer);
|
||||
void processItemState(const QString& buffer);
|
||||
std::shared_ptr<Item> processTrainLine(const QString& buffer);
|
||||
std::shared_ptr<Item> processTurnoutLine(const QString& buffer);
|
||||
|
||||
void write(char *buffer, const size_t length);
|
||||
void write(const QByteArray& buffer);
|
||||
void write(char *buffer, const size_t length);
|
||||
void write(const QByteArray& buffer);
|
||||
|
||||
public:
|
||||
Microcontroller(QIODevice* port);
|
||||
Microcontroller();
|
||||
~Microcontroller();
|
||||
bool connected();
|
||||
void setIODevice(QIODevice* port);
|
||||
Microcontroller(QIODevice* port);
|
||||
Microcontroller();
|
||||
~Microcontroller();
|
||||
bool connected();
|
||||
void setIODevice(QIODevice* port);
|
||||
|
||||
public slots:
|
||||
void requestState();
|
||||
void requestState();
|
||||
|
||||
void trainSetSpeed(uint8_t id, int8_t speed);
|
||||
void trainReverse(uint8_t id);
|
||||
void trainSetFunction(uint8_t id, uint8_t function, bool on);
|
||||
void tunoutSetDirection(uint8_t id, bool direction);
|
||||
void estop();
|
||||
void setPower(bool on);
|
||||
void trainReverse(uint8_t id);
|
||||
void trainSetFunction(uint8_t id, uint8_t function, bool on);
|
||||
void tunoutSetDirection(uint8_t id, bool direction);
|
||||
void estop();
|
||||
void setPower(bool on);
|
||||
|
||||
private slots:
|
||||
void isReadyRead();
|
||||
void isReadyRead();
|
||||
|
||||
signals:
|
||||
void textRecived(const QString string);
|
||||
void itemChanged(ItemData relay);
|
||||
void auxStateChanged(int value);
|
||||
void gotItemList(std::vector< std::shared_ptr<Item> >&);
|
||||
void textRecived(const QString string);
|
||||
void itemChanged(ItemData relay);
|
||||
void auxStateChanged(int value);
|
||||
void gotItemList(std::vector< std::shared_ptr<Item> >&);
|
||||
};
|
||||
|
||||
#endif // MICROCONTROLLER_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue