Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libfsdaqwriter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DetectorSoftware
libfsdaqwriter
Commits
1100b0e8
Commit
1100b0e8
authored
5 years ago
by
Yuelong Yu
Browse files
Options
Downloads
Patches
Plain Diff
fixed tif multiple close event
parent
5b128f4b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TiffWriter.cpp
+22
-14
22 additions, 14 deletions
src/TiffWriter.cpp
with
22 additions
and
14 deletions
src/TiffWriter.cpp
+
22
−
14
View file @
1100b0e8
...
...
@@ -63,35 +63,43 @@ namespace FSDaqNS
string
filename
=
m_metadata2d
.
filename
+
"_"
+
to_string
(
frameno
)
+
".tif"
;
string
filenametmp
=
m_metadata2d
.
filename
+
"_"
+
to_string
(
frameno
)
+
".tmp"
;
if
(
m_tiffwriter
->
isInitialized
())
{
m_tiffwriter
->
close
();
return
false
;
}
else
try
{
m_tiffwriter
->
setFrame
(
m_metadata2d
.
x
,
m_metadata2d
.
y
);
m_tiffwriter
->
setFileName
(
filenametmp
,
"PCO tango server"
);
LOG_INFOS
(
"create tif file : "
+
filenametmp
);
}
catch
(...)
{
try
{
m_tiffwriter
->
setFrame
(
m_metadata2d
.
x
,
m_metadata2d
.
y
);
m_tiffwriter
->
setFileName
(
filename
,
"PCO tango server"
);
LOG_INFOS
(
"create tif file : "
+
filename
);
}
catch
(...)
{
LOG_STREAM
(
__FUNCTION__
,
FSDetCoreNS
::
ERROR
,
"cannot create a new TIF file"
);
return
false
;
}
LOG_STREAM
(
__FUNCTION__
,
FSDetCoreNS
::
ERROR
,
"cannot create a new TIF file"
);
return
false
;
}
int16
*
ptr
=
data
.
data
();
m_tiffwriter
->
append
(
ptr
);
bool
ret
=
m_tiffwriter
->
writeFile
();
m_tiffwriter
->
close
();
LOG_INFOS
(
"close tif file : "
+
filename
);
LOG_INFOS
(
"close tif file : "
+
filename
tmp
);
if
(
std
::
rename
(
filenametmp
.
c_str
(),
filename
.
c_str
()))
{
ret
=
false
;
LOG_STREAM
(
__FUNCTION__
,
FSDetCoreNS
::
ERROR
,
"cannot rename file"
);
}
return
ret
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment