From 40594c467cd5bc44572f04c9e7d0e35bd30fca07 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Mon, 22 Dec 2014 17:39:42 +0000 Subject: [PATCH] - cleaned up - removed Timer git-svn-id: http://moon:8086/svn/software/trunk/projects/mpsk_rx_gui@109 b431acfa-c32f-4a4a-93f1-934dc6c82436 --- Source/ControlComponent.cpp | 9 +-------- Source/ControlComponent.h | 2 -- Source/IQPlaneComponent.cpp | 3 +-- Source/IQPoint.cpp | 39 ++++--------------------------------- Source/IQPoint.h | 7 +------ 5 files changed, 7 insertions(+), 53 deletions(-) diff --git a/Source/ControlComponent.cpp b/Source/ControlComponent.cpp index 5d5d40f..36f3a12 100644 --- a/Source/ControlComponent.cpp +++ b/Source/ControlComponent.cpp @@ -668,8 +668,6 @@ ControlComponent::ControlComponent (ReceiverInterface *pReceiverControlListener, //[Constructor] You can add your own custom stuff here.. - startTimer (1000 / 1); - addChangeListener(this); // Texteditor Listeners @@ -1451,11 +1449,6 @@ void ControlComponent::mouseDown (const MouseEvent& e) //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... -void ControlComponent::timerCallback() -{ - receiverStatusChanged(m_pReceiverControlListener); -} - void ControlComponent::textEditorTextChanged (TextEditor &textEditor) { m_userParamEntryinProgress = textEditor.isTextInputActive(); @@ -1679,7 +1672,7 @@ void ControlComponent::changeListenerCallback(juce::ChangeBroadcaster* source) BEGIN_JUCER_METADATA m_tooltipWindow; - void timerCallback(); //[/UserVariables] //============================================================================== diff --git a/Source/IQPlaneComponent.cpp b/Source/IQPlaneComponent.cpp index 3220e3c..34535f1 100644 --- a/Source/IQPlaneComponent.cpp +++ b/Source/IQPlaneComponent.cpp @@ -19,7 +19,7 @@ //[Headers] You can add your own extra header files here... //[/Headers] -#include + #include "IQPlaneComponent.h" @@ -123,7 +123,6 @@ void IQPlaneComponent::receiverStatusChanged(ReceiverInterface *pReceiver) params = pReceiver->getParams(); m_numConst = (uint32_t)pow(2.0, params.numBitsPerSymbol); - repaint(); } void IQPlaneComponent::trackerPointEnable(uint32_t id, juce::Colour color, cpx_t pos, float size) diff --git a/Source/IQPoint.cpp b/Source/IQPoint.cpp index 42140f9..7c2cc52 100644 --- a/Source/IQPoint.cpp +++ b/Source/IQPoint.cpp @@ -94,43 +94,12 @@ void IQPoint::drawPlusSign(Graphics& g) (void)g; } -void IQPoint::start() -{ - m_alpha = 1.0f; - startTimer (1000 / 20); - setVisible(true); - repaint(); -} - -void IQPoint::stop() -{ - stopTimer (); - setVisible(false); - m_alpha = 1.0f; - repaint(); -} - void IQPoint::setColor(Colour color) { m_color = color; repaint(); } -void IQPoint::timerCallback() -{ - // Reduce the alpha level of the flash slightly so it fades out - m_alpha -= 0.06f*m_alpha; - - if (m_alpha < 0.05f) - { - stop(); - sendChangeMessage(); - // Once we've finsihed flashing send a change message to trigger the next component to flash - } - - repaint(); -} - //[/MiscUserCode] @@ -144,10 +113,10 @@ void IQPoint::timerCallback() BEGIN_JUCER_METADATA + parentClasses="public Component" constructorParams="uint32 id" + variableInitialisers="m_id(id)" snapPixels="8" snapActive="1" + snapShown="1" overlayOpacity="0.330" fixedSize="0" initialWidth="10" + initialHeight="10"> diff --git a/Source/IQPoint.h b/Source/IQPoint.h index adc4760..17f14fc 100644 --- a/Source/IQPoint.h +++ b/Source/IQPoint.h @@ -34,9 +34,7 @@ Describe your class and how it works here! //[/Comments] */ -class IQPoint : public Component, - public ChangeBroadcaster, - public Timer +class IQPoint : public Component { public: //============================================================================== @@ -47,8 +45,6 @@ public: //[UserMethods] -- You can add your own custom methods in this section. LinkedListPointer nextListItem; - void start(); - void stop(); void setColor(Colour color); void drawCross(Graphics& g); //[/UserMethods] @@ -64,7 +60,6 @@ private: Colour m_color; int m_pos_x; int m_pos_y; - void timerCallback() override; float m_alpha; void drawPoint(Graphics& g); void drawPlusSign(Graphics& g);