trikRuntime
encoderIndicator.h
Go to the documentation of this file.
1 /* Copyright 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/QHBoxLayout>
21  #include <QtGui/QLabel>
22  #include <QtGui/QDial>
23 #else
24  #include <QtWidgets/QHBoxLayout>
25  #include <QtWidgets/QLabel>
26  #include <QtWidgets/QDial>
27 #endif
28 
29 #include "abstractIndicator.h"
30 
31 namespace trikControl {
32 class EncoderInterface;
33 }
34 
35 namespace trikGui {
36 
39 {
40  Q_OBJECT
41 
42 public:
47  EncoderIndicator(const QString &port, trikControl::EncoderInterface &encoder, QWidget *parent = 0);
48 
49 public slots:
50  void renew() override;
51 
52 private:
54 
55  QHBoxLayout mLayout;
56  QLabel mNameLabel;
57  QDial mValueDial;
58  QLabel mValueLabel;
59 };
60 
61 }
static const int port
Definition: trikCommunicatorTest.cpp:24
Base class for a widget that can show some reading from sensor, encoder and so on.
Definition: abstractIndicator.h:24
Definition: abstractIndicator.h:21
Encoder of power motor.
Definition: encoderInterface.h:26
Definition: trikCommunicator.h:27
Widget that shows current encoder reading.
Definition: encoderIndicator.h:38