Skip to main content
amitr
Associate
March 15, 2019
Solved

CircleProgress MoveAnimator widget ERROR

  • March 15, 2019
  • 5 replies
  • 1163 views

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();
}
 
 

This topic has been closed for replies.
Best answer by Martin KJELDSEN

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.

5 replies

Martin KJELDSEN
Principal III
March 15, 2019

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;

amitr
amitrAuthor
Associate
March 15, 2019

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(

Martin KJELDSEN
Principal III
March 15, 2019

But your temperature_screenView inherits from temperature_screenViewBase (generated from the designer), so you have access to all declared variables.

amitr
amitrAuthor
Associate
March 15, 2019

sure, thats why i have asked about - what should be the proper fix for that

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
March 18, 2019

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.