Skip to content

Commit

Permalink
Merge pull request #299 from fixstars/fix/release-v1-u3v-param
Browse files Browse the repository at this point in the history
change param
  • Loading branch information
xinyuli1204 authored Jul 19, 2024
2 parents 2e4e5e4 + 35bf123 commit 197e2f3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion example/u3v_camera1_opencv/u3v_camera1_opencv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main(int argc, char *argv[])
Param("frame_sync", false),
Param("gain_key", FEATURE_GAIN_KEY),
Param("exposure_key", FEATURE_EXPOSURE_KEY),
Param("realtime_diaplay_mode", true),
Param("realtime_display_mode", true),
Param("enable_control", true)
);

Expand Down
4 changes: 2 additions & 2 deletions example/u3v_camera1_opencv/u3v_camera1_opencv.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
frame_sync = Param('frame_sync', 'false')
gain_key = Param('gain_key', feature_gain_key)
exposure_key = Param('exposure_key', feature_exposure_key)
realtime_diaplay_mode = Param('realtime_diaplay_mode', 'true')
realtime_display_mode = Param('realtime_display_mode', 'true')
enable_control = Param('enable_control', 'true')

# Add node and connect the input port to the node instance
node = builder.add('image_io_u3v_cameraN_u16x2')\
.set_iport([gain0_p, exposure0_p])\
.set_param([num_devices, frame_sync, gain_key, exposure_key, realtime_diaplay_mode, enable_control])
.set_param([num_devices, frame_sync, gain_key, exposure_key, realtime_display_mode, enable_control])

# Define Output Port
out_p = node.get_port('output')
Expand Down
2 changes: 1 addition & 1 deletion example/u3v_camera2_opencv/u3v_camera2_opencv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main(int argc, char *argv[])
Param("frame_sync", false),
Param("gain_key", FEATURE_GAIN_KEY),
Param("exposure_key", FEATURE_EXPOSURE_KEY),
Param("realtime_diaplay_mode", true),
Param("realtime_display_mode", true),
Param("enable_control", true)
);

Expand Down
4 changes: 2 additions & 2 deletions example/u3v_camera2_opencv/u3v_camera2_opencv.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
frame_sync = Param('frame_sync', 'false')
gain_key = Param('gain_key', feature_gain_key)
exposure_key = Param('exposure_key', feature_exposure_key)
realtime_diaplay_mode = Param('realtime_diaplay_mode', 'true')
realtime_display_mode = Param('realtime_display_mode', 'true')
enable_control = Param('enable_control', 'true')

# Add node and connect the input port to the node instance
node = builder.add('image_io_u3v_cameraN_u16x2')\
.set_iport([gain0_p, gain1_p, exposure0_p, exposure1_p, ])\
.set_param([num_devices, frame_sync, gain_key, exposure_key, realtime_diaplay_mode, enable_control])
.set_param([num_devices, frame_sync, gain_key, exposure_key, realtime_display_mode, enable_control])


