ngscopeclient
v0.2.2
Loading...
Searching...
No Matches
lib
scopeprotocols
BINImportFilter.h
Go to the documentation of this file.
1
/***********************************************************************************************************************
2
* *
3
* libscopeprotocols *
4
* *
5
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
6
* All rights reserved. *
7
* *
8
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9
* following conditions are met: *
10
* *
11
* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12
* following disclaimer. *
13
* *
14
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15
* following disclaimer in the documentation and/or other materials provided with the distribution. *
16
* *
17
* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18
* derived from this software without specific prior written permission. *
19
* *
20
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22
* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26
* POSSIBILITY OF SUCH DAMAGE. *
27
* *
28
***********************************************************************************************************************/
29
35
#ifndef BINImportFilter_h
36
#define BINImportFilter_h
37
38
class
BINImportFilter
:
public
ImportFilter
39
{
40
public
:
41
BINImportFilter
(
const
std::string&
color
);
42
43
static
std::string GetProtocolName();
44
45
PROTOCOL_DECODER_INITPROC(
BINImportFilter
)
46
47
//Agilent/Keysight/Rigol binary capture structs
48
#pragma pack(push, 1)
49
struct
FileHeader
50
{
51
char
magic[2];
//File magic string ("AG" / "RG")
52
char
version[2];
//File format version
53
uint32_t
length;
//Length of file in bytes (in theory, seems to be wrong a lot for Rigol)
54
uint32_t
count;
//Number of waveforms
55
//Note: Rigol MSO5000 seems to sometimes concatenate >1 file with multiple FileHeader's
56
};
57
58
struct
WaveHeader
59
{
60
uint32_t
size;
//Waveform header length (usually 0x8C, but MSO5000 reports 0x90 which seems wrong)
61
uint32_t
type;
//Waveform type
62
uint32_t
buffers;
//Number of buffers
63
uint32_t
samples;
//Number of samples
64
uint32_t
averaging;
//Averaging count
65
float
duration;
//Capture duration
66
double
start;
//Display start time
67
double
interval;
//Sample time interval
68
double
origin;
//Capture origin time
69
uint32_t
x;
//X axis unit
70
uint32_t
y;
//Y axis unit
71
char
date[16];
//Capture date
72
char
time[16];
//Capture time
73
char
hardware[24];
//Model and serial
74
char
label[16];
//Waveform label
75
double
holdoff;
//Trigger holdoff
76
uint32_t
segment;
//Segment number
77
};
78
79
struct
DataHeader
80
{
81
uint32_t
size;
//Waveform data header length
82
short
type;
//Sample data type
83
short
depth;
//Sample bit depth
84
uint32_t
length;
//Data buffer length
85
};
86
#pragma pack(pop)
87
88
protected
:
89
void
OnFileNameChanged();
90
};
91
92
#endif
AcceleratorBufferIterator
Definition
AcceleratorBuffer.h:204
BINImportFilter
Definition
BINImportFilter.h:39
ImportFilter
Helper base class for filters that import a waveform from a file.
Definition
ImportFilter.h:46
BINImportFilter::DataHeader
Definition
BINImportFilter.h:80
BINImportFilter::FileHeader
Definition
BINImportFilter.h:50
BINImportFilter::WaveHeader
Definition
BINImportFilter.h:59
Generated by
1.9.8