QXRD  0.11.16
Public Slots | Public Member Functions | Properties | Private Slots | Private Member Functions | Private Attributes | List of all members
QxrdApplication Class Reference

#include <qxrdapplication.h>

Inheritance diagram for QxrdApplication:
Inheritance graph
[legend]
Collaboration diagram for QxrdApplication:
Collaboration graph
[legend]

Public Slots

void finish ()
 
void chooseNewExperiment ()
 
void chooseExistingExperiment ()
 
void openRecentExperiment (QString path)
 
void activateExperiment (QString path)
 
void openExperiment (QString path)
 
void closeExperiment (QxrdExperimentWPtr exp)
 
void openedExperiment (QxrdExperimentThreadPtr expthrdw)
 
void closedExperiment (QxrdExperimentThreadPtr expthrdw)
 
QList< QxrdExperimentWPtr > & experiments ()
 
QxrdExperimentPtr experiment (int i)
 
void openWelcomeWindow ()
 
void closeWelcomeWindow ()
 
void doAboutQxrd ()
 
void doOpenQXRDWebPage ()
 
void doOpenURL (QString url)
 
void possiblyQuit ()
 
void editGlobalPreferences ()
 
void debugChanged (qint64 newValue)
 
void readSettings ()
 
void writeSettings ()
 
void readSettings (QSettings *settings, QString section)
 
void writeSettings (QSettings *settings, QString section)
 
void doSavePreferences ()
 
void doLoadPreferences ()
 
void loadPreferences (QString path)
 
void savePreferences (QString path)
 
void splashMessage (QString msg)
 
void logMessage (QString msg)
 
void warningMessage (QString msg, QDateTime ts=QDateTime::currentDateTime())
 
void printMessage (QString msg, QDateTime ts=QDateTime::currentDateTime())
 
void statusMessage (QString msg, QDateTime ts=QDateTime::currentDateTime())
 
void criticalMessage (QString msg, QDateTime ts=QDateTime::currentDateTime())
 
void processEventCounter ()
 
QString homePath ()
 
QString currentPath ()
 
QString rootPath ()
 
void lockerTimerElapsed ()
 
virtual void setDefaultObjectData (QcepDataObject *obj)
 

Public Member Functions

 QxrdApplication (int &argc, char **argv)
 
virtual ~QxrdApplication ()
 
bool init (QxrdApplicationWPtr app, int &argc, char **argv)
 
QcepAllocatorWPtr allocator () const
 
QxrdNIDAQPluginInterfacePtr nidaqPlugin ()
 
void loadPlugins ()
 
void tiffWarning (const char *module, const char *msg)
 
void tiffError (const char *module, const char *msg)
 
bool event (QEvent *ev)
 
QStringList makeStringListFromArgs (int argc, char **argv)
 
void readDefaultSettings ()
 
void writeDefaultSettings ()
 
void appendRecentExperiment (QString path)
 
QString normalizeExperimentName (QString filename)
 
void setNewExperimentSettings (QSettings &settings, int type, QString filename)
 
bool wantToQuit ()
 
void incLockerCount ()
 
- Public Member Functions inherited from QcepApplication
 QcepApplication (int &argc, char **argv)
 
virtual void printMessage (QString msg, QDateTime ts=QDateTime::currentDateTime())=0
 
virtual void criticalMessage (QString msg, QDateTime ts=QDateTime::currentDateTime())=0
 
virtual void setDefaultObjectData (QcepDataObject *obj)=0
 

Properties

QStringList recentExperiments
 
int recentExperimentsSize
 
QString currentExperiment
 
QString currentDirectory
 
qint64 debug
 
int freshStart
 
int fileBrowserLimit
 
int messageWindowLines
 
int updateIntervalMsec
 
int argc
 
QStringList argv
 
int guiWanted
 
int startDetectors
 
QStringList cmdList
 
QStringList fileList
 
int lockerCount
 
double lockerRate
 

Private Slots

void hideSplash ()
 

Private Member Functions

void setupTiffHandlers ()
 

Private Attributes

QcepObjectNamer m_ObjectNamer
 
QcepSettingsSaverPtr m_Saver
 
QxrdApplicationWPtr m_Application
 
QList< QxrdExperimentThreadPtrm_ExperimentThreads
 
QList< QxrdExperimentWPtrm_Experiments
 
QTimer m_SplashTimer
 
QxrdSplashScreenPtr m_Splash
 
QxrdWelcomeWindowPtr m_WelcomeWindow
 
QcepAllocatorThreadPtr m_AllocatorThread
 
QcepAllocatorWPtr m_Allocator
 
QxrdNIDAQPluginInterfacePtr m_NIDAQPluginInterface
 
QxrdResponseTimerm_ResponseTimer
 
QMutex m_SettingsMutex
 
QTimer m_LockerTimer
 
QTime m_LastLockerTime
 
int m_LastLockerCount
 

Detailed Description

Definition at line 27 of file qxrdapplication.h.

Constructor & Destructor Documentation

QxrdApplication::QxrdApplication ( int &  argc,
char **  argv 
)

Definition at line 98 of file qxrdapplication.cpp.

References DEBUG_CONSTRUCTORS, qcepDebug(), QxrdCalibrantDSpacings::registerMetaTypes(), QxrdCalibrantDSpacing::registerMetaTypes(), QxrdPowderPoint::registerMetaTypes(), QcepProperty::registerMetaTypes(), and QxrdPowderPointVector::registerMetaTypes().

98  :
100  m_ObjectNamer(this, "application"),
102  new QcepSettingsSaver(this))),
103  m_RecentExperiments(m_Saver, this, "recentExperiments", QStringList(), "Recent Experiments"),
104  m_RecentExperimentsSize(m_Saver, this,"recentExperimentsSize", 8, "Number of Recent Experiments to Remember"),
105  m_CurrentExperiment(m_Saver, this, "currentExperiment", "", "Current Experiment"),
106  m_CurrentDirectory(m_Saver, this, "currentDirectory", QDir::homePath(), "Current Directory"),
107 // m_OpenDirectly(m_Saver, this,"openDirectly", false, "Open Last Experiment at Startup"),
108  m_Debug(m_Saver, this,"debug", 0, "Debug Level"),
109  m_FreshStart(QcepSettingsSaverPtr(), this,"freshStart", 0, "Do a Fresh Start"),
110  m_FileBrowserLimit(m_Saver, this, "fileBrowserLimit", 1000, "Max Number of Files in Browser Windows (0 = unlimited)"),
111  m_MessageWindowLines(m_Saver, this, "messageWindowLines", 1000, "Number of Lines in Message Window (0 = unlimited)"),
112  m_UpdateIntervalMsec(m_Saver, this, "updateIntervalMsec", 1000, "Time Intervale for Updates (in msec)"),
113  m_Argc(QcepSettingsSaverPtr(), this, "argc", argc, "Number of Command Line Arguments"),
114  m_Argv(QcepSettingsSaverPtr(), this, "argv", makeStringListFromArgs(argc, argv), "Command Line Arguments"),
115  m_GuiWanted(QcepSettingsSaverPtr(), this, "guiWanted", 1, "GUI Wanted?"),
116  m_StartDetectors(QcepSettingsSaverPtr(), this, "startDetectors", 1, "Start Detectors when opening experiments"),
117  m_CmdList(QcepSettingsSaverPtr(), this, "cmdList", QStringList(), "Commands to Execute"),
118  m_FileList(QcepSettingsSaverPtr(), this, "fileList", QStringList(), "Files to Process"),
119  m_LockerCount(QcepSettingsSaverPtr(), this, "lockerCount", 0, "Number of mutex locks taken"),
120  m_LockerRate(QcepSettingsSaverPtr(), this, "lockerRate", 0, "Mutex Locking Rate"),
121  m_Splash(NULL),
122  m_WelcomeWindow(NULL),
123  m_AllocatorThread(NULL),
124  m_Allocator(),
126  #ifdef HAVE_PERKIN_ELMER
127  m_PerkinElmerPluginInterface(NULL),
128  #endif
129  m_ResponseTimer(NULL),
130  m_SettingsMutex(),
132 {
134  printf("QxrdApplication::QxrdApplication(%p)\n", this);
135  }
136 
142 }
QcepAllocatorWPtr m_Allocator
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
static void registerMetaTypes()
QcepApplication(int &argc, char **argv)
static void registerMetaTypes()
QxrdResponseTimer * m_ResponseTimer
QStringList argv
QStringList makeStringListFromArgs(int argc, char **argv)
QxrdWelcomeWindowPtr m_WelcomeWindow
QcepObjectNamer m_ObjectNamer
QcepAllocatorThreadPtr m_AllocatorThread
static void registerMetaTypes()
QSharedPointer< QcepSettingsSaver > QcepSettingsSaverPtr
QxrdNIDAQPluginInterfacePtr m_NIDAQPluginInterface
QxrdSplashScreenPtr m_Splash
QcepSettingsSaverPtr m_Saver

Here is the call graph for this function:

QxrdApplication::~QxrdApplication ( )
virtual

Definition at line 270 of file qxrdapplication.cpp.

References DEBUG_CONSTRUCTORS, m_Saver, and qcepDebug().

271 {
272 #ifndef QT_NO_DEBUG
273  printf("Deleting application\n");
274 #endif
275 
276  m_Saver->performSave();
277 
279  printf("QxrdApplication::~QxrdApplication(%p)\n", this);
280  }
281 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QcepSettingsSaverPtr m_Saver

Here is the call graph for this function:

Member Function Documentation

void QxrdApplication::activateExperiment ( QString  path)
slot

Definition at line 1036 of file qxrdapplication.cpp.

References m_Experiments.

Referenced by QxrdWindow::populateExperimentsMenu().

1037 {
1038  foreach(QxrdExperimentPtr exp, m_Experiments) {
1039  if (exp->experimentFilePath() == path) {
1040  QxrdWindowPtr win = exp->window();
1041 
1042  if (win) {
1043  win->activateWindow();
1044  }
1045  }
1046  }
1047 }
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
QSharedPointer< QxrdWindow > QxrdWindowPtr
Definition: qxrdwindow-ptr.h:6
QList< QxrdExperimentWPtr > m_Experiments

Here is the caller graph for this function:

QcepAllocatorWPtr QxrdApplication::allocator ( ) const

Definition at line 650 of file qxrdapplication.cpp.

References m_Allocator.

Referenced by QxrdGlobalPreferencesDialog::accept(), init(), and QxrdGlobalPreferencesDialog::QxrdGlobalPreferencesDialog().

651 {
652  return m_Allocator;
653 }
QcepAllocatorWPtr m_Allocator

Here is the caller graph for this function:

void QxrdApplication::appendRecentExperiment ( QString  path)

Definition at line 873 of file qxrdapplication.cpp.

Referenced by openedExperiment().

874 {
875  QStringList recent = get_RecentExperiments();
876 
877  recent.prepend(path);
878  recent.removeDuplicates();
879 
880  while(recent.length() > get_RecentExperimentsSize()) {
881  recent.removeLast();
882  }
883 
884  set_RecentExperiments(recent);
885 }

Here is the caller graph for this function:

void QxrdApplication::chooseExistingExperiment ( )
slot

Definition at line 828 of file qxrdapplication.cpp.

References openExperiment().

Referenced by QxrdWindow::initialize(), and QxrdWelcomeWindow::QxrdWelcomeWindow().

829 {
830  QString res = QFileDialog::getOpenFileName(NULL,
831  "Open an existing experiment...",
832  get_CurrentExperiment(),
833  "QXRD Experiments (*.qxrdp);;Other Files (*)");
834 
835  if (res.length() > 0) {
836  openExperiment(res);
837  }
838 }
void openExperiment(QString path)

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::chooseNewExperiment ( )
slot

Definition at line 823 of file qxrdapplication.cpp.

References openWelcomeWindow().

Referenced by QxrdWindow::initialize(), and QxrdWelcomeWindow::QxrdWelcomeWindow().

824 {
826 }

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::closedExperiment ( QxrdExperimentThreadPtr  expthrdw)
slot

Definition at line 1014 of file qxrdapplication.cpp.

References m_Experiments, and m_ExperimentThreads.

Referenced by closeExperiment().

1015 {
1016  QxrdExperimentThreadPtr expthrd(expthrdw);
1017 
1018  if (expthrd) {
1019  QxrdExperimentPtr expt = expthrd->experiment();
1020 
1021  m_ExperimentThreads.removeAll(expthrd);
1022  m_Experiments.removeAll(expt);
1023  }
1024 }
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
QList< QxrdExperimentWPtr > m_Experiments
QSharedPointer< QxrdExperimentThread > QxrdExperimentThreadPtr
QList< QxrdExperimentThreadPtr > m_ExperimentThreads

Here is the caller graph for this function:

void QxrdApplication::closeExperiment ( QxrdExperimentWPtr  exp)
slot

Definition at line 856 of file qxrdapplication.cpp.

References closedExperiment(), DEBUG_APP, and qcepDebug().

857 {
858  if (qcepDebug(DEBUG_APP)) {
859  printf("QxrdApplication::closeExperiment(%p)\n", exp.data());
860  }
861 
862  QxrdExperimentPtr expp(exp);
863 
864  if (expp) {
865  QxrdExperimentThreadPtr expthrd = expp -> experimentThread();
866 
867  if (expthrd) {
868  closedExperiment(expthrd);
869  }
870  }
871 }
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QSharedPointer< QxrdExperimentThread > QxrdExperimentThreadPtr
void closedExperiment(QxrdExperimentThreadPtr expthrdw)

