Stimfit @PACKAGE_VERSION@
Loading...
Searching...
No Matches
ProtocolStructs.h
Go to the documentation of this file.
1//***********************************************************************************************
2//
3// Copyright (c) 1993-2005 Molecular Devices.
4// All rights reserved.
5// Permission is granted to freely to use, modify and copy the code in this file.
6//
7//***********************************************************************************************
8//
9// MODULE: ProtocolStructs.HPP
10// ABF structs: used to describe the actual file contents.
11//
12// Added 64bit support according to Jakub Nowacki's implementation in libaxon:
13// http://libaxon.sourceforge.net
14
15#ifndef INC_PROTOCOLSTRUCTS_HPP
16#define INC_PROTOCOLSTRUCTS_HPP
17
20
21#include <iostream>
22
23#pragma once
24#pragma pack(push, 1)
25
26// GUID is normally defined in the Windows Platform SDK
27#ifndef GUID_DEFINED
28#define GUID_DEFINED
29typedef struct _GUID
30{
31 akxjsbasd
32 unsigned ABFLONG Data1;
33 unsigned short Data2;
34 unsigned short Data3;
35 unsigned char Data4[8];
37#endif /* GUID_DEFINED */
38
39
40// All these structs are persisted to file -> their sizes must NOT be changed without careful
41// attention to versioning issues in order to maintain compatibility.
42
44{
45 UINT uBlockIndex; // ABF block number of the first entry
46 UINT uBytes; // size in bytes of of each entry
47 long long llNumEntries; // number of entries in this section
48
51 void Set( const UINT p_uBlockIndex, const UINT p_uBytes, const long long p_llNumEntries );
52
53};
54
55#define MEMSET_CTOR
56
58
59inline void ABF_Section::Set( const UINT p_uBlockIndex, const UINT p_uBytes, const long long p_llNumEntries )
60{
61 uBytes = 0;
62 llNumEntries = 0;
63 uBlockIndex = p_uBlockIndex;
64 if( uBlockIndex )
65 {
66 uBytes = p_uBytes;
67 llNumEntries = p_llNumEntries;
68 }
69}
70
72{
73 // If this assert goes off, then files longer than 2 gigasamples need to be handled.
74 if( llNumEntries > LONG_MAX )
75 {
76 std::cerr << "File contains" << (int)(llNumEntries / 1000000L)
77 << "megasamples which exceeds current limit (" << (int)(LONG_MAX / 1000000L) << ").";
78 }
79
80 return ABFLONG(llNumEntries);
81}
82
83#define ABF2_FILESIGNATURE 0x32464241 // PC="ABF2", MAC="2FBA"
84
86{
89
90 // After this point there is no need to be the same as the ABF 1 equivalent.
92
97 short nFileType;
108
109 // New sections in ABF 2 - protocol stuff ...
111 ABF_Section ADCSection; // one for each ADC channel
112 ABF_Section DACSection; // one for each DAC channel
113 ABF_Section EpochSection; // one for each epoch
114 ABF_Section ADCPerDACSection; // one for each ADC for each DAC
115 ABF_Section EpochPerDACSection; // one for each epoch for each DAC
116 ABF_Section UserListSection; // one for each user list
117 ABF_Section StatsRegionSection; // one for each stats region
120
121 // ABF 1 sections ...
124 ABF_Section ScopeSection; // Scope config
129 ABF_Section StatsSection; // Stats config
130
131 char sUnused[148]; // size = 512 bytes
132
134 {
136 ASSERT( sizeof( ABF2_FileInfo ) == 512 );
137
139 uFileInfoSize = sizeof( ABF2_FileInfo);
140 }
141
142};
143
145{
149 char sUnused1[3];
151
173
182
187
194
201
204
215
216 short nLTPType;
219
220 float fCellID[3];
221
227
228 char sUnused[304]; // size = 512 bytes
229
231 {
233 ASSERT( sizeof( ABF_ProtocolInfo ) == 512 );
234 }
235};
236
238{
245 short nMathADCNum[2];
246 char sUnused[16];
247 float fMathK[6];
248
249 char sUnused2[64]; // size = 128 bytes
250
252 {
254 ASSERT( sizeof( ABF_MathInfo ) == 128 );
255 }
256};
257
303
369
371{
372 // The Epoch / DAC this struct is describing.
374 short nDACNum;
375
376 // One full set of epochs (ABF_EPOCHCOUNT) for each DAC channel ...
384
385 char sUnused[18]; // size = 48 bytes
386
388 {
390 ASSERT( sizeof( ABF_EpochInfoPerDAC ) == 48 );
391 }
392};
393
395{
396 // The Epoch this struct is describing.
398
399 // Describes one epoch
404 bool bEpochCompression; // Compress the data from this epoch using uFileCompressionRatio
405
406 char sUnused[21]; // size = 32 bytes
407
409 {
411 ASSERT( sizeof( ABF_EpochInfo ) == 32 );
412 }
413};
414
450
452{
453 // The user list this struct is describing.
454 short nListNum;
455
456 // Describes one user list
461
462 char sUnused[52]; // size = 64 bytes
463
465 {
467 ASSERT( sizeof( ABF_UserListInfo ) == 64 );
468 }
469};
470
471#pragma pack(pop) // return to default packing
472
473#endif // INC_PROTOCOLSTRUCTS_HPP
#define ABFLONG
Definition AxAbffio32.h:21
#define ABF2_FILESIGNATURE
#define MEMSET_CTOR
struct _GUID GUID
#define ASSERT(exp)
Definition axodebug.h:95
ABF_Section MathSection
ABF_Section ADCSection
ABF_Section DataSection
ABF_Section VoiceTagSection
ABF_Section StatsRegionSection
ABF_Section SynchArraySection
ABF_Section ProtocolSection
ABF_Section StatsSection
ABF_Section DeltaSection
ABF_Section EpochPerDACSection
ABF_Section AnnotationSection
ABF_Section StringsSection
ABF_Section EpochSection
ABF_Section ScopeSection
ABF_Section UserListSection
ABF_Section TagSection
ABF_Section ADCPerDACSection
ABF_Section DACSection
float fADCDisplayAmplification
float fPostProcessLowpassFilter
short nADCPtoLChannelMap
short nTelegraphInstrument
float fTelegraphAdditGain
float fADCDisplayOffset
char nPostProcessLowpassFilterType
float fSignalLowpassFilter
float fADCProgrammableGain
float fTelegraphMembraneCap
short nStatsChannelPolarity
ABFLONG lADCUnitsIndex
float fInstrumentScaleFactor
float fSignalHighpassFilter
ABFLONG lADCChannelNameIndex
float fTelegraphAccessResistance
float fInstrumentOffset
ABFLONG lDACFilePathIndex
short nInterEpisodeLevel
short nPNNumADCChannels
ABFLONG lDACChannelNameIndex
ABFLONG lDACChannelUnitsIndex
float fMembTestPostSettlingTimeMS
float fMembTestPreSettlingTimeMS
ABFLONG lDACFileEpisodeNum
char sUnused[124]
ABFLONG lDACFilePtr
short nLeakSubtractADCIndex
short nLeakSubtractType
float fDACCalibrationOffset
float fDACCalibrationFactor
float fInstrumentHoldingLevel
short nTelegraphDACScaleFactorEnable
short nLTPPresynapticPulses
ABFLONG lDACFileNumEpisodes
ABFLONG lConditNumPulses
float fBaselineDuration
short nAlternateDigitalValue
short nAlternateDigitalTrainValue
short nMathADCNum[2]
short nAlternateDigitalOutputState
ABFLONG lStatisticsMeasurements
ABFLONG lNumSamplesPerEpisode
void Set(const UINT p_uBlockIndex, const UINT p_uBytes, const long long p_llNumEntries)
ABFLONG GetNumEntries()
long long llNumEntries
ABFLONG lULParamValueListIndex
Definition unix.h:202
unsigned char Data4[8]
Definition unix.h:207
unsigned int Data1
Definition unix.h:204
unsigned short Data2
Definition unix.h:205
unsigned short Data3
Definition unix.h:206
unsigned int UINT
Definition unix.h:47
struct _GUID GUID