Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
Lima
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
62
Issues
62
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Merge Requests
4
Merge Requests
4
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
LimaGroup
Lima
Commits
181c9dea
Commit
181c9dea
authored
Oct 24, 2012
by
Sebastien Petitdemange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pilatus code refactoring
parent
ccaf48f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
16 deletions
+33
-16
applications/tango
applications/tango
+1
-1
camera/pilatus
camera/pilatus
+1
-1
hardware/include/HwFileEventMgr.h
hardware/include/HwFileEventMgr.h
+10
-1
hardware/src/HwFileEventMgr.cpp
hardware/src/HwFileEventMgr.cpp
+21
-13
No files found.
tango
@
ab45b47b
Subproject commit
9a9f9d76d02690f9de3ac098634d7e8ae5062fcc
Subproject commit
ab45b47b45a9a4130ef7ad9ef9f83cc2e795499b
pilatus
@
f62bc46b
Subproject commit f
299a6dec9a5662792011c7bcb76f59b662ce7d7
Subproject commit f
62bc46bb4dbca5be759cc3901277e3521ca5bee
hardware/include/HwFileEventMgr.h
View file @
181c9dea
...
...
@@ -33,12 +33,14 @@ namespace lima
class
HwFileEventCallbackHelper
:
public
DirectoryEvent
::
Callback
{
public:
enum
CallFrom
{
Acquisition
,
OnDemand
};
class
Callback
{
public:
virtual
void
prepare
(
const
DirectoryEvent
::
Parameters
&
)
{}
virtual
bool
getFrameInfo
(
int
image_number
,
const
char
*
full_path
,
HwFrameInfoType
&
)
=
0
;
CallFrom
,
HwFrameInfoType
&
)
=
0
;
virtual
bool
newFrameReady
(
const
HwFrameInfoType
&
)
=
0
;
};
...
...
@@ -49,6 +51,7 @@ namespace lima
int
&
next_file_number_expected
)
throw
();
virtual
bool
newFile
(
int
file_number
,
const
char
*
full_path
)
throw
();
int
getNbOfFramePending
()
const
{
return
m_pending_frame_infos
.
size
();}
private:
typedef
std
::
map
<
int
,
HwFrameInfoType
>
DatasPendingType
;
...
...
@@ -63,7 +66,10 @@ namespace lima
class
Callback
{
public:
virtual
void
prepare
(
const
DirectoryEvent
::
Parameters
&
)
{}
virtual
bool
getFrameInfo
(
int
image_number
,
const
char
*
full_path
,
HwFileEventCallbackHelper
::
CallFrom
,
HwFrameInfoType
&
)
=
0
;
virtual
void
getFrameDim
(
FrameDim
&
frame_dim
)
=
0
;
};
...
...
@@ -80,6 +86,8 @@ namespace lima
bool
isStopped
()
const
;
int
getLastAcquiredFrame
()
const
;
int
getNbOfFramePending
()
const
{
return
m_directory_cbk
.
getNbOfFramePending
();}
//methodes used by Lima core
virtual
void
setFrameDim
(
const
FrameDim
&
frame_dim
);
virtual
void
getFrameDim
(
FrameDim
&
frame_dim
);
...
...
@@ -105,6 +113,7 @@ namespace lima
friend
class
_CBK
;
int
_calcNbMaxImages
();
bool
_getFrameInfo
(
int
image_number
,
const
char
*
full_path
,
HwFileEventCallbackHelper
::
CallFrom
,
HwFrameInfoType
&
frame_info
);
std
::
string
m_tmpfs_path
;
...
...
hardware/src/HwFileEventMgr.cpp
View file @
181c9dea
...
...
@@ -47,8 +47,9 @@ bool HwFileEventCallbackHelper::nextFileExpected(int file_number,
bool
continueFlag
=
true
;
try
{
continueFlag
=
m_cbk
.
getFrameInfo
(
file_number
,
full_path
,
aNewFrameInfo
);
bool
continueAcq
=
!
m_cbk
.
newFrameReady
(
aNewFrameInfo
);
continueFlag
=
m_cbk
.
getFrameInfo
(
file_number
,
full_path
,
Acquisition
,
aNewFrameInfo
);
bool
continueAcq
=
m_cbk
.
newFrameReady
(
aNewFrameInfo
);
if
(
continueFlag
)
continueFlag
=
continueAcq
;
DatasPendingType
::
iterator
i
=
m_pending_frame_infos
.
begin
();
while
(
i
!=
m_pending_frame_infos
.
end
()
&&
continueFlag
)
...
...
@@ -82,7 +83,9 @@ bool HwFileEventCallbackHelper::newFile(int file_number,const char *full_path) t
try
{
HwFrameInfoType
aNewFrameInfo
;
continueFlag
=
m_cbk
.
getFrameInfo
(
file_number
,
full_path
,
aNewFrameInfo
);
continueFlag
=
m_cbk
.
getFrameInfo
(
file_number
,
full_path
,
Acquisition
,
aNewFrameInfo
);
m_pending_frame_infos
[
file_number
]
=
aNewFrameInfo
;
}
catch
(...)
...
...
@@ -119,12 +122,14 @@ public:
unlink
(
fullPath
);
}
closedir
(
aWatchDir
);
}
}
m_cnt
.
m_cbk
.
prepare
(
params
);
}
virtual
bool
getFrameInfo
(
int
image_number
,
const
char
*
full_path
,
HwFileEventCallbackHelper
::
CallFrom
mode
,
HwFrameInfoType
&
frame_info
)
{
return
m_cnt
.
_getFrameInfo
(
image_number
,
full_path
,
frame_info
);
return
m_cnt
.
_getFrameInfo
(
image_number
,
full_path
,
mode
,
frame_info
);
}
virtual
bool
newFrameReady
(
const
HwFrameInfoType
&
frame_info
)
{
...
...
@@ -271,14 +276,16 @@ void HwTmpfsBufferMgr::getStartTimestamp(Timestamp& start_ts)
void
HwTmpfsBufferMgr
::
getFrameInfo
(
int
acq_frame_nb
,
HwFrameInfoType
&
info
)
{
DEB_MEMBER_FUNCT
();
DEB_MEMBER_FUNCT
();
char
filename
[
1024
];
snprintf
(
filename
,
sizeof
(
filename
),
m_file_pattern
.
c_str
(),
acq_frame_nb
);
std
::
string
fullPath
=
m_tmpfs_path
+
"/"
;
fullPath
+=
filename
;
m_cbk
.
getFrameInfo
(
acq_frame_nb
,
fullPath
.
c_str
(),
info
);
char
filename
[
1024
];
snprintf
(
filename
,
sizeof
(
filename
),
m_file_pattern
.
c_str
(),
acq_frame_nb
);
std
::
string
fullPath
=
m_tmpfs_path
+
"/"
;
fullPath
+=
filename
;
m_cbk
.
getFrameInfo
(
acq_frame_nb
,
fullPath
.
c_str
(),
HwFileEventCallbackHelper
::
OnDemand
,
info
);
}
void
HwTmpfsBufferMgr
::
registerFrameCallback
(
HwFrameCallback
&
frame_cb
)
...
...
@@ -309,7 +316,8 @@ int HwTmpfsBufferMgr::_calcNbMaxImages()
}
bool
HwTmpfsBufferMgr
::
_getFrameInfo
(
int
image_number
,
const
char
*
full_path
,
HwFileEventCallbackHelper
::
CallFrom
mode
,
HwFrameInfoType
&
frame_info
)
{
return
m_cbk
.
getFrameInfo
(
image_number
,
full_path
,
frame_info
);
return
m_cbk
.
getFrameInfo
(
image_number
,
full_path
,
mode
,
frame_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