-
-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented AcquisitionFrameCount on Fake-camera #699
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -336,6 +336,21 @@ | |
<Endianess>BigEndian</Endianess> | ||
</IntReg> | ||
|
||
<Integer Name="AcquisitionFrameCount" NameSpace="Custom"> | ||
<pValue>AcquisitionFrameCountRegister</pValue> | ||
<Min>1</Min> | ||
<Max>65535</Max> | ||
</Integer> | ||
|
||
<IntReg Name="AcquisitionFrameCountRegister" NameSpace="Custom"> | ||
<Address>0x310</Address> | ||
<Length>4</Length> | ||
Comment on lines
+342
to
+347
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use a 64bit integer, 65535 seems to small. |
||
<AccessMode>RW</AccessMode> | ||
<pPort>Device</pPort> | ||
<Sign>Unsigned</Sign> | ||
<Endianess>BigEndian</Endianess> | ||
</IntReg> | ||
|
||
<Enumeration Name="TriggerSelector" NameSpace="Standard"> | ||
<EnumEntry Name="FrameStart" NameSpace="Standard"> | ||
<Value>0</Value> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,7 @@ typedef struct { | |
|
||
guint32 frame_id; | ||
double trigger_frequency; | ||
int frameSeqCount; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be multi_frame_count instead of frameSeqCount. |
||
|
||
GMutex fill_pattern_mutex; | ||
|
||
|
@@ -218,10 +219,20 @@ arv_fake_camera_get_sleep_time_for_next_frame (ArvFakeCamera *camera, guint64 *n | |
|
||
g_return_val_if_fail (ARV_IS_FAKE_CAMERA (camera), 0); | ||
|
||
if (_get_register (camera, ARV_FAKE_CAMERA_REGISTER_TRIGGER_MODE) == 1) | ||
if (_get_register (camera, ARV_FAKE_CAMERA_REGISTER_TRIGGER_MODE) == 1 && | ||
camera->priv->frameSeqCount >= _get_register (camera, ARV_FAKE_CAMERA_ACQUISITION_FRAME_COUNT)) { | ||
frame_period_time_us = 1000000L / camera->priv->trigger_frequency; | ||
else | ||
frame_period_time_us = (guint64) _get_register (camera, ARV_FAKE_CAMERA_REGISTER_ACQUISITION_FRAME_PERIOD_US); | ||
|
||
/* | ||
//consider the time of the sequence inside the time between triggers? | ||
frame_period_time_us -= _get_register(camera, ARV_FAKE_CAMERA_ACQUISITION_FRAME_COUNT) * _get_register (camera, ARV_FAKE_CAMERA_REGISTER_ACQUISITION_FRAME_PERIOD_US) | ||
*/ | ||
} | ||
else { | ||
frame_period_time_us = | ||
(guint64) _get_register (camera, ARV_FAKE_CAMERA_REGISTER_ACQUISITION_FRAME_PERIOD_US); | ||
} | ||
|
||
|
||
if (frame_period_time_us == 0) { | ||
arv_warning_misc ("Invalid zero frame period, defaulting to 1 second"); | ||
|
@@ -866,9 +877,17 @@ arv_fake_camera_check_and_acknowledge_software_trigger (ArvFakeCamera *camera) | |
|
||
|
||
if (_get_register (camera, ARV_FAKE_CAMERA_REGISTER_TRIGGER_SOFTWARE) == 1) { | ||
|
||
arv_fake_camera_write_register (camera, ARV_FAKE_CAMERA_REGISTER_TRIGGER_SOFTWARE, 0); | ||
camera->priv->frameSeqCount = 1; | ||
return TRUE; | ||
} | ||
} else if (camera->priv->frameSeqCount < _get_register (camera, ARV_FAKE_CAMERA_ACQUISITION_FRAME_COUNT)) { | ||
camera->priv->frameSeqCount++; | ||
if (camera->priv->frameSeqCount == _get_register (camera, ARV_FAKE_CAMERA_ACQUISITION_FRAME_COUNT)) { | ||
camera->priv->frameSeqCount = 65535; | ||
} | ||
return TRUE; | ||
} | ||
return FALSE; | ||
} | ||
|
||
|
@@ -906,6 +925,18 @@ arv_fake_camera_get_control_channel_privilege (ArvFakeCamera *camera) | |
return value; | ||
} | ||
|
||
guint64 | ||
arv_fake_camera_get_frame_period(ArvFakeCamera* camera) | ||
{ | ||
return _get_register (camera, ARV_FAKE_CAMERA_REGISTER_ACQUISITION_FRAME_PERIOD_US); | ||
} | ||
|
||
int | ||
arv_fake_camera_get_acquisition_frame_count (ArvFakeCamera *camera) | ||
{ | ||
return _get_register (camera, ARV_FAKE_CAMERA_ACQUISITION_FRAME_COUNT); | ||
} | ||
|
||
void | ||
Comment on lines
+928
to
940
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These functions are never used. |
||
arv_fake_camera_set_control_channel_privilege (ArvFakeCamera *camera, guint32 privilege) | ||
{ | ||
|
@@ -1074,6 +1105,7 @@ arv_fake_camera_init (ArvFakeCamera *fake_camera) | |
|
||
fake_camera->priv->trigger_frequency = 25.0; | ||
fake_camera->priv->frame_id = 65400; /* Trigger circular counter bugs sooner */ | ||
fake_camera->priv->frameSeqCount = 65535;//max possible value by default for acquisition count | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't use C++ style comments |
||
} | ||
|
||
static void | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't include unrelated changes.