Please enable JavaScript to use RhodeCode Enterprise
##// END OF EJS Templates
Jeandet Alexis
- Fri, 14 Mar 2014 19:01:56
Show More
0
spwplugin/SpwTcpPacketServer/spwtcppacketserver.cpp
spwplugin/SpwTcpPacketServer/spwtcppacketserver.cpp
+33
0
@@
-27,9
+27,42
SpwTcpPacketServer::SpwTcpPacketServer(Q
27
27
ui ( new Ui :: SpwTcpPacketServer )
28
28
{
29
29
ui -> setupUi ( this );
30
this -> p_bridge = NULL ;
31
this -> p_server = new QTcpServer ();
32
connect ( this -> ui -> startServeQpb , SIGNAL ( clicked ( bool )), SLOT ( toggleServer ()));
30
33
}
31
34
32
35
SpwTcpPacketServer ::~ SpwTcpPacketServer ()
33
36
{
34
37
delete ui ;
35
38
}
39
40
void SpwTcpPacketServer :: setBridge ( abstractSpwBridge * bridge )
41
{
42
if ( this -> p_bridge != NULL )
43
{
44
disconnect ( this , SLOT ( pushPacket ( char * , int )));
45
}
46
this -> p_bridge = bridge ;
47
connect ( bridge , SIGNAL ( pushPacketOverTCP ( char * , int )), SLOT ( pushPacket ( char * , int )));
48
}
49
50
void SpwTcpPacketServer :: pushPacket ( char * packet , int size )
51
{
52
53
}
54
55
void SpwTcpPacketServer :: toggleServer ()
56
{
57
if ( this -> p_server -> isListening ())
58
{
59
this -> ui -> startServeQpb -> setText ( "Start Server" );
60
this -> p_server -> close ();
61
}
62
else
63
{
64
this -> p_server -> listen ( QHostAddress :: Any , this -> ui -> PortLineEdit -> text (). toInt ());
65
66
this -> ui -> startServeQpb -> setText ( "Stop Server" );
67
}
68
}
0
spwplugin/SpwTcpPacketServer/spwtcppacketserver.h
spwplugin/SpwTcpPacketServer/spwtcppacketserver.h
+9
0
@@
-23,6
+23,8
23
23
#define SPWTCPPACKETSERVER_H
24
24
25
25
#include <QWidget>
26
#include <abstractspwbridge.h>
27
#include <QTcpServer>
26
28
27
29
namespace Ui {
28
30
class SpwTcpPacketServer ;
@@
-36,8
+38,15
public:
36
38
explicit SpwTcpPacketServer ( QWidget * parent = 0 );
37
39
~ SpwTcpPacketServer ();
38
40
41
void setBridge ( abstractSpwBridge * bridge );
42
43
public slots :
44
void pushPacket ( char * packet , int size );
45
void toggleServer ();
39
46
private :
40
47
Ui :: SpwTcpPacketServer * ui ;
48
abstractSpwBridge * p_bridge ;
49
QTcpServer * p_server ;
41
50
};
42
51
43
52
#endif // SPWTCPPACKETSERVER_H
0
spwplugin/abstractspwbridge.h
spwplugin/abstractspwbridge.h
+1
0
@@
-42,6
+42,7
public slots:
42
42
virtual int pushRMAPPacket ( char * packet , int size ) = 0 ;
43
43
signals :
44
44
void setConnected ( bool connected );
45
void pushPacketOverTCP ( char * packet , int size );
45
46
protected :
46
47
socexplorerplugin * plugin ;
47
48
QWidget * p_GUI ;
0
spwplugin/spwplugin.cpp
spwplugin/spwplugin.cpp
+4
0
@@
-24,14
+24,18
24
24
#include "stardundeespw_usb.h"
25
25
#include <socexplorerproxy.h>
26
26
#include "spwpywrapper.h"
27
27
28
spwplugin :: spwplugin ( QWidget * parent ) : socexplorerplugin ( parent , false )
28
29
{
29
30
Q_UNUSED ( parent )
30
31
this -> bridge = NULL ;
31
32
this -> scanDone = false ;
32
33
this -> pyObject = new spwPyWrapper ( this );
34
this -> tcpServer = new SpwTcpPacketServer ( this );
33
35
this -> mainGroupBox = new QGroupBox ( "SpaceWire Plugin Configuration" , this );
34
36
this -> bridgeSelector = new QComboBox ( this );
37
this -> mainTabWidgt = new QTabWidget ( this );
38
this -> mainTabWidgt -> addTab ( this -> mainGroupBox , "Bridge Configuration" )
35
39
this -> mainLayout = new QGridLayout ( this -> mainGroupBox );
36
40
this -> mainLayout -> addWidget ( new QLabel ( "Select SpaceWire bridge" , this ), 0 , 0 , 1 , 1 , Qt :: AlignCenter );
37
41
this -> mainLayout -> addWidget ( this -> bridgeSelector , 0 , 1 , 1 , 1 );
0
spwplugin/spwplugin.h
spwplugin/spwplugin.h
+4
0
@@
-28,10
+28,12
28
28
#include <QGroupBox>
29
29
#include <QComboBox>
30
30
#include <QLabel>
31
#include <QTabWidget>
31
32
32
33
#include <abstractspwbridge.h>
33
34
#include <socexplorerplugin.h>
34
35
36
#include "SpwTcpPacketServer/spwtcppacketserver.h"
35
37
36
38
class spwplugin : public socexplorerplugin
37
39
{
@@
-62,7
+64,9
signals:
62
64
63
65
private :
64
66
abstractSpwBridge * bridge ;
67
SpwTcpPacketServer * tcpServer ;
65
68
bool scanDone ;
69
QTabWidget * mainTabWidgt ;
66
70
QGroupBox * mainGroupBox ;
67
71
QComboBox * bridgeSelector ;
68
72
QGridLayout * mainLayout ;
0
spwplugin/spwplugin.pro
spwplugin/spwplugin.pro
+1
0
@@
-4,6
+4,7
4
4
#-------------------------------------------------
5
5
6
6
CONFIG += socexplorerplugin
7
QT += network
7
8
win32: CONFIG += dll
8
9
win32: CONFIG -= static
9
10
CONFIG ( debug , debug | release ) {
0
spwplugin/stardundeespw_usb.h
spwplugin/stardundeespw_usb.h
0
-1
@@
-122,7
+122,6
public slots:
122
122
private :
123
123
void makeGUI ( socexplorerplugin * parent );
124
124
stardundeeSPW_USB_Manager * manager ;
125
// QGridLayout* mainLayout;
126
125
};
127
126
128
127
#endif // STARDUNDEESPW_USB_H
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
g 0-9
Goto bookmarked items from 0-9
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository access permissions settings
t s
Toggle sidebar on some pages