Kstars

cloud.h
1/*
2 SPDX-FileCopyrightText: 2018 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 Cloud Channel
5
6 SPDX-License-Identifier: GPL-2.0-or-later
7*/
8
9#pragma once
10
11#include <QtWebSockets/QWebSocket>
12#include <memory>
13
14#include "ekos/manager.h"
15#include "nodemanager.h"
16
17class FITSView;
18
19namespace EkosLive
20{
21class Cloud : public QObject
22{
24
25 public:
26 explicit Cloud(Ekos::Manager * manager, QVector<QSharedPointer<NodeManager>> &nodeManagers);
27 virtual ~Cloud() = default;
28
29 bool isConnected() const;
30 void registerCameras();
31
32 // Ekos Cloud Message to User
33 void sendData(const QSharedPointer<FITSData> &data, const QString &uuid);
34
35 signals:
36 void connected();
37 void disconnected();
38 void newImage(const QByteArray &image);
39
40 public slots:
41 void updateOptions();
42
43 private slots:
44 // Connection
45 void onConnected();
46 void onDisconnected();
47
48 // Communication
49 void onTextReceived(const QString &message);
50 void uploadImage(const QByteArray &image);
51
52 private:
53 void dispatch(const QSharedPointer<FITSData> &data, const QString &uuid);
54
55 Ekos::Manager * m_Manager { nullptr };
57
58 QString extension;
59 QStringList temporaryFiles;
60
61 bool m_sendBlobs {true};
62
63 // Image width for high-bandwidth setting
64 static const uint16_t HB_WIDTH = 640;
65 // Image high bandwidth image quality (jpg)
66 static const uint8_t HB_IMAGE_QUALITY = 76;
67 // Video high bandwidth video quality (jpg)
68 static const uint8_t HB_VIDEO_QUALITY = 64;
69
70 // Binary Metadata Size
71 static const uint16_t METADATA_PACKET = 2048;
72
73 // Retry every 5 seconds in case remote server is down
74 static const uint16_t RECONNECT_INTERVAL = 5000;
75 // Retry for 1 hour before giving up
76 static const uint16_t RECONNECT_MAX_TRIES = 720;
77};
78}
Generic record interfaces and implementations.
Definition cloud.cpp:22
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.