00001 00008 00009 00010 #ifndef VIRTUAL_CLIENT_H 00011 #define VIRTUAL_CLIENT_H 00012 00013 #include "engine.h" 00014 #include "rail.h" 00015 00016 #include <QObject> 00017 00022 class VirtualClient : public QObject 00023 { 00024 Q_OBJECT 00025 00026 public : 00027 00029 VirtualClient( QObject *parent ) ; 00030 00031 public slots : 00032 00035 void setLocalPort( quint16 port ) ; 00036 00039 void setServerPort( quint16 port ) ; 00040 00043 void setServerAddress( QString address ) ; 00044 00047 virtual void setConnection( const bool &c ) = 0 ; 00048 00052 virtual void setPower( const bool &power ) = 0 ; 00053 00057 virtual void requestNewRailState() = 0 ; 00058 00061 virtual void setNewEngineState() = 0 ; 00062 00063 signals : 00065 void errorOccured( QString ) ; 00066 00068 void connectionErrorOccured( QString ) ; 00069 void writeErrorOccured( QString ) ; 00070 void readErrorOccured( QString ) ; 00071 00074 void infoReceived( QString ) ; 00075 00078 void infoReceivedRailState( int, bool ) ; 00079 00082 void infoReceivedEngineState( int, bool, int, bool, bool, bool, bool ) ; 00083 00086 void infoReceivedPower( bool ) ; 00087 00088 private slots : 00089 00090 protected : 00091 00093 quint16 _localPort ; 00094 00096 quint16 _serverPort ; 00097 00099 QString _serverAddress ; 00100 } ; 00101 00102 00103 #endif // VIRTUAL_CLIENT_H