-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reliability improvements, Various object rendering fixes
Fixed issue with some containers' visible state being incorrect. Greatly improved reliability of capturing mouse events in the data mask render area. Fixed an off-by-one issue when rendering input list options. Added drawing and clicking of input booleans. Fixed working set child objects always being placed at 0,0. Fixed working set child objects not getting periodically redrawn. Fixed output polygons with no fill being filled as black. Fixed output rectangles not accounting for "fill with line colour". Fixed working set selector not handling working set master timeouts. Fixed an exception when removing a timed-out working set. Added some copyright headers to the cpp files.
- Loading branch information
Showing
28 changed files
with
422 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,57 @@ | ||
/******************************************************************************* | ||
** @file InputBooleanComponent.cpp | ||
** @author Adrian Del Grosso | ||
** @copyright The Open-Agriculture Developers | ||
*******************************************************************************/ | ||
#include "InputBooleanComponent.hpp" | ||
|
||
InputBooleanComponent::InputBooleanComponent(std::shared_ptr<isobus::VirtualTerminalServerManagedWorkingSet> workingSet, isobus::InputBoolean sourceObject) : | ||
isobus::InputBoolean(sourceObject), | ||
parentWorkingSet(workingSet) | ||
{ | ||
setOpaque(false); | ||
setSize(get_width(), get_height()); | ||
|
||
setEnabled(get_enabled()); | ||
} | ||
|
||
void InputBooleanComponent::paint(Graphics &g) | ||
{ | ||
// Draw background | ||
auto vtColour = colourTable.get_colour(get_background_color()); | ||
g.setColour(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); | ||
g.drawRect(0, 0, static_cast<int>(get_width()), static_cast<int>(get_height()), 0); | ||
|
||
g.setColour(Colour::fromFloatRGBA(0.0f, 0.0f, 0.0f, 1.0f)); | ||
// Change colour to foreground colour if present | ||
for (std::uint16_t i = 0; i < get_number_children(); i++) | ||
{ | ||
auto child = get_object_by_id(get_child_id(i)); | ||
|
||
if ((nullptr != child) && (isobus::VirtualTerminalObjectType::FontAttributes == child->get_object_type())) | ||
{ | ||
vtColour = colourTable.get_colour(std::static_pointer_cast<isobus::FontAttributes>(child)->get_background_color()); | ||
g.setColour(Colour::fromFloatRGBA(vtColour.r, vtColour.g, vtColour.b, 1.0f)); | ||
break; | ||
} | ||
} | ||
|
||
bool isChecked = (0 != get_value()); | ||
// Change use number variable if one was provided | ||
for (std::uint16_t i = 0; i < get_number_children(); i++) | ||
{ | ||
auto child = get_object_by_id(get_child_id(i)); | ||
|
||
if ((nullptr != child) && (isobus::VirtualTerminalObjectType::NumberVariable == child->get_object_type())) | ||
{ | ||
isChecked = std::static_pointer_cast<isobus::NumberVariable>(child)->get_value(); | ||
break; | ||
} | ||
} | ||
|
||
if (isChecked) | ||
{ | ||
g.drawLine(0, get_height() / 2, get_width() / 2, get_height()); | ||
g.drawLine(get_width() / 2, get_height(), get_width(), 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.