Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
martonmiklos committed Jan 11, 2025
1 parent ab38a6d commit 0a6d623
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ namespace isobus

std::mutex managedWorkingSetMutex; ///< A mutex to protect the interface of the managed working set
VTColourTable workingSetColourTable; ///< This working set's colour table
std::uint32_t iopSize = 0, transferredIopSize = 0;
std::uint32_t iopSize = 0;
std::uint32_t transferredIopSize = 0;
std::map<std::uint16_t, std::shared_ptr<VTObject>> vtObjectTree; ///< The C++ object representation (deserialized) of the object pool being managed
std::vector<std::vector<std::uint8_t>> iopFilesRawData; ///< Raw IOP File data from the client
std::uint16_t workingSetID = NULL_OBJECT_ID; ///< Stores the object ID of the working set object itself
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,22 @@ namespace isobus
}

auto totalTransferredSize = transferredIopSize;
if (totalTransferredSize < iopSize) {
if (totalTransferredSize < iopSize)
{
// if IOP transfer is not completed check if there is an ongoing IOP transfer to us
auto sessions = CANNetworkManager::CANNetwork.get_active_transport_protocol_sessions(0);
for (const auto &session : sessions)
{
if (session->get_source()->get_address() == get_control_function()->get_address())
if (session->get_source()->get_address() == get_control_function()->get_address() &&
(static_cast<std::uint32_t>(CANLibParameterGroupNumber::ECUtoVirtualTerminal) == session->get_parameter_group_number()))
{
totalTransferredSize += session->get_total_bytes_transferred();
break;
}
}
}

return (totalTransferredSize / (float)iopSize) * 100.0f;
return (totalTransferredSize / static_cast<float>(iopSize)) * 100.0f;
}

void VirtualTerminalServerManagedWorkingSet::set_object_pool_processing_state(ObjectPoolProcessingThreadState value)
Expand Down

0 comments on commit 0a6d623

Please sign in to comment.