Here is the call graph for this function:

void QxrdApplication::closeWelcomeWindow ( )
slot

Definition at line 309 of file qxrdapplication.cpp.

References GUI_THREAD_CHECK, and m_WelcomeWindow.

Referenced by openedExperiment().

310 {
312 
313  if (m_WelcomeWindow) {
314  m_WelcomeWindow -> hide();
315  }
316 }
#define GUI_THREAD_CHECK
Definition: qcepmacros.h:10
QxrdWelcomeWindowPtr m_WelcomeWindow

Here is the caller graph for this function:

void QxrdApplication::criticalMessage ( QString  msg,
QDateTime  ts = QDateTime::currentDateTime() 
)
slot

Definition at line 526 of file qxrdapplication.cpp.

References experiment(), INVOKE_CHECK, and logMessage().

Referenced by tiffError(), and tiffWarning().

527 {
528  QString message = ts.toString("yyyy.MM.dd : hh:mm:ss.zzz ")+msg.trimmed();
529 
530  message = message.replace("\n", " : ");
531 
532  logMessage(message);
533 
534  if (experiment(0)) {
535  INVOKE_CHECK(QMetaObject::invokeMethod(experiment(0).data(), "criticalMessage", Qt::QueuedConnection, Q_ARG(QString, message)));
536  }
537 }
QxrdExperimentPtr experiment(int i)
void logMessage(QString msg)
#define INVOKE_CHECK(res)
Definition: qcepmacros.h:13

Here is the call graph for this function:

Here is the caller graph for this function:

QString QxrdApplication::currentPath ( )
slot

Definition at line 544 of file qxrdapplication.cpp.

545 {
546  return QDir::currentPath();
547 }
void QxrdApplication::debugChanged ( qint64  newValue)
slot

Definition at line 723 of file qxrdapplication.cpp.

References g_DebugLevel, and printMessage().

Referenced by init().

724 {
725  if (g_DebugLevel) {
726  printMessage(tr("Debug level changed from %1 to %2").arg(g_DebugLevel->debugLevel()).arg(newValue));
727 
728  g_DebugLevel->setDebugLevel(newValue);
729  }
730 }
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())
QSharedPointer< QcepDebugDictionary > g_DebugLevel
Definition: qcepdebug.cpp:4

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::doAboutQxrd ( )
slot

Definition at line 655 of file qxrdapplication.cpp.

References STR.

Referenced by QxrdWindow::initialize().

656 {
657  QString about = "QXRD Data Acquisition for PE Area Detectors\nVersion " STR(QXRD_VERSION);
658 
659  if (sizeof(void*) == 4) {
660  about += " - 32 Bit";
661  } else {
662  about += " - 64 Bit";
663  }
664 
665 #ifdef Q_CC_MSVC
666  about += " MSVC";
667 #endif
668 
669 #ifdef Q_CC_GNU
670 #ifdef Q_CC_CLANG
671  about += " clang";
672 #else
673  about += " gcc";
674 #endif
675 #endif
676 
677 #ifdef QT_NO_DEBUG
678  about += " Release\n";
679 #else
680  about += " Debug\n";
681 #endif
682 
683  about += tr("Qt Version %1\n").arg(qVersion());
684  about += tr("Qceplib Version %1\n").arg(STR(QCEPLIB_VERSION));
685  about += tr("QWT Version %1\n").arg(STR(QCEPLIB_QWT_VERSION));
686  about += tr("Mar345 Version %1\n").arg(STR(QCEPLIB_MAR345_VERSION));
687  about += tr("CBF Version %1\n").arg(STR(QCEPLIB_CBF_VERSION));
688  about += tr("TIFF Version %1\n").arg(STR(QCEPLIB_TIFF_VERSION));
689  about += tr("LevMar Version %1\n").arg(STR(QCEPLIB_LEVMAR_VERSION));
690 #ifdef QCEPLIB_ZLIB_VERSION
691  about += tr("ZLIB Version %1\n").arg(STR(QCEPLIB_ZLIB_VERSION));
692 #endif
693 
694 #ifdef QCEPLIB_SZIP_VERSION
695  about += tr("SZIP Version %1\n").arg(STR(QCEPLIB_SZIP_VERSION));
696 #endif
697 
698 #ifdef QCEPLIB_HDF5_VERSION
699  about += tr("HDF5 Version %1\n").arg(STR(QCEPLIB_HDF5_VERSION));
700 #endif
701  about += tr("Spec Server Version %1\n").arg(STR(QCEPLIB_SPECSERVER_VERSION));
702 
703  QMessageBox::about(NULL, "QXRD", about);
704 }
#define STR(s)
Definition: qcepmacros.h:16

Here is the caller graph for this function:

void QxrdApplication::doLoadPreferences ( )
slot

Definition at line 594 of file qxrdapplication.cpp.

References loadPreferences().

Referenced by QxrdWindow::initialize().

595 {
596  QString loadPrefsFrom = QFileDialog::getOpenFileName(NULL,
597  "Load QXRD Preferences from...");
598 
599  if (loadPrefsFrom != "") {
600  loadPreferences(loadPrefsFrom);
601  }
602 }
void loadPreferences(QString path)

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::doOpenQXRDWebPage ( )
slot

Definition at line 706 of file qxrdapplication.cpp.

Referenced by QxrdWindow::initialize().

707 {
708  QDesktopServices::openUrl(QUrl("http://qxrd.sourceforge.net/"));
709 }

Here is the caller graph for this function:

void QxrdApplication::doOpenURL ( QString  url)
slot

Definition at line 711 of file qxrdapplication.cpp.

712 {
713  QDesktopServices::openUrl(QUrl(url));
714 }
void QxrdApplication::doSavePreferences ( )
slot

Definition at line 611 of file qxrdapplication.cpp.

References savePreferences().

Referenced by QxrdWindow::initialize().

612 {
613  QString savePrefsTo = QFileDialog::getSaveFileName(NULL,
614  "Save QXRD Preferences to...");
615 
616  if (savePrefsTo != "") {
617  savePreferences(savePrefsTo);
618  }
619 }
void savePreferences(QString path)

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::editGlobalPreferences ( )
slot

Definition at line 716 of file qxrdapplication.cpp.

Referenced by init(), QxrdWindow::initialize(), and QxrdWelcomeWindow::QxrdWelcomeWindow().

717 {
718  QxrdGlobalPreferencesDialog prefs(this);
719 
720  prefs.exec();
721 }

Here is the caller graph for this function:

bool QxrdApplication::event ( QEvent *  ev)

Definition at line 780 of file qxrdapplication.cpp.

References printMessage().

781 {
782  QTime tick;
783  tick.start();
784 
785  bool res = QApplication::event(ev);
786 
787  int elapsed = tick.restart();
788 
789  if (elapsed > 1000) {
790  printMessage("event processing took more than 1 sec");
791  }
792 
793  return res;
794 }
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())