# Define Output Port
Expand Down
26 changes: 13 additions & 13 deletions src/bb/image-io/bb.h
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ class U3VCamera1 : public ion::BuildingBlock<U3VCamera1<T, D>> {
BuildingBlockParam<bool> frame_sync{"frame_sync", false};
BuildingBlockParam<std::string> gain_key_ptr{"gain_key", "Gain"};
BuildingBlockParam<std::string> exposure_key_ptr{"exposure_key", "Exposure"};
BuildingBlockParam<bool> realtime_diaplay_mode{"realtime_diaplay_mode", false};
BuildingBlockParam<bool> realtime_display_mode{"realtime_display_mode", false};

Input<double> gain0{ "gain0" };
Input<double> exposure0{ "exposure0" };
Expand All @@ -740,7 +740,7 @@ class U3VCamera1 : public ion::BuildingBlock<U3VCamera1<T, D>> {
std::memcpy(exposure_key_buf.data(), exposure_key.c_str(), exposure_key.size());

std::vector<ExternFuncArgument> params{
static_cast<bool>(frame_sync), static_cast<bool>(realtime_diaplay_mode),
static_cast<bool>(frame_sync), static_cast<bool>(realtime_display_mode),
gain0, exposure0,
id_buf, gain_key_buf, exposure_key_buf
};
Expand All @@ -752,7 +752,7 @@ class U3VCamera1 : public ion::BuildingBlock<U3VCamera1<T, D>> {
Func camera1_frame_count;
{
Buffer<uint8_t> id_buf = this->get_id();
camera1_frame_count.define_extern("ion_bb_image_io_u3v_camera1_frame_count",{camera1, 1, static_cast<bool>(frame_sync), static_cast<bool>(realtime_diaplay_mode), id_buf}, type_of<uint32_t>(), 1);
camera1_frame_count.define_extern("ion_bb_image_io_u3v_camera1_frame_count",{camera1, 1, static_cast<bool>(frame_sync), static_cast<bool>(realtime_display_mode), id_buf}, type_of<uint32_t>(), 1);
camera1_frame_count.compute_root();
frame_count(_) = camera1_frame_count(_);
}
Expand All @@ -773,7 +773,7 @@ class U3VCamera2 : public ion::BuildingBlock<U3VCamera2<T, D>> {
BuildingBlockParam<bool> frame_sync{"frame_sync", false};
BuildingBlockParam<std::string> gain_key_ptr{"gain_key", "Gain"};
BuildingBlockParam<std::string> exposure_key_ptr{"exposure_key", "Exposure"};
BuildingBlockParam<bool> realtime_diaplay_mode{"realtime_diaplay_mode", false};
BuildingBlockParam<bool> realtime_display_mode{"realtime_display_mode", false};

Input<double> gain0{ "gain0" };
Input<double> gain1{ "gain1" };
Expand Down Expand Up @@ -802,7 +802,7 @@ class U3VCamera2 : public ion::BuildingBlock<U3VCamera2<T, D>> {
std::memcpy(exposure_key_buf.data(), exposure_key.c_str(), exposure_key.size());

std::vector<ExternFuncArgument> params{
static_cast<bool>(frame_sync), static_cast<bool>(realtime_diaplay_mode),
static_cast<bool>(frame_sync), static_cast<bool>(realtime_display_mode),
gain0, gain1, exposure0, exposure1,
id_buf, gain_key_buf, exposure_key_buf
};
Expand All @@ -814,7 +814,7 @@ class U3VCamera2 : public ion::BuildingBlock<U3VCamera2<T, D>> {

Func camera2_frame_count;{
Buffer<uint8_t> id_buf = this->get_id();
camera2_frame_count.define_extern("ion_bb_image_io_u3v_camera2_frame_count", { camera2, 2, static_cast<bool>(frame_sync), static_cast<bool>(realtime_diaplay_mode), id_buf}, type_of<uint32_t>(), 1);
camera2_frame_count.define_extern("ion_bb_image_io_u3v_camera2_frame_count", { camera2, 2, static_cast<bool>(frame_sync), static_cast<bool>(realtime_display_mode), id_buf}, type_of<uint32_t>(), 1);
camera2_frame_count.compute_root();
frame_count(_) = camera2_frame_count(_);
}
Expand All @@ -831,7 +831,7 @@ class U3VCameraN : public ion::BuildingBlock<U3VCameraN<T, D>> {
public:
BuildingBlockParam<int32_t> num_devices{"num_devices", 2};
BuildingBlockParam<bool> frame_sync{"frame_sync", false};
BuildingBlockParam<bool> realtime_diaplay_mode{"realtime_diaplay_mode", false};
BuildingBlockParam<bool> realtime_display_mode{"realtime_display_mode", false};

BuildingBlockParam<bool> enable_control{"enable_control", false};
BuildingBlockParam<std::string> gain_key_ptr{"gain_key", "Gain"};
Expand Down Expand Up @@ -885,7 +885,7 @@ class U3VCameraN : public ion::BuildingBlock<U3VCameraN<T, D>> {
id_buf,
static_cast<bool>(force_sim_mode),
static_cast<int32_t>(width), static_cast<int32_t>(height),static_cast<float_t>(fps),
static_cast<bool>(frame_sync), static_cast<bool>(realtime_diaplay_mode),
static_cast<bool>(frame_sync), static_cast<bool>(realtime_display_mode),
static_cast<bool>(enable_control),
gain_key_buf, exposure_key_buf, pixel_format_buf
};
Expand Down Expand Up @@ -928,7 +928,7 @@ class U3VCameraN : public ion::BuildingBlock<U3VCameraN<T, D>> {
cameraN, id_buf, static_cast<int32_t>(num_devices),
static_cast<bool>(force_sim_mode),
static_cast<int32_t>(width), static_cast<int32_t>(height), static_cast<float_t>(fps),
static_cast<bool>(frame_sync), static_cast<bool>(realtime_diaplay_mode),
static_cast<bool>(frame_sync), static_cast<bool>(realtime_display_mode),
pixel_format_buf
};

Expand Down Expand Up @@ -960,7 +960,7 @@ class U3VCameraN : public ion::BuildingBlock<U3VCameraN<T, D>> {
cameraN, id_buf, static_cast<int32_t>(num_devices),
static_cast<bool>(force_sim_mode),
static_cast<int32_t>(width), static_cast<int32_t>(height), static_cast<float_t>(fps),
static_cast<bool>(frame_sync), static_cast<bool>(realtime_diaplay_mode),
static_cast<bool>(frame_sync), static_cast<bool>(realtime_display_mode),
pixel_format_buf
};

Expand Down Expand Up @@ -992,7 +992,7 @@ class U3VCameraGenDC : public ion::BuildingBlock<U3VCameraGenDC> {
public:
BuildingBlockParam<int32_t> num_devices{"num_devices", 2};
BuildingBlockParam<bool> frame_sync{"frame_sync", false};
BuildingBlockParam<bool> realtime_diaplay_mode{"realtime_diaplay_mode", false};
BuildingBlockParam<bool> realtime_display_mode{"realtime_display_mode", false};

BuildingBlockParam<bool> enable_control{"enable_control", false};
BuildingBlockParam<std::string> gain_key_ptr{"gain_key", "Gain"};
Expand Down Expand Up @@ -1045,7 +1045,7 @@ class U3VCameraGenDC : public ion::BuildingBlock<U3VCameraGenDC> {
id_buf,
static_cast<bool>(force_sim_mode),
static_cast<int32_t>(width), static_cast<int32_t>(height),static_cast<float_t>(fps),
static_cast<bool>(frame_sync), static_cast<bool>(realtime_diaplay_mode),
static_cast<bool>(frame_sync), static_cast<bool>(realtime_display_mode),
static_cast<bool>(enable_control),
gain_key_buf, exposure_key_buf, pixel_format_buf
};
Expand Down Expand Up @@ -1092,7 +1092,7 @@ class U3VCameraGenDC : public ion::BuildingBlock<U3VCameraGenDC> {
u3v_gendc, id_buf, static_cast<int32_t>(num_devices),
static_cast<bool>(force_sim_mode),
static_cast<int32_t>(width), static_cast<int32_t>(height), static_cast<float_t>(fps),
static_cast<bool>(frame_sync), static_cast<bool>(realtime_diaplay_mode),
static_cast<bool>(frame_sync), static_cast<bool>(realtime_display_mode),
pixel_format_buf
};

Expand Down

0 comments on commit 197e2f3

Please sign in to comment.