File indexing completed on 2024-04-14 03:42:44

0001 /*
0002     SPDX-FileCopyrightText: 2003 Jasem Mutlaq <mutlaqja@ikarustech.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "ui_telescopewizard.h"
0010 #include "indi/indistd.h"
0011 
0012 #include <QHash>
0013 #include <QStringList>
0014 
0015 #include <memory>
0016 
0017 class DriverInfo;
0018 
0019 class QProgressDialog;
0020 
0021 class telescopeWizardProcess : public QDialog
0022 {
0023     Q_OBJECT
0024 
0025   public:
0026     explicit telescopeWizardProcess(QWidget *parent = nullptr);
0027     ~telescopeWizardProcess();
0028 
0029     unsigned int currentPage;
0030     enum
0031     {
0032         INTRO_P     = 0,
0033         MODEL_P     = 1,
0034         TELESCOPE_P = 2,
0035         LOCAL_P     = 3,
0036         PORT_P      = 4
0037     };
0038 
0039 private:
0040     void establishLink();
0041     void Reset();
0042 
0043 public slots:
0044     void cancelCheck();
0045     void processNext();
0046     void processBack();
0047     void newTime();
0048     void newLocation();
0049     void processTelescope(ISD::GDInterface *);
0050     void scanPorts();
0051     void linkSuccess();
0052 
0053 private:
0054     std::unique_ptr<Ui::telescopeWizard> ui;
0055     ISD::GDInterface *scopeDevice { nullptr };
0056     QProgressDialog *progressScan { nullptr };
0057     QStringList portList;
0058     int currentPort { -1 };
0059     bool INDIMessageBar { false };
0060     bool linkRejected { false };
0061     QHash<QString, DriverInfo *> driversList;
0062     QList<DriverInfo *> managedDevice;
0063 };