Here is the call graph for this function:

QxrdExperimentPtr QxrdApplication::experiment ( int  i)
slot

Definition at line 1031 of file qxrdapplication.cpp.

References m_Experiments.

Referenced by criticalMessage(), printMessage(), statusMessage(), and warningMessage().

1032 {
1033  return m_Experiments.value(i);
1034 }
QList< QxrdExperimentWPtr > m_Experiments

Here is the caller graph for this function:

QList< QxrdExperimentWPtr > & QxrdApplication::experiments ( )
slot

Definition at line 1026 of file qxrdapplication.cpp.

References m_Experiments.

1027 {
1028  return m_Experiments;
1029 }
QList< QxrdExperimentWPtr > m_Experiments
void QxrdApplication::finish ( )
slot

Definition at line 283 of file qxrdapplication.cpp.

References DEBUG_APP, m_AllocatorThread, m_Experiments, m_ExperimentThreads, printMessage(), qcepDebug(), and writeSettings().

Referenced by init().

284 {
285  if (qcepDebug(DEBUG_APP)) {
286  printMessage("QxrdApplication::finish()");
287  }
288 
289  writeSettings();
290 
291  m_ExperimentThreads.clear();
292  m_Experiments.clear();
293 
295 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QList< QxrdExperimentWPtr > m_Experiments
QSharedPointer< QcepAllocatorThread > QcepAllocatorThreadPtr
QcepAllocatorThreadPtr m_AllocatorThread
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())
QList< QxrdExperimentThreadPtr > m_ExperimentThreads

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::hideSplash ( )
privateslot

Definition at line 472 of file qxrdapplication.cpp.

References GUI_THREAD_CHECK, and m_Splash.

Referenced by init().

473 {
475 
476  if (m_Splash) {
477  m_Splash -> hide();
478  }
479 }
#define GUI_THREAD_CHECK
Definition: qcepmacros.h:10
QxrdSplashScreenPtr m_Splash

Here is the caller graph for this function:

QString QxrdApplication::homePath ( )
slot

Definition at line 539 of file qxrdapplication.cpp.

540 {
541  return QDir::homePath();
542 }
void QxrdApplication::incLockerCount ( )

Definition at line 1145 of file qxrdapplication.cpp.

1146 {
1147  prop_LockerCount()->incValue(1);
1148 }
bool QxrdApplication::init ( QxrdApplicationWPtr  app,
int &  argc,
char **  argv 
)

Definition at line 144 of file qxrdapplication.cpp.

References allocator(), argc, debugChanged(), editGlobalPreferences(), finish(), hideSplash(), loadPlugins(), lockerTimerElapsed(), m_Allocator, m_AllocatorThread, m_Application, m_LastLockerTime, m_LockerTimer, m_Saver, m_SplashTimer, openExperiment(), openWelcomeWindow(), printMessage(), readSettings(), setupTiffHandlers(), STR, and QcepInt64Property::valueChanged().

145 {
146  m_Application = app;
147 
148  connect(this, &QCoreApplication::aboutToQuit, this, &QxrdApplication::finish);
149 
150  connect(&m_SplashTimer, &QTimer::timeout, this, &QxrdApplication::hideSplash);
151 
152  connect(&m_LockerTimer, &QTimer::timeout, this, &QxrdApplication::lockerTimerElapsed);
153 
154  m_LastLockerTime.start();
155  m_LockerTimer.start(5000);
156 
157  QDir::setCurrent(QDir::homePath());
158 
159  setOrganizationName("cep");
160  setOrganizationDomain("xray.aps.anl.gov");
161  setApplicationName("qxrd");
162 
163  printMessage("------ Starting QXRD Application ------");
164 
165  QString about = "QXRD Version " STR(QXRD_VERSION);
166 
167  if (sizeof(void*) == 4) {
168  about += " - 32 Bit";
169  } else {
170  about += " - 64 Bit";
171  }
172 
173 #ifdef Q_CC_MSVC
174  about += " MSVC";
175 #endif
176 
177 #ifdef Q_CC_GNU
178  about += " gcc";
179 #endif
180 
181 #ifdef QT_NO_DEBUG
182  about += " Release\n";
183 #else
184  about += " Debug\n";
185 #endif
186 
187  printMessage(about);
188  printMessage("QWT Version " QWT_VERSION_STR);
189  printMessage(tr("QT Version %1").arg(qVersion()));
190 
191  connect(prop_Debug(), &QcepInt64Property::valueChanged,
193  readSettings();
194 
195  for (int i=1; i<argc; i++) {
196  int dbg=0;
197 
198  if (strcmp(argv[i],"-fresh") == 0) {
199  set_FreshStart(true);
200  } else if (sscanf(argv[i],"-debug=%d",&dbg)==1) {
201  set_Debug(dbg);
202  } else if (strcmp(argv[i],"-nogui")==0) {
203  set_GuiWanted(false);
204  } else if (strcmp(argv[i],"-gui")==0) {
205  set_GuiWanted(true);
206  } else if (strcmp(argv[i],"-nostart")==0) {
207  printf("Don't start detectors\n");
208  set_StartDetectors(false);
209  } else if (strcmp(argv[i],"-start")==0) {
210  set_StartDetectors(true);
211  } else if (strcmp(argv[i],"-c")==0) {
212  if (i++ < argc) {
213  prop_CmdList()->appendValue(argv[i]);
214  }
215  } else if (strcmp(argv[i],"-s")==0) {
216  if (i++ < argc) {
217  prop_CmdList()->appendValue(tr("loadScript(\"%1\")").arg(argv[i]));
218  }
219  } else {
220  prop_FileList()->appendValue(argv[i]);
221  }
222  }
223 
224  if (get_GuiWanted() == false) {
225  foreach(QString cmd, get_CmdList()) {
226  printf("Cmd: %s\n", qPrintable(cmd));
227  }
228 
229  foreach(QString file, get_FileList()) {
230  printf("File: %s\n", qPrintable(file));
231  }
232  }
233 
236  m_AllocatorThread -> setObjectName("alloc");
237  m_AllocatorThread -> start();
239 
240  printMessage(tr("Home Path: %1").arg(QDir::homePath()));
241  printMessage(tr("Current Path: %1").arg(QDir::currentPath()));
242  printMessage(tr("Root Path %1").arg(QDir::rootPath()));
243 
245 
246  QThread::currentThread()->setObjectName("app");
247 
248  loadPlugins();
249  readSettings();
250 
251  printMessage(tr("Optimal thread count = %1").arg(QThread::idealThreadCount()));
252 
253 // m_ResponseTimer = new QxrdResponseTimer(30000, 5000, this);
254 
255  if (get_FreshStart()) {
257  }
258 
259  if (/*get_OpenDirectly() &&*/ (get_CurrentExperiment().length()>0)) {
260  openExperiment(get_CurrentExperiment());
261  } else {
263  }
264 
265  m_Saver->start();
266 
267  return true;
268 }
QcepAllocatorWPtr m_Allocator
#define STR(s)
Definition: qcepmacros.h:16
void debugChanged(qint64 newValue)
QxrdApplicationWPtr m_Application
QStringList argv
QSharedPointer< QcepAllocatorThread > QcepAllocatorThreadPtr
QcepAllocatorThreadPtr m_AllocatorThread
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())
void valueChanged(qint64 val, int index)
QcepAllocatorWPtr allocator() const
void openExperiment(QString path)
QcepSettingsSaverPtr m_Saver

