-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWSignal.h
74 lines (73 loc) · 3.48 KB
/
WSignal.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* shunt signal [- WSIGNAL.H -]
*******************************************************************************
* shunt signal for shunting trips, possible routes include: *
* - shunt signal to main signal *
* - shunt signal to shunt signal *
*******************************************************************************
*/
#ifndef WSIGNAL_H
#define WSIGNAL_H
#include "VSignal.h"
#include <QLabel>
#include "WSignalQPushButton.h"
#include <QObject>
#include <Block.h>
#include <Weiche.h>
#include <QString>
#include <QList>
#include <QPair>
#include <QMessageBox>
class WSignal : public QObject,public VSignal{ //WSignal inherits from VSignal
Q_OBJECT
public:
WSignal( int name ) : VSignal( name ){ setV_id( name ); }// with :HSignal(name) call the Super Constructor
void setV_id( int name ); //overload setS_id, because of W as prefix
void setFahrt(WSignal* toZiel);
void setFahrt(QString toZiel);
QString getZiel(){ return ziel; }
void addWeichenstatus( WSignal *toZiel , QList<QPair<Weiche* , bool>> weichenpair );
void addWeichenstatusZuH( QString toZiel , QList<QPair<Weiche* , bool>> weichenpair );
//void showWeichenstatusALL();
void showWeichenstatus( WSignal *whichZiel );
void addBlock( WSignal *toZiel , QList<Block*> inputBlock );
void addBlockZuH( QString toZiel , QList<Block*> inputBlock );
void showBlock( WSignal *whichZiel );
//void showBlockALL();
void deleteNachbar( WSignal *todelete );
void setZiel( QString zziel );
void deleteFS();
bool isNachbar(WSignal *toZiel); //check if end signal is neighbour
bool isNachbar(QString toZiel); //check if end signal is neighbour overload
void changeColor();
~WSignal();
//
//+++ GUI +++
//
void addButtonAndLabel(QLabel *lab, WSignalQPushButton *but);
void moveLabel( int x , int y ){ beschriftung->move(x,y); }
void moveButton( int x, int y ){ push->move(x,y); }
signals:
void listened( WSignal *clickedWS);
void refreshStellwerkstechnikW( QString sig , bool stat ); //update stellwerkstechnik
public slots:
void listenToFS(); //look for clicks, which will be conerted to route commands from clickmanager
void zugpassiertW(QString addressedSignal); //zugpassiert for routes of character WS->WS FS
void showShowContexts();
void showWeichenstatusALL();
void showBlockALL();
//void zugpassiert() //zugpassiert from routes of character HS->HS with WS as VS: WS inherits from VS and inherits therefore VS`s zugpassiert
private:
QString ziel; //save end signal
bool hasWSZiel = false;
bool hasHSZiel = false;
QList<QPair<QString , QList<QPair<Weiche* , bool>> > > weichenstatus; // involved turnouts in specific routes to WS
QList<QPair<QString, QList<Block*>> > block; // involved segments in specific routes to WS
QList<QPair<QString , QList<QPair<Weiche* , bool>> > > weichenstatusZuH;// involved turnouts in specific routes to HS
QList<QPair<QString, QList<Block*>> > blockZuH; // involved segments in specific routes to HS
//+++GUI+++
QLabel *beschriftung = new QLabel();
WSignalQPushButton *push = new WSignalQPushButton();
QMessageBox *showBox = new QMessageBox();
};
#endif