/*
  ==============================================================================

  This is an automatically generated GUI class created by the Introjucer!

  Be careful when adding custom code to these files, as only the code within
  the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
  and re-saved.

  Created with Introjucer version: 3.1.0

  ------------------------------------------------------------------------------

  The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
  Copyright 2004-13 by Raw Material Software Ltd.

  ==============================================================================
*/

#ifndef __JUCE_HEADER_AD7F5AFA07457368__
#define __JUCE_HEADER_AD7F5AFA07457368__

//[Headers]     -- You can add your own extra header files here --
#include "JuceHeader.h"
#include "Receiver.h"
#include "Transmitter.h"
//[/Headers]



//==============================================================================
/**
                                                                    //[Comments]
    An auto-generated component, created by the Introjucer.

    Describe your class and how it works here!
                                                                    //[/Comments]
*/
class ControlComponent  : public Component,
                          public TextEditor::Listener,
                          public ChangeBroadcaster,
                          public ChangeListener,
                          public ButtonListener,
                          public ReceiverStatusListener,
                          public SliderListener,
                          public ComboBoxListener
{
public:
    //==============================================================================
    ControlComponent (ReceiverInterface *pReceiverControlListener, TransmitterInterface *pTransmitterControlListener);
    ~ControlComponent();

    //==============================================================================
    //[UserMethods]     -- You can add your own custom methods in this section.
    //[/UserMethods]

    void paint (Graphics& g);
    void resized();
    void buttonClicked (Button* buttonThatWasClicked);
    void sliderValueChanged (Slider* sliderThatWasMoved);
    void comboBoxChanged (ComboBox* comboBoxThatHasChanged);
    void mouseDown (const MouseEvent& e);



private:
    //[UserVariables]   -- You can add your own custom variables in this section.
	ReceiverInterface *m_pReceiverControlListener;
	TransmitterInterface *m_pTransmitterControlListener;
	params_t m_params;
	status_t m_status;
	cma_mode m_cmaModeSelected;
	void receiverStatusChanged(ReceiverInterface *pReceiver);
	void changeListenerCallback(juce::ChangeBroadcaster* source);
	void textEditorFocusLost (TextEditor &textEditor);
	void textEditorTextChanged (TextEditor &textEditor);
	void textEditorReturnKeyPressed (TextEditor &textEditor);
	bool m_userParamEntryinProgress;
	ScopedPointer<TooltipWindow> m_tooltipWindow;
    //[/UserVariables]

    //==============================================================================
    ScopedPointer<GroupComponent> groupComponent3;
    ScopedPointer<GroupComponent> m_GroupSymbolTimingRecovery2;
    ScopedPointer<GroupComponent> groupComponent;
    ScopedPointer<GroupComponent> groupDFE;
    ScopedPointer<GroupComponent> groupCMA;
    ScopedPointer<GroupComponent> groupCarrierPhaseRecovery;
    ScopedPointer<GroupComponent> m_GroupSymbolTimingRecovery;
    ScopedPointer<ToggleButton> toggleButtonCPREnable;
    ScopedPointer<ToggleButton> toggleButtonDFEEnable;
    ScopedPointer<ToggleButton> toggleButtonSTREnable;
    ScopedPointer<TextEditor> m_entrySTRLoopFilterLead_0;
    ScopedPointer<TextEditor> m_entrySTRLoopFilterLag_0;
    ScopedPointer<TextEditor> m_entryCPRLoopFilterLead_0;
    ScopedPointer<TextEditor> m_entryCPRLoopFilterLag_0;
    ScopedPointer<TextButton> m_buttonDfeOnUpdateFromDfeOff;
    ScopedPointer<TextButton> m_buttonResetDFE;
    ScopedPointer<TextButton> m_buttonResetCMA;
    ScopedPointer<GroupComponent> groupComponent2;
    ScopedPointer<TextEditor> m_entryCmaMu;
    ScopedPointer<TextEditor> m_entryDfeMu;
    ScopedPointer<Label> m_labelPowerRF;
    ScopedPointer<Label> m_labelPowerDDC;
    ScopedPointer<Label> m_labelPowerMF;
    ScopedPointer<Label> m_labelPowerCPR;
    ScopedPointer<Label> m_labelPowerAGC2;
    ScopedPointer<Label> m_labelPowerEQ;
    ScopedPointer<Label> m_labelSnrCurrent;
    ScopedPointer<Label> m_labelSnrCma;
    ScopedPointer<Label> m_labelSnrDfeOn;
    ScopedPointer<Label> m_labelSnrDfeOff;
    ScopedPointer<Label> m_labelSnrSymbolMag;
    ScopedPointer<Label> m_labelSnrSymbolPhase;
    ScopedPointer<Label> m_labelNoiseStr;
    ScopedPointer<Label> m_labelSymbolReceivedCount;
    ScopedPointer<TextButton> m_buttonResetReset;
    ScopedPointer<TextEditor> m_entryAgcMu_0;
    ScopedPointer<ToggleButton> toggleButtonCmaTrainingEnable;
    ScopedPointer<ToggleButton> toggleButtonDfeTrainingEnable;
    ScopedPointer<TextButton> m_buttonDfeOffUpdateFromCma;
    ScopedPointer<TextEditor> m_entryNumBitsPerSymbol;
    ScopedPointer<TextEditor> m_entrySymbolRate;
    ScopedPointer<TextEditor> m_entryDdcFrequency;
    ScopedPointer<Label> m_labelDdcDeltaFreq;
    ScopedPointer<Label> m_labelStrDeltaFreq;
    ScopedPointer<Label> m_labelCprState;
    ScopedPointer<Label> m_labelStrState;
    ScopedPointer<ToggleButton> toggleButtonAgcEnable;
    ScopedPointer<Label> m_labelAgcState;
    ScopedPointer<ToggleButton> toggleButtonAgcMuForceTrack;
    ScopedPointer<Label> m_labelDdcMinI;
    ScopedPointer<Label> m_labelDdcMaxI;
    ScopedPointer<Label> m_labelDdcMinQ;
    ScopedPointer<Label> m_labelDdcMaxQ;
    ScopedPointer<Label> m_labelDdcMinMag;
    ScopedPointer<Label> m_labelDdcMaxMag;
    ScopedPointer<Label> m_labelDdcPhiMinI;
    ScopedPointer<Label> m_labelDdcPhiMaxI;
    ScopedPointer<Label> m_labelDdcPhiMinQ;
    ScopedPointer<Label> m_labelDdcPhiMaxQ;
    ScopedPointer<TextEditor> m_entryAgcMu_1;
    ScopedPointer<TextEditor> m_entryCPRLoopFilterLead_1;
    ScopedPointer<TextEditor> m_entryCPRLoopFilterLag_1;
    ScopedPointer<TextEditor> m_entrySTRLoopFilterLead_1;
    ScopedPointer<TextEditor> m_entrySTRLoopFilterLag_1;
    ScopedPointer<ToggleButton> toggleButtonSTRLoopFilterForceTrack;
    ScopedPointer<ToggleButton> toggleButtonCPRLoopFilterForceTrack;
    ScopedPointer<ToggleButton> toggleButtonDfeAutoUpdateEnable;
    ScopedPointer<Label> m_labelEbN0;
    ScopedPointer<Label> m_labelFrameTotalCount;
    ScopedPointer<Label> m_labelFrameDataCount;
    ScopedPointer<Label> m_labelFrameIdleCount;
    ScopedPointer<Label> m_labelFrameInvalidCount;
    ScopedPointer<Label> m_labelFrameByteCount;
    ScopedPointer<TextButton> m_buttonResetStatistic;
    ScopedPointer<Slider> m_sliderCarrierPhase;
    ScopedPointer<TextButton> m_buttonResetCPR;
    ScopedPointer<TextButton> m_buttonResetStr;
    ScopedPointer<ComboBox> comboBoxCmaMode;
    ScopedPointer<ToggleButton> toggleButtonCMAEnable;
    ScopedPointer<Label> m_labelPowerDecision;
    ScopedPointer<Label> m_labelPowerDecisionMag;
    ScopedPointer<Label> m_labelPowerDecisionPhase;
    ScopedPointer<Label> m_labelNoiseCpr;


    //==============================================================================
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ControlComponent)
};

//[EndFile] You can add extra defines here...
//[/EndFile]

#endif   // __JUCE_HEADER_AD7F5AFA07457368__
