Skip to content

Commit

Permalink
Merge branch 'dev-0.7.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
tpanzarella committed Oct 4, 2018
2 parents 01cdf95 + 07390ef commit cefac20
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 19 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Changes between libo3d3xx 0.7.5 and 0.7.6

* Makes unit tests pass for the 1.23.1522 firmware (json dumps still do not
expose the new parameters).

## Changes between libo3d3xx 0.7.4 and 0.7.5

* Added timestamp support for images grabbed with the oem module
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ Software Compatibility Matrix
<td>O3D303</td>
<td>Timestamp support in OEM image module</td>
</tr>
<tr>
<td>0.7.6</td>
<td>1.23.1522</td>
<td>O3D303</td>
<td>Ethernet/IP assembly size configuration and PCIC schema auto update</td>
</tr>
</table>

Features
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/o3d3xx_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
################################################
set(O3D3XX_VERSION_MAJOR 0)
set(O3D3XX_VERSION_MINOR 7)
set(O3D3XX_VERSION_PATCH 5)
set(O3D3XX_VERSION_PATCH 6)
set(O3D3XX_VERSION_STRING
"${O3D3XX_VERSION_MAJOR}.${O3D3XX_VERSION_MINOR}.${O3D3XX_VERSION_PATCH}")
36 changes: 32 additions & 4 deletions modules/camera/include/o3d3xx_camera/device_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,16 @@ namespace o3d3xx
bool EnableAcquisitionFinishedPCIC() const noexcept;
void SetEnableAcquisitionFinishedPCIC(bool on) noexcept;

int EIPProducingSize() const noexcept;
void SetEIPProducingSize(int i) noexcept;

int EIPConsumingSize() const noexcept;
void SetEIPConsumingSize(int i) noexcept;

bool PcicTcpSchemaAutoUpdate() const noexcept;
void SetPcicTcpSchemaAutoUpdate(bool on) noexcept;


protected:
/**
* User-defined name of the device (max 64 characters)
Expand Down Expand Up @@ -351,25 +361,43 @@ namespace o3d3xx
double temp_illu_;

/**
* @todo needs documentation
* The Profinet device name
*/
std::string pnio_device_name_;

/**
* @todo needs documentation
* Select the ethernet fieldbus
*/
int ethernet_field_bus_;

/**
* @todo needs documentation
* Selects the Endianess of the fieldbus
*/
int ethernet_field_bus_endianness_;

/**
* @todo needs documentation
* Enable the asynchronous notification for the
* acquisition finished signal over PCIC
*/
bool enable_acquisition_finished_pcic_;

/**
* Ethernet/IP producing assembly size
*/
int eip_producing_size_;

/**
* Ethernet/IP consuming assembly size
*/
int eip_consuming_size_;

