Add debug view
This commit is contained in:
@ -0,0 +1,62 @@
|
||||
/*********************************************************************************/
|
||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
|
||||
/*********************************************************************************/
|
||||
#include <gui_generated/debugview_screen/DebugViewViewBase.hpp>
|
||||
#include <touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp>
|
||||
#include <touchgfx/Color.hpp>
|
||||
|
||||
DebugViewViewBase::DebugViewViewBase() :
|
||||
updateItemCallback(this, &DebugViewViewBase::updateItemCallbackHandler)
|
||||
{
|
||||
touchgfx::CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);
|
||||
|
||||
__background.setPosition(0, 0, 480, 320);
|
||||
__background.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
|
||||
add(__background);
|
||||
|
||||
list.setPosition(0, 4, 480, 312);
|
||||
list.setHorizontal(false);
|
||||
list.setCircular(true);
|
||||
list.setEasingEquation(touchgfx::EasingEquations::backEaseOut);
|
||||
list.setSwipeAcceleration(10);
|
||||
list.setDragAcceleration(10);
|
||||
list.setNumberOfItems(1);
|
||||
list.setPadding(0, 0);
|
||||
list.setSnapping(false);
|
||||
list.setDrawableSize(26, 0);
|
||||
list.setDrawables(listListItems, updateItemCallback);
|
||||
add(list);
|
||||
|
||||
line1.setPosition(0, 3, 480, 1);
|
||||
line1Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
|
||||
line1.setPainter(line1Painter);
|
||||
line1.setStart(0, 0);
|
||||
line1.setEnd(480, 0);
|
||||
line1.setLineWidth(10);
|
||||
line1.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
|
||||
add(line1);
|
||||
}
|
||||
|
||||
DebugViewViewBase::~DebugViewViewBase()
|
||||
{
|
||||
touchgfx::CanvasWidgetRenderer::resetBuffer();
|
||||
}
|
||||
|
||||
void DebugViewViewBase::setupScreen()
|
||||
{
|
||||
list.initialize();
|
||||
for (int i = 0; i < listListItems.getNumberOfDrawables(); i++)
|
||||
{
|
||||
listListItems[i].initialize();
|
||||
}
|
||||
}
|
||||
|
||||
void DebugViewViewBase::updateItemCallbackHandler(touchgfx::DrawableListItemsInterface* items, int16_t containerIndex, int16_t itemIndex)
|
||||
{
|
||||
if (items == &listListItems)
|
||||
{
|
||||
touchgfx::Drawable* d = items->getDrawable(containerIndex);
|
||||
DebugViewLine* cc = (DebugViewLine*)d;
|
||||
listUpdateItem(*cc, itemIndex);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user