Here is the call graph for this function:

void QxrdApplication::loadPlugins ( )

Definition at line 345 of file qxrdapplication.cpp.

References DEBUG_PLUGINS, m_NIDAQPluginInterface, printMessage(), qcepDebug(), splashMessage(), and xstr.

Referenced by init().

346 {
347  QList<QDir> pluginsDirList;
348 
349 #ifdef QXRD_PLUGIN_PATH
350  pluginsDirList.append(QDir(xstr(QXRD_PLUGIN_PATH)));
351 #endif
352  QDir pluginsDir = QDir(qApp->applicationDirPath());
353  pluginsDir.cd("plugins");
354  pluginsDirList.append(pluginsDir);
355 
356  foreach (QDir pluginsDir, pluginsDirList) {
357  if (qcepDebug(DEBUG_PLUGINS)) {
358  printf("Looking for plugins in directory %s\n", qPrintable(pluginsDir.absolutePath()));
359  }
360 
361  foreach (QString fileName, pluginsDir.entryList(QDir::Files)) {
362  QString fullPath = pluginsDir.absoluteFilePath(fileName);
363 
364  if (qcepDebug(DEBUG_PLUGINS)) {
365  printf("Looking for plugin in file %s\n", qPrintable(fullPath));
366  }
367 
368  if (QLibrary::isLibrary(fullPath)) {
369  QPluginLoader loader(fullPath);
370 
371 #if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
372  QJsonObject meta = loader.metaData();
373 
374  if (qcepDebug(DEBUG_PLUGINS)) {
375  printf("Plugin metadata for %s\n", qPrintable(fullPath));
376  foreach(QString key, meta.keys()) {
377  printf("Key %s = %s\n", qPrintable(key), qPrintable(meta.value(key).toString()));
378  }
379  }
380 #endif
381 
382  QObject *plugin = loader.instance();
383  if (plugin) {
384  if (qcepDebug(DEBUG_PLUGINS)) {
385  printf("Loaded plugin from %s : type %s\n", qPrintable(fullPath), qPrintable(plugin->metaObject()->className()));
386  }
387 
388  QString pluginName = "";
389 
390  QxrdDetectorPluginInterface* detector = qobject_cast<QxrdDetectorPluginInterface*>(plugin);
391 
392  if (detector) {
393  pluginName = detector -> name();
394  }
395 
396  QxrdProcessorInterface* processor = qobject_cast<QxrdProcessorInterface*>(plugin);
397 
398  if (processor) {
399  pluginName = processor -> name();
400  }
401 
402 #ifdef HAVE_PERKIN_ELMER
403  QxrdPerkinElmerPluginInterface *perkinElmer = qobject_cast<QxrdPerkinElmerPluginInterface*>(plugin);
404 
405  if (perkinElmer) {
406  pluginName = perkinElmer -> name();
407 
408  m_PerkinElmerPluginInterface = QxrdPerkinElmerPluginInterfacePtr(perkinElmer);
409  }
410 #endif
411 
412  QxrdNIDAQPluginInterface *nidaq = qobject_cast<QxrdNIDAQPluginInterface*>(plugin);
413 
414  if (nidaq) {
415  pluginName = nidaq -> name();
416 
418  m_NIDAQPluginInterface -> setErrorOutput(this);
419  }
420 
421  splashMessage(tr("Loaded plugin \"%1\"").arg(pluginName));
422 
423  printMessage(tr("Loaded plugin \"%1\" from %2")
424  .arg(pluginName)
425  .arg(pluginsDir.absoluteFilePath(fileName)));
426  } else {
427  if (qcepDebug(DEBUG_PLUGINS)) {
428  printf("Failed to load plugin from %s : %s\n", qPrintable(fileName), qPrintable(loader.errorString()));
429  }
430 
431  if (QLibrary::isLibrary(pluginsDir.absoluteFilePath(fileName))) {
432  QString msg = tr("Failed to load plugin %1 : %2")
433  .arg(pluginsDir.absoluteFilePath(fileName))
434  .arg(loader.errorString());
435  splashMessage(msg);
436  printMessage(msg);
437  }
438  }
439  } else {
440  if (qcepDebug(DEBUG_PLUGINS)) {
441  printf("File %s is not a library\n", qPrintable(fileName));
442  }
443  }
444  }
445  }
446 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QSharedPointer< QxrdPerkinElmerPluginInterface > QxrdPerkinElmerPluginInterfacePtr
#define xstr(s)
void splashMessage(QString msg)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())
QSharedPointer< QxrdNIDAQPluginInterface > QxrdNIDAQPluginInterfacePtr
QxrdNIDAQPluginInterfacePtr m_NIDAQPluginInterface

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::loadPreferences ( QString  path)
slot

Definition at line 604 of file qxrdapplication.cpp.

References readSettings().

Referenced by doLoadPreferences().

605 {
606  QxrdGlobalSettings settings(path, QSettings::IniFormat);
607 
608  readSettings(&settings, "application");
609 }

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::lockerTimerElapsed ( )
slot

Definition at line 1150 of file qxrdapplication.cpp.

References m_LastLockerCount, m_LastLockerTime, and printMessage().

Referenced by init().

1151 {
1152  double elapsed = m_LastLockerTime.restart();
1153 
1154  double rate = 1000.0*(get_LockerCount() - m_LastLockerCount)/elapsed;
1155 
1156 // set_LockerRate(rate);
1157 
1158 // m_LastLockerTime = QTime::currentTime();
1159  m_LastLockerCount= get_LockerCount();
1160 
1161  if (rate>10000) {
1162  printMessage(tr("Locker rate %1 locks/sec").arg(/*get_LockerRate()*/rate));
1163  }
1164 }
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::logMessage ( QString  msg)
slot

Definition at line 481 of file qxrdapplication.cpp.

Referenced by criticalMessage(), printMessage(), and statusMessage().

482 {
483 }

Here is the caller graph for this function:

QStringList QxrdApplication::makeStringListFromArgs ( int  argc,
char **  argv 
)

Definition at line 87 of file qxrdapplication.cpp.

References argc.

