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 upload(const QString &filename, const QString &uuid);
34 void upload(const QSharedPointer<FITSData> &data, const QString &uuid);
35
36 signals:
37 void connected();
38 void disconnected();
39 void newImage(const QByteArray &image);
40
41 public slots:
42 void updateOptions();
43
44 private slots:
45 // Connection
46 void onConnected();
47 void onDisconnected();
48
49 // Communication
50 void onTextReceived(const QString &message);
51
52 // Send image
53 void sendImage();
54
55 void uploadImage(const QByteArray &image);
56
57 private:
58 void asyncUpload();
59
60 Ekos::Manager * m_Manager { nullptr };
62 QString m_UUID;
63
64 QSharedPointer<FITSData> m_ImageData;
66
67 QString extension;
68 QStringList temporaryFiles;
69
70 bool m_sendBlobs {true};
71
72 // Image width for high-bandwidth setting
73 static const uint16_t HB_WIDTH = 640;
74 // Image high bandwidth image quality (jpg)
75 static const uint8_t HB_IMAGE_QUALITY = 76;
76 // Video high bandwidth video quality (jpg)
77 static const uint8_t HB_VIDEO_QUALITY = 64;
78
79 // Binary Metadata Size
80 static const uint16_t METADATA_PACKET = 2048;
81
82 // Retry every 5 seconds in case remote server is down
83 static const uint16_t RECONNECT_INTERVAL = 5000;
84 // Retry for 1 hour before giving up
85 static const uint16_t RECONNECT_MAX_TRIES = 720;
86};
87}
Generic record interfaces and implementations.
Definition cloud.cpp:23
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:49:21 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.