trikRuntime
communicationSettingsWidget.h
Go to the documentation of this file.
1 /* Copyright 2014 - 2015 CyberTech Labs Ltd.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. */
14 
15 #pragma once
16 
17 #include <QtCore/qglobal.h>
18 
19 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
20  #include <QtGui/QWidget>
21  #include <QtGui/QVBoxLayout>
22  #include <QtGui/QLabel>
23 #else
24  #include <QtWidgets/QWidget>
25  #include <QtWidgets/QVBoxLayout>
26  #include <QtWidgets/QLabel>
27 #endif
28 
30 
31 #include "trikGuiDialog.h"
32 #include "numberSelectionWidget.h"
33 #include "connectButton.h"
34 
35 namespace trikGui {
36 
39 {
40  Q_OBJECT
41 
42 public:
46  explicit CommunicationSettingsWidget(trikNetwork::MailboxInterface &mailbox, QWidget *parent = 0);
47 
49  static QString menuEntry();
50 
51 public slots:
52  void renewFocus() override;
53 
54 protected:
55  void keyPressEvent(QKeyEvent *event) override;
56 
57 private slots:
59  void onConnectButtonClicked();
60 
63  void onHullNumberChanged(int newHullNumber);
64 
66  void focusUp();
67 
69  void focusDown();
70 
71 private:
73  QVBoxLayout mLayout;
74 
76  QLabel mTitle;
77 
79  QLabel mSelectorsHelpLabel;
80 
82  QLabel mHullNumberLabel;
83 
85  NumberSelectionWidget mHullNumberSelector;
86 
88  QLabel mServerIpLabel;
89 
91  QLabel mIpHelpLabel;
92 
94  NumberSelectionWidget mServerIpSelector;
95 
97  ConnectButton mConnectButton;
98 
101 };
102 
103 }
void keyPressEvent(QKeyEvent *event) override
Definition: communicationSettingsWidget.cpp:98
Widget that is used to configure settings of robot group communication via mailboxes.
Definition: communicationSettingsWidget.h:38
Widget that allows to input integer numbers using robot keys.
Definition: numberSelectionWidget.h:32
Base class for all trikGui dialog widgets.
Definition: trikGuiDialog.h:24
static QString menuEntry()
String that shall appear in menu for this widget.
Definition: communicationSettingsWidget.cpp:81
Definition: abstractIndicator.h:21
CommunicationSettingsWidget(trikNetwork::MailboxInterface &mailbox, QWidget *parent=0)
Constructor.
Definition: communicationSettingsWidget.cpp:22
void renewFocus() override
Definition: communicationSettingsWidget.cpp:86
Allows communication between robots.
Definition: mailboxInterface.h:31
Somewhat tuned button for communication settings widget.
Definition: connectButton.h:28