88 {
89  QStringList res;
90 
91  for (int i=0; i<argc; i++) {
92  res.append(argv[i]);
93  }
94 
95  return res;
96 }
QStringList argv
QxrdNIDAQPluginInterfacePtr QxrdApplication::nidaqPlugin ( )

Definition at line 337 of file qxrdapplication.cpp.

References m_NIDAQPluginInterface.

338 {
339  return m_NIDAQPluginInterface;
340 }
QxrdNIDAQPluginInterfacePtr m_NIDAQPluginInterface
QString QxrdApplication::normalizeExperimentName ( QString  filename)

Definition at line 887 of file qxrdapplication.cpp.

888 {
889  QFileInfo info(filename);
890  QString exten = info.suffix();
891 
892  if (exten != "qxrdp") {
893  return filename+".qxrdp";
894  } else {
895  return filename;
896  }
897 }
void QxrdApplication::openedExperiment ( QxrdExperimentThreadPtr  expthrdw)
slot

Definition at line 988 of file qxrdapplication.cpp.

References appendRecentExperiment(), closeWelcomeWindow(), m_Experiments, m_ExperimentThreads, and printMessage().

Referenced by openExperiment().

989 {
990  QxrdExperimentThreadPtr expthrd(expthrdw);
991 
992  if (expthrd) {
993  QxrdExperimentPtr expt = expthrd->experiment();
994 
995  if (expt) {
996  QString path = expt->experimentFilePath();
997  set_CurrentExperiment(path);
999 
1000  m_ExperimentThreads.append(expthrd);
1001  m_Experiments.append(expt);
1002 
1003  printMessage("");
1004  printMessage("New experiment loaded");
1005  printMessage("");
1006 
1008 
1009  expt->openWindows();
1010  }
1011  }
1012 }
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
void appendRecentExperiment(QString path)
QList< QxrdExperimentWPtr > m_Experiments
QSharedPointer< QxrdExperimentThread > QxrdExperimentThreadPtr
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())
QList< QxrdExperimentThreadPtr > m_ExperimentThreads

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::openExperiment ( QString  path)
slot

Definition at line 840 of file qxrdapplication.cpp.

References m_Application, QxrdExperimentThread::newExperiment(), openedExperiment(), and printMessage().

Referenced by chooseExistingExperiment(), init(), QxrdWelcomeWindow::openMostRecent(), and openRecentExperiment().

841 {
842  if (path.length() > 0) {
843  QxrdExperimentSettings settings(path);
844 
846 
847  QxrdExperimentPtr exp = experimentThread->experiment();
848 
849  printMessage("");
850  printMessage(tr("===== Open Experiment %1").arg(path));
851 
852  openedExperiment(experimentThread);
853  }
854 }
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
static QxrdExperimentThreadPtr newExperiment(QString path, QxrdApplicationWPtr app, QSettings *settings)
QxrdApplicationWPtr m_Application
void openedExperiment(QxrdExperimentThreadPtr expthrdw)
QSharedPointer< QxrdExperimentThread > QxrdExperimentThreadPtr
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::openRecentExperiment ( QString  path)
slot

Definition at line 977 of file qxrdapplication.cpp.

References openExperiment(), and printMessage().

Referenced by QxrdWindow::populateRecentExperimentsMenu(), and QxrdWelcomeWindow::QxrdWelcomeWindow().

978 {
979  QFileInfo info(path);
980 
981  if (info.exists()) {
982  openExperiment(path);
983  } else {
984  printMessage(tr("Experiment %1 does not exist").arg(path));
985  }
986 }
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())
void openExperiment(QString path)

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::openWelcomeWindow ( )
slot

Definition at line 297 of file qxrdapplication.cpp.

References GUI_THREAD_CHECK, and m_WelcomeWindow.

Referenced by chooseNewExperiment(), and init().

298 {
300 
301  if (m_WelcomeWindow == NULL) {
303  m_WelcomeWindow->setAttribute(Qt::WA_DeleteOnClose, true);
304  }
305 
306  m_WelcomeWindow -> show();
307 }
#define GUI_THREAD_CHECK
Definition: qcepmacros.h:10
QxrdWelcomeWindowPtr m_WelcomeWindow

Here is the caller graph for this function:

void QxrdApplication::possiblyQuit ( )
slot

Definition at line 636 of file qxrdapplication.cpp.

References wantToQuit().

Referenced by QxrdWindow::initialize(), and QxrdWelcomeWindow::QxrdWelcomeWindow().

637 {
638  if (wantToQuit()) {
639  quit();
640  }
641 }

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::printMessage ( QString  msg,
QDateTime  ts = QDateTime::currentDateTime() 
)
slot

Definition at line 492 of file qxrdapplication.cpp.

References DEBUG_NOMESSAGES, experiment(), INVOKE_CHECK, logMessage(), and qcepDebug().

Referenced by debugChanged(), event(), finish(), init(), loadPlugins(), lockerTimerElapsed(), openedExperiment(), openExperiment(), openRecentExperiment(), processEventCounter(), QxrdGlobalSettings::QxrdGlobalSettings(), and QxrdGlobalSettings::~QxrdGlobalSettings().

493 {
495  } else {
496  QString message = ts.toString("yyyy.MM.dd : hh:mm:ss.zzz ")+
497  QThread::currentThread()->objectName()+": "+
498  msg.trimmed();
499 
500  message = message.replace("\n", " : ");
501 
502  logMessage(message);
503 
504  if (experiment(0)) {
505  INVOKE_CHECK(QMetaObject::invokeMethod(experiment(0).data(), "printMessage", Qt::QueuedConnection, Q_ARG(QString, msg)));
506  }
507  }
508 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QxrdExperimentPtr experiment(int i)
void logMessage(QString msg)
#define INVOKE_CHECK(res)
Definition: qcepmacros.h:13

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::processEventCounter ( )
slot

Definition at line 78 of file qxrdapplication.cpp.

References DEBUG_APP, eventCounter, printMessage(), and qcepDebug().

79 {
80  if (qcepDebug(DEBUG_APP)) {
81  printMessage(tr("%1 events processed").arg(eventCounter));
82  }
83 
84  eventCounter = 0;
85 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())
int eventCounter

Here is the call graph for this function:

void QxrdApplication::readDefaultSettings ( )

Definition at line 805 of file qxrdapplication.cpp.

806 {
807  QSettings settings("cep.xor.aps.anl.gov", "qxrd-defaults");
808 
809  set_RecentExperiments(settings.value("recentExperiments").toStringList());
810  set_RecentExperimentsSize(settings.value("recentExperimentsSize", 8).toInt());
811  set_CurrentExperiment(settings.value("currentExperiment").toString());
812 }
void QxrdApplication::readSettings ( )
slot

Definition at line 554 of file qxrdapplication.cpp.

References m_SettingsMutex.

Referenced by init(), and loadPreferences().

