Debian Codegraph @

biosig4c++/t210/axon_structs.h

raw symbols SCIP
1 //
2 // This file is part of the Axon Library.
3 //
4 // Copyright (c) 2008-2009 Jakub Nowacki
5 //
6 // The Axon Binary Format is property of Molecular Devices.
7 // All rights to the Axon Binary Format are reserved to Molecular Devices.
8 //
9 // This program is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU Lesser General Public License as published by
11 // the Free Software Foundation; either version 3 of the License, or
12 // (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 //
23
24 /*
25 modified for use with biosig
26 Copyright (C) 2013 Alois Schlögl,
27 This file is part of the "BioSig for C/C++" repository
28 (biosig4c++) at http://biosig.sf.net/
29
30 BioSig is free software; you can redistribute it and/or
31 modify it under the terms of the GNU General Public License
32 as published by the Free Software Foundation; either version 3
33 of the License, or (at your option) any later version.
34
35 This program is distributed in the hope that it will be useful,
36 but WITHOUT ANY WARRANTY; without even the implied warranty of
37 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 GNU General Public License for more details.
39
40 You should have received a copy of the GNU General Public License
41 along with this program. If not, see <http://www.gnu.org/licenses/>.
42 */
43
44 /*! \file
45 * \brief Header containing all structures of ABF
46 */
47
48 #ifndef INC_PROTOCOLSTRUCTS_HPP
49 #define INC_PROTOCOLSTRUCTS_HPP
50
51 #pragma once
52 #pragma pack(push, 1)
53
54 //#define UINT unsigned int
55 //#define LONGLONG long long
56 #define bool int
57
58
59 // GUID is normally defined in the Windows Platform SDK
60 struct GUID
61 {
62 uint32_t Data1;
63 unsigned short Data2;
64 unsigned short Data3;
65 unsigned char Data4[8];
66 };
67
68
69 // All these structs are persisted to file -> their sizes must NOT be changed without careful
70 // attention to versioning issues in order to maintain compatibility.
71
72 typedef struct ABF_Section
73 {
74 unsigned int uBlockIndex; // ABF block number of the first entry
75 unsigned int uBytes; // size in bytes of of each entry
76 long long llNumEntries; // number of entries in this section
77 } ABF_Section;
78
79 #define ABF_FILESIGNATURE 0x32464241 // PC="ABF2", MAC="2FBA"
80
81 struct ABF_FileInfo
82 {
83 unsigned int uFileSignature;
84 unsigned int uFileVersionNumber;
85
86 // After this point there is no need to be the same as the ABF 1 equivalent.
87 unsigned int uFileInfoSize;
88
89 unsigned int uActualEpisodes;
90 unsigned int uFileStartDate;
91 unsigned int uFileStartTimeMS;
92 unsigned int uStopwatchTime;
93 short nFileType;
94 short nDataFormat;
95 short nSimultaneousScan;
96 short nCRCEnable;
97 unsigned int uFileCRC;
98 struct GUID FileGUID;
99 unsigned int uCreatorVersion;
100 unsigned int uCreatorNameIndex;
101 unsigned int uModifierVersion;
102 unsigned int uModifierNameIndex;
103 unsigned int uProtocolPathIndex;
104
105 // New sections in ABF 2 - protocol stuff ...
106 ABF_Section ProtocolSection; // the protocol
107 ABF_Section ADCSection; // one for each ADC channel
108 ABF_Section DACSection; // one for each DAC channel
109 ABF_Section EpochSection; // one for each epoch
110 ABF_Section ADCPerDACSection; // one for each ADC for each DAC
111 ABF_Section EpochPerDACSection; // one for each epoch for each DAC
112 ABF_Section UserListSection; // one for each user list
113 ABF_Section StatsRegionSection; // one for each stats region
114 ABF_Section MathSection;
115 ABF_Section StringsSection;
116
117 // ABF 1 sections ...
118 ABF_Section DataSection; // Data
119 ABF_Section TagSection; // Tags
120 ABF_Section ScopeSection; // Scope config
121 ABF_Section DeltaSection; // Deltas
122 ABF_Section VoiceTagSection; // Voice Tags
123 ABF_Section SynchArraySection; // Synch Array
124 ABF_Section AnnotationSection; // Annotations
125 ABF_Section StatsSection; // Stats config
126
127 char sUnused[148]; // size = 512 bytes
128 };
129
130 struct ABF_ProtocolInfo
131 {
132 short nOperationMode;
133 float fADCSequenceInterval;
134 bool bEnableFileCompression;
135 char sUnused1[3];
136 unsigned int uFileCompressionRatio;
137
138 float fSynchTimeUnit;
139 float fSecondsPerRun;
140 ABFLONG lNumSamplesPerEpisode;
141 ABFLONG lPreTriggerSamples;
142 ABFLONG lEpisodesPerRun;
143 ABFLONG lRunsPerTrial;
144 ABFLONG lNumberOfTrials;
145 short nAveragingMode;
146 short nUndoRunCount;
147 short nFirstEpisodeInRun;
148 float fTriggerThreshold;
149 short nTriggerSource;
150 short nTriggerAction;
151 short nTriggerPolarity;
152 float fScopeOutputInterval;
153 float fEpisodeStartToStart;
154 float fRunStartToStart;
155 ABFLONG lAverageCount;
156 float fTrialStartToStart;
157 short nAutoTriggerStrategy;
158 float fFirstRunDelayS;
159
160 short nChannelStatsStrategy;
161 ABFLONG lSamplesPerTrace;
162 ABFLONG lStartDisplayNum;
163 ABFLONG lFinishDisplayNum;
164 short nShowPNRawData;
165 float fStatisticsPeriod;
166 ABFLONG lStatisticsMeasurements;
167 short nStatisticsSaveStrategy;
168
169 float fADCRange;
170 float fDACRange;
171 ABFLONG lADCResolution;
172 ABFLONG lDACResolution;
173
174 short nExperimentType;
175 short nManualInfoStrategy;
176 short nCommentsEnable;
177 ABFLONG lFileCommentIndex;
178 short nAutoAnalyseEnable;
179 short nSignalType;
180
181 short nDigitalEnable;
182 short nActiveDACChannel;
183 short nDigitalHolding;
184 short nDigitalInterEpisode;
185 short nDigitalDACChannel;
186 short nDigitalTrainActiveLogic;
187
188 short nStatsEnable;
189 short nStatisticsClearStrategy;
190
191 short nLevelHysteresis;
192 ABFLONG lTimeHysteresis;
193 short nAllowExternalTags;
194 short nAverageAlgorithm;
195 float fAverageWeighting;
196 short nUndoPromptStrategy;
197 short nTrialTriggerSource;
198 short nStatisticsDisplayStrategy;
199 short nExternalTagType;
200 short nScopeTriggerOut;
201
202 short nLTPType;
203 short nAlternateDACOutputState;
204 short nAlternateDigitalOutputState;
205
206 float fCellID[3];
207
208 short nDigitizerADCs;
209 short nDigitizerDACs;
210 short nDigitizerTotalDigitalOuts;
211 short nDigitizerSynchDigitalOuts;
212 short nDigitizerType;
213
214 char sUnused[304]; // size = 512 bytes
215 };
216
217 struct ABF_MathInfo
218 {
219 short nMathEnable;
220 short nMathExpression;
221 unsigned int uMathOperatorIndex;
222 unsigned int uMathUnitsIndex;
223 float fMathUpperLimit;
224 float fMathLowerLimit;
225 short nMathADCNum[2];
226 char sUnused[16];
227 float fMathK[6];
228
229 char sUnused2[64]; // size = 128 bytes
230 };
231
232 struct ABF_ADCInfo
233 {
234 // The ADC this struct is describing.
235 short nADCNum;
236
237 short nTelegraphEnable;
238 short nTelegraphInstrument;
239 float fTelegraphAdditGain;
240 float fTelegraphFilter;
241 float fTelegraphMembraneCap;
242 short nTelegraphMode;
243 float fTelegraphAccessResistance;
244
245 short nADCPtoLChannelMap;
246 short nADCSamplingSeq;
247
248 float fADCProgrammableGain;
249 float fADCDisplayAmplification;
250 float fADCDisplayOffset;
251 float fInstrumentScaleFactor;
252 float fInstrumentOffset;
253 float fSignalGain;
254 float fSignalOffset;
255 float fSignalLowpassFilter;
256 float fSignalHighpassFilter;
257
258 char nLowpassFilterType;
259 char nHighpassFilterType;
260 float fPostProcessLowpassFilter;
261 char nPostProcessLowpassFilterType;
262 bool bEnabledDuringPN;
263
264 short nStatsChannelPolarity;
265
266 ABFLONG lADCChannelNameIndex;
267 ABFLONG lADCUnitsIndex;
268
269 char sUnused[46]; // size = 128 bytes
270 };
271
272 struct ABF_DACInfo
273 {
274 // The DAC this struct is describing.
275 short nDACNum;
276
277 short nTelegraphDACScaleFactorEnable;
278 float fInstrumentHoldingLevel;
279
280 float fDACScaleFactor;
281 float fDACHoldingLevel;
282 float fDACCalibrationFactor;
283 float fDACCalibrationOffset;
284
285 ABFLONG lDACChannelNameIndex;
286 ABFLONG lDACChannelUnitsIndex;
287
288 ABFLONG lDACFilePtr;
289 ABFLONG lDACFileNumEpisodes;
290
291 short nWaveformEnable;
292 short nWaveformSource;
293 short nInterEpisodeLevel;
294
295 float fDACFileScale;
296 float fDACFileOffset;
297 ABFLONG lDACFileEpisodeNum;
298 short nDACFileADCNum;
299
300 short nConditEnable;
301 ABFLONG lConditNumPulses;
302 float fBaselineDuration;
303 float fBaselineLevel;
304 float fStepDuration;
305 float fStepLevel;
306 float fPostTrainPeriod;
307 float fPostTrainLevel;
308 short nMembTestEnable;
309
310 short nLeakSubtractType;
311 short nPNPolarity;
312 float fPNHoldingLevel;
313 short nPNNumADCChannels;
314 short nPNPosition;
315 short nPNNumPulses;
316 float fPNSettlingTime;
317 float fPNInterpulse;
318
319 short nLTPUsageOfDAC;
320 short nLTPPresynapticPulses;
321
322 ABFLONG lDACFilePathIndex;
323
324 float fMembTestPreSettlingTimeMS;
325 float fMembTestPostSettlingTimeMS;
326
327 short nLeakSubtractADCIndex;
328
329 char sUnused[124]; // size = 256 bytes
330 };
331
332 struct ABF_EpochInfoPerDAC
333 {
334 // The Epoch / DAC this struct is describing.
335 short nEpochNum;
336 short nDACNum;
337
338 // One full set of epochs (ABF_EPOCHCOUNT) for each DAC channel ...
339 short nEpochType;
340 float fEpochInitLevel;
341 float fEpochLevelInc;
342 ABFLONG lEpochInitDuration;
343 ABFLONG lEpochDurationInc;
344 ABFLONG lEpochPulsePeriod;
345 ABFLONG lEpochPulseWidth;
346
347 char sUnused[18]; // size = 48 bytes
348 };
349
350 struct ABF_EpochInfo
351 {
352 // The Epoch this struct is describing.
353 short nEpochNum;
354
355 // Describes one epoch
356 short nDigitalValue;
357 short nDigitalTrainValue;
358 short nAlternateDigitalValue;
359 short nAlternateDigitalTrainValue;
360 bool bEpochCompression; // Compress the data from this epoch using uFileCompressionRatio
361
362 char sUnused[21]; // size = 32 bytes
363 };
364
365 struct ABF_StatsRegionInfo
366 {
367 // The stats region this struct is describing.
368 short nRegionNum;
369 short nADCNum;
370
371 short nStatsActiveChannels;
372 short nStatsSearchRegionFlags;
373 short nStatsSelectedRegion;
374 short nStatsSmoothing;
375 short nStatsSmoothingEnable;
376 short nStatsBaseline;
377 ABFLONG lStatsBaselineStart;
378 ABFLONG lStatsBaselineEnd;
379
380 // Describes one stats region
381 ABFLONG lStatsMeasurements;
382 ABFLONG lStatsStart;
383 ABFLONG lStatsEnd;
384 short nRiseBottomPercentile;
385 short nRiseTopPercentile;
386 short nDecayBottomPercentile;
387 short nDecayTopPercentile;
388 short nStatsSearchMode;
389 short nStatsSearchDAC;
390 short nStatsBaselineDAC;
391
392 char sUnused[78]; // size = 128 bytes
393 };
394
395 struct ABF_UserListInfo
396 {
397 // The user list this struct is describing.
398 short nListNum;
399
400 // Describes one user list
401 short nULEnable;
402 short nULParamToVary;
403 short nULRepeat;
404 ABFLONG lULParamValueListIndex;
405
406 char sUnused[52]; // size = 64 bytes
407 };
408
409 struct ABF_SynchArray
410 {
411 ABFLONG lStart;
412 ABFLONG lLength;
413 };
414
415 // Strings section structure not defined by Axon
416
417 #pragma pack(pop) // return to default packing
418
419 #endif // INC_PROTOCOLSTRUCTS_HPP