File indexing completed on 2024-10-06 03:30:32
0001 /* 0002 SPDX-FileCopyrightText: 2017 Artem Fedoskin <afedoskin3@gmail.com> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 #pragma once 0006 0007 #include <QObject> 0008 0009 class DeviceOrientation : public QObject 0010 { 0011 Q_OBJECT 0012 0013 // Q_PROPERTY(int azimuth MEMBER m_Azimuth NOTIFY azimuthChanged) 0014 // Q_PROPERTY(int pitch MEMBER m_Pitch NOTIFY pitchChanged) 0015 // Q_PROPERTY(int roll MEMBER m_Roll NOTIFY rollChanged) 0016 public: 0017 explicit DeviceOrientation(QObject *parent = nullptr); 0018 void getOrientation(); 0019 0020 float getAzimuth() { return m_Azimuth; } 0021 float getAltitude() { return m_Altitude; } 0022 float getRoll() { return m_Roll; } 0023 void stopSensors(); 0024 void startSensors(); 0025 signals: 0026 // void pitchChanged(int pitch); 0027 // void azimuthChanged(int Azimuth); 0028 // void rollChanged(int roll); 0029 0030 private: 0031 float m_Azimuth { 0 }; 0032 float m_Altitude { 0 }; 0033 float m_Roll { 0 }; 0034 };