Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DetectorSoftware
pcosdk
Commits
1c070f67
Commit
1c070f67
authored
Mar 20, 2020
by
Yuelong Yu
Browse files
working on pco4000
parent
126136b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
api/Version.h
View file @
1c070f67
...
...
@@ -24,5 +24,5 @@
namespace
PcoNS
{
const
std
::
string
PCOSDK_VERSION
=
"0.
4
"
;
const
std
::
string
PCOSDK_VERSION
=
"0.
5
"
;
}
pcome4/Pco4000.cpp
View file @
1c070f67
...
...
@@ -36,8 +36,22 @@ namespace PcoNS
if
(
SetADCOperation
(
2
)
!=
OK
)
return
SET_ERROR
;
//10s timeout
if
(
m_sptrGrabber
->
Set_Grabber_Timeout
(
10000
)
!=
OK
)
return
SET_ERROR
;
if
(
m_sptrCamera
->
PCO_SetCameraToCurrentTime
()
!=
OK
)
return
SET_ERROR
;
if
(
m_sptrCamera
->
PCO_ResetSettingsToDefault
()
!=
OK
)
return
SET_ERROR
;
if
(
m_sptrCamera
->
PCO_SetBitAlignment
(
BIT_ALIGNMENT_LSB
)
!=
OK
)
return
SET_ERROR
;
return
OK
;
}
int
Pco4000
::
GetPixelRate
(
int
&
nPixelRate
)
{
unsigned
int
unTmp
;
...
...
@@ -95,10 +109,27 @@ namespace PcoNS
int
Pco4000
::
SetBinning
(
short
shBinHorz
,
short
shBinVert
)
{
if
(
m_sptrCamera
->
PCO_SetBinning
(
static_cast
<
unsigned
short
>
(
shBinHorz
),
static_cast
<
unsigned
short
>
(
shBinVert
))
!=
OK
)
// if(m_sptrCamera->PCO_SetBinning(static_cast<unsigned short>(shBinHorz),
// static_cast<unsigned short>(shBinVert)) != OK)
// return SET_ERROR;
unsigned
short
binh
=
static_cast
<
unsigned
short
>
(
shBinHorz
);
unsigned
short
binv
=
static_cast
<
unsigned
short
>
(
shBinVert
);
if
(
m_sptrCamera
->
PCO_SetBinning
(
binh
,
binv
)
!=
OK
)
return
GET_ERROR
;
int
max_x
,
max_y
;
if
(
GetCameraMaxSize
(
max_x
,
max_y
)
!=
OK
)
return
GET_ERROR
;
short
x1
=
max_x
/
binh
;
short
y1
=
max_y
/
binv
;
if
(
SetROI
(
1
,
1
,
x1
,
y1
)
!=
OK
)
return
SET_ERROR
;
return
OK
;
return
ArmCamera
();
//return OK;
}
int
Pco4000
::
GetADCOperation
(
short
&
shADCNum
)
...
...
@@ -136,8 +167,8 @@ namespace PcoNS
if
(
SetRecordingState
(
0
)
!=
OK
)
return
SET_ERROR
;
if
(
m_sptrCamera
->
PCO_ResetSettingsToDefault
()
!=
OK
)
return
SET_ERROR
;
//
if(m_sptrCamera->PCO_ResetSettingsToDefault() != OK)
//
return SET_ERROR;
short
shX
,
shY
;
int
nRet
;
stTransferParams
stData
;
...
...
@@ -250,4 +281,55 @@ namespace PcoNS
return
OK
;
}
int
Pco4000
::
ChangeTimeBaseToUS
()
{
//cout<<"Pco4000:ChangeTimeBaseUS"<<endl;
unsigned
short
ushDelayTimeBase
,
ushExposureTimeBase
;
if
(
m_sptrCamera
->
PCO_GetTimebase
(
&
ushDelayTimeBase
,
&
ushExposureTimeBase
)
!=
OK
)
return
GET_ERROR
;
// 1:timebase microsecond
if
(
ushDelayTimeBase
!=
1
||
ushExposureTimeBase
!=
1
)
{
//get current timebase,delay time,exposure time
unsigned
int
unDelay
,
unExposure
;
unsigned
short
ushDelayTB
,
ushExposureTB
;
if
(
m_sptrCamera
->
PCO_GetDelayExposureTime
(
&
unDelay
,
&
unExposure
,
&
ushDelayTB
,
&
ushExposureTB
)
!=
OK
)
return
GET_ERROR
;
switch
(
ushExposureTB
)
{
case
0
:
// ns
unExposure
/=
1000
;
break
;
case
1
:
// us
break
;
case
2
:
// ms
unExposure
*=
(
pow
(
10
,
3
));
break
;
}
switch
(
ushDelayTB
)
{
case
0
:
// ns
unDelay
/=
1000
;
break
;
case
1
:
// us
break
;
case
2
:
// ms
unDelay
*=
(
pow
(
10
,
3
));
break
;
}
if
(
m_sptrCamera
->
PCO_SetDelayExposureTime
(
unDelay
,
unExposure
,
1
,
1
)
!=
OK
)
return
SET_ERROR
;
}
return
OK
;
}
}
pcome4/Pco4000.h
View file @
1c070f67
...
...
@@ -53,6 +53,7 @@ namespace PcoNS
int
GetImageData
(
vector
<
unsigned
short
>&
vImg
,
int
&
nX
,
int
&
nY
);
private:
int
PreAcq
();
int
ChangeTimeBaseToUS
();
vector
<
unsigned
short
>
m_vImg
;
};
...
...
Write
Preview
Supports
Markdown
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