Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
GANILAnalysis
MFMlib
Commits
b46dfa25
Commit
b46dfa25
authored
Jun 11, 2021
by
LEGEARD Luc
☢
Browse files
fix compilation without XML and fix extraction mode
parent
9198f843
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
54 deletions
+62
-54
README.txt
README.txt
+1
-2
sources/MFMCoboTopoFrame.h
sources/MFMCoboTopoFrame.h
+2
-2
sources/MFMtest.cc
sources/MFMtest.cc
+59
-50
No files found.
README.txt
View file @
b46dfa25
...
...
@@ -60,8 +60,7 @@ Usage
usage "MFMtest.exe --help" for help
In a tuto directory, you have a example usage of MFMlib for you own C++ code
...
...
sources/MFMCoboTopoFrame.h
View file @
b46dfa25
...
...
@@ -33,9 +33,9 @@ struct MFM_CoboTopo_frame{
class
MFMCoboTopoFrame
:
public
MFMBlobFrame
{
#ifndef NO_MFMXML
TiXmlDocument
*
MyTinyDoc
;
#endif
public
:
MFMCoboTopoFrame
();
...
...
sources/MFMtest.cc
View file @
b46dfa25
...
...
@@ -138,17 +138,16 @@ int main(int argc, char **argv) {
fNbFramesStart
=
0
;
fNbFramesDump
=
0
;
fVerbose
=
5
;
fNbItems
=
-
1
;
// if -1 , we leave frame to get its defined value
fNbItems
=
-
1
;
// if -1 , we leave frame to get its defined value
fExpSize
=
-
1
;
fExpType
=
-
1
;
fExpEndian
=
-
1
;
fExpMaxSize
=
-
1
;
fExpSize
=
-
1
;
fExpType
=
-
1
;
fExpEndian
=
-
1
;
fExpMaxSize
=
-
1
;
fExtractMode
=
false
;
fActionFile
=
false
;
int
fExtDumpSize
=
0
;
strcpy
(
fExtFilename
,
""
);
strcpy
(
filename
,
fDeffilename
);
...
...
@@ -185,7 +184,7 @@ int main(int argc, char **argv) {
fReaGenericframe
=
new
MFMReaGenericFrame
();
uint16_t
tabcard
[
1
];
// this is given in example
tabcard
[
0
]
=
112
;
// this is given in example
//fReaGenericframe -> InitTabValues(tabcard,1); // this is given in example
//fReaGenericframe -> InitTabValues(tabcard,1); // this is given in example
and test
fReaTraceframe
=
new
MFMReaTraceFrame
();
fSiriusframe
=
new
MFMSiriusFrame
();
fDeflectorframe
=
new
MFMS3DeflectorFrame
();
...
...
@@ -293,7 +292,9 @@ int main(int argc, char **argv) {
fFileSize
=
filestatus
.
st_size
;
int
minsizeheader
=
MFM_BLOB_HEADER_SIZE
;
// =8
if
((
fExtractMode
==
false
)
and
(
fPatternMode
==
false
))
{
if
((
fExtractMode
==
false
)
and
(
fPatternMode
==
false
))
{
// mode read standard
int
fLun
=
0
;
// Logical Unit Number
fLun
=
open
(
filename
,
(
O_RDONLY
));
if
(
fLun
<=
0
)
{
...
...
@@ -311,6 +312,7 @@ int main(int argc, char **argv) {
//------------------------------------------------------------------------
// Test xml a enlever des que c'est prêt
//
#ifndef NO_MFMXML
DataParameters
datapar
;
datapar
.
FillFromActionXMLFile
((
const
char
*
)
filename
);
...
...
@@ -330,6 +332,9 @@ int main(int argc, char **argv) {
cout
<<
"-----------------4-----------------------------------
\n
"
;
datascal
.
WriteXML
(
"bidon.xml"
);
cout
<<
"-----------------5-----------------------------------
\n
"
;
#else
cout
<<
" When compilation of XML is devalided , this action on ACTION FILE is not possible!
\n
"
;
#endif
return
0
;
//------------------------------------------------------------------------
...
...
@@ -359,7 +364,7 @@ int main(int argc, char **argv) {
}
if
(
fExtractMode
==
true
)
{
if
(
(
fExtractMode
==
true
)
and
(
fPatternMode
==
false
)){
// mode read avec exctraction sur critère de taille ....
cout
<<
endl
;
cout
<<
"-------------------------------------------------------------"
<<
endl
;
...
...
@@ -442,8 +447,12 @@ int main(int argc, char **argv) {
type
=
fFrame
->
GetFrameType
();
endianness
=
fFrame
->
GetFrameEndianness
();
cout
<<
"Framesize "
<<
framesize
<<
" ?=? "
<<
fExpSize
<<
endl
;
cout
<<
"Type "
<<
type
<<
" ?=? "
<<
fExpType
<<
endl
;
cout
<<
"endianness "
<<
endianness
<<
" ?=? "
<<
fExpEndian
<<
endl
;
if
(((
framesize
!=
fExpSize
)
and
(
fExpSize
!=-
1
))
or
((
type
!=
fExpType
)
and
(
fExpType
!=-
1
))
or
((
endianness
!=
fExpEndian
)
and
(
fExpEndian
!=-
1
))){
if
(((
framesize
!=
fExpSize
)
and
(
fExpSize
!=-
1
))
or
((
type
!=
fExpType
)
and
(
fExpType
!=
1
))
or
((
endianness
!=
fExpEndian
)
and
(
fExpEndian
!=
1
))){
if
(
fExtDumpSize
>
0
)
{
cout
<<
" ----------Dump Problem------"
<<
fReadsize
<<
"------------
\n
"
;
...
...
@@ -453,7 +462,7 @@ int main(int argc, char **argv) {
fNonExpectedSizeCount
++
;
fseek
(
fLun
,
(
-
retour
+
1
),
SEEK_CUR
);
}
else
{
}
else
{
cout
<<
"Match
\n
"
;;
fFrame
->
FillStat
();
if
(
fLunOut
)
fwrite
(
vector
,
1
,
retour
,
fLunOut
);
...
...
@@ -478,7 +487,7 @@ int main(int argc, char **argv) {
if
(
fLun
!=
NULL
)
{
fclose
(
fLun
);}
}
// end of if (fExtractMode==true)
if
(
fPatternMode
==
true
)
{
if
(
fPatternMode
==
true
)
{
// mode read avec extraction sur critère de pattern ....
cout
<<
endl
;
cout
<<
"-------------------------------------------------------------"
<<
endl
;
cout
<<
"| MFMtest "
<<
" version : "
<<
MFM_VERSION
<<
endl
;
...
...
@@ -1450,7 +1459,7 @@ int ReadInBadFile(FILE * fLun, char** vector, int * vectorsize,
if
(
countsize2
!=
sizetoread
)
{
if
(
sizetoread
<
(
filesize
-
(
readsize
+
FirstSizeToRead
)))
{
char
info
[
200
];
sprintf
(
info
,
"Error in read file ,read /asked to read : %d / %d "
,
sprintf
(
info
,
"Error in read file ,read /asked to read : %d / %d
(may be end of file?)
"
,
countsize2
,
sizetoread
);
Error
.
TreatError
(
1
,
0
,
info
);
}
...
...
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