File: ScopeCanvas.h

package info (click to toggle)
cubicsdr 0.2.7%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,532 kB
  • sloc: cpp: 32,852; sh: 60; makefile: 6
file content (75 lines) | stat: -rw-r--r-- 1,984 bytes parent folder | download | duplicates (2)
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
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+

#pragma once

#include "wx/glcanvas.h"
#include "wx/timer.h"

#include <vector>
#include <queue>
#include <memory>

#include "ScopeContext.h"
#include "ScopeVisualProcessor.h"
#include "ScopePanel.h"
#include "SpectrumPanel.h"
#include "InteractiveCanvas.h"

class ScopeCanvas: public InteractiveCanvas {
public:
    ScopeCanvas(wxWindow *parent, std::vector<int> dispAttrs);
    ~ScopeCanvas();

    //This is public because it is indeed forwarded from
    //AppFrame::OnGlobalKeyDown, because global key handler intercepts 
    //calls in all windows.
    void OnKeyDown(wxKeyEvent& event);

    //This is public because it is indeed forwarded from
    //AppFrame::OnGlobalKeyUp, because global key handler intercepts 
    //calls in all windows.
    void OnKeyUp(wxKeyEvent& event);

    void setDeviceName(std::string device_name);
    void setPPMMode(bool ppmMode_in);
    bool getPPMMode() const;

    void setShowDb(bool showDb);
    bool getShowDb() const;

    bool scopeVisible();
    bool spectrumVisible();
    
    void setHelpTip(std::string tip);

    ScopeRenderDataQueuePtr getInputQueue();
    
private:
    void OnPaint(wxPaintEvent& event);
    void OnIdle(wxIdleEvent &event);
    void OnMouseMoved(wxMouseEvent& event);
    void OnMouseWheelMoved(wxMouseEvent& event);
    void OnMouseDown(wxMouseEvent& event);
    void OnMouseReleased(wxMouseEvent& event);
    void OnMouseEnterWindow(wxMouseEvent& event);
    void OnMouseLeftWindow(wxMouseEvent& event);

    ScopeRenderDataQueuePtr inputData = std::make_shared<ScopeRenderDataQueue>();
    ScopePanel scopePanel;
    GLPanel parentPanel;
    SpectrumPanel spectrumPanel;
    GLPanel bgPanel;
    ScopeContext *glContext;
    std::string deviceName;
    bool ppmMode;
    bool showDb;
    float panelSpacing;
    float ctr;
    float ctrTarget;
    float dragAccel;
    std::string helpTip;
// event table
wxDECLARE_EVENT_TABLE();
};