Skip to content

Conversation

@gunicsba
Copy link
Contributor

Filename should be DDOP.
some implements have the Ascii 3 character meaning no more text which we should consider.

When the activity is suspended (e.g. AUX-N master switch) the painting is also suspended in AgOpenGPS.
…ement.

Fixed the parameter names in the help function of the console.
…onfusing that it works with 2 boolean values at the same time.
…onfusing that it works with 2 boolean values at the same time.

+ Fix formatting
…onfusing that it works with 2 boolean values at the same time.
The ISO Wheel and Radar speed is coming from the Tractor BUS and is provided by the Tractor ECU.

The NMEA2000 speed was x10
…csba/AOG-TaskController into develop

# Conflicts:
#	src/app.cpp

Bump stack version to the latest and the minor version to 1.3
…ext" ASCII character in their name.

Also the extension should be .ddop not .iop
@GwnDaan GwnDaan requested a review from Copilot December 30, 2025 12:07
@GwnDaan
Copy link
Collaborator

GwnDaan commented Dec 30, 2025

Run clang format

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the DDOP (Device Descriptor Object Pool) filename generation and implements several enhancements to the Task Controller functionality. The main change updates the file extension from ".iop" to ".ddop" and adds proper handling for label trimming when null or ETX (0x03) characters are present.

Key changes:

  • Fixed DDOP filename extension from ".iop" to ".ddop" and improved label string handling to trim at null or ETX characters
  • Added per-element work state management to properly handle section states based on master element work states
  • Increased section capacity from 16 to 64 sections and added support for both modern ECU (SetpointCondensedWorkState) and fallback (ActualCondensedWorkState) communication patterns

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/task_controller.cpp Fixed DDOP filename extension, added element work state tracking, improved section state calculation, and enhanced fallback logic for ECU compatibility
src/main.cpp Updated help text to reflect correct command-line parameter names (can_adapter, can_channel)
src/app.cpp Added separate TECU control function creation, improved null pointer guards for speed/NMEA interfaces, and expanded section data handling to support 64 sections
include/task_controller.hpp Added new methods for per-element work state management and included data dictionary header
include/app.hpp Added tecuCF member variable to store TECU control function reference
CMakeLists.txt Updated version to 1.3.0 and updated isobus library dependency to newer commit

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


auto labelBytes = deviceObject->get_localization_label();
std::string label(reinterpret_cast<const char *>(labelBytes.data()), labelBytes.size());
// trim at first occurrence of null or ETX (0x03)
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment uses lowercase "ddop" but the actual file extension is ".ddop". For consistency and clarity, consider using uppercase "DDOP" in the comment to match the file extension and standard terminology.

Copilot uses AI. Check for mistakes.
value |= (clients[client].get_section_setpoint_state(sectionOffset + i) << (2 * i));
}

// Modern ECU? (DDI 290 SetpointCondensedWorkState1_16 exists)
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an extra space in the comment between "290" and "SetpointCondensedWorkState1_16". Should be a single space for consistency.

Suggested change
// Modern ECU? (DDI 290 SetpointCondensedWorkState1_16 exists)
// Modern ECU? (DDI 290 SetpointCondensedWorkState1_16 exists)

Copilot uses AI. Check for mistakes.
return;
}

std::cout << "[TC Server] Neither condensed nor controllable-actual work state supported Missing DDI 290 and 141!" << std::endl;
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message has a missing period before "Missing". Should be: "Neither condensed nor controllable-actual work state supported. Missing DDI 290 and 141!"

Suggested change
std::cout << "[TC Server] Neither condensed nor controllable-actual work state supported Missing DDI 290 and 141!" << std::endl;
std::cout << "[TC Server] Neither condensed nor controllable-actual work state supported. Missing DDI 290 and 141!" << std::endl;

Copilot uses AI. Check for mistakes.
sectionStates.push_back(data[6] & (1 << i));
}
for (std::uint8_t i = 0; i < 8; i++)
for (std::uint8_t scb = 0; scb < 8; scb++)
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's trailing whitespace after 'scb' on this line. Consider removing it for code cleanliness.

Suggested change
for (std::uint8_t scb = 0; scb < 8; scb++)
for (std::uint8_t scb = 0; scb < 8; scb++)

Copilot uses AI. Check for mistakes.
sectionStates.push_back(data[6] & (1 << i));
}
for (std::uint8_t i = 0; i < 8; i++)
for (std::uint8_t scb = 0; scb < 8; scb++)
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name 'scb' is unclear and cryptic. Consider using a more descriptive name like 'byteIndex' or 'sectionByte' to improve code readability.

Copilot uses AI. Check for mistakes.
void mark_measurement_commands_sent();
std::uint16_t get_element_number_for_ddi(isobus::DataDescriptionIndex ddi) const;
void set_element_number_for_ddi(isobus::DataDescriptionIndex ddi, std::uint16_t elementNumber);
// Element work state management these act like master / override for actual sections
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is missing proper capitalization at the start. It should be: "Element work state management: these act like master/override for actual sections" or split into a proper sentence structure.

Suggested change
// Element work state management these act like master / override for actual sections
// Element work state management: these act like master/override for actual sections

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants