-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclickmanager.h
37 lines (36 loc) · 1.71 KB
/
clickmanager.h
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
36
37
/*
* clickmanager to control the rail system [- CLICKMANAGER.H -]
*******************************************************************************
* - click from signal A to B --> sets route (automatically reserves *
* segments and turnouts) *
* - double click on signal A deletes the route, but not the memory *
*******************************************************************************
*/
#ifndef CLICKMANAGER_H
#define CLICKMANAGER_H
#include <QObject>
#include <QPair>
#include <HSignal.h>
#include <WSignal.h>
class clickmanager : public QObject{
Q_OBJECT
public:
clickmanager(){}
~clickmanager(){}
public slots:
void recieveFS(HSignal *toFS);
void recieveFS(WSignal *toFS);
protected:
void reset();
int counter = 2; //counter registers two last HSignal clicks-->counter=2 cf reciveFS
int counterForW = 2; //counter registers two last WSignal clicks -->counter=2 cf reciveFS
int counterForHW = 2; //counter needed for HS->WS signalling
int counterForWH = 2; //counter, needed for WS->HS signalling
QPair<HSignal*,HSignal*> clickList; //HS->HS
QPair<WSignal*,WSignal*> clickListW; //WS->WS
QPair<HSignal*,WSignal*> clickListHW; //HS->WS
QPair<WSignal*,HSignal*> clickListWH; //WS->HS
bool toW = false; //is there a transition from HS->WS
bool toH = false; //is there a transition from WS->HS
};
#endif // CLICKMANAGER_H