diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 2f6bf0ce0..a7f94baec 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -39,10 +39,11 @@ using namespace std; CSignalBar::CSignalBar() { initVarSigBar(); + sb_name = "SIG"; initSBItems(); } -CSignalBar::CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref) +CSignalBar::CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const string& sbname) { initVarSigBar(); sb_frontend = frontend_ref; @@ -50,6 +51,7 @@ CSignalBar::CSignalBar(const int& xpos, const int& ypos, const int& w, const int y = ypos; width = w; height = h; + sb_name = sbname; initSBItems(); } @@ -115,7 +117,6 @@ void CSignalBar::initVarSigBar() sb_scale = NULL; sb_vlbl = NULL; sb_lbl = NULL; - sb_name = "SIG"; } void CSignalBar::initSBarScale() @@ -245,36 +246,6 @@ void CSignalBar::paint(bool do_save_bg) //******************************************************************************************************************************* -CSignalNoiseRatioBar::CSignalNoiseRatioBar() -{ - initVarSnrBar(); -#if 0 // called from base (CSignalBar) ctor - initSBItems(); -#endif -} - -CSignalNoiseRatioBar::CSignalNoiseRatioBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref) -{ - initVarSnrBar(); - sb_frontend = frontend_ref; - x = xpos; - y = ypos; - width = w; - height = h; - -#if 0 // called from base (CSignalBar) ctor - initSBItems(); -#endif -} - -void CSignalNoiseRatioBar::initVarSnrBar() -{ -#if 0 // called from base (CSignalBar) ctor - initVarSigBar(); -#endif - sb_name = "SNR"; -} - void CSignalNoiseRatioBar::Refresh() { //get current value from frontend diff --git a/src/gui/components/cc_frm_signalbars.h b/src/gui/components/cc_frm_signalbars.h index a5730e785..3945cdbb8 100644 --- a/src/gui/components/cc_frm_signalbars.h +++ b/src/gui/components/cc_frm_signalbars.h @@ -31,8 +31,7 @@ #include #endif -// #include -// #include + #include #include #include @@ -116,7 +115,7 @@ class CSignalBar : public CComponentsForm public: CSignalBar(); ///basic component class constructor for signal. - CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref); + CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sb_name = "SIG"); ///assigns the current used frontend, simplified a tuner object, see frontend_c.h virtual void setFrontEnd(CFrontend *frontend_ref){sb_frontend = frontend_ref;}; @@ -155,14 +154,11 @@ class CSignalNoiseRatioBar : public CSignalBar ///refresh current item properties, use this before paintScale(). void Refresh(); - protected: - ///initialize all needed basic attributes and objects - void initVarSnrBar(); - public: - CSignalNoiseRatioBar(); + CSignalNoiseRatioBar(){}; ///basic component class constructor for signal noise ratio. - CSignalNoiseRatioBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref); + CSignalNoiseRatioBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref) + : CSignalBar(xpos, ypos, w, h, frontend_ref, "SNR"){}; }; /// Class CSignalBox() provides CSignalBar(), CSignalNoiseRatioBar() scales at once. @@ -172,7 +168,7 @@ additional of CSignalBar()- and CSignalNoiseRatioBar()-objects. To add a signalbox object to your code add this to a header file: -#include +#include class CSampleClass {