trikRuntime
gyroscopeIndicator.h
Go to the documentation of this file.
1 /* Copyright 2019 Dina Funt
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 <QVBoxLayout>
18 #include <QLabel>
19 #include <QRectF>
20 
21 #include "abstractIndicator.h"
22 
23 namespace trikControl {
24 class GyroSensorInterface;
25 }
26 
27 namespace trikGui {
28 
31 {
32  Q_OBJECT
33 
34 public:
38  explicit GyroscopeIndicator(trikControl::GyroSensorInterface &gyroscope, QWidget *parent = 0);
39 
40 public slots:
41  void renew() override;
42 
43 private:
44  void resizeEvent(QResizeEvent *) override;
45  void paintEvent(QPaintEvent *) override;
46 
47  QRectF mBounds;
48 
49  QLabel mTitle;
50  QLabel mValueX;
51  QLabel mValueY;
52  QLabel mValueZ;
53  QLabel mCircle;
54  QVBoxLayout mLayout;
55 
56  int mX {};
57  int mY {};
58  int mZ {};
60 };
61 }
Base class for a widget that can show some reading from sensor, encoder and so on.
Definition: abstractIndicator.h:24
Definition: abstractIndicator.h:21
Widget that shows current gyroscope reading.
Definition: gyroscopeIndicator.h:30
Definition: trikCommunicator.h:27
Class that returns raw and processed data from the gyroscope.
Definition: gyroSensorInterface.h:27