#include "keyb.h"
#include "Functions.h"
#include <stdio.h>
#include <unistd.h>
#include <stdint.h>
#include <ctype.h>
#include <sys/time.h>
Go to the source code of this file.
|
long | get_time () |
| Get time in milliseconds. More...
|
|
int | DataConsistencyCheck (uint32_t *buff32, int NumWords) |
| Do some data consistency check. More...
|
|
int | SaveHistogram (char *basename, int b, int ch, uint32_t *EHisto) |
|
int | SaveWaveform (int b, int ch, int trace, int size, int16_t *WaveData) |
|
int | SaveDigitalProbe (int b, int ch, int trace, int size, uint8_t *WaveData) |
| Save Digital Waveforms to output file. More...
|
|
void | PrintInterface () |
| Print the interface to screen. More...
|
|
int DataConsistencyCheck |
( |
uint32_t * |
buff32, |
|
|
int |
NumWords |
|
) |
| |
Do some data consistency check.
- Returns
- 0=success; -1=error
Definition at line 64 of file Functions.c.
References i, and printf().
74 EventSize = buff32[pnt] & 0x0FFFFFFF;
76 }
while (pnt<NumWords);
77 if (pnt != NumWords) {
78 printf(
"Data Error: Event truncation\n");
83 for(i=0; i<NumWords; i++) {
84 if (buff32[i] == 0) zcnt++;
87 printf(
"Data Error: Burst of zeroes\n");
Get time in milliseconds.
- Returns
- time in msec
- Note
- TERMS OF USE: 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. 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. The user relies on the software, documentation and results solely at his own risk.
- Returns
- time in msec
Definition at line 43 of file Functions.c.
Referenced by A3818UpgradeFromFile(), A3818UpgradeFromMem(), and main().
47 struct _timeb timebuffer;
48 _ftime( &timebuffer );
49 time_ms = (long)timebuffer.time * 1000 + (
long)timebuffer.millitm;
53 gettimeofday(&t1, &tz);
54 time_ms = (t1.tv_sec) * 1000 + t1.tv_usec / 1000;
Print the interface to screen.
- Returns
- none /* ------------------------------------------------------------------------------------------------------—
Definition at line 177 of file Functions.c.
References printf().
Referenced by main().
178 printf(
"\ns ) Start acquisition\n");
179 printf(
"S ) Stop acquisition\n");
180 printf(
"r ) Restart acquisition\n");
182 printf(
"t ) Send a software trigger\n");
183 printf(
"h ) Save Histograms to file\n");
184 printf(
"w ) Save waveforms to file\n\n\n");
int SaveDigitalProbe |
( |
int |
b, |
|
|
int |
ch, |
|
|
int |
trace, |
|
|
int |
size, |
|
|
uint8_t * |
WaveData |
|
) |
| |
Save Digital Waveforms to output file.
- Returns
- 0=success; -1=error
Definition at line 153 of file Functions.c.
References i, size, and sprintf().
Referenced by main().
162 sprintf(filename,
"DWaveform_%d_%d_%d.txt", b, ch, trace);
163 fh = fopen(filename,
"w");
166 for(i=0; i<
size; i++)
167 fprintf(fh,
"%d\n", WaveData[i]);
int SaveHistogram |
( |
char * |
basename, |
|
|
int |
b, |
|
|
int |
ch, |
|
|
uint32_t * |
EHisto |
|
) |
| |
Definition at line 101 of file Functions.c.
References i, printf(), and sprintf().
Referenced by main().
112 fh = fopen(filename,
"w");
115 for(i=0; i<(1<<12); i++) {
116 fprintf(fh,
"%d\n", EHisto[i]);
119 printf(
"Histograms saved to '%s_<board>_<channel>.txt'\n",
basename);
int SaveWaveform |
( |
int |
b, |
|
|
int |
ch, |
|
|
int |
trace, |
|
|
int |
size, |
|
|
int16_t * |
WaveData |
|
) |
| |
Definition at line 129 of file Functions.c.
References i, size, and sprintf().
Referenced by main().
138 sprintf(filename,
"Waveform_%d_%d_%d.txt", b, ch, trace);
139 fh = fopen(filename,
"w");
142 for(i=0; i<
size; i++)
143 fprintf(fh,
"%d\n", WaveData[i]);