Enroute Flight Navigation
A navigation app for VFR pilots
src
traffic
ConnectionScanner_SerialPort.h
1
/***************************************************************************
2
* Copyright (C) 2025 by Stefan Kebekus *
3
* stefan.kebekus@gmail.com *
4
* *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 3 of the License, or *
8
* (at your option) any later version. *
9
* *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
14
* *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program; if not, write to the *
17
* Free Software Foundation, Inc., *
18
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19
***************************************************************************/
20
21
#pragma once
22
23
#include <QQmlEngine>
24
25
#include "traffic/ConnectionScanner_Abstract.h"
26
27
28
namespace
Traffic {
29
36
class
ConnectionScanner_SerialPort
:
public
ConnectionScanner_Abstract
{
37
Q_OBJECT
38
QML_ELEMENT
39
QML_SINGLETON
40
41
// Properties need to be repeated, or else the Qt CMake macros cannot find them.
42
Q_PROPERTY(QList<Traffic::ConnectionInfo> connectionInfos READ connectionInfos NOTIFY
connectionInfosChanged
)
43
Q_PROPERTY(QString error READ error NOTIFY
errorChanged
)
44
Q_PROPERTY(
bool
scanning READ scanning NOTIFY
scanningChanged
)
45
46
public
:
53
explicit
ConnectionScanner_SerialPort
(QObject* parent =
nullptr
);
54
55
// No default constructor, important for QML singleton
56
explicit
ConnectionScanner_SerialPort
() =
delete
;
57
58
// factory function for QML singleton
59
static
Traffic::ConnectionScanner_SerialPort
* create(QQmlEngine*
/*unused*/
, QJSEngine*
/*unused*/
)
60
{
61
return
new
Traffic::ConnectionScanner_SerialPort
(
nullptr
);
62
}
63
64
public
slots:
65
// Re-implemented from ConnectionScanner_Abstract
66
void
start
()
override
;
67
68
// Re-implemented from ConnectionScanner_Abstract
69
void
stop
()
override
{ m_running =
false
;};
70
71
private
:
72
bool
m_running {
false
};
73
};
74
75
}
// namespace Traffic
Traffic::ConnectionScanner_Abstract::errorChanged
void errorChanged()
Notifier signal.
Traffic::ConnectionScanner_Abstract::start
virtual void start()=0
Start scan process.
Traffic::ConnectionScanner_Abstract::scanningChanged
void scanningChanged()
Notifier signal.
Traffic::ConnectionScanner_Abstract::ConnectionScanner_Abstract
ConnectionScanner_Abstract(QObject *parent=nullptr)
Constructor.
Traffic::ConnectionScanner_Abstract::stop
virtual void stop()=0
Stop scan process.
Traffic::ConnectionScanner_Abstract::connectionInfosChanged
void connectionInfosChanged()
Notifier signal.
Traffic::ConnectionScanner_SerialPort
Connection Scanner: SerialPort Devices.
Definition
ConnectionScanner_SerialPort.h:36
Traffic::ConnectionScanner_SerialPort::ConnectionScanner_SerialPort
ConnectionScanner_SerialPort(QObject *parent=nullptr)
Constructor.
Generated by
1.14.0