Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ML
lib
Binary Storage
Commits
f0e558a4
Commit
f0e558a4
authored
Feb 28, 2020
by
Zhukov, Alexander P
Browse files
Added return status
parent
251b78c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
c-code/README.md
View file @
f0e558a4
...
...
@@ -7,7 +7,7 @@ There are two examples: **test_MPS** and **test_DBL**.
It replicates structure from
[
SoftIOC > Errant > MPS > DTL_LLRF_HPM6_fault > 20200214_135209
](
https://ics-srv-web2.sns.ornl.gov/Diagnostics/index.php?dir=Instruments%2FSoftIOC%2FErrant%2FMPS%2FDTL_LLRF_HPM6_fault%2F20200214_135209%2F
)
1.
#### DBL
This creates a
~10Mb
file that stores waveforms.
This creates a
relatively large
file that stores waveforms.
## Compilation
To compile
**test_XXX**
executable run following from
**c-code**
directory
...
...
c-code/binary_storage.c
View file @
f0e558a4
...
...
@@ -39,7 +39,7 @@ void close_record(BinaryStorage *bs){
free
(
bs
->
contents
);
bs
->
contents
=
temp
;
bs
->
buf_size
=
newsz
;
printf
(
"Buffer size was doubled, new size is %
d
\n
"
,
newsz
);
//
printf("Buffer size was doubled, new size is %
zu
\n",newsz);
}
bs
->
contents
[
bs
->
con_idx
]
=
ftell
(
bs
->
file
);
...
...
@@ -94,10 +94,12 @@ int write_meta(BinaryStorage *bs, char* name, TSTMP timestamp, TAGS *tags, char*
fwrite
(
&
raw_len
,
4
,
1
,
bs
->
file
);
fwrite
(
description
,
1
,
length
,
bs
->
file
);
}
return
0
;
}
int
bsWriteTagsOnly
(
BinaryStorage
*
bs
,
char
*
name
,
TSTMP
timestamp
,
TAGS
*
tags
,
char
*
description
){
write_meta
(
bs
,
name
,
timestamp
,
tags
,
description
,
0
);
close_record
(
bs
);
return
0
;
}
int
bsWriteDBL
(
BinaryStorage
*
bs
,
char
*
name
,
TSTMP
timestamp
,
DBL
value
,
TAGS
*
tags
,
char
*
description
){
uint32_t
count
=
value
.
count
;
...
...
@@ -121,6 +123,7 @@ int bsWriteDBL(BinaryStorage *bs, char* name, TSTMP timestamp, DBL value, TAGS *
}
close_record
(
bs
);
return
0
;
}
...
...
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