/**
* This enables the PCIC auto schema update.
* When enabled the default schema will be updated on all
* open connections
*/
bool pcic_tcp_schema_auto_update_;

}; // end: class DeviceConfig

} // end: namespace 03d3xx
Expand Down
2 changes: 1 addition & 1 deletion modules/camera/src/libo3d3xx_camera/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ o3d3xx::Camera::SetImagerConfig(const o3d3xx::ImagerConfig* config)
"ExposureTime", config->ExposureTime());
}
}
else
else if (boost::algorithm::ends_with(im->Type(), "moderate"))
{
if (im->ExposureTime() != config->ExposureTime())
{
Expand Down
55 changes: 53 additions & 2 deletions modules/camera/src/libo3d3xx_camera/device_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ o3d3xx::DeviceConfig::DeviceConfig()
pnio_device_name_(""),
ethernet_field_bus_(0),
ethernet_field_bus_endianness_(0),
enable_acquisition_finished_pcic_(false)
enable_acquisition_finished_pcic_(false),
eip_producing_size_(0),
eip_consuming_size_(0),
pcic_tcp_schema_auto_update_(false)
{ }

o3d3xx::DeviceConfig::DeviceConfig(
Expand Down Expand Up @@ -497,6 +500,42 @@ o3d3xx::DeviceConfig::SetEnableAcquisitionFinishedPCIC(bool on) noexcept
this->enable_acquisition_finished_pcic_ = on;
}

int
o3d3xx::DeviceConfig::EIPProducingSize() const noexcept
{
return this->eip_producing_size_;
}

void
o3d3xx::DeviceConfig::SetEIPProducingSize(int i) noexcept
{
this->eip_producing_size_ = i;
}

int
o3d3xx::DeviceConfig::EIPConsumingSize() const noexcept
{
return this->eip_consuming_size_;
}

void
o3d3xx::DeviceConfig::SetEIPConsumingSize(int i) noexcept
{
this->eip_consuming_size_ = i;
}

bool
o3d3xx::DeviceConfig::PcicTcpSchemaAutoUpdate() const noexcept
{
return this->pcic_tcp_schema_auto_update_;
}

void
o3d3xx::DeviceConfig::SetPcicTcpSchemaAutoUpdate(bool on) noexcept
{
this->pcic_tcp_schema_auto_update_ = on;
}

const std::unordered_map<std::string,
std::function<void(o3d3xx::DeviceConfig*,
const std::string&)> >
Expand Down Expand Up @@ -644,7 +683,19 @@ o3d3xx::DeviceConfig::mutator_map =

{"EthernetFieldBusEndianness",
[](o3d3xx::DeviceConfig* dev, const std::string& val)
{ dev->SetEthernetFieldBusEndianness(std::stoi(val)); }}
{ dev->SetEthernetFieldBusEndianness(std::stoi(val)); }},

{"EIPProducingSize",
[](o3d3xx::DeviceConfig* dev, const std::string& val)
{ dev->SetEIPProducingSize(std::stoi(val)); }},

{"EIPConsumingSize",
[](o3d3xx::DeviceConfig* dev, const std::string& val)
{ dev->SetEIPConsumingSize(std::stoi(val)); }},

{"PcicTcpSchemaAutoUpdate",
[](o3d3xx::DeviceConfig* dev, const std::string& val)
{ dev->SetPcicTcpSchemaAutoUpdate(o3d3xx::stob(val)); }}
};

std::string
Expand Down
33 changes: 23 additions & 10 deletions modules/camera/test/o3d3xx-app-imager-tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ TEST_F(AppImagerTest, GetAppParameters)
// std::cout << kv.first << "=" << kv.second << std::endl;
// }

ASSERT_EQ(params.size(), 9);
ASSERT_EQ(params.size(), 10);

ASSERT_NO_THROW(params.at("Name"));
ASSERT_NO_THROW(params.at("Description"));
Expand All @@ -139,6 +139,7 @@ TEST_F(AppImagerTest, GetAppParameters)
ASSERT_NO_THROW(params.at("TemplateInfo"));
ASSERT_NO_THROW(params.at("Type"));
ASSERT_NO_THROW(params.at("LogicGraph"));
ASSERT_NO_THROW(params.at("RtspOverlayStyle"));

cam_->StopEditingApplication();
cam_->DeleteApplication(new_idx);
Expand Down Expand Up @@ -260,7 +261,6 @@ TEST_F(AppImagerTest, GetImagerParameters)
ASSERT_NO_THROW(params.at("AutoExposureReferenceROI"));
ASSERT_NO_THROW(params.at("AutoExposureReferenceType"));
ASSERT_NO_THROW(params.at("AutoExposureMaxExposureTime"));
ASSERT_NO_THROW(params.at("Channel"));
ASSERT_NO_THROW(params.at("ClippingBottom"));
ASSERT_NO_THROW(params.at("ClippingLeft"));
ASSERT_NO_THROW(params.at("ClippingRight"));
Expand All @@ -286,27 +286,40 @@ TEST_F(AppImagerTest, GetImagerParameters)
ASSERT_NO_THROW(params.at("TwoFreqMaxLineDistPercentage"));
ASSERT_NO_THROW(params.at("Type"));
ASSERT_NO_THROW(params.at("MaxAllowedLEDFrameRate"));
ASSERT_NO_THROW(params.at("ContinuousUserFrameCalibration"));

if(!boost::algorithm::ends_with(type, "depalletizing_upto_30m_high"))
{
ASSERT_NO_THROW(params.at("Channel"));
}

