~ea4k/klog/trunk

« back to all changes in this revision

Viewing changes to branches/1.3/setuppages/setuppagehamlib.h

  • Committer: jaime
  • Date: 2020-10-03 09:19:54 UTC
  • Revision ID: svn-v4:5834a56a-7829-0410-841d-b57922c102d6::782
KLogĀ 1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SETUPPAGEHAMLIB_H
 
2
#define SETUPPAGEHAMLIB_H
 
3
 
 
4
/***************************************************************************
 
5
                          setuppagehamlib.h  -  description
 
6
                             -------------------
 
7
    begin                : feb 2018
 
8
    copyright            : (C) 2018 by Jaime Robles
 
9
    email                : jaime@robles.es
 
10
 ***************************************************************************/
 
11
 
 
12
/*****************************************************************************
 
13
 * This file is part of KLog.                                                *
 
14
 *                                                                           *
 
15
 *    KLog is free software: you can redistribute it and/or modify           *
 
16
 *    it under the terms of the GNU General Public License as published by   *
 
17
 *    the Free Software Foundation, either version 3 of the License, or      *
 
18
 *    (at your option) any later version.                                    *
 
19
 *                                                                           *
 
20
 *    KLog is distributed in the hope that it will be useful,                *
 
21
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of         *
 
22
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
 
23
 *    GNU General Public License for more details.                           *
 
24
 *                                                                           *
 
25
 *    You should have received a copy of the GNU General Public License      *
 
26
 *    along with KLog.  If not, see <https://www.gnu.org/licenses/>.          *
 
27
 *                                                                           *
 
28
 *****************************************************************************/
 
29
 
 
30
#include <QObject>
 
31
#include <QWidget>
 
32
#include <QtWidgets>
 
33
#include <QSerialPortInfo>
 
34
#include "hamlibclass.h"
 
35
#include "dataproxy_sqlite.h"
 
36
#include <hamlib/rig.h>
 
37
 
 
38
 
 
39
class SetupPageHamLib : public QWidget
 
40
{
 
41
    Q_OBJECT
 
42
public:
 
43
    explicit SetupPageHamLib(DataProxy_SQLite *dp, QWidget *parent = nullptr);
 
44
    QString getData();
 
45
    bool setRigType(const QString &_radio);
 
46
    bool setSerialPort(const QString &_port);
 
47
    bool setSerialSpeed(const QString &_speed );
 
48
    void setActive(const QString &_active);
 
49
    //void setRTS(const QString &_state);
 
50
    //void setDTR(const QString &_state);
 
51
    void setDataBits(const QString &_st);
 
52
    void setFlowControl(const QString &_st);
 
53
    void setParity(const QString &_st);
 
54
    void setStopBits(const QString &_st);
 
55
    //void setPollInterval(const QString &_st);
 
56
    void setReadOnly(const QString &_m);
 
57
 
 
58
 
 
59
 
 
60
signals:
 
61
 
 
62
public slots:
 
63
    void slotScanPorts();
 
64
 
 
65
private:
 
66
    void createUI();
 
67
    void setRig();
 
68
    void setDefaults();
 
69
    void fillSerialPortsComboBox();
 
70
    //static int addRigToList(const struct rig_caps* caps, void* data);
 
71
    QStringList getAvailableSerialPorts();
 
72
 
 
73
    QString getDataBits();
 
74
    QString getFlowControl();
 
75
    QString getParity();
 
76
    QString getStopBits();
 
77
    QString getPollInterval();
 
78
 
 
79
/*
 
80
 
 
81
DataBits { Data5, Data6, Data7, Data8, UnknownDataBits }
 
82
FlowControl { NoFlowControl, HardwareControl, SoftwareControl, UnknownFlowControl }
 
83
Parity { NoParity, EvenParity, OddParity, SpaceParity, MarkParity, UnknownParity }
 
84
StopBits { OneStop, OneAndHalfStop, TwoStop, UnknownStopBits }
 
85
 
 
86
*/
 
87
 
 
88
    QPushButton *scanSerialPortButton;
 
89
    QComboBox *rigTypeComboBox, *serialBaudsComboBox, *serialPortComboBox, *dataBitsComboBox,
 
90
                *flowControlComboBox, *parityComboBox, *stopBitsComboBox;
 
91
    //QSpinBox *serialBaudsSpinBox;
 
92
    QLineEdit *serialPort;
 
93
    QSpinBox *pollIntervalQSpinBox;
 
94
 
 
95
    HamLibClass *hamlib;
 
96
 
 
97
    //RIG *my_rig;            // handle to rig (instance)
 
98
    //freq_t freq;
 
99
    //rig_model_t myrig_model;
 
100
 
 
101
    QStringList strings, serialPorts;
 
102
    QCheckBox *activateHamlibCheckBox, *readOnlyModeCheckBox; //, *RTSCheckBox, *DTRCheckBox;
 
103
 
 
104
 
 
105
    //int defaultPortSpeed;
 
106
};
 
107
 
 
108
#endif // SETUPPAGEHAMLIB_H