Skip to content

Commit

Permalink
fix(tc-helper): fallback to maximum working width
Browse files Browse the repository at this point in the history
  • Loading branch information
GwnDaan committed Jan 8, 2025
1 parent 65aa380 commit 71d0959
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions isobus/src/isobus_device_descriptor_object_pool_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ namespace isobus
set_value_from_property(retVal.yOffset_mm, property, DataDescriptionIndex::DeviceElementOffsetY);
set_value_from_property(retVal.zOffset_mm, property, DataDescriptionIndex::DeviceElementOffsetZ);
set_value_from_property(retVal.width_mm, property, DataDescriptionIndex::ActualWorkingWidth);
if (!retVal.width_mm.exists())
{
set_value_from_property(retVal.width_mm, property, DataDescriptionIndex::MaximumWorkingWidth);
}
}
else if (task_controller_object::ObjectTypes::DeviceProcessData == sectionChildObject->get_object_type())
{
Expand All @@ -244,6 +248,10 @@ namespace isobus
set_editable_from_process_data(retVal.yOffset_mm, processData, DataDescriptionIndex::DeviceElementOffsetY);
set_editable_from_process_data(retVal.zOffset_mm, processData, DataDescriptionIndex::DeviceElementOffsetZ);
set_editable_from_process_data(retVal.width_mm, processData, DataDescriptionIndex::ActualWorkingWidth);
if (!retVal.width_mm.exists())
{
set_editable_from_process_data(retVal.width_mm, processData, DataDescriptionIndex::MaximumWorkingWidth);
}
}
else if ((task_controller_object::ObjectTypes::DeviceElement == sectionChildObject->get_object_type()) &&
(task_controller_object::DeviceElementObject::Type::Bin == std::static_pointer_cast<task_controller_object::DeviceElementObject>(sectionChildObject)->get_type()))
Expand Down Expand Up @@ -296,6 +304,10 @@ namespace isobus
set_value_from_property(retVal.yOffset_mm, property, DataDescriptionIndex::DeviceElementOffsetY);
set_value_from_property(retVal.zOffset_mm, property, DataDescriptionIndex::DeviceElementOffsetZ);
set_value_from_property(retVal.width_mm, property, DataDescriptionIndex::ActualWorkingWidth);
if (!retVal.width_mm.exists())
{
set_value_from_property(retVal.width_mm, property, DataDescriptionIndex::MaximumWorkingWidth);
}
}
else if (task_controller_object::ObjectTypes::DeviceProcessData == childObject->get_object_type())
{
Expand All @@ -304,6 +316,10 @@ namespace isobus
set_editable_from_process_data(retVal.yOffset_mm, processData, DataDescriptionIndex::DeviceElementOffsetY);
set_editable_from_process_data(retVal.zOffset_mm, processData, DataDescriptionIndex::DeviceElementOffsetZ);
set_editable_from_process_data(retVal.width_mm, processData, DataDescriptionIndex::ActualWorkingWidth);
if (!retVal.width_mm.exists())
{
set_editable_from_process_data(retVal.width_mm, processData, DataDescriptionIndex::MaximumWorkingWidth);
}
}
else if ((task_controller_object::ObjectTypes::DeviceElement == childObject->get_object_type()) &&
(task_controller_object::DeviceElementObject::Type::Bin == std::static_pointer_cast<task_controller_object::DeviceElementObject>(childObject)->get_type()))
Expand Down

0 comments on commit 71d0959

Please sign in to comment.