Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
lst-data-process-128
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lst
lst-data-process-128
Commits
d5019527
Commit
d5019527
authored
Jan 11, 2017
by
legoc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version 1.1.1 with writing of header.
parent
36713169
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
4 deletions
+56
-4
CHANGELOG
CHANGELOG
+1
-1
configure.ac
configure.ac
+1
-1
src/lstdpp128/CrateBoard.cpp
src/lstdpp128/CrateBoard.cpp
+40
-0
src/lstdpp128/CrateBoard.h
src/lstdpp128/CrateBoard.h
+14
-2
No files found.
CHANGELOG
View file @
d5019527
Version 1.1.1, 20YY-MM-DD
-------------------------
- Implemented writeListModeContextToBinary
Version 1.1.0, 2016-12-16
-------------------------
...
...
configure.ac
View file @
d5019527
...
...
@@ -2,7 +2,7 @@
# This configure.ac script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
AC_INIT([lstdataprocess128], [1.1.1
-dev
])
AC_INIT([lstdataprocess128], [1.1.1])
LIBRARY_VERSION=1:1:1
...
...
src/lstdpp128/CrateBoard.cpp
View file @
d5019527
...
...
@@ -51,6 +51,46 @@ std::ostream& operator<< (std::ostream& os, ListModeContext const & header) {
return
os
;
}
std
::
string
writeListModeContextToBinary
(
const
ListModeContext
&
listModeContext
)
{
// Count the number of boards.
int
boardSize
=
0
;
for
(
int
c
=
0
;
c
<
listModeContext
.
crateBoard
.
nbCrates
;
c
++
)
{
for
(
int
b
=
0
;
b
<
listModeContext
.
crateBoard
.
crates
[
c
].
nbBoards
;
b
++
)
{
++
boardSize
;
}
}
// Allocate the data.
uint32_t
buffer
[
4
+
boardSize
];
buffer
[
0
]
=
1
;
buffer
[
1
]
=
9
;
buffer
[
2
]
=
0
;
buffer
[
3
]
=
boardSize
;
int
i
=
0
;
for
(
int
c
=
0
;
c
<
listModeContext
.
crateBoard
.
nbCrates
;
c
++
)
{
for
(
int
b
=
0
;
b
<
listModeContext
.
crateBoard
.
crates
[
c
].
nbBoards
;
b
++
)
{
int32_t
eventType
=
listModeContext
.
crateBoard
.
crates
[
c
].
boards
[
b
].
eventType
;
int32_t
crate
=
listModeContext
.
crateBoard
.
crates
[
c
].
boards
[
b
].
crate
;
int32_t
nbChannels
=
listModeContext
.
crateBoard
.
crates
[
c
].
boards
[
b
].
nbChannels
;
int32_t
boardType
=
listModeContext
.
crateBoard
.
crates
[
c
].
boards
[
b
].
boardType
;
buffer
[
4
+
i
]
=
boardType
&
0x3F
;
buffer
[
4
+
i
]
|=
(
nbChannels
&
0x3F
)
<<
6
;
buffer
[
4
+
i
]
|=
(
crate
&
0xF
)
<<
12
;
buffer
[
4
+
i
]
|=
(
eventType
&
0xFFFF
)
<<
16
;
++
i
;
}
}
// Return the binary content.
return
string
(
reinterpret_cast
<
const
char
*>
(
buffer
),
(
4
+
boardSize
)
*
sizeof
(
uint32_t
));
}
uint32_t
readListModeContextFromBinary
(
ListModeContext
&
listModeContext
,
uint32_t
version
,
uint32_t
timeBase
,
uint32_t
nbEvents
,
uint32_t
nbBoards
,
uint32_t
*
data
)
{
listModeContext
.
version
=
version
;
...
...
src/lstdpp128/CrateBoard.h
View file @
d5019527
...
...
@@ -35,6 +35,15 @@ static const int EVENT_SIZE_32 = 4;
*/
static
const
int
EVENT_SIZE_8
=
16
;
/**
* Version of the file.
*/
static
const
int
FORMAT_VERSION
=
1
;
/**
* Time base.
*/
static
const
int
TIME_BASE
=
9
;
/**
* List of different available boards.
...
...
@@ -197,7 +206,7 @@ struct ListModeContext {
uint32_t
nbEvents
;
CrateBoard
crateBoard
;
ListModeContext
()
:
version
(
0
),
timeBase
(
0
),
nbEvents
(
0
)
{}
ListModeContext
()
:
version
(
FORMAT_VERSION
),
timeBase
(
TIME_BASE
),
nbEvents
(
0
)
{}
};
/**
...
...
@@ -215,7 +224,10 @@ extern int32_t listModeHeaderSize;
*/
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
ListModeContext
const
&
header
);
//std::string writeListModeContextToBinary();
/**
* Writes the list mode header. Returns a binary string.
*/
std
::
string
writeListModeContextToBinary
(
const
ListModeContext
&
listModeContext
);
/**
* Reads the list mode header.
...
...
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