Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DaqIOLib
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
NADS-Public
DaqIOLib
Commits
9a7d625b
Commit
9a7d625b
authored
Feb 21, 2005
by
yiannis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Latest
parent
e7e51bee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
15 deletions
+44
-15
DaqIo.h
DaqIo.h
+44
-15
No files found.
DaqIo.h
View file @
9a7d625b
...
@@ -23,7 +23,7 @@ typedef vector<FILE *> TFileVec;
...
@@ -23,7 +23,7 @@ typedef vector<FILE *> TFileVec;
typedef
vector
<
CDaqChannelInfo
>
TChanInfoVec
;
typedef
vector
<
CDaqChannelInfo
>
TChanInfoVec
;
const
int
cMaxDaqRec
=
96
*
1024
;
///< maximum size of data per DAQ record
const
int
cMaxDaqRec
=
128
*
1024
;
///< maximum size of data per DAQ record
const
int
cMaxChannels
=
500
;
///< maximum number of channels we can handle
const
int
cMaxChannels
=
500
;
///< maximum number of channels we can handle
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
...
@@ -36,12 +36,9 @@ typedef enum {
...
@@ -36,12 +36,9 @@ typedef enum {
eNO_OPTION
=
0
,
eNO_OPTION
=
0
,
eEXPAND_DIFFERENTIAL
=
1
,
eEXPAND_DIFFERENTIAL
=
1
,
eFILL_MISSING
=
2
,
eFILL_MISSING
=
2
,
eFILL_MISSING_ORDER_0
=
4
,
eINCLUDE_FRAME
=
4
,
eFILL_MISSING_ORDER_1
=
8
,
eFILL_MISSING_ORDER_2
=
16
,
eBINARY_FORMAT
=
32
,
eBINARY_FORMAT
=
32
,
eASCII_FORMAT
=
64
,
eASCII_FORMAT
=
64
eINCLUDE_FRAME
=
128
}
TConvertOptions
;
}
TConvertOptions
;
inline
TConvertOptions
inline
TConvertOptions
...
@@ -218,8 +215,11 @@ public:
...
@@ -218,8 +215,11 @@ public:
vector
<
TDaqByte
>
m_Data
;
// data is stored here
vector
<
TDaqByte
>
m_Data
;
// data is stored here
protected
:
protected
:
void
Append
(
void
*
pData
,
int
size
,
int
count
);
void
Append
(
const
void
*
pData
,
int
size
,
int
count
);
void
Replace
(
const
void
*
pData
,
size_t
size
,
int
count
);
void
AllocSpace
(
int
size
,
int
count
=
0
);
void
AllocSpace
(
int
size
,
int
count
=
0
);
void
Clear
(
void
)
{
m_Data
.
clear
();
m_Count
=
0
;
};
int
m_Count
;
// count of data, not in bytes but in type
int
m_Count
;
// count of data, not in bytes but in type
};
};
...
@@ -239,9 +239,9 @@ protected:
...
@@ -239,9 +239,9 @@ protected:
///
///
inline
void
inline
void
CDaqBuffer
::
Append
(
CDaqBuffer
::
Append
(
void
*
p
,
///< pointer to data to append
const
void
*
p
,
///< pointer to data to append
int
size
,
///< size in bytes of data
int
size
,
///< size in bytes of data
int
count
)
///< count of data items in that buffer
int
count
)
///< count of data items in that buffer
{
{
size_t
oldsize
=
m_Data
.
size
();
size_t
oldsize
=
m_Data
.
size
();
...
@@ -251,6 +251,33 @@ CDaqBuffer::Append(
...
@@ -251,6 +251,33 @@ CDaqBuffer::Append(
m_Count
+=
count
;
m_Count
+=
count
;
}
}
/////////////////////////////////////////////////////////////////////////////////
///
/// This function replaces the existing data with new one.
///
/// The function receives a pointer to the data, the size of the buffer in
/// bytes and a count of elements in that buffer. The class deals with
/// untyped buffers, so the only way to keep track of how many elements
/// are in the buffer (i.e., 2 integers as opposed to 8 bytes) is for the
/// caller to provide that information, which in this case is the count
/// argument.
///
inline
void
CDaqBuffer
::
Replace
(
const
void
*
p
,
///< pointer to data to append
size_t
size
,
///< size in bytes of data
int
count
)
///< count of data items in that buffer
{
size_t
oldsize
=
m_Data
.
size
();
if
(
oldsize
<
size
)
{
m_Data
.
resize
(
size
);
}
memcpy
(
&
m_Data
[
0
],
p
,
size
);
m_Count
=
count
;
}
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
///
///
...
@@ -307,14 +334,16 @@ public:
...
@@ -307,14 +334,16 @@ public:
{
return
m_LastError
;
};
{
return
m_LastError
;
};
void
Close
(
void
);
void
Close
(
void
);
bool
FrameDropped
(
int
frm
);
bool
FrameHasData
(
int
frm
);
void
SetCallbacks
(
void
errf
(
const
char
*
,
const
char
*
),
void
progf
(
const
char
*
,
int
,
int
));
void
SetCallbacks
(
void
errf
(
const
char
*
,
const
char
*
),
void
progf
(
const
char
*
,
int
,
int
));
bool
LowLevelDataRead
(
const
TIntVec
*
chans
,
TDataVec
&
data
);
bool
LowLevelDataRead
(
const
TIntVec
*
chans
,
TDataVec
&
data
,
vector
<
TIntVec
>*
pFrameList
=
0
);
bool
LowLevelDataCopy
(
const
TIntVec
*
chans
,
TFileVec
&
dest
,
bool
LowLevelDataCopy
(
const
TIntVec
*
chans
,
TFileVec
&
dest
,
TConvertOptions
options
=
eBINARY_FORMAT
+
eINCLUDE_FRAME
);
TConvertOptions
options
=
eBINARY_FORMAT
+
eINCLUDE_FRAME
);
bool
GetFullData
(
const
TIntVec
*
chans
,
TDataVec
&
data
,
const
TIntVec
&
subsample
,
bool
GetFullData
(
const
TIntVec
*
chans
,
TDataVec
&
data
,
TConvertOptions
option
=
eNO_OPTION
,
TConvertOptions
options
=
eFILL_MISSING_ORDER_0
,
int
frm1
=
-
1
,
int
frm2
=
-
1
,
vector
<
TIntVec
>*
pFrameList
=
0
);
int
frm1
=
-
1
,
int
frm2
=
-
1
);
private
:
private
:
enum
TReadErrorCode
{
enum
TReadErrorCode
{
...
@@ -341,7 +370,7 @@ private:
...
@@ -341,7 +370,7 @@ private:
bool
WriteTocFile
(
const
string
&
fname
);
bool
WriteTocFile
(
const
string
&
fname
);
bool
ReadTocFile
(
const
string
&
fname
);
bool
ReadTocFile
(
const
string
&
fname
);
TReadErrorCode
ReadFrameHeader
(
int
,
int
&
,
int
&
,
int
&
);
TReadErrorCode
ReadFrameHeader
(
int
,
int
&
,
int
&
,
int
&
);
TReadErrorCode
ReadDataForOneFrame
(
int
,
TIntVec
,
TDataVec
&
,
void
*
);
TReadErrorCode
ReadDataForOneFrame
(
int
,
TIntVec
,
TDataVec
&
,
void
*
,
vector
<
bool
>&
);
// bool GenPurpTraverse(bool frameCB(int frm, int numC, bool end),
// bool GenPurpTraverse(bool frameCB(int frm, int numC, bool end),
// bool channelCB(int frm, int chan) );
// bool channelCB(int frm, int chan) );
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment