trikRuntime
accelerometerWidget.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 VectorSensorInterface;
25 }
26 
27 namespace trikGui {
28 
31 {
32  Q_OBJECT
33 
34 public:
38  explicit AccelerometerWidget(trikControl::VectorSensorInterface &accelerometer, 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  QRectF mKnopBounds;
49 
50  QLabel mTitle;
51  QLabel mValueX;
52  QLabel mValueY;
53  QLabel mValueZ;
54  QLabel mCircle;
55  QVBoxLayout mLayout;
56 
57  trikControl::VectorSensorInterface &mAccelerometer;
58 };
59 }
Sensor that returns a vector.
Definition: vectorSensorInterface.h:29
Base class for a widget that can show some reading from sensor, encoder and so on.
Definition: abstractIndicator.h:24
Widget that shows current accelerometer reading.
Definition: accelerometerWidget.h:30
Definition: abstractIndicator.h:21
Definition: trikCommunicator.h:27