555 {
556  QcepMutexLocker lock(__FILE__, __LINE__, &m_SettingsMutex);
557 
558  QxrdGlobalSettings settings(this);
559 
560  readSettings(&settings, "application");
561 }

Here is the caller graph for this function:

void QxrdApplication::readSettings ( QSettings *  settings,
QString  section 
)
slot

Definition at line 563 of file qxrdapplication.cpp.

References m_Allocator, and QcepProperty::readSettings().

564 {
565  QcepProperty::readSettings(this, settings, section);
566 
568 
569  if (alloc) {
570  alloc->readSettings(settings, "allocator");
571  }
572 }
QcepAllocatorWPtr m_Allocator
static void readSettings(QObject *object, QSettings *settings, QString section)
QSharedPointer< QcepAllocator > QcepAllocatorPtr

Here is the call graph for this function:

QString QxrdApplication::rootPath ( )
slot

Definition at line 549 of file qxrdapplication.cpp.

550 {
551  return QDir::rootPath();
552 }
void QxrdApplication::savePreferences ( QString  path)
slot

Definition at line 621 of file qxrdapplication.cpp.

References writeSettings().

Referenced by doSavePreferences().

622 {
623  QFile::remove(path+".new");
624 
625  {
626  QxrdGlobalSettings settings(path+".new", QSettings::IniFormat);
627 
628  writeSettings(&settings, "application");
629  }
630 
631  QFile::remove(path+".bak");
632  QFile::rename(path, path+".bak");
633  QFile::rename(path+".new", path);
634 }

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::setDefaultObjectData ( QcepDataObject obj)
virtualslot

Definition at line 796 of file qxrdapplication.cpp.

References STR.

797 {
798  if (obj) {
799  obj->set_Creator("QXRD");
800  obj->set_Version(STR(QXRD_VERSION));
801  obj->set_QtVersion(QT_VERSION_STR);
802  }
803 }
#define STR(s)
Definition: qcepmacros.h:16
void QxrdApplication::setNewExperimentSettings ( QSettings &  settings,
int  type,
QString  filename 
)

Definition at line 899 of file qxrdapplication.cpp.

900 {
901  QFileInfo info(filename);
902  QString path = info.path();
903  QString base = info.completeBaseName();
904 
905  settings.setValue("application/d", type);
906  settings.setValue("processor/outputDirectory", path);
907  settings.setValue("application/logFileName", base+".log");
908  settings.setValue("processor/integratedFileName", base+".avg");
909  settings.setValue("window/inputFileBrowser/rootDirectory", path);
910  settings.setValue("window/outputFileBrowser/rootDirectory", path);
911 
912  switch(type) {
913  case 1: // Perkin Elmer
914  break;
915 
916  case 2: // Pilatus
917  break;
918 
919  case 4: // Analysis
920  settings.setValue("application/runSpecServer", false);
921  settings.setValue("application/runSimpleServer", false);
922  break;
923  }
924 }
void QxrdApplication::setupTiffHandlers ( )
private

Definition at line 754 of file qxrdapplication.cpp.

References qxrdTIFFErrorHandler(), and qxrdTIFFWarningHandler().

Referenced by init().

755 {
756  TIFFSetErrorHandler (&qxrdTIFFErrorHandler);
757  TIFFSetErrorHandlerExt (NULL);
758  TIFFSetWarningHandler (&qxrdTIFFWarningHandler);
759  TIFFSetWarningHandlerExt (NULL);
760 }
static void qxrdTIFFErrorHandler(const char *module, const char *fmt, va_list ap)
static void qxrdTIFFWarningHandler(const char *, const char *, va_list)

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::splashMessage ( QString  msg)
slot

Definition at line 448 of file qxrdapplication.cpp.

References GUI_THREAD_CHECK, m_Splash, m_SplashTimer, and STR.

Referenced by loadPlugins().

449 {
450  if (QThread::currentThread() != thread()) {
451  QMetaObject::invokeMethod(this, "splashMessage", Q_ARG(QString, msg));
452  } else {
454 
455  if (get_GuiWanted()) {
456  if (m_Splash == NULL) {
458  }
459 
460  m_Splash -> show();
461 
462  QString msgf = tr("Qxrd Version " STR(QXRD_VERSION) "\n")+msg;
463 
464  m_Splash->showMessage(msgf, Qt::AlignBottom|Qt::AlignHCenter);
465  processEvents();
466 
467  m_SplashTimer.start(5000);
468  }
469  }
470 }
#define STR(s)
Definition: qcepmacros.h:16
#define GUI_THREAD_CHECK
Definition: qcepmacros.h:10
QSharedPointer< QxrdSplashScreen > QxrdSplashScreenPtr
QxrdSplashScreenPtr m_Splash

Here is the caller graph for this function:

void QxrdApplication::statusMessage ( QString  msg,
QDateTime  ts = QDateTime::currentDateTime() 
)
slot

Definition at line 510 of file qxrdapplication.cpp.

References DEBUG_NOMESSAGES, experiment(), INVOKE_CHECK, logMessage(), and qcepDebug().

511 {
513  } else {
514  QString message = ts.toString("yyyy.MM.dd : hh:mm:ss.zzz ")+msg.trimmed();
515 
516  message = message.replace("\n", " : ");
517 
518  logMessage(message);
519 
520  if (experiment(0)) {
521  INVOKE_CHECK(QMetaObject::invokeMethod(experiment(0).data(), "statusMessage", Qt::QueuedConnection, Q_ARG(QString, message)));
522  }
523  }
524 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QxrdExperimentPtr experiment(int i)
void logMessage(QString msg)
#define INVOKE_CHECK(res)
Definition: qcepmacros.h:13

Here is the call graph for this function:

void QxrdApplication::tiffError ( const char *  module,
const char *  msg 
)

Definition at line 771 of file qxrdapplication.cpp.

References criticalMessage(), and g_Application.

Referenced by qxrdTIFFErrorHandler().

772 {
773  QxrdApplication *app = qobject_cast<QxrdApplication*>(g_Application);
774 
775  if (app) {
776  app->criticalMessage(tr("TIFF Error from %1 : %2").arg(module).arg(msg));
777  }
778 }
QcepApplication * g_Application
void criticalMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdApplication::tiffWarning ( const char *  module,
const char *  msg 
)

Definition at line 762 of file qxrdapplication.cpp.

References criticalMessage(), and g_Application.

763 {
764  QxrdApplication *app = qobject_cast<QxrdApplication*>(g_Application);
765 
766  if (app) {
767  app->criticalMessage(tr("TIFF Warning from %1 : %2").arg(module).arg(msg));
768  }
769 }
QcepApplication * g_Application
void criticalMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())

Here is the call graph for this function:

bool QxrdApplication::wantToQuit ( )

Definition at line 643 of file qxrdapplication.cpp.

Referenced by possiblyQuit().

