Changeset 5084 in ntrip


Ignore:
Timestamp:
Mar 31, 2013, 9:51:10 AM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/app.cpp

    r5074 r5084  
    2020using namespace std;
    2121
    22 // Global Variable
    23 ////////////////////////////////////////////////////////////////////////////
    24 t_bncCore* BNC_CORE = 0;
    25 
    2622// Constructor
    2723////////////////////////////////////////////////////////////////////////////
    28 t_app::t_app(int& argc, char* argv[], bool GUIenabled) :
    29   QApplication(argc, argv, GUIenabled) {
    30   BNC_CORE = new t_bncCore(GUIenabled);
     24t_app::t_app(int& argc, char* argv[], bool GUIenabled) : QApplication(argc, argv, GUIenabled) {
    3125}
    3226
  • trunk/BNC/src/bnccore.cpp

    r5074 r5084  
    5656using namespace std;
    5757
     58// Singleton
     59////////////////////////////////////////////////////////////////////////////
     60t_bncCore& bncCoreInstance() {
     61  static t_bncCore _bncCore;
     62  return _bncCore;
     63}
     64
    5865// Constructor
    5966////////////////////////////////////////////////////////////////////////////
    60 t_bncCore::t_bncCore(bool GUIenabled) {
    61   _GUIenabled  = GUIenabled;
     67t_bncCore::t_bncCore() {
     68  _GUIenabled  = true;
    6269  _logFileFlag = 0;
    6370  _logFile     = 0;
  • trunk/BNC/src/bnccore.h

    r5074 r5084  
    4444  public:
    4545    enum e_mode {interactive, nonInteractive, batchPostProcessing};
    46     t_bncCore(bool GUIenabled);
     46    t_bncCore();
    4747    virtual ~t_bncCore(); 
    4848    e_mode mode() const {return _mode;}
    49     void   setMode(e_mode mode) {_mode = mode;}
     49    void setGUIenabled(bool GUIenabled) {_GUIenabled = GUIenabled;}
     50    void setMode(e_mode mode) {_mode = mode;}
    5051    void setPort(int port);
    5152    void setPortCorr(int port);
     
    142143};
    143144
    144 extern t_bncCore* BNC_CORE;
     145t_bncCore& bncCoreInstance();
     146
     147#define BNC_CORE (&bncCoreInstance())
    145148
    146149#endif
  • trunk/BNC/src/bncmain.cpp

    r5072 r5084  
    122122  app.setOrganizationName("BKG");
    123123  app.setOrganizationDomain("www.bkg.bund.de");
     124
     125  BNC_CORE->setGUIenabled(GUIenabled);
    124126  BNC_CORE->setConfFileName( confFileName );
    125127
  • trunk/BNC/src/bncwindow.cpp

    r5083 r5084  
    7474#ifdef GNSSCENTER_PLUGIN
    7575Q_EXPORT_PLUGIN2(gnsscenter_bnc, t_bncFactory)
    76 t_bncCore* BNC_CORE = 0;
    7776#endif
    7877
     
    8079////////////////////////////////////////////////////////////////////////////
    8180bncWindow::bncWindow() {
    82 
    83 #ifdef GNSSCENTER_PLUGIN
    84   if (BNC_CORE != 0) {
    85     QMessageBox::critical(this, "Caution", "Only one BNC allowed");
    86   }
    87   BNC_CORE = new t_bncCore(true);
    88   BNC_CORE->setConfFileName("");
    89 #endif
    9081
    9182  _caster    = 0;
     
    20452036  }
    20462037
    2047 #ifdef GNSSCENTER_PLUGIN
    2048   delete BNC_CORE;
    2049   BNC_CORE = 0;
    2050 #endif
    2051 
    20522038  QMainWindow::closeEvent(event);
    20532039}
Note: See TracChangeset for help on using the changeset viewer.