File: cwsender.h

package info (click to toggle)
wfview 2.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,256 kB
  • sloc: cpp: 43,386; ansic: 3,196; sh: 32; xml: 29; makefile: 11
file content (126 lines) | stat: -rw-r--r-- 3,007 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#ifndef CWSENDER_H
#define CWSENDER_H

#include <QMainWindow>
#include <QString>
#include <QFont>
#include <QInputDialog>
#include <QMessageBox>
#include <QThread>
#include <QList>
#include <math.h>
#include "cwsidetone.h"
#include "wfviewtypes.h"
#include "cachingqueue.h"

namespace Ui {
class cwSender;
}

class cwSender : public QMainWindow
{
    Q_OBJECT

public:
    explicit cwSender(QWidget *parent = 0);
    ~cwSender();
    QStringList getMacroText();
    void setMacroText(QStringList macros);
    void setCutNumbers(bool val);
    void setSendImmediate(bool val);
    void setSidetoneEnable(bool val);
    void setSidetoneLevel(int val);
    bool getCutNumbers();
    bool getSendImmediate();
    bool getSidetoneEnable();
    int getSidetoneLevel();
    void receive(QString text);
    void receiveEnabled(bool);

signals:
    void sendCW(QString cwMessage);
    void stopCW();
    void setKeySpeed(quint8 wpm);
    void setDashRatio(quint8 ratio);
    void setPitch(quint16 pitch);
    void setLevel(int level);
    void setBreakInMode(quint8 b);
    void getCWSettings();
    void sidetone(QString text);
    void pitchChanged(int val);
    void dashChanged(int val);
    void wpmChanged(int val);
    void initTone();

public slots:
    void handleKeySpeed(quint8 wpm);
    void handleDashRatio(quint8 ratio);
    void handlePitch(quint16 pitch);
    void handleBreakInMode(quint8 b);
    void handleCurrentModeUpdate(rigMode_t mode);

private slots:
    void on_sendBtn_clicked();
    void showEvent(QShowEvent* event);

    void on_stopBtn_clicked();

    //void on_textToSendEdit_returnPressed();

    void textChanged(QString text);

    void on_breakinCombo_activated(int index);

    void on_wpmSpin_valueChanged(int arg1);

    void on_dashSpin_valueChanged(double arg1);

    void on_pitchSpin_valueChanged(int arg1);

    void on_macro1btn_clicked();

    void on_macro2btn_clicked();

    void on_macro3btn_clicked();

    void on_macro4btn_clicked();

    void on_macro5btn_clicked();

    void on_macro6btn_clicked();

    void on_macro7btn_clicked();

    void on_macro8btn_clicked();

    void on_macro9btn_clicked();

    void on_macro10btn_clicked();

    void on_sequenceSpin_valueChanged(int arg1);

    void on_sidetoneEnableChk_clicked(bool clicked);

    void on_sidetoneLevelSlider_valueChanged(int val);

private:
    Ui::cwSender *ui;
    QString macroText[11];
    int sequenceNumber = 1;
    int lastSentPos = 0;
    rigMode_t currentMode;
    int sidetoneLevel=0;
    void processMacroButton(int buttonNumber, QPushButton *btn);
    void runMacroButton(int buttonNumber);
    void editMacroButton(int buttonNumber, QPushButton *btn);
    void setMacroButtonText(QString btnText, QPushButton *btn);
    cwSidetone* tone=Q_NULLPTR;
    QThread* toneThread = Q_NULLPTR;
    bool sidetoneWasEnabled=false;
    QList<QMetaObject::Connection> connections;
    cachingQueue* queue;
    rigCapabilities* rigCaps = Q_NULLPTR;
    int maxChars = 0;
};

#endif // CWSENDER_H