Skip to content

Commit

Permalink
Check if working sets are selectable before allowing them to be selected
Browse files Browse the repository at this point in the history
  • Loading branch information
ad3154 committed Dec 13, 2023
1 parent 9f09961 commit a68864c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ Supported features:
- Logging
- Multiple simultaneous VT clients
- Selecting different working sets
- Most common macro and extended macro functionality

Unimplemented features (for now)

- Arbitrary audio control functionality
- Window masks (tolerated in the object pool though)
- Aux N/O
- Most macro functionality
- Animations
- Output Lists
- Output arched bar graph
Expand Down
9 changes: 7 additions & 2 deletions src/ServerMainComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,11 @@ void ServerMainComponent::timerCallback()
send_end_of_object_pool_response(true, isobus::NULL_OBJECT_ID, isobus::NULL_OBJECT_ID, 0, ws->get_control_function());
}
workingSetSelector.add_working_set_to_draw(ws);
if (isobus::NULL_CAN_ADDRESS == activeWorkingSetMasterAddress)

auto workingSetObject = std::static_pointer_cast<isobus::WorkingSet>(ws->get_working_set_object());
if ((isobus::NULL_CAN_ADDRESS == activeWorkingSetMasterAddress) &&
(nullptr != workingSetObject) &&
(workingSetObject->get_selectable()))
{
ws->set_working_set_maintenance_message_timestamp_ms(isobus::SystemTiming::get_timestamp_ms());
change_selected_working_set(0);
Expand Down Expand Up @@ -722,7 +726,8 @@ std::shared_ptr<isobus::ControlFunction> ServerMainComponent::get_client_control

void ServerMainComponent::change_selected_working_set(std::uint8_t index)
{
if (index < managedWorkingSetList.size())
if ((index < managedWorkingSetList.size()) &&
(std::static_pointer_cast<isobus::WorkingSet>(managedWorkingSetList.at(index)->get_working_set_object())->get_selectable()))
{
bool lProcessActivateDeactivateMacros = false;

Expand Down

0 comments on commit a68864c

Please sign in to comment.