Debian Codegraph @

biosig4c++/t210/abfheadr.h

raw symbols SCIP
1 //***********************************************************************************************
2 //
3 // Copyright (c) 1993-2003 Axon Instruments.
4 // All rights reserved.
5 // Permission is granted to freely use, modify and copy the code in this file.
6 //
7 //***********************************************************************************************
8 // HEADER: ABFHEADR.H.
9 // PURPOSE: Defines the ABFFileHeader structure, and provides prototypes for
10 // functions implemented in ABFHEADR.CPP for reading and writing
11 // ABFFileHeader's.
12 // REVISIONS:
13 // 1.1 - Version 1.1 was released in April 1992.
14 // 1.2 - Added nDataFormat so that data can optionally be stored in floating point format.
15 // - Added lClockChange to control the multiplexed ADC sample number after which the second sampling interval commences.
16 // 1.3 - Change 4-byte sFileType string to long lFileSignature.
17 // - #define ABF_NATIVESIGNATURE & ABF_REVERSESIGNATURE for byte order detection.
18 // - Added support for Bells during before or after acquisitions
19 // - Added parameters to describe hysteresis during event detected acquisitions: nLevelHysteresis and lTimeHysteresis.
20 // - Dropped support for BASIC and Pascal.
21 // - Added the ABF Scope Config section to store scope configuration information
22 // 1.4 - Remove support for big-endian machines.
23 // 1.5 - Change ABFSignal parameters from UUTop & UUBottom to
24 // fDisplayGain & fDisplayOffset.
25 // - Added and changed parameters in the 'File Structure', 'Display Parameters',
26 // 'DAC Output File', 'Autopeak Measurements' and 'Unused space and end of header' sections of the ABF file header.
27 // - Expanded the ABF API and error return codes
28 // 1.6 - Expanded header to 5120 bytes and added extra parameters to support 2 waveform channels PRC
29 // 1.65 - Telegraph support added.
30 // 1.67 - Train epochs, multiple channel and multiple region stats
31 // 1.68 - ABFScopeConfig expanded
32 // 1.69 - Added user entered percentile levels for rise and decay stats
33 // 1.70 - Added data reduction - AjD
34 // 1.71 - Added epoch resistance
35 // 1.72 - Added alternating outputs
36 // 1.73 - Added post-processing lowpass filter settings. When filtering is done in Clampfit it is stored in the header.
37 // 1.74 - Added channel_count_acquired
38 // 1.75 - Added polarity for each channel
39 // 1.76 - Added digital trigger out flag
40 // 1.77 - Added major, minor and bugfix version numbers
41 // 1.78 - Added separate entries for alternating DAC and digital outputs
42 // 1.79 - Removed data reduction (now minidigi only)
43 // 1.80 - Added stats mode for each region: mode is cursor region, epoch etc
44 // 1.81 - Added multi input signal P / N leak subtraction
45 // 1.82 - Cyclic Redundancy Code (CRC).
46 // 1.83 - Added Modifier application name / version number
47 //
48 // Added 64bit support according to Jakub Nowacki's implementation in libaxon:
49 // http://libaxon.sourceforge.net
50
51 /*
52 modified for use with biosig
53 Copyright (C) 2013 Alois Schlögl,
54 This file is part of the "BioSig for C/C++" repository
55 (biosig4c++) at http://biosig.sf.net/
56
57 BioSig is free software; you can redistribute it and/or
58 modify it under the terms of the GNU General Public License
59 as published by the Free Software Foundation; either version 3
60 of the License, or (at your option) any later version.
61
62 This program is distributed in the hope that it will be useful,
63 but WITHOUT ANY WARRANTY; without even the implied warranty of
64 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65 GNU General Public License for more details.
66
67 You should have received a copy of the GNU General Public License
68 along with this program. If not, see <http://www.gnu.org/licenses/>.
69 */
70
71 #ifndef INC_ABFHEADR_H
72 #define INC_ABFHEADR_H
73
74 #include <stdio.h>
75 #include <string.h>
76
77
78 //#include "AxAbffio32.h"
79
80 #ifdef __cplusplus
81 extern "C" {
82 #endif
83
84 //
85 // Constants used in defining the ABF file header
86 //
87
88 #define ABF_ADCCOUNT 16 // number of ADC channels supported.
89 #define ABF_DACCOUNT 4 // number of DAC channels supported.
90 #define ABF_WAVEFORMCOUNT 2 // number of DAC channels which support waveforms.
91 #define ABF_EPOCHCOUNT 10 // number of waveform epochs supported.
92 #define ABF_BELLCOUNT 2 // Number of auditory signals supported.
93 #define ABF_ADCUNITLEN 8 // length of ADC units strings
94 #define ABF_ADCNAMELEN 10 // length of ADC channel name strings
95 #define ABF_DACUNITLEN 8 // length of DAC units strings
96 #define ABF_DACNAMELEN 10 // length of DAC channel name strings
97 #define ABF_VARPARAMLISTLEN 80 // length of conditioning string
98 #define ABF_USERLISTLEN 256 // length of the user list (V1.6)
99 #define ABF_USERLISTCOUNT 4 // number of independent user lists (V1.6)
100 #define ABF_OLDFILECOMMENTLEN 56 // length of file comment string (pre V1.6)
101 #define ABF_FILECOMMENTLEN 128 // length of file comment string (V1.6)
102
103 #define ABF_CREATORINFOLEN 16 // length of file creator info string
104 #define ABF_OLDDACFILENAMELEN 12 // old length of the DACFile name string
105 #define ABF_OLDDACFILEPATHLEN 60 // old length of the DACFile path string
106 #define ABF_DACFILEPATHLEN 84 // length of full path for DACFile
107 #define ABF_PATHLEN 256 // length of full path, used for DACFile and Protocol name.
108 #define ABF_ARITHMETICOPLEN 2 // length of the Arithmetic operator field
109 #define ABF_ARITHMETICUNITSLEN 8 // length of arithmetic units string
110 #define ABF_TAGCOMMENTLEN 56 // length of tag comment string
111 #define ABF_LONGDESCRIPTIONLEN 56 // length of long description entry
112 #define ABF_NOTENAMELEN 10 // length of the name component of a note
113 #define ABF_NOTEVALUELEN 8 // length of the value component of a note
114 #define ABF_NOTEUNITSLEN 8 // length of the units component of a note
115 #define ABF_BLOCKSIZE 512 // Size of block alignment in ABF files.
116 #define ABF_MACRONAMELEN 64 // Size of a Clampfit macro name.
117
118 #define ABF_CURRENTVERSION ABF_V183 // Current file format version number
119 #define ABF_PREVIOUSVERSION 1.5F // Previous file format version number (for old header size)
120 #define ABF_V16 1.6F // Version number when the header size changed.
121 #define ABF_HEADERSIZE 6144 // Size of a Version 1.6 or later header
122 #define ABF_OLDHEADERSIZE 2048 // Size of a Version 1.5 or earlier header
123 #define ABF_NATIVESIGNATURE 0x20464241 // PC="ABF ", MAC=" FBA"
124 #define ABF_REVERSESIGNATURE 0x41424620 // PC=" FBA", MAC="ABF "
125
126 #define PCLAMP6_MAXSWEEPLENGTH 16384 // Maximum multiplexed sweep length supported by pCLAMP6 apps.
127 #define PCLAMP7_MAXSWEEPLEN_PERCHAN 1032258 // Maximum per channel sweep length supported by pCLAMP7 apps.
128
129 #define ABF_MAX_TRIAL_SAMPLES 0x7FFFFFFF // Maximum length of acquisition supported (samples)
130 // INT_MAX is used instead of UINT_MAX because of the signed
131 // values in the ABF header.
132
133 #define ABF_MAX_SWEEPS_PER_AVERAGE 65500 // The maximum number of sweeps that can be combined into a
134 // cumulative average (nAverageAlgorithm=ABF_INFINITEAVERAGE).
135
136 #define ABF_STATS_REGIONS 8 // The number of independent statistics regions.
137 #define ABF_BASELINE_REGIONS 1 // The number of independent baseline regions.
138
139 #ifdef _MAC
140 #define ABF_OLDPCLAMP ABF_REVERSESIGNATURE
141 #else
142 #define ABF_OLDPCLAMP ABF_NATIVESIGNATURE
143 #endif
144
145 //
146 // Constant definitions for nFileType
147 //
148 #define ABF_ABFFILE 1
149 #define ABF_FETCHEX 2
150 #define ABF_CLAMPEX 3
151
152 //
153 // Constant definitions for nDataFormat
154 //
155 #define ABF_INTEGERDATA 0
156 #define ABF_FLOATDATA 1
157
158 //
159 // Constant definitions for nOperationMode
160 //
161 #define ABF_VARLENEVENTS 1
162 #define ABF_FIXLENEVENTS 2 // (ABF_FIXLENEVENTS == ABF_LOSSFREEOSC)
163 #define ABF_LOSSFREEOSC 2
164 #define ABF_GAPFREEFILE 3
165 #define ABF_HIGHSPEEDOSC 4
166 #define ABF_WAVEFORMFILE 5
167
168 //
169 // Constant definitions for nParamToVary
170 //
171 #define ABF_CONDITNUMPULSES 0
172 #define ABF_CONDITBASELINEDURATION 1
173 #define ABF_CONDITBASELINELEVEL 2
174 #define ABF_CONDITSTEPDURATION 3
175 #define ABF_CONDITSTEPLEVEL 4
176 #define ABF_CONDITPOSTTRAINDURATION 5
177 #define ABF_CONDITPOSTTRAINLEVEL 6
178 #define ABF_EPISODESTARTTOSTART 7
179 #define ABF_INACTIVEHOLDING 8
180 #define ABF_DIGITALHOLDING 9
181 #define ABF_PNNUMPULSES 10
182 #define ABF_PARALLELVALUE 11
183 #define ABF_EPOCHINITLEVEL (ABF_PARALLELVALUE + ABF_EPOCHCOUNT)
184 #define ABF_EPOCHINITDURATION (ABF_EPOCHINITLEVEL + ABF_EPOCHCOUNT)
185 #define ABF_EPOCHTRAINPERIOD (ABF_EPOCHINITDURATION + ABF_EPOCHCOUNT)
186 #define ABF_EPOCHTRAINPULSEWIDTH (ABF_EPOCHTRAINPERIOD + ABF_EPOCHCOUNT)
187 // Next value is (ABF_EPOCHINITDURATION + ABF_EPOCHCOUNT)
188
189 //
190 // Constants for nAveragingMode
191 //
192 #define ABF_NOAVERAGING 0
193 #define ABF_SAVEAVERAGEONLY 1
194 #define ABF_AVERAGESAVEALL 2
195
196 //
197 // Constants for nAverageAlgorithm
198 //
199 #define ABF_INFINITEAVERAGE 0
200 #define ABF_SLIDINGAVERAGE 1
201
202 //
203 // Constants for nEpochType
204 //
205 #define ABF_EPOCHDISABLED 0 // disabled epoch
206 #define ABF_EPOCHSTEPPED 1 // stepped waveform
207 #define ABF_EPOCHRAMPED 2 // ramp waveform
208 #define ABF_EPOCH_TYPE_RECTANGLE 3 // rectangular pulse train
209 #define ABF_EPOCH_TYPE_TRIANGLE 4 // triangular waveform
210 #define ABF_EPOCH_TYPE_COSINE 5 // cosinusoidal waveform
211 #define ABF_EPOCH_TYPE_RESISTANCE 6 // resistance waveform
212 #define ABF_EPOCH_TYPE_BIPHASIC 7 // biphasic pulse train
213
214 //
215 // Constants for epoch resistance
216 //
217 #define ABF_MIN_EPOCH_RESISTANCE_DURATION 8
218
219 //
220 // Constants for nWaveformSource
221 //
222 #define ABF_WAVEFORMDISABLED 0 // disabled waveform
223 #define ABF_EPOCHTABLEWAVEFORM 1
224 #define ABF_DACFILEWAVEFORM 2
225
226 //
227 // Constants for nInterEpisodeLevel & nDigitalInterEpisode
228 //
229 #define ABF_INTEREPI_USEHOLDING 0
230 #define ABF_INTEREPI_USELASTEPOCH 1
231
232 //
233 // Constants for nExperimentType
234 //
235 #define ABF_VOLTAGECLAMP 0
236 #define ABF_CURRENTCLAMP 1
237 #define ABF_SIMPLEACQUISITION 2
238
239 //
240 // Constants for nAutosampleEnable
241 //
242 #define ABF_AUTOSAMPLEDISABLED 0
243 #define ABF_AUTOSAMPLEAUTOMATIC 1
244 #define ABF_AUTOSAMPLEMANUAL 2
245
246 //
247 // Constants for nAutosampleInstrument
248 //
249 #define ABF_INST_UNKNOWN 0 // Unknown instrument (manual or user defined telegraph table).
250 #define ABF_INST_AXOPATCH1 1 // Axopatch-1 with CV-4-1/100
251 #define ABF_INST_AXOPATCH1_1 2 // Axopatch-1 with CV-4-0.1/100
252 #define ABF_INST_AXOPATCH1B 3 // Axopatch-1B(inv.) CV-4-1/100
253 #define ABF_INST_AXOPATCH1B_1 4 // Axopatch-1B(inv) CV-4-0.1/100
254 #define ABF_INST_AXOPATCH201 5 // Axopatch 200 with CV 201
255 #define ABF_INST_AXOPATCH202 6 // Axopatch 200 with CV 202
256 #define ABF_INST_GENECLAMP 7 // GeneClamp
257 #define ABF_INST_DAGAN3900 8 // Dagan 3900
258 #define ABF_INST_DAGAN3900A 9 // Dagan 3900A
259 #define ABF_INST_DAGANCA1_1 10 // Dagan CA-1 Im=0.1
260 #define ABF_INST_DAGANCA1 11 // Dagan CA-1 Im=1.0
261 #define ABF_INST_DAGANCA10 12 // Dagan CA-1 Im=10
262 #define ABF_INST_WARNER_OC725 13 // Warner OC-725
263 #define ABF_INST_WARNER_OC725C 14 // Warner OC-725
264 #define ABF_INST_AXOPATCH200B 15 // Axopatch 200B
265 #define ABF_INST_DAGANPCONE0_1 16 // Dagan PC-ONE Im=0.1
266 #define ABF_INST_DAGANPCONE1 17 // Dagan PC-ONE Im=1.0
267 #define ABF_INST_DAGANPCONE10 18 // Dagan PC-ONE Im=10
268 #define ABF_INST_DAGANPCONE100 19 // Dagan PC-ONE Im=100
269 #define ABF_INST_WARNER_BC525C 20 // Warner BC-525C
270 #define ABF_INST_WARNER_PC505 21 // Warner PC-505
271 #define ABF_INST_WARNER_PC501 22 // Warner PC-501
272 #define ABF_INST_DAGANCA1_05 23 // Dagan CA-1 Im=0.05
273 #define ABF_INST_MULTICLAMP700 24 // MultiClamp 700
274 #define ABF_INST_TURBO_TEC 25 // Turbo Tec
275 #define ABF_INST_OPUSXPRESS6000 26 // OpusXpress 6000A
276
277 //
278 // Constants for nManualInfoStrategy
279 //
280 #define ABF_ENV_DONOTWRITE 0
281 #define ABF_ENV_WRITEEACHTRIAL 1
282 #define ABF_ENV_PROMPTEACHTRIAL 2
283
284 //
285 // Constants for nTriggerSource
286 //
287 #define ABF_TRIGGERLINEINPUT -5 // Start on line trigger (DD1320 only)
288 #define ABF_TRIGGERTAGINPUT -4
289 #define ABF_TRIGGERFIRSTCHANNEL -3
290 #define ABF_TRIGGEREXTERNAL -2
291 #define ABF_TRIGGERSPACEBAR -1
292 // >=0 = ADC channel to trigger off.
293
294 //
295 // Constants for nTrialTriggerSource
296 //
297 #define ABF_TRIALTRIGGER_SWSTARTONLY -6 // Start on software message, end when protocol ends.
298 #define ABF_TRIALTRIGGER_SWSTARTSTOP -5 // Start and end on software messages.
299 #define ABF_TRIALTRIGGER_LINEINPUT -4 // Start on line trigger (DD1320 only)
300 #define ABF_TRIALTRIGGER_SPACEBAR -3 // Start on spacebar press.
301 #define ABF_TRIALTRIGGER_EXTERNAL -2 // Start on external trigger high
302 #define ABF_TRIALTRIGGER_NONE -1 // Start immediately (default).
303 // >=0 = ADC channel to trigger off. // Not implemented as yet...
304
305 //
306 // Constants for nTriggerPolarity.
307 //
308 #define ABF_TRIGGER_RISINGEDGE 0
309 #define ABF_TRIGGER_FALLINGEDGE 1
310
311 //
312 // Constants for nTriggerAction
313 //
314 #define ABF_TRIGGER_STARTEPISODE 0
315 #define ABF_TRIGGER_STARTRUN 1
316 #define ABF_TRIGGER_STARTTRIAL 2 // N.B. Discontinued in favor of nTrialTriggerSource
317
318 //
319 // Constants for nDrawingStrategy
320 //
321 #define ABF_DRAW_NONE 0
322 #define ABF_DRAW_REALTIME 1
323 #define ABF_DRAW_FULLSCREEN 2
324 #define ABF_DRAW_ENDOFRUN 3
325
326 //
327 // Constants for nTiledDisplay
328 //
329 #define ABF_DISPLAY_SUPERIMPOSED 0
330 #define ABF_DISPLAY_TILED 1
331
332 //
333 // Constants for nDataDisplayMode
334 //
335 #define ABF_DRAW_POINTS 0
336 #define ABF_DRAW_LINES 1
337
338 //
339 // Constants for nArithmeticExpression
340 //
341 #define ABF_SIMPLE_EXPRESSION 0
342 #define ABF_RATIO_EXPRESSION 1
343
344 //
345 // Constants for nLowpassFilterType & nHighpassFilterType
346 //
347 #define ABF_FILTER_NONE 0
348 #define ABF_FILTER_EXTERNAL 1
349 #define ABF_FILTER_SIMPLE_RC 2
350 #define ABF_FILTER_BESSEL 3
351 #define ABF_FILTER_BUTTERWORTH 4
352
353 //
354 // Constants for nPNPosition
355 //
356 #define ABF_PN_BEFORE_EPISODE 0
357 #define ABF_PN_AFTER_EPISODE 1
358
359 //
360 // Constants for nPNPolarity
361 //
362 #define ABF_PN_OPPOSITE_POLARITY -1
363 #define ABF_PN_SAME_POLARITY 1
364
365 //
366 // Constants for nAutopeakPolarity
367 //
368 #define ABF_PEAK_NEGATIVE -1
369 #define ABF_PEAK_ABSOLUTE 0
370 #define ABF_PEAK_POSITIVE 1
371
372 //
373 // Constants for nAutopeakSearchMode
374 //
375 #define ABF_PEAK_SEARCH_SPECIFIED -2
376 #define ABF_PEAK_SEARCH_ALL -1
377 // nAutopeakSearchMode 0..9 = epoch in waveform 0's epoch table
378 // nAutopeakSearchMode 10..19 = epoch in waveform 1's epoch table
379
380 //
381 // Constants for nAutopeakBaseline
382 //
383 #define ABF_PEAK_BASELINE_SPECIFIED -3
384 #define ABF_PEAK_BASELINE_NONE -2
385 #define ABF_PEAK_BASELINE_FIRSTHOLDING -1
386 #define ABF_PEAK_BASELINE_LASTHOLDING -4
387
388 //
389 // Constants for lAutopeakMeasurements
390 //
391 #define ABF_PEAK_MEASURE_PEAK 0x00000001
392 #define ABF_PEAK_MEASURE_PEAKTIME 0x00000002
393 #define ABF_PEAK_MEASURE_ANTIPEAK 0x00000004
394 #define ABF_PEAK_MEASURE_ANTIPEAKTIME 0x00000008
395 #define ABF_PEAK_MEASURE_MEAN 0x00000010
396 #define ABF_PEAK_MEASURE_STDDEV 0x00000020
397 #define ABF_PEAK_MEASURE_INTEGRAL 0x00000040
398 #define ABF_PEAK_MEASURE_MAXRISESLOPE 0x00000080
399 #define ABF_PEAK_MEASURE_MAXRISESLOPETIME 0x00000100
400 #define ABF_PEAK_MEASURE_MAXDECAYSLOPE 0x00000200
401 #define ABF_PEAK_MEASURE_MAXDECAYSLOPETIME 0x00000400
402 #define ABF_PEAK_MEASURE_RISETIME 0x00000800
403 #define ABF_PEAK_MEASURE_DECAYTIME 0x00001000
404 #define ABF_PEAK_MEASURE_HALFWIDTH 0x00002000
405 #define ABF_PEAK_MEASURE_BASELINE 0x00004000
406 #define ABF_PEAK_MEASURE_RISESLOPE 0x00008000
407 #define ABF_PEAK_MEASURE_DECAYSLOPE 0x00010000
408 #define ABF_PEAK_MEASURE_REGIONSLOPE 0x00020000
409 #define ABF_PEAK_MEASURE_ALL 0x0002FFFF // All of the above OR'd together.
410
411 //
412 // Constants for nStatsActiveChannels
413 //
414 #define ABF_PEAK_SEARCH_CHANNEL0 0x0001
415 #define ABF_PEAK_SEARCH_CHANNEL1 0x0002
416 #define ABF_PEAK_SEARCH_CHANNEL2 0x0004
417 #define ABF_PEAK_SEARCH_CHANNEL3 0x0008
418 #define ABF_PEAK_SEARCH_CHANNEL4 0x0010
419 #define ABF_PEAK_SEARCH_CHANNEL5 0x0020
420 #define ABF_PEAK_SEARCH_CHANNEL6 0x0040
421 #define ABF_PEAK_SEARCH_CHANNEL7 0x0080
422 #define ABF_PEAK_SEARCH_CHANNEL8 0x0100
423 #define ABF_PEAK_SEARCH_CHANNEL9 0x0200
424 #define ABF_PEAK_SEARCH_CHANNEL10 0x0400
425 #define ABF_PEAK_SEARCH_CHANNEL11 0x0800
426 #define ABF_PEAK_SEARCH_CHANNEL12 0x1000
427 #define ABF_PEAK_SEARCH_CHANNEL13 0x2000
428 #define ABF_PEAK_SEARCH_CHANNEL14 0x4000
429 #define ABF_PEAK_SEARCH_CHANNEL15 0x8000
430 #define ABF_PEAK_SEARCH_CHANNELSALL 0xFFFF // All of the above OR'd together.
431
432 // Bit flag settings for nStatsSearchRegionFlags
433 //
434 #define ABF_PEAK_SEARCH_REGION0 0x01
435 #define ABF_PEAK_SEARCH_REGION1 0x02
436 #define ABF_PEAK_SEARCH_REGION2 0x04
437 #define ABF_PEAK_SEARCH_REGION3 0x08
438 #define ABF_PEAK_SEARCH_REGION4 0x10
439 #define ABF_PEAK_SEARCH_REGION5 0x20
440 #define ABF_PEAK_SEARCH_REGION6 0x40
441 #define ABF_PEAK_SEARCH_REGION7 0x80
442 #define ABF_PEAK_SEARCH_REGIONALL 0xFF // All of the above OR'd together.
443
444 //
445 // Constants for lStatisticsMeasurements
446 //
447 #define ABF_STATISTICS_ABOVETHRESHOLD 0x00000001
448 #define ABF_STATISTICS_EVENTFREQUENCY 0x00000002
449 #define ABF_STATISTICS_MEANOPENTIME 0x00000004
450 #define ABF_STATISTICS_MEANCLOSEDTIME 0x00000008
451 #define ABF_STATISTICS_ALL 0x0000000F // All the above OR'd together.
452
453 //
454 // Constants for nStatisticsSaveStrategy
455 //
456 #define ABF_STATISTICS_NOAUTOSAVE 0
457 #define ABF_STATISTICS_AUTOSAVE 1
458 #define ABF_STATISTICS_AUTOSAVE_AUTOCLEAR 2
459
460 //
461 // Constants for nStatisticsDisplayStrategy
462 //
463 #define ABF_STATISTICS_DISPLAY 0
464 #define ABF_STATISTICS_NODISPLAY 1
465
466 //
467 // Constants for nStatisticsClearStrategy
468 // determines whether to clear statistics after saving.
469 //
470 #define ABF_STATISTICS_NOCLEAR 0
471 #define ABF_STATISTICS_CLEAR 1
472
473 //
474 // Constants for nDACFileEpisodeNum
475 //
476 #define ABF_DACFILE_SKIPFIRSTSWEEP -1
477 #define ABF_DACFILE_USEALLSWEEPS 0
478 // >0 = The specific sweep number.
479
480 //
481 // Constants for nUndoPromptStrategy
482 //
483 #define ABF_UNDOPROMPT_ONABORT 0
484 #define ABF_UNDOPROMPT_ALWAYS 1
485
486 //
487 // Constants for nAutoAnalyseEnable
488 //
489 #define ABF_AUTOANALYSE_DISABLED 0
490 #define ABF_AUTOANALYSE_DEFAULT 1
491 #define ABF_AUTOANALYSE_RUNMACRO 2
492
493 //
494 // Constants for post nPostprocessLowpassFilterType
495 //
496 #define ABF_POSTPROCESS_FILTER_NONE 0
497 #define ABF_POSTPROCESS_FILTER_ADAPTIVE 1
498 #define ABF_POSTPROCESS_FILTER_BESSEL 2
499 #define ABF_POSTPROCESS_FILTER_BOXCAR 3
500 #define ABF_POSTPROCESS_FILTER_BUTTERWORTH 4
501 #define ABF_POSTPROCESS_FILTER_CHEBYSHEV 5
502 #define ABF_POSTPROCESS_FILTER_GAUSSIAN 6
503 #define ABF_POSTPROCESS_FILTER_RC 7
504 #define ABF_POSTPROCESS_FILTER_RC8 8
505 #define ABF_POSTPROCESS_FILTER_NOTCH 9
506
507
508 //
509 // Miscellaneous constants
510 //
511 #define ABF_FILTERDISABLED 100000.0F // Large frequency to disable lowpass filters
512 #define ABF_UNUSED_CHANNEL -1 // Unused ADC and DAC channels.
513
514 //
515 // The output sampling sequence identifier for a seperate digital out channel.
516 //
517 #define ABF_DIGITAL_OUT_CHANNEL -1
518 #define ABF_PADDING_OUT_CHANNEL -2
519
520 //
521 // maximum values for various parameters (used by ABFH_CheckUserList).
522 //
523 #define ABF_CTPULSECOUNT_MAX 10000
524 #define ABF_CTBASELINEDURATION_MAX 100000.0F
525 #define ABF_CTSTEPDURATION_MAX 100000.0F
526 #define ABF_CTPOSTTRAINDURATION_MAX 100000.0F
527 #define ABF_SWEEPSTARTTOSTARTTIME_MAX 100000.0F
528 #define ABF_PNPULSECOUNT_MAX 8
529 #define ABF_DIGITALVALUE_MAX 0xFF
530 #define ABF_EPOCHDIGITALVALUE_MAX 0x0F
531
532 //
533 // LTP Types - Reflects whether the header is used for LTP as baseline or induction.
534 //
535 #define ABF_LTP_TYPE_NONE 0
536 #define ABF_LTP_TYPE_BASELINE 1
537 #define ABF_LTP_TYPE_INDUCTION 2
538
539 //
540 // LTP Usage of DAC - Reflects whether the analog output will be used presynaptically or postsynaptically.
541 //
542 #define ABF_LTP_DAC_USAGE_NONE 0
543 #define ABF_LTP_DAC_USAGE_PRESYNAPTIC 1
544 #define ABF_LTP_DAC_USAGE_POSTSYNAPTIC 2
545
546 //
547 // Header Version Numbers
548 //
549 #define ABF_V166 1.66F
550 #define ABF_V167 1.67F
551 #define ABF_V168 1.68F
552 #define ABF_V169 1.69F
553 #define ABF_V170 1.70F
554 #define ABF_V171 1.71F
555 #define ABF_V172 1.72F
556 #define ABF_V173 1.73F
557 #define ABF_V174 1.74F
558 #define ABF_V175 1.75F
559 #define ABF_V176 1.76F
560 #define ABF_V177 1.77F
561 #define ABF_V178 1.78F
562 #define ABF_V179 1.79F
563 #define ABF_V180 1.80F
564 #define ABF_V181 1.81F
565 #define ABF_V182 1.82F
566 #define ABF_V183 1.83F
567
568
569 //
570 // pack structure on byte boundaries
571 //
572
573 #ifndef RC_INVOKED
574 #pragma pack(push, 1)
575 #endif
576
577 //
578 // Definition of the ABF header structure.
579 //
580
581 struct ABFFileHeader // The total header length = 6144 bytes.
582 {
583 // GROUP #1 - File ID and size information. (40 bytes)
584 ABFLONG lFileSignature;
585 float fFileVersionNumber;
586 short nOperationMode;
587 ABFLONG lActualAcqLength;
588 short nNumPointsIgnored;
589 ABFLONG lActualEpisodes;
590 ABFLONG lFileStartDate; // YYYYMMDD
591 ABFLONG lFileStartTime;
592 ABFLONG lStopwatchTime;
593 float fHeaderVersionNumber;
594 short nFileType;
595 short nMSBinFormat;
596
597 // GROUP #2 - File Structure (78 bytes)
598 ABFLONG lDataSectionPtr;
599 ABFLONG lTagSectionPtr;
600 ABFLONG lNumTagEntries;
601 ABFLONG lScopeConfigPtr;
602 ABFLONG lNumScopes;
603 ABFLONG _lDACFilePtr;
604 ABFLONG _lDACFileNumEpisodes;
605 char sUnused001[4];
606 ABFLONG lDeltaArrayPtr;
607 ABFLONG lNumDeltas;
608 ABFLONG lVoiceTagPtr;
609 ABFLONG lVoiceTagEntries;
610 ABFLONG lUnused002;
611 ABFLONG lSynchArrayPtr;
612 ABFLONG lSynchArraySize;
613 short nDataFormat;
614 short nSimultaneousScan;
615 ABFLONG lStatisticsConfigPtr;
616 ABFLONG lAnnotationSectionPtr;
617 ABFLONG lNumAnnotations;
618 char sUnused003[2];
619
620 // GROUP #3 - Trial hierarchy information (82 bytes)
621 /**
622 The number of input channels we acquired.
623 Do not access directly - use CABFHeader::get_channel_count_acquired
624 */
625 short channel_count_acquired;
626
627 /**
628 The number of input channels we recorded.
629 Do not access directly - use CABFHeader::get_channel_count_recorded
630 */
631 short nADCNumChannels;
632 float fADCSampleInterval;
633 /*{{
634 The documentation says these two sample intervals are the interval between multiplexed samples, but not all digitisers work like that.
635 Instead, these are the per-channel sample rate divided by the number of channels.
636 If the user chose 100uS and has two channels, this value will be 50uS.
637 }}*/
638 float fADCSecondSampleInterval;
639 /*{{
640 // The two sample intervals must be an integer multiple (or submultiple) of each other.
641 if (fADCSampleInterval > fADCSecondSampleInterval)
642 ASSERT(fmod(fADCSampleInterval, fADCSecondSampleInterval) == 0.0);
643 if (fADCSecondSampleInterval, fADCSampleInterval)
644 ASSERT(fmod(fADCSecondSampleInterval, fADCSampleInterval) == 0.0);
645 }}*/
646 float fSynchTimeUnit;
647 float fSecondsPerRun;
648
649 /**
650 * The total number of samples per episode, for the recorded channels only.
651 * This does not include channels which are acquired but not recorded.
652 *
653 * This is the number of samples per episode per channel, times the number of recorded channels.
654 *
655 * If you want the samples per episode for one channel, you must divide this by get_channel_count_recorded().
656 */
657 ABFLONG lNumSamplesPerEpisode;
658 ABFLONG lPreTriggerSamples;
659 ABFLONG lEpisodesPerRun;
660 ABFLONG lRunsPerTrial;
661 ABFLONG lNumberOfTrials;
662 short nAveragingMode;
663 short nUndoRunCount;
664 short nFirstEpisodeInRun;
665 float fTriggerThreshold;
666 short nTriggerSource;
667 short nTriggerAction;
668 short nTriggerPolarity;
669 float fScopeOutputInterval;
670 float fEpisodeStartToStart;
671 float fRunStartToStart;
672 float fTrialStartToStart;
673 ABFLONG lAverageCount;
674 ABFLONG lClockChange;
675 short nAutoTriggerStrategy;
676
677 // GROUP #4 - Display Parameters (44 bytes)
678 short nDrawingStrategy;
679 short nTiledDisplay;
680 short nEraseStrategy; // N.B. Discontinued. Use scope config entry instead.
681 short nDataDisplayMode;
682 ABFLONG lDisplayAverageUpdate;
683 short nChannelStatsStrategy;
684 ABFLONG lCalculationPeriod; // N.B. Discontinued. Use fStatisticsPeriod.
685 ABFLONG lSamplesPerTrace;
686 ABFLONG lStartDisplayNum;
687 ABFLONG lFinishDisplayNum;
688 short nMultiColor;
689 short nShowPNRawData;
690 float fStatisticsPeriod;
691 ABFLONG lStatisticsMeasurements;
692 short nStatisticsSaveStrategy;
693
694 // GROUP #5 - Hardware information (16 bytes)
695 float fADCRange;
696 float fDACRange;
697 ABFLONG lADCResolution;
698 ABFLONG lDACResolution;
699
700 // GROUP #6 Environmental Information (118 bytes)
701 short nExperimentType;
702 short _nAutosampleEnable;
703 short _nAutosampleADCNum;
704 short _nAutosampleInstrument;
705 float _fAutosampleAdditGain;
706 float _fAutosampleFilter;
707 float _fAutosampleMembraneCap;
708 short nManualInfoStrategy;
709 float fCellID1;
710 float fCellID2;
711 float fCellID3;
712 char sCreatorInfo[ABF_CREATORINFOLEN];
713 char _sFileComment[ABF_OLDFILECOMMENTLEN];
714 short nFileStartMillisecs; // Milliseconds portion of lFileStartTime
715 short nCommentsEnable;
716 char sUnused003a[8];
717
718 // GROUP #7 - Multi-channel information (1044 bytes)
719 short nADCPtoLChannelMap[ABF_ADCCOUNT];
720 short nADCSamplingSeq[ABF_ADCCOUNT];
721 char sADCChannelName[ABF_ADCCOUNT][ABF_ADCNAMELEN];
722 char sADCUnits[ABF_ADCCOUNT][ABF_ADCUNITLEN];
723 float fADCProgrammableGain[ABF_ADCCOUNT];
724 float fADCDisplayAmplification[ABF_ADCCOUNT];
725 float fADCDisplayOffset[ABF_ADCCOUNT];
726 float fInstrumentScaleFactor[ABF_ADCCOUNT];
727 float fInstrumentOffset[ABF_ADCCOUNT];
728 float fSignalGain[ABF_ADCCOUNT];
729 float fSignalOffset[ABF_ADCCOUNT];
730 float fSignalLowpassFilter[ABF_ADCCOUNT];
731 float fSignalHighpassFilter[ABF_ADCCOUNT];
732 char sDACChannelName[ABF_DACCOUNT][ABF_DACNAMELEN];
733 char sDACChannelUnits[ABF_DACCOUNT][ABF_DACUNITLEN];
734 float fDACScaleFactor[ABF_DACCOUNT];
735 float fDACHoldingLevel[ABF_DACCOUNT];
736 short nSignalType;
737 char sUnused004[10];
738
739 // GROUP #8 - Synchronous timer outputs (14 bytes)
740 short nOUTEnable;
741 short nSampleNumberOUT1;
742 short nSampleNumberOUT2;
743 short nFirstEpisodeOUT;
744 short nLastEpisodeOUT;
745 short nPulseSamplesOUT1;
746 short nPulseSamplesOUT2;
747
748 // GROUP #9 - Epoch Waveform and Pulses (184 bytes)
749 short nDigitalEnable;
750 short _nWaveformSource;
751 short nActiveDACChannel;
752 short _nInterEpisodeLevel;
753 short _nEpochType[ABF_EPOCHCOUNT];
754 float _fEpochInitLevel[ABF_EPOCHCOUNT];
755 float _fEpochLevelInc[ABF_EPOCHCOUNT];
756 short _nEpochInitDuration[ABF_EPOCHCOUNT];
757 short _nEpochDurationInc[ABF_EPOCHCOUNT];
758 short nDigitalHolding;
759 short nDigitalInterEpisode;
760 short nDigitalValue[ABF_EPOCHCOUNT];
761 char sUnavailable1608[4]; // was float fWaveformOffset;
762 short nDigitalDACChannel;
763 char sUnused005[6];
764
765 // GROUP #10 - DAC Output File (98 bytes)
766 float _fDACFileScale;
767 float _fDACFileOffset;
768 char sUnused006[2];
769 short _nDACFileEpisodeNum;
770 short _nDACFileADCNum;
771 char _sDACFilePath[ABF_DACFILEPATHLEN];
772
773 // GROUP #11 - Presweep (conditioning) pulse train (44 bytes)
774 short _nConditEnable;
775 short _nConditChannel;
776 ABFLONG _lConditNumPulses;
777 float _fBaselineDuration;
778 float _fBaselineLevel;
779 float _fStepDuration;
780 float _fStepLevel;
781 float _fPostTrainPeriod;
782 float _fPostTrainLevel;
783 char sUnused007[12];
784
785 // GROUP #12 - Variable parameter user list ( 82 bytes)
786 short _nParamToVary;
787 char _sParamValueList[ABF_VARPARAMLISTLEN];
788
789 // GROUP #13 - Autopeak measurement (36 bytes)
790 short _nAutopeakEnable;
791 short _nAutopeakPolarity;
792 short _nAutopeakADCNum;
793 short _nAutopeakSearchMode;
794 ABFLONG _lAutopeakStart;
795 ABFLONG _lAutopeakEnd;
796 short _nAutopeakSmoothing;
797 short _nAutopeakBaseline;
798 short _nAutopeakAverage;
799 char sUnavailable1866[2]; // Was nAutopeakSaveStrategy, use nStatisticsSaveStrategy
800 ABFLONG _lAutopeakBaselineStart;
801 ABFLONG _lAutopeakBaselineEnd;
802 ABFLONG _lAutopeakMeasurements;
803
804 // GROUP #14 - Channel Arithmetic (52 bytes)
805 short nArithmeticEnable;
806 float fArithmeticUpperLimit;
807 float fArithmeticLowerLimit;
808 short nArithmeticADCNumA;
809 short nArithmeticADCNumB;
810 float fArithmeticK1;
811 float fArithmeticK2;
812 float fArithmeticK3;
813 float fArithmeticK4;
814 char sArithmeticOperator[ABF_ARITHMETICOPLEN];
815 char sArithmeticUnits[ABF_ARITHMETICUNITSLEN];
816 float fArithmeticK5;
817 float fArithmeticK6;
818 short nArithmeticExpression;
819 char sUnused008[2];
820
821 // GROUP #15 - On-line subtraction (34 bytes)
822 short _nPNEnable;
823 short nPNPosition;
824 short _nPNPolarity;
825 short nPNNumPulses;
826 short _nPNADCNum;
827 float _fPNHoldingLevel;
828 float fPNSettlingTime;
829 float fPNInterpulse;
830 char sUnused009[12];
831
832 // GROUP #16 - Miscellaneous variables (82 bytes)
833 short _nListEnable;
834
835 short nBellEnable[ABF_BELLCOUNT];
836 short nBellLocation[ABF_BELLCOUNT];
837 short nBellRepetitions[ABF_BELLCOUNT];
838
839 short nLevelHysteresis;
840 ABFLONG lTimeHysteresis;
841 short nAllowExternalTags;
842
843 char nLowpassFilterType[ABF_ADCCOUNT];
844 char nHighpassFilterType[ABF_ADCCOUNT];
845 short nAverageAlgorithm;
846 float fAverageWeighting;
847 short nUndoPromptStrategy;
848 short nTrialTriggerSource;
849 short nStatisticsDisplayStrategy;
850 short nExternalTagType;
851 ABFLONG lHeaderSize;
852 double dFileDuration;
853 short nStatisticsClearStrategy;
854 // Size of v1.5 header = 2048
855
856 // Extra parameters in v1.6
857 // EXTENDED GROUP #2 - File Structure (26 bytes)
858 ABFLONG lDACFilePtr[ABF_WAVEFORMCOUNT];
859 ABFLONG lDACFileNumEpisodes[ABF_WAVEFORMCOUNT];
860
861 // EXTENDED GROUP #3 - Trial Hierarchy
862 float fFirstRunDelay;
863 char sUnused010[6];
864
865 // EXTENDED GROUP #7 - Multi-channel information (62 bytes)
866 float fDACCalibrationFactor[ABF_DACCOUNT];
867 float fDACCalibrationOffset[ABF_DACCOUNT];
868 char sUnused011[30];
869
870 // GROUP #17 - Trains parameters (160 bytes)
871 ABFLONG lEpochPulsePeriod[ABF_WAVEFORMCOUNT][ABF_EPOCHCOUNT];
872 ABFLONG lEpochPulseWidth [ABF_WAVEFORMCOUNT][ABF_EPOCHCOUNT];
873
874 // EXTENDED GROUP #9 - Epoch Waveform and Pulses ( 412 bytes)
875 short nWaveformEnable[ABF_WAVEFORMCOUNT];
876 short nWaveformSource[ABF_WAVEFORMCOUNT];
877 short nInterEpisodeLevel[ABF_WAVEFORMCOUNT];
878 short nEpochType[ABF_WAVEFORMCOUNT][ABF_EPOCHCOUNT];
879 float fEpochInitLevel[ABF_WAVEFORMCOUNT][ABF_EPOCHCOUNT];
880 float fEpochLevelInc[ABF_WAVEFORMCOUNT][ABF_EPOCHCOUNT];
881 ABFLONG lEpochInitDuration[ABF_WAVEFORMCOUNT][ABF_EPOCHCOUNT];
882 ABFLONG lEpochDurationInc[ABF_WAVEFORMCOUNT][ABF_EPOCHCOUNT];
883 short nDigitalTrainValue[ABF_EPOCHCOUNT]; // 2 * 10 = 20 bytes
884 short nDigitalTrainActiveLogic; // 2 bytes
885 char sUnused012[18];
886
887 // EXTENDED GROUP #10 - DAC Output File (552 bytes)
888 float fDACFileScale[ABF_WAVEFORMCOUNT];
889 float fDACFileOffset[ABF_WAVEFORMCOUNT];
890 ABFLONG lDACFileEpisodeNum[ABF_WAVEFORMCOUNT];
891 short nDACFileADCNum[ABF_WAVEFORMCOUNT];
892 char sDACFilePath[ABF_WAVEFORMCOUNT][ABF_PATHLEN];
893 char sUnused013[12];
894
895 // EXTENDED GROUP #11 - Presweep (conditioning) pulse train (100 bytes)
896 short nConditEnable[ABF_WAVEFORMCOUNT];
897 ABFLONG lConditNumPulses[ABF_WAVEFORMCOUNT];
898 float fBaselineDuration[ABF_WAVEFORMCOUNT];
899 float fBaselineLevel[ABF_WAVEFORMCOUNT];
900 float fStepDuration[ABF_WAVEFORMCOUNT];
901 float fStepLevel[ABF_WAVEFORMCOUNT];
902 float fPostTrainPeriod[ABF_WAVEFORMCOUNT];
903 float fPostTrainLevel[ABF_WAVEFORMCOUNT];
904 char sUnused014[40];
905
906 // EXTENDED GROUP #12 - Variable parameter user list (1096 bytes)
907 short nULEnable[ABF_USERLISTCOUNT];
908 short nULParamToVary[ABF_USERLISTCOUNT];
909 char sULParamValueList[ABF_USERLISTCOUNT][ABF_USERLISTLEN];
910 short nULRepeat[ABF_USERLISTCOUNT];
911 char sUnused015[48];
912
913 // EXTENDED GROUP #15 - On-line subtraction (56 bytes)
914 short nPNEnable[ABF_WAVEFORMCOUNT];
915 short nPNPolarity[ABF_WAVEFORMCOUNT];
916 short __nPNADCNum[ABF_WAVEFORMCOUNT];
917 float fPNHoldingLevel[ABF_WAVEFORMCOUNT];
918 short nPNNumADCChannels[ABF_WAVEFORMCOUNT];
919 char nPNADCSamplingSeq[ABF_WAVEFORMCOUNT][ABF_ADCCOUNT];
920
921 // EXTENDED GROUP #6 Environmental Information (898 bytes)
922 short nTelegraphEnable[ABF_ADCCOUNT];
923 short nTelegraphInstrument[ABF_ADCCOUNT];
924 float fTelegraphAdditGain[ABF_ADCCOUNT];
925 float fTelegraphFilter[ABF_ADCCOUNT];
926 float fTelegraphMembraneCap[ABF_ADCCOUNT];
927 short nTelegraphMode[ABF_ADCCOUNT];
928 short nTelegraphDACScaleFactorEnable[ABF_DACCOUNT];
929 char sUnused016a[24];
930
931 short nAutoAnalyseEnable;
932 char sAutoAnalysisMacroName[ABF_MACRONAMELEN];
933 char sProtocolPath[ABF_PATHLEN];
934
935 char sFileComment[ABF_FILECOMMENTLEN];
936 struct GUID FileGUID;
937 float fInstrumentHoldingLevel[ABF_DACCOUNT];
938 uint32_t ulFileCRC;
939 char sModifierInfo[ABF_CREATORINFOLEN];
940 char sUnused017[76];
941
942 // EXTENDED GROUP #13 - Statistics measurements (388 bytes)
943 short nStatsEnable;
944 unsigned short nStatsActiveChannels; // Active stats channel bit flag
945 unsigned short nStatsSearchRegionFlags; // Active stats region bit flag
946 short nStatsSelectedRegion;
947 short _nStatsSearchMode;
948 short nStatsSmoothing;
949 short nStatsSmoothingEnable;
950 short nStatsBaseline;
951 ABFLONG lStatsBaselineStart;
952 ABFLONG lStatsBaselineEnd;
953 ABFLONG lStatsMeasurements[ABF_STATS_REGIONS]; // Measurement bit flag for each region
954 ABFLONG lStatsStart[ABF_STATS_REGIONS];
955 ABFLONG lStatsEnd[ABF_STATS_REGIONS];
956 short nRiseBottomPercentile[ABF_STATS_REGIONS];
957 short nRiseTopPercentile[ABF_STATS_REGIONS];
958 short nDecayBottomPercentile[ABF_STATS_REGIONS];
959 short nDecayTopPercentile[ABF_STATS_REGIONS];
960 short nStatsChannelPolarity[ABF_ADCCOUNT];
961 short nStatsSearchMode[ABF_STATS_REGIONS]; // Stats mode per region: mode is cursor region, epoch etc
962 char sUnused018[156];
963
964 // GROUP #18 - Application version data (16 bytes)
965 short nCreatorMajorVersion;
966 short nCreatorMinorVersion;
967 short nCreatorBugfixVersion;
968 short nCreatorBuildVersion;
969 short nModifierMajorVersion;
970 short nModifierMinorVersion;
971 short nModifierBugfixVersion;
972 short nModifierBuildVersion;
973
974 // GROUP #19 - LTP protocol (14 bytes)
975 short nLTPType;
976 short nLTPUsageOfDAC[ABF_WAVEFORMCOUNT];
977 short nLTPPresynapticPulses[ABF_WAVEFORMCOUNT];
978 char sUnused020[4];
979
980 // GROUP #20 - Digidata 132x Trigger out flag. (8 bytes)
981 short nDD132xTriggerOut;
982 char sUnused021[6];
983
984 // GROUP #21 - Epoch resistance (40 bytes)
985 char sEpochResistanceSignalName[ABF_WAVEFORMCOUNT][ABF_ADCNAMELEN];
986 short nEpochResistanceState[ABF_WAVEFORMCOUNT];
987 char sUnused022[16];
988
989 // GROUP #22 - Alternating episodic mode (58 bytes)
990 short nAlternateDACOutputState;
991 short nAlternateDigitalValue[ABF_EPOCHCOUNT];
992 short nAlternateDigitalTrainValue[ABF_EPOCHCOUNT];
993 short nAlternateDigitalOutputState;
994 char sUnused023[14];
995
996 // GROUP #23 - Post-processing actions (210 bytes)
997 float fPostProcessLowpassFilter[ABF_ADCCOUNT];
998 char nPostProcessLowpassFilterType[ABF_ADCCOUNT];
999
1000
1001 // 6014 header bytes allocated + 130 header bytes not allocated
1002 char sUnused2048[130];
1003
1004 }; // Size = 6144
1005
1006 // This structure is persisted, so the size MUST NOT CHANGE
1007 #if !defined(_WINDOWS) || defined(__MINGW32__)
1008 #define C_ASSERT(e) extern void __C_ASSERT__(int [(e)?1:-1])
1009 #endif
1010 C_ASSERT(sizeof(struct ABFFileHeader) == 6144);
1011
1012 /*
1013 inline ABFFileHeader::ABFFileHeader()
1014 {
1015 // Set everything to 0.
1016 memset( this, 0, sizeof(ABFFileHeader) );
1017
1018 // Set critical parameters so we can determine the version.
1019 lFileSignature = ABF_NATIVESIGNATURE;
1020 fFileVersionNumber = ABF_CURRENTVERSION;
1021 fHeaderVersionNumber = ABF_CURRENTVERSION;
1022 lHeaderSize = ABF_HEADERSIZE;
1023 }
1024 */
1025
1026 /*
1027 //
1028 // Scope descriptor format.
1029 //
1030 #define ABF_FACESIZE 32
1031 struct ABFLogFont
1032 {
1033 short nHeight; // Height of the font in pixels.
1034 // short lWidth; // use 0
1035 // short lEscapement; // use 0
1036 // short lOrientation; // use 0
1037 short nWeight; // MSWindows font weight value.
1038 // char bItalic; // use 0
1039 // char bUnderline; // use 0
1040 // char bStrikeOut; // use 0
1041 // char cCharSet; // use ANSI_CHARSET (0)
1042 // char cOutPrecision; // use OUT_TT_PRECIS
1043 // char cClipPrecision; // use CLIP_DEFAULT_PRECIS
1044 // char cQuality; // use PROOF_QUALITY
1045 char cPitchAndFamily; // MSWindows pitch and family mask.
1046 char Unused[3]; // Unused space to maintain 4-byte packing.
1047 char szFaceName[ABF_FACESIZE];// Face name of the font.
1048 }; // Size = 40
1049
1050 struct ABFSignal
1051 {
1052 char szName[ABF_ADCNAMELEN+2]; // ABF name length + '\0' + 1 for alignment.
1053 short nMxOffset; // Offset of the signal in the sampling sequence.
1054 DWORD rgbColor; // Pen color used to draw trace.
1055 char nPenWidth; // Pen width in pixels.
1056 char bDrawPoints; // TRUE = Draw disconnected points
1057 char bHidden; // TRUE = Hide the trace.
1058 char bFloatData; // TRUE = Floating point pseudo channel
1059 float fVertProportion; // Relative proportion of client area to use
1060 float fDisplayGain; // Display gain of trace in UserUnits
1061 float fDisplayOffset; // Display offset of trace in UserUnits
1062
1063 // float fUUTop; // Top of window in UserUnits
1064 // float fUUBottom; // Bottom of window in UserUnits
1065 }; // Size = 34
1066
1067 ///////////////////////////////////////////////////////////////////////////////////
1068 //// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING //////
1069 ///////////////////////////////////////////////////////////////////////////////////
1070 // The Following #defines appear to be largely unused in opur code base
1071 // However there does exist a second set of #defines in AxScope32.h
1072 // that REALLY defines what these bits in the header do.
1073 // In particular it important to note that all 32 bits are in fact used internally
1074 ///////////////////////////////////////////////////////////////////////////////////
1075 ///////////////////////////////////////////////////////////////////////////////////
1076 // Bit flags used in dwFlags field of ABFScopeConfig.
1077 #define ABF_OVERLAPPED 0x00000001
1078 #define ABF_DONTERASE 0x00000002
1079 #define ABF_MONOCHROME 0x00000004
1080 #define ABF_CLIPPING 0x00000008
1081 #define ABF_HIDEHORZGRIDS 0x00000010
1082 #define ABF_HIDEVERTGRIDS 0x00000020
1083 #define ABF_FULLSCREEN 0x00000040
1084 #define ABF_HIDEXAXIS 0x00000080
1085 #define ABF_HIDEYAXIS 0x00000100
1086 #define ABF_HIDEXSCROLL 0x00000200
1087 #define ABF_HIDEYSCROLL 0x00000400
1088 #define ABF_HIDESIGNALNAME 0x00000800
1089 #define ABF_ENABLEZOOM 0x00001000
1090 #define ABF_XSPINFROMCENTER 0x00002000
1091 #define ABF_HIDEXSPINNER 0x00004000
1092 #define ABF_LARGESPINNERS 0x00008000
1093 #define ABF_PERSISTENCEMODE 0x00010000
1094 #define ABF_CARDIACMODE 0x00020000
1095 #define ABF_HIDETWIRLER 0x00040000
1096 #define ABF_DISABLEUI 0x00080000
1097 ///////////////////////////////////////////////////////////////////////////////////
1098 // #define ABF_INTERNALUSE 0xFFF00000
1099 // Do not add extra bit flags ^^^ here they are used internally
1100 ///////////////////////////////////////////////////////////////////////////////////
1101 ///////////////////////////////////////////////////////////////////////////////////
1102 //// DANGER DANGER DANGER DANGER DANGER DANGER DANGER DANGER DANGER DANGER DANGER//
1103 ///////////////////////////////////////////////////////////////////////////////////
1104
1105 // Values for the wScopeMode field in ABFScopeConfig.
1106 #define ABF_EPISODICMODE 0
1107 #define ABF_CONTINUOUSMODE 1
1108 //#define ABF_XYMODE 2
1109
1110 // Values for the nEraseStrategy field in ABFScopeConfig.
1111 #define ABF_ERASE_EACHSWEEP 0
1112 #define ABF_ERASE_EACHRUN 1
1113 #define ABF_ERASE_EACHTRIAL 2
1114 #define ABF_ERASE_DONTERASE 3
1115
1116 // Indexes into the rgbColor field of ABFScopeConfig.
1117 #define ABF_BACKGROUNDCOLOR 0
1118 #define ABF_GRIDCOLOR 1
1119 #define ABF_THRESHOLDCOLOR 2
1120 #define ABF_EVENTMARKERCOLOR 3
1121 #define ABF_SEPARATORCOLOR 4
1122 #define ABF_AVERAGECOLOR 5
1123 #define ABF_OLDDATACOLOR 6
1124 #define ABF_TEXTCOLOR 7
1125 #define ABF_AXISCOLOR 8
1126 #define ABF_ACTIVEAXISCOLOR 9
1127 #define ABF_LASTCOLOR ABF_ACTIVEAXISCOLOR
1128 #define ABF_SCOPECOLORS (ABF_LASTCOLOR+1)
1129
1130 // Extended colors for rgbColorEx field in ABFScopeConfig
1131 #define ABF_STATISTICS_REGION0 0
1132 #define ABF_STATISTICS_REGION1 1
1133 #define ABF_STATISTICS_REGION2 2
1134 #define ABF_STATISTICS_REGION3 3
1135 #define ABF_STATISTICS_REGION4 4
1136 #define ABF_STATISTICS_REGION5 5
1137 #define ABF_STATISTICS_REGION6 6
1138 #define ABF_STATISTICS_REGION7 7
1139 #define ABF_BASELINE_REGION 8
1140 #define ABF_STOREDSWEEPCOLOR 9
1141 #define ABF_LASTCOLOR_EX ABF_STOREDSWEEPCOLOR
1142 #define ABF_SCOPECOLORS_EX (ABF_LASTCOLOR+1)
1143
1144 // Values for the nDockState field in ABFScopeConfig
1145 #define ABF_SCOPE_NOTDOCKED 0
1146 #define ABF_SCOPE_DOCKED_TOP 1
1147 #define ABF_SCOPE_DOCKED_LEFT 2
1148 #define ABF_SCOPE_DOCKED_RIGHT 3
1149 #define ABF_SCOPE_DOCKED_BOTTOM 4
1150
1151 struct ABFScopeConfig
1152 {
1153 // Section 1 scope configurations
1154 DWORD dwFlags; // Flags that are meaningful to the scope.
1155 DWORD rgbColor[ABF_SCOPECOLORS]; // Colors for the components of the scope.
1156 float fDisplayStart; // Start of the display area in ms.
1157 float fDisplayEnd; // End of the display area in ms.
1158 WORD wScopeMode; // Mode that the scope is in.
1159 char bMaximized; // TRUE = Scope parent is maximized.
1160 char bMinimized; // TRUE = Scope parent is minimized.
1161 short xLeft; // Coordinate of the left edge.
1162 short yTop; // Coordinate of the top edge.
1163 short xRight; // Coordinate of the right edge.
1164 short yBottom; // Coordinate of the bottom edge.
1165 ABFLogFont LogFont; // Description of current font.
1166 ABFSignal TraceList[ABF_ADCCOUNT]; // List of traces in current use.
1167 short nYAxisWidth; // Width of the YAxis region.
1168 short nTraceCount; // Number of traces described in TraceList.
1169 short nEraseStrategy; // Erase strategy.
1170 short nDockState; // Docked position.
1171 // Size 656
1172 // * Do not insert any new members above this point! *
1173 // Section 2 scope configurations for file version 1.68.
1174 short nSizeofOldStructure; // Unused byte to determine the offset of the version 2 data.
1175 DWORD rgbColorEx[ ABF_SCOPECOLORS_EX ]; // New color settings for stored sweep and cursors.
1176 short nAutoZeroState; // Status of the autozero selection.
1177 DWORD dwCursorsVisibleState; // Flag for visible status of cursors.
1178 DWORD dwCursorsLockedState; // Flag for enabled status of cursors.
1179 char sUnasigned[61];
1180 // Size 113
1181 ABFScopeConfig();
1182 }; // Size = 769
1183
1184 inline ABFScopeConfig::ABFScopeConfig()
1185 {
1186 // Set everything to 0.
1187 memset( this, 0, sizeof(ABFScopeConfig) );
1188
1189 // Set critical parameters so we can determine the version.
1190 nSizeofOldStructure = 656;
1191 }
1192 */
1193 //
1194 // Definition of the ABF synch array structure
1195 //
1196
1197 struct ABFSynch
1198 {
1199 ABFLONG lStart; // Start of the episode/event in fSynchTimeUnit units.
1200 ABFLONG lLength; // Length of the episode/event in multiplexed samples.
1201 }; // Size = 8
1202
1203 //
1204 // Constants for nTagType in the ABFTag structure.
1205 //
1206 #define ABF_TIMETAG 0
1207 #define ABF_COMMENTTAG 1
1208 #define ABF_EXTERNALTAG 2
1209 #define ABF_VOICETAG 3
1210 #define ABF_NEWFILETAG 4
1211 #define ABF_ANNOTATIONTAG 5 // Same as a comment tag except that nAnnotationIndex holds
1212 // the index of the annotation that holds extra information.
1213 //
1214 // Definition of the ABF Tag structure
1215 //
1216 struct ABFTag
1217 {
1218 ABFLONG lTagTime; // Time at which the tag was entered in fSynchTimeUnit units.
1219 char sComment[ABF_TAGCOMMENTLEN]; // Optional tag comment.
1220 short nTagType; // Type of tag ABF_TIMETAG, ABF_COMMENTTAG, ABF_EXTERNALTAG, ABF_VOICETAG, ABF_NEWFILETAG or ABF_ANNOTATIONTAG
1221 union
1222 {
1223 short nVoiceTagNumber; // If nTagType=ABF_VOICETAG, this is the number of this voice tag.
1224 short nAnnotationIndex; // If nTagType=ABF_ANNOTATIONTAG, this is the index of the corresponding annotation.
1225 };
1226 }; // Size = 64
1227
1228 // Comment inserted for externally acquired tags (expanded with spaces to ABF_TAGCOMMENTLEN).
1229 #define ABF_EXTERNALTAGCOMMENT "<External>"
1230 #define ABF_VOICETAGCOMMENT "<Voice Tag>"
1231
1232 //
1233 // Constants for nCompressionType in the ABFVoiceTagInfo structure.
1234 //
1235 #define ABF_COMPRESSION_NONE 0
1236 #define ABF_COMPRESSION_PKWARE 1
1237 //#define ABF_COMPRESSION_MPEG 2
1238
1239 //
1240 // Definition of the ABFVoiceTagInfo structure.
1241 //
1242 struct ABFVoiceTagInfo
1243 {
1244 ABFLONG lTagNumber; // The tag number that corresponds to this VoiceTag
1245 ABFLONG lFileOffset; // Offset to this tag within the VoiceTag block
1246 ABFLONG lUncompressedSize; // Size of the voice tag expanded.
1247 ABFLONG lCompressedSize; // Compressed size of the tag.
1248 short nCompressionType; // Compression method used.
1249 short nSampleSize; // Size of the samples acquired.
1250 ABFLONG lSamplesPerSecond; // Rate at which the sound was acquired.
1251 uint32_t dwCRC; // CRC used to check data integrity.
1252 uint16_t wChannels; // Number of channels in the tag (usually 1).
1253 uint16_t wUnused; // Unused space.
1254 }; // Size 32
1255
1256 //
1257 // Constants for lParameterID in the ABFDelta structure.
1258 //
1259 // NOTE: If any changes are made to this list, the code in ABF_UpdateHeader must
1260 // be updated to include the new items.
1261 #define ABF_DELTA_HOLDING0 0
1262 #define ABF_DELTA_HOLDING1 1
1263 #define ABF_DELTA_HOLDING2 2
1264 #define ABF_DELTA_HOLDING3 3
1265 #define ABF_DELTA_DIGITALOUTS 4
1266 #define ABF_DELTA_THRESHOLD 5
1267 #define ABF_DELTA_PRETRIGGER 6
1268
1269 // Because of lack of space, the Autosample Gain ID also contains the ADC number.
1270 #define ABF_DELTA_AUTOSAMPLE_GAIN 100 // +ADC channel.
1271
1272 // Because of lack of space, the Signal Gain ID also contains the ADC number.
1273 #define ABF_DELTA_SIGNAL_GAIN 200 // +ADC channel.
1274
1275 //
1276 // Definition of the ABF Delta structure.
1277 //
1278
1279 struct ABFDelta
1280 {
1281 ABFLONG lDeltaTime; // Time at which the parameter was changed in fSynchTimeUnit units.
1282 ABFLONG lParameterID; // Identifier for the parameter changed
1283 union
1284 {
1285 ABFLONG lNewParamValue; // Depending on the value of lParameterID
1286 float fNewParamValue; // this entry may be either a float or a long.
1287 };
1288 }; // Size = 12
1289
1290 #ifndef RC_INVOKED
1291 #pragma pack(pop) // return to default packing
1292 #endif
1293
1294 /*
1295 //
1296 // The size of the buffers to be passed to ABFH_GetWaveformVertor
1297 //
1298 #define ABFH_MAXVECTORS 30
1299
1300 //
1301 // Function prototypes for functions in ABFHEADR.C
1302 //
1303
1304 void WINAPI ABFH_Initialize( ABFFileHeader *pFH );
1305
1306 void WINAPI ABFH_InitializeScopeConfig(const ABFFileHeader *pFH, ABFScopeConfig *pCfg);
1307
1308 BOOL WINAPI ABFH_CheckScopeConfig(ABFFileHeader *pFH, ABFScopeConfig *pCfg);
1309
1310 void WINAPI ABFH_GetADCDisplayRange( const ABFFileHeader *pFH, int nChannel,
1311 float *pfUUTop, float *pfUUBottom);
1312
1313 void WINAPI ABFH_GetADCtoUUFactors( const ABFFileHeader *pFH, int nChannel,
1314 float *pfADCToUUFactor, float *pfADCToUUShift );
1315
1316 void WINAPI ABFH_ClipADCUUValue(const ABFFileHeader *pFH, int nChannel, float *pfUUValue);
1317
1318 void WINAPI ABFH_GetDACtoUUFactors( const ABFFileHeader *pFH, int nChannel,
1319 float *pfDACToUUFactor, float *pfDACToUUShift );
1320
1321 void WINAPI ABFH_ClipDACUUValue(const ABFFileHeader *pFH, int nChannel, float *pfUUValue);
1322
1323 BOOL WINAPI ABFH_GetMathValue(const ABFFileHeader *pFH, float fA, float fB, float *pfRval);
1324
1325 int WINAPI ABFH_GetMathChannelName(char *pszName, UINT uNameLen);
1326
1327 BOOL WINAPI ABFH_ParamReader( FILEHANDLE hFile, ABFFileHeader *pFH, int *pnError );
1328
1329 BOOL WINAPI ABFH_ParamReaderEx( HANDLE hFile, ABFFileHeader *pFH, int *pnError );
1330 BOOL WINAPI ABFH_ParamWriter( HANDLE hFile, ABFFileHeader *pFH, int *pnError );
1331
1332 BOOL WINAPI ABFH_GetErrorText( int nError, char *pszBuffer, UINT nBufferSize );
1333
1334 // ABFHWAVE.CPP
1335
1336 // Constants for ABFH_GetEpochLimits
1337 #define ABFH_FIRSTHOLDING -1
1338 #define ABFH_LASTHOLDING ABF_EPOCHCOUNT
1339
1340 // Return the bounds of a given epoch in a given episode. Values returned are ZERO relative.
1341 BOOL WINAPI ABFH_GetEpochLimits(const ABFFileHeader *pFH, int nADCChannel, DWORD dwEpisode,
1342 int nEpoch, UINT *puEpochStart, UINT *puEpochEnd,
1343 int *pnError);
1344
1345 BOOL WINAPI ABFH_GetEpochLimitsEx(const ABFFileHeader *pFH, int nADCChannel, UINT uDACChannel, DWORD dwEpisode,
1346 int nEpoch, UINT *puEpochStart, UINT *puEpochEnd,
1347 int *pnError);
1348
1349 // Get the offset in the sampling sequence for the given physical channel.
1350 BOOL WINAPI ABFH_GetChannelOffset( const ABFFileHeader *pFH, int nChannel, UINT *puChannelOffset );
1351
1352 // This function forms the de-multiplexed DAC output waveform for the
1353 // particular channel in the pfBuffer, in DAC UserUnits.
1354 BOOL WINAPI ABFH_GetWaveform( const ABFFileHeader *pFH, int nADCChannel, DWORD dwEpisode,
1355 float *pfBuffer, int *pnError);
1356
1357 BOOL WINAPI ABFH_GetWaveformEx( const ABFFileHeader *pFH, UINT uDACChannel, DWORD dwEpisode,
1358 float *pfBuffer, int *pnError);
1359
1360 // This function forms the de-multiplexed Digital output waveform for the
1361 // particular channel in the pdwBuffer, as a bit mask. Digital OUT 0 is in bit 0.
1362 BOOL WINAPI ABFH_GetDigitalWaveform( const ABFFileHeader *pFH, int nChannel, DWORD dwEpisode,
1363 DWORD *pdwBuffer, int *pnError);
1364
1365 // Returns vector pairs for displaying a waveform made up of epochs.
1366 BOOL WINAPI ABFH_GetWaveformVector(const ABFFileHeader *pFH, DWORD dwEpisode, UINT uStart,
1367 UINT uFinish, float *pfLevels, float *pfTimes,
1368 int *pnVectors, int *pnError);
1369
1370 // Returns vector pairs for displaying the digital outs.
1371 BOOL WINAPI ABFH_GetDigitalWaveformVector(const ABFFileHeader *pFH, DWORD dwEpisode, UINT uStart,
1372 UINT uFinish, DWORD *pdwLevels, float *pfTimes,
1373 int *pnVectors, int *pnError);
1374
1375 // Calculates the timebase array for the file.
1376 void WINAPI ABFH_GetTimebase(const ABFFileHeader *pFH, float fTimeOffset, float *pfBuffer, UINT uBufferSize);
1377 void WINAPI ABFH_GetTimebaseEx(const ABFFileHeader *pFH, double dTimeOffset, double *pdBuffer, UINT uBufferSize);
1378
1379 // Constant for ABFH_GetHoldingDuration
1380 #define ABFH_HOLDINGFRACTION 64
1381
1382 // Get the duration of the first holding period.
1383 UINT WINAPI ABFH_GetHoldingDuration(const ABFFileHeader *pFH);
1384
1385 // Checks whether the waveform varies from episode to episode.
1386 BOOL WINAPI ABFH_IsConstantWaveform(const ABFFileHeader *pFH);
1387
1388 BOOL WINAPI ABFH_IsConstantWaveformEx(const ABFFileHeader *pFH, UINT uDACChannel);
1389
1390 // Checks that the sample intervals in the header are valid.
1391 BOOL WINAPI ABFH_CheckSampleIntervals(const ABFFileHeader *pFH, float fClockResolution, int *pnError);
1392
1393 // Gets the closest sample intervals higher and lower than the passed interval.
1394 void WINAPI ABFH_GetClosestSampleIntervals(float fSampleInterval, float fClockResolution,
1395 int nOperationMode, float fMinPeriod, float fMaxPeriod,
1396 float *pfHigher, float *pfLower);
1397
1398 // Sets up the list for the spinner to drive the sampling interval through.
1399 UINT WINAPI ABFH_SetupSamplingList(UINT uNumChannels, float fMinPeriod, float fMaxPeriod,
1400 float *pfIntervalList, UINT uListEntries);
1401
1402 // Get the full sweep length given the length available to epochs or vice-versa.
1403 int WINAPI ABFH_SweepLenFromUserLen(int nUserLength, int nNumChannels);
1404 int WINAPI ABFH_UserLenFromSweepLen(int nSweepLength, int nNumChannels);
1405
1406 // Converts a display range to the equivalent gain and offset factors.
1407 void WINAPI ABFH_GainOffsetToDisplayRange( const ABFFileHeader *pFH, int nChannel,
1408 float fDisplayGain, float fDisplayOffset,
1409 float *pfUUTop, float *pfUUBottom);
1410
1411 // Converts a display range to the equivalent gain and offset factors.
1412 void WINAPI ABFH_DisplayRangeToGainOffset( const ABFFileHeader *pFH, int nChannel,
1413 float fUUTop, float fUUBottom,
1414 float *pfDisplayGain, float *pfDisplayOffset);
1415
1416 // Converts a time value to a synch time count or vice-versa.
1417 void WINAPI ABFH_SynchCountToMS(const ABFFileHeader *pFH, UINT uCount, double *pdTimeMS);
1418 UINT WINAPI ABFH_MSToSynchCount(const ABFFileHeader *pFH, double dTimeMS);
1419
1420 // Gets the point at which the sampling interval changes if split clock.
1421 UINT WINAPI ABFH_GetClockChange(const ABFFileHeader *pFH);
1422
1423 // Gets the duration of the Waveform Episode (in us), allowing for split clock etc.
1424 void WINAPI ABFH_GetEpisodeDuration(const ABFFileHeader *pFH, double *pdEpisodeDuration);
1425
1426 // Gets the duration of a P/N sequence (in us), including settling times.
1427 void WINAPI ABFH_GetPNDuration(const ABFFileHeader *pFH, double *pdPNDuration);
1428
1429 void WINAPI ABFH_GetPNDurationEx(const ABFFileHeader *pFH, UINT uDAC, double *pdPNDuration);
1430
1431 // Gets the duration of a pre-sweep train in us.
1432 void WINAPI ABFH_GetTrainDuration(const ABFFileHeader *pFH, double *pdTrainDuration);
1433
1434 void WINAPI ABFH_GetTrainDurationEx (const ABFFileHeader *pFH, UINT uDAC, double *pdTrainDuration);
1435
1436 // Gets the duration of a whole meta-episode (in us).
1437 void WINAPI ABFH_GetMetaEpisodeDuration(const ABFFileHeader *pFH, double *pdMetaEpisodeDuration);
1438
1439 // Gets the start to start period for the episode in us.
1440 void WINAPI ABFH_GetEpisodeStartToStart(const ABFFileHeader *pFH, double *pdEpisodeStartToStart);
1441
1442 // Checks that the user list contains valid entries for the protocol.
1443 BOOL WINAPI ABFH_CheckUserList(const ABFFileHeader *pFH, int *pnError);
1444
1445 BOOL WINAPI ABFH_CheckUserListEx(const ABFFileHeader *pFH, UINT uListNum, int *pnError);
1446
1447 // Checks if the ABFFileHeader is a new (6k) or old (2k) header.
1448 //BOOL WINAPI ABFH_IsNewHeader(const ABFFileHeader *pFH);
1449
1450 // Demotes a new ABF header to a 1.5 version ABF header.
1451 void WINAPI ABFH_DemoteHeader(ABFFileHeader *pOut, const ABFFileHeader *pIn );
1452
1453 // Promotes an old ABF header to a 1.8 version ABF header.
1454 void WINAPI ABFH_PromoteHeader(ABFFileHeader *pOut, const ABFFileHeader *pIn );
1455
1456 // Gets the first sample interval, expressed as a double.
1457 double WINAPI ABFH_GetFirstSampleInterval( const ABFFileHeader *pFH );
1458
1459 // Gets the second sample interval expressed as a double.
1460 double WINAPI ABFH_GetSecondSampleInterval( const ABFFileHeader *pFH );
1461
1462 // Counts the number of changing sweeps.
1463 UINT WINAPI ABFH_GetNumberOfChangingSweeps( const ABFFileHeader *pFH );
1464
1465 // // Checks whether the digital output varies from episode to episode.
1466 BOOL WINAPI ABFH_IsConstantDigitalOutput(const ABFFileHeader *pFH);
1467
1468 BOOL WINAPI ABFH_IsConstantDigitalOutputEx(const ABFFileHeader *pFH, UINT uDACChannel);
1469
1470 int WINAPI ABFH_GetEpochDuration(const ABFFileHeader *pFH, UINT uDACChannel, UINT uEpisode, int nEpoch);
1471
1472 float WINAPI ABFH_GetEpochLevel(const ABFFileHeader *pFH, UINT uDACChannel, UINT uEpisode, int nEpoch);
1473 BOOL WINAPI ABFH_GetEpochLevelRange(const ABFFileHeader *pFH, UINT uDACChannel, int nEpoch, float *pfMin, float *pfMax);
1474 UINT WINAPI ABFH_GetMaxPNSubsweeps(const ABFFileHeader *pFH, UINT uDACChannel);
1475 */
1476 //
1477 // Error return values that may be returned by the ABFH_xxx functions.
1478 //
1479
1480 #define ABFH_FIRSTERRORNUMBER 2001
1481 #define ABFH_EHEADERREAD 2001
1482 #define ABFH_EHEADERWRITE 2002
1483 #define ABFH_EINVALIDFILE 2003
1484 #define ABFH_EUNKNOWNFILETYPE 2004
1485 #define ABFH_CHANNELNOTSAMPLED 2005
1486 #define ABFH_EPOCHNOTPRESENT 2006
1487 #define ABFH_ENOWAVEFORM 2007
1488 #define ABFH_EDACFILEWAVEFORM 2008
1489 #define ABFH_ENOMEMORY 2009
1490 #define ABFH_BADSAMPLEINTERVAL 2010
1491 #define ABFH_BADSECONDSAMPLEINTERVAL 2011
1492 #define ABFH_BADSAMPLEINTERVALS 2012
1493 #define ABFH_ENOCONDITTRAINS 2013
1494 #define ABFH_EMETADURATION 2014
1495 #define ABFH_ECONDITNUMPULSES 2015
1496 #define ABFH_ECONDITBASEDUR 2016
1497 #define ABFH_ECONDITBASELEVEL 2017
1498 #define ABFH_ECONDITPOSTTRAINDUR 2018
1499 #define ABFH_ECONDITPOSTTRAINLEVEL 2019
1500 #define ABFH_ESTART2START 2020
1501 #define ABFH_EINACTIVEHOLDING 2021
1502 #define ABFH_EINVALIDCHARS 2022
1503 #define ABFH_ENODIG 2023
1504 #define ABFH_EDIGHOLDLEVEL 2024
1505 #define ABFH_ENOPNPULSES 2025
1506 #define ABFH_EPNNUMPULSES 2026
1507 #define ABFH_ENOEPOCH 2027
1508 #define ABFH_EEPOCHLEN 2028
1509 #define ABFH_EEPOCHINITLEVEL 2029
1510 #define ABFH_EDIGLEVEL 2030
1511 #define ABFH_ECONDITSTEPDUR 2031
1512 #define ABFH_ECONDITSTEPLEVEL 2032
1513 #define ABFH_EINVALIDBINARYCHARS 2033
1514 #define ABFH_EBADWAVEFORM 2034
1515
1516
1517 #ifdef __cplusplus
1518 }
1519 #endif
1520
1521 #endif /* INC_ABFHEADR_H */