if (boost::algorithm::ends_with(type, "high"))
{
ASSERT_THROW(params.at("ExposureTime"), std::out_of_range);
ASSERT_THROW(params.at("ExposureTimeRatio"), std::out_of_range);

ASSERT_EQ(params.size(), 31);
if(boost::algorithm::ends_with(type, "depalletizing_upto_30m_high"))
{
ASSERT_EQ(params.size(), 31);
}
else
{
ASSERT_EQ(params.size(), 32);
}
}
else if (boost::algorithm::ends_with(type, "low"))
{
ASSERT_NO_THROW(params.at("ExposureTime"));
ASSERT_THROW(params.at("ExposureTimeRatio"), std::out_of_range);

ASSERT_EQ(params.size(), 32);
ASSERT_EQ(params.size(), 33);
}
else
else if (boost::algorithm::ends_with(type, "moderate"))
{
ASSERT_NO_THROW(params.at("ExposureTime"));
ASSERT_NO_THROW(params.at("ExposureTimeRatio"));

ASSERT_EQ(params.size(), 33);
ASSERT_EQ(params.size(), 34);
}
}

Expand Down Expand Up @@ -405,7 +418,7 @@ TEST_F(AppImagerTest, ImagerConfig)
{
ASSERT_NO_THROW(im->SetExposureTime(2000));
}
else
else if (boost::algorithm::ends_with(type, "moderate"))
{
ASSERT_NO_THROW(im->SetExposureTime(2000));
ASSERT_NO_THROW(im->SetExposureTimeRatio(5));
Expand Down Expand Up @@ -436,7 +449,7 @@ TEST_F(AppImagerTest, ImagerConfig)
{
ASSERT_EQ(im2->ExposureTime(), im->ExposureTime());
}
else
else if (boost::algorithm::ends_with(type, "moderate"))
{
ASSERT_EQ(im2->ExposureTime(), im->ExposureTime());
ASSERT_EQ(im2->ExposureTimeRatio(),
Expand Down Expand Up @@ -580,7 +593,7 @@ TEST_F(AppImagerTest, Exposure)
{
ASSERT_NO_THROW(im->SetExposureTime(2000));
}
else
else if (boost::algorithm::ends_with(type, "moderate"))
{
ASSERT_NO_THROW(im->SetExposureTime(2000));
ASSERT_NO_THROW(im->SetExposureTimeRatio(5));
Expand All @@ -607,7 +620,7 @@ TEST_F(AppImagerTest, Exposure)
ASSERT_EQ(exposure_strings.size(), 1);
ASSERT_EQ(std::atoi(exposure_strings.at(0).c_str()), 2000);
}
else
else if (boost::algorithm::ends_with(type, "moderate"))
{
ASSERT_EQ(exposure_strings.size(), 2);
ASSERT_EQ(std::atoi(exposure_strings.at(0).c_str()), 2000/5);
Expand Down
8 changes: 7 additions & 1 deletion modules/camera/test/o3d3xx-camera-tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ TEST(Camera_Tests, GetDeviceConfig)
// std::cout << kv.first << "=" << kv.second << std::endl;
// }

EXPECT_EQ(params.size(), 35);
EXPECT_EQ(params.size(), 38);

EXPECT_EQ(params.at("Name"), dev->Name());
EXPECT_EQ(params.at("Description"), dev->Description());
Expand Down Expand Up @@ -220,6 +220,12 @@ TEST(Camera_Tests, GetDeviceConfig)
EXPECT_EQ(params.at("PNIODeviceName"), dev->PNIODeviceName());
EXPECT_EQ(o3d3xx::stob(params.at("EnableAcquisitionFinishedPCIC")),
dev->EnableAcquisitionFinishedPCIC());
EXPECT_EQ(std::stoi(params.at("EIPProducingSize")),
dev->EIPProducingSize());
EXPECT_EQ(std::stoi(params.at("EIPConsumingSize")),
dev->EIPConsumingSize());
EXPECT_EQ(o3d3xx::stob(params.at("PcicTcpSchemaAutoUpdate")),
dev->PcicTcpSchemaAutoUpdate());
}

TEST(Camera_Tests, ActivateDisablePassword)
Expand Down

0 comments on commit cefac20

Please sign in to comment.