-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFl_Scope.H
112 lines (101 loc) · 3.02 KB
/
Fl_Scope.H
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
/* Fl_Scope.h
*
* Author: Michael Pearce
* Copyright: Copyright 2003-2005 Michael Pearce All Rights reserved.
* Licence: GNU/GPL
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (GNU.txt); if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or visit http://www.gnu.org/licenses/licenses.html
*/
#ifndef _FL_SCOPE_H_
#define _FL_SCOPE_H_
#include <FL/Fl_Box.H>
#define FL_SCOPE_TRACE_SCROLL 0
#define FL_SCOPE_TRACE_LOOP 1
#define FL_SCOPE_TRACE_LOOP_CLEAR 2
#define FL_SCOPE_REDRAW_OFF 0
#define FL_SCOPE_REDRAW_FULL 1
#define FL_SCOPE_REDRAW_ALWAYS 2
#define FL_SCOPE_DOT 0
#define FL_SCOPE_LINE 1
#define FL_SCOPE_SIGNED 0
#define FL_SCOPE_UNSIGNED 1
class Fl_Scope : public Fl_Box {
public:
//
Fl_Scope(int,int,int,int,const char * = 0);
~Fl_Scope();
//
int x(){return _x;};
//void x(int X){ _x=X;};
int y(){return _y;};
//void y(int Y){ _y=Y;};
int w(){return _w;};
//void w(int W){ _w=W;};
int h(){return _h;};
//void h(int H){ _h=H;};
//
int tracetype(){return TraceType;};
void tracetype(int t){TraceType=t;};
int redrawmode(){return RedrawMode;};
void redrawmode(int t){RedrawMode=t;};
int linetype(){return LineType;};
void linetype(int t){LineType=t;};
int datatype(){return DataType;};
void datatype(int t){DataType=t;};
/* Add Data to Scope */
int add(int);
Fl_Color TraceColour(){return _TraceColour;};
void TraceColour(Fl_Color c){_TraceColour=c;};
Fl_Color BackColour(){return _BackColour;};
void BackColour(Fl_Color c){_BackColour=c;};
virtual int handle(int);
//
void set_min_bits(float f){ min_bits = f;};
void set_max_bits(float f){ max_bits = f;};
protected:
//
void draw(int,int,int,int);
int handle(int,int,int,int,int);
void draw();
/* These are protected because changing the size screws up the buffer */
/* May Fix this problem later */
void x(int X){ _x=X;};
void y(int Y){ _y=Y;};
void w(int W){ _w=W;};
void h(int H){ _h=H;};
private:
/* The draw position */
int _x,_y,_w,_h;
//unsigned char *ScopeData; /* Pointer to dynamic array of track info */
/* Pointer to dynamic array of track info */
int *ScopeData;
int ScopeDataSize;
int ScopeDataPos;
//
float min_bits;
float max_bits;
//
/* Trace Colour */
Fl_Color _TraceColour;
/* Background Colour */
Fl_Color _BackColour;
int TraceType;
int RedrawMode;
int LineType;
int DataType;
};
#endif
// END