Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 207b75a4

Přidáno uživatelem Oto Šťáva před téměř 4 roky(ů)

Re #9001 - Make Qt server port configurable

Zobrazit rozdíly:

deltarobot/curvedataserver.cpp
122 122

  
123 123
// Server //////////////////////////////////////////////////////////////////////////////////////////////////////////////
124 124

  
125
CurveDataServer::CurveDataServer() :
125
CurveDataServer::CurveDataServer(quint16 port) :
126 126
    _server(this),
127 127
    _sockets()
128 128
{
129
    _server.listen(QHostAddress::Any, 4242);
129
    qDebug() << "Curve server listening on port" << port;
130
    _server.listen(QHostAddress::Any, port);
130 131
    connect(&_server, SIGNAL(newConnection()), this, SLOT(onNewConnection()));
131 132
}
132 133

  
deltarobot/curvedataserver.h
51 51
        Client(QTcpSocket* socket);
52 52
    };
53 53

  
54
    explicit CurveDataServer();
54
    explicit CurveDataServer(quint16 port = 4242);
55 55
    ~CurveDataServer();
56 56

  
57 57
    /** Sends the current actuator position. */
deltarobot/mainwindow.cpp
94 94

  
95 95
MainWindow::MainWindow(QWidget *parent) :
96 96
    QMainWindow(parent),
97
    ui(new Ui::MainWindow),
98
    cdServer(new CurveDataServer)
97
    ui(new Ui::MainWindow)
99 98
{
100 99
    ui->setupUi(this);
101 100

  
......
205 204
    //ui->glwidget->setConfig(cStep);
206 205
    calculatedCurve.clear();
207 206

  
207
    cdServer = new CurveDataServer(st.value("curveServerPort", "4242").toUInt());
208

  
208 209
    //inicializace databaze
209 210
    useDb = st.value("useDb", 0).toInt();
210 211
    auto dbAddr = st.value("dbAddress", "localhost").toString();

Také k dispozici: Unified diff