644 {
645  return QMessageBox::question(NULL, tr("Really Quit?"),
646  tr("Do you really want to exit the application?"),
647  QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok;
648 }

Here is the caller graph for this function:

void QxrdApplication::warningMessage ( QString  msg,
QDateTime  ts = QDateTime::currentDateTime() 
)
slot

Definition at line 485 of file qxrdapplication.cpp.

References experiment(), and INVOKE_CHECK.

486 {
487  if (experiment(0)) {
488  INVOKE_CHECK(QMetaObject::invokeMethod(experiment(0).data(), "warningMessage", Qt::BlockingQueuedConnection, Q_ARG(QString, msg)));
489  }
490 }
QxrdExperimentPtr experiment(int i)
#define INVOKE_CHECK(res)
Definition: qcepmacros.h:13

Here is the call graph for this function:

void QxrdApplication::writeDefaultSettings ( )

Definition at line 814 of file qxrdapplication.cpp.

815 {
816  QSettings settings("cep.xor.aps.anl.gov", "qxrd-defaults");
817 
818  settings.setValue("recentExperiments", get_RecentExperiments());
819  settings.setValue("recentExperimentsSize", get_RecentExperimentsSize());
820  settings.setValue("currentExperiment", get_CurrentExperiment());
821 }
void QxrdApplication::writeSettings ( )
slot

Definition at line 574 of file qxrdapplication.cpp.

References m_SettingsMutex.

Referenced by finish(), and savePreferences().

575 {
576  QcepMutexLocker lock(__FILE__, __LINE__, &m_SettingsMutex);
577 
578  QxrdGlobalSettings settings(this);
579 
580  writeSettings(&settings, "application");
581 }

Here is the caller graph for this function:

void QxrdApplication::writeSettings ( QSettings *  settings,
QString  section 
)
slot

Definition at line 583 of file qxrdapplication.cpp.

References m_Allocator, and QcepProperty::writeSettings().

584 {
585  QcepProperty::writeSettings(this, settings, section);
586 
588 
589  if (alloc) {
590  alloc->writeSettings(settings, "allocator");
591  }
592 }
QcepAllocatorWPtr m_Allocator
static void writeSettings(QObject *object, QSettings *settings, QString section)
QSharedPointer< QcepAllocator > QcepAllocatorPtr

Here is the call graph for this function:

Member Data Documentation

QcepAllocatorWPtr QxrdApplication::m_Allocator
private

Definition at line 202 of file qxrdapplication.h.

Referenced by allocator(), init(), readSettings(), and writeSettings().

QcepAllocatorThreadPtr QxrdApplication::m_AllocatorThread
private

Definition at line 201 of file qxrdapplication.h.

Referenced by finish(), and init().

QxrdApplicationWPtr QxrdApplication::m_Application
private

Definition at line 193 of file qxrdapplication.h.

Referenced by init(), and openExperiment().

QList<QxrdExperimentWPtr> QxrdApplication::m_Experiments
private
QList<QxrdExperimentThreadPtr> QxrdApplication::m_ExperimentThreads
private

Definition at line 194 of file qxrdapplication.h.

Referenced by closedExperiment(), finish(), and openedExperiment().

int QxrdApplication::m_LastLockerCount
private

Definition at line 213 of file qxrdapplication.h.

Referenced by lockerTimerElapsed().

QTime QxrdApplication::m_LastLockerTime
private

Definition at line 212 of file qxrdapplication.h.

Referenced by init(), and lockerTimerElapsed().

QTimer QxrdApplication::m_LockerTimer
private

Definition at line 211 of file qxrdapplication.h.

Referenced by init().

QxrdNIDAQPluginInterfacePtr QxrdApplication::m_NIDAQPluginInterface
private

Definition at line 203 of file qxrdapplication.h.

Referenced by loadPlugins(), and nidaqPlugin().

QcepObjectNamer QxrdApplication::m_ObjectNamer
private

Definition at line 134 of file qxrdapplication.h.

QxrdResponseTimer* QxrdApplication::m_ResponseTimer
private

Definition at line 207 of file qxrdapplication.h.

QcepSettingsSaverPtr QxrdApplication::m_Saver
private

Definition at line 135 of file qxrdapplication.h.

Referenced by init(), and ~QxrdApplication().

QMutex QxrdApplication::m_SettingsMutex
private

Definition at line 209 of file qxrdapplication.h.

Referenced by readSettings(), and writeSettings().

QxrdSplashScreenPtr QxrdApplication::m_Splash
private

Definition at line 198 of file qxrdapplication.h.

Referenced by hideSplash(), and splashMessage().

QTimer QxrdApplication::m_SplashTimer
private

Definition at line 197 of file qxrdapplication.h.

Referenced by init(), and splashMessage().

QxrdWelcomeWindowPtr QxrdApplication::m_WelcomeWindow
private

Definition at line 200 of file qxrdapplication.h.

Referenced by closeWelcomeWindow(), and openWelcomeWindow().

Property Documentation

int QxrdApplication::argc
readwrite

Definition at line 168 of file qxrdapplication.h.

Referenced by init(), and makeStringListFromArgs().

QStringList QxrdApplication::argv
readwrite

Definition at line 171 of file qxrdapplication.h.

QStringList QxrdApplication::cmdList
readwrite

Definition at line 180 of file qxrdapplication.h.

QString QxrdApplication::currentDirectory
readwrite

Definition at line 147 of file qxrdapplication.h.

QString QxrdApplication::currentExperiment
readwrite

Definition at line 144 of file qxrdapplication.h.

qint64 QxrdApplication::debug
readwrite

Definition at line 153 of file qxrdapplication.h.

int QxrdApplication::fileBrowserLimit
readwrite

Definition at line 159 of file qxrdapplication.h.

QStringList QxrdApplication::fileList
readwrite

Definition at line 183 of file qxrdapplication.h.

int QxrdApplication::freshStart
readwrite

Definition at line 156 of file qxrdapplication.h.

int QxrdApplication::guiWanted
readwrite

Definition at line 174 of file qxrdapplication.h.

int QxrdApplication::lockerCount
readwrite

Definition at line 186 of file qxrdapplication.h.

double QxrdApplication::lockerRate
readwrite

Definition at line 189 of file qxrdapplication.h.

int QxrdApplication::messageWindowLines
readwrite

Definition at line 162 of file qxrdapplication.h.

QStringList QxrdApplication::recentExperiments
readwrite

Definition at line 138 of file qxrdapplication.h.

int QxrdApplication::recentExperimentsSize
readwrite

Definition at line 141 of file qxrdapplication.h.

int QxrdApplication::startDetectors
readwrite

Definition at line 177 of file qxrdapplication.h.

int QxrdApplication::updateIntervalMsec
readwrite

Definition at line 165 of file qxrdapplication.h.


The documentation for this class was generated from the following files: