2019-03-15 03:25 AM
Hello everyone! Please, i need help, and i`ve tried everything i could but still cant solve the problem. The thing is that i need my CircleProgress to move using moveAnimator when the screen in entered. So ive added all the lines in the code but still got an error error: redeclaration of 'touchgfx::MoveAnimator<touchgfx::CircleProgress> temperature_screenView::circletemperature'
Thanks a lot and looking forward to get some help. Have a day
TEMPERATURE_SCREENVIEW.hpp
#ifndef TEMPERATURE_SCREEN_VIEW_HPP
#define TEMPERATURE_SCREEN_VIEW_HPP
#include <gui_generated/temperature_screen_screen/temperature_screenViewBase.hpp>
#include <gui/common/FrontendApplication.hpp>
#include <gui/temperature_screen_screen/temperature_screenPresenter.hpp>
#include <touchgfx/widgets/canvas/PainterRGB888Bitmap.hpp>
#include <touchgfx/containers/progress_indicators/CircleProgress.hpp>
#include <touchgfx/widgets/Box.hpp>
#include <touchgfx/EasingEquations.hpp>
#include <touchgfx/mixins/MoveAnimator.hpp>
#include <touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp>
#include <touchgfx/widgets/TextAreaWithWildcard.hpp>
#include <touchgfx/widgets/AnimatedImage.hpp>
class temperature_screenView : public temperature_screenViewBase
{
public:
temperature_screenView();
virtual ~temperature_screenView() {}
virtual void setupScreen();
virtual void tearDownScreen();
virtual void afterTransition();
protected:
touchgfx::CircleProgress circletemperature;
touchgfx::PainterRGB888Bitmap circletemperaturePainter;
touchgfx::MoveAnimator< touchgfx::CircleProgress > circletemperature;
};
#endif // TEMPERATURE_SCREEN_VIEW_HPP
TEMPERATURE_SCREENVIEW.cpp
#include <gui/temperature_screen_screen/temperature_screenView.hpp>
#include <touchgfx/Color.hpp>
#include "BitmapDatabase.hpp"
#include <texts/TextKeysAndLanguages.hpp>
#include <touchgfx/EasingEquations.hpp>
#include <touchgfx/mixins/MoveAnimator.hpp>
temperature_screenView::temperature_screenView()
{
circletemperature.setXY(47, 79);
circletemperature.setProgressIndicatorPosition(0, 0, 148, 116);
circletemperature.setRange(0, 100);
circletemperature.setCenter(74, 74);
circletemperature.setRadius(67);
circletemperature.setLineWidth(14);
circletemperature.setStartEndAngle(-121, 121);
circletemperature.setCapPrecision(10);
circletemperature.setBackground(Bitmap(BITMAP_TEMP_RINGBACK_ID));
circletemperaturePainter.setBitmap(Bitmap(BITMAP_TEMP_RINGCLR_ID));
circletemperature.setPainter(circletemperaturePainter);
circletemperature.setValue(36);
circletemperature.setAlpha(255);
add(circletemperature);
}
void temperature_screenView::setupScreen()
{
temperature_screenViewBase::setupScreen();
}
void temperature_screenView::afterTransition()
{
circletemperature.clearMoveAnimationEndedAction();
circletemperature.startMoveAnimation(47, 89, 36, EasingEquations::sineEaseOut, EasingEquations::sineEaseOut);
}
void temperature_screenView::tearDownScreen()
{
temperature_screenViewBase::tearDownScreen();
}
Solved! Go to Solution.
2019-03-18 01:04 AM
After using the designer to add a circle progress (And adding the moveanimator mixin), just reference "circletemperature" from your inherited view "temperature_screenView" without re-declaring it in your headerfile.
2019-03-15 07:23 AM
You've declared circleProgress twice. Here's what i get when i add a circle progress in the designer and add a MoveAnimator property. You've declared it inside your inherited ScreenView and not through the designer, it seems like.
/*
* Member Declarations
*/
touchgfx::MoveAnimator< touchgfx::CircleProgress > circleProgress1;
touchgfx::PainterRGB565Bitmap circleProgress1Painter;
2019-03-15 07:27 AM
Yep, in the designer i did`t do that cause i need CircleProgress to be implemented inside the code, in the lines that are
touchgfx::MoveAnimator< touchgfx::CircleProgress > circleProgress1;
touchgfx::PainterRGB565Bitmap circleProgress1Painter;
i simply coppied from the Base page, cause i dont know how to declare it properly. So what has to be changed, could you tell me please, cause im stuck with it 8(
2019-03-15 07:40 AM
But your temperature_screenView inherits from temperature_screenViewBase (generated from the designer), so you have access to all declared variables.
2019-03-15 08:33 AM
sure, thats why i have asked about - what should be the proper fix for that
2019-03-18 01:04 AM
After using the designer to add a circle progress (And adding the moveanimator mixin), just reference "circletemperature" from your inherited view "temperature_screenView" without re-declaring it in your headerfile.