QXRD  0.11.16
Public Slots | Public Member Functions | Properties | List of all members
QxrdServer Class Reference

#include <qxrdserver.h>

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

Public Slots

void runModeChanged ()
 
void serverPortChanged ()
 
QVariant readProperty (QString name)
 
void shutdown ()
 

Public Member Functions

 QxrdServer (QcepSettingsSaverWPtr saver, QxrdExperimentWPtr doc, QString name)
 
virtual ~QxrdServer ()
 
virtual void readSettings (QSettings *settings, QString section)
 
virtual void writeSettings (QSettings *settings, QString section)
 

Properties

int runSpecServer
 
int specServerPort
 

Detailed Description

Definition at line 10 of file qxrdserver.h.

Constructor & Destructor Documentation

QxrdServer::QxrdServer ( QcepSettingsSaverWPtr  saver,
QxrdExperimentWPtr  doc,
QString  name 
)

Definition at line 14 of file qxrdserver.cpp.

References DEBUG_CONSTRUCTORS, qcepDebug(), runModeChanged(), serverPortChanged(), and QcepIntProperty::valueChanged().

14  :
15  QSpecServer(doc, name),
16  m_RunSpecServer(saver, this,"runSpecServer", 1, "Run SPEC Server?"),
17  m_SpecServerPort(saver, this,"specServerPort", -1, "Port for SPEC Server")
18 {
20  printf("QxrdServer::QxrdServer(%p)\n", this);
21  }
22 
23  connect(prop_RunSpecServer(), &QcepIntProperty::valueChanged, this, &QxrdServer::runModeChanged);
24  connect(prop_SpecServerPort(), &QcepIntProperty::valueChanged, this, &QxrdServer::serverPortChanged);
25 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void serverPortChanged()
Definition: qxrdserver.cpp:59
void valueChanged(int val, int index)
void runModeChanged()
Definition: qxrdserver.cpp:46

Here is the call graph for this function:

QxrdServer::~QxrdServer ( )
virtual

Definition at line 27 of file qxrdserver.cpp.

References DEBUG_CONSTRUCTORS, and qcepDebug().

28 {
30  printf("QxrdServer::~QxrdServer(%p)\n", this);
31  }
32 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26

Here is the call graph for this function:

Member Function Documentation

QVariant QxrdServer::readProperty ( QString  name)
slot

Definition at line 72 of file qxrdserver.cpp.

73 {
74  QVariant res;
75 
76  if (name=="test") {
77  return 42;
78  }
79 
80  return QSpecServer::readProperty(name);
81 }
void QxrdServer::readSettings ( QSettings *  settings,
QString  section 
)
virtual

Definition at line 34 of file qxrdserver.cpp.

References QcepProperty::readSettings(), and runModeChanged().

35 {
36  QcepProperty::readSettings(this, settings, section);
37 
39 }
static void readSettings(QObject *object, QSettings *settings, QString section)
void runModeChanged()
Definition: qxrdserver.cpp:46

Here is the call graph for this function:

void QxrdServer::runModeChanged ( )
slot

Definition at line 46 of file qxrdserver.cpp.

Referenced by QxrdServer(), and readSettings().

47 {
48  if (QThread::currentThread() != thread()) {
49  QMetaObject::invokeMethod(this, "runModeChanged");
50  } else {
51  if (get_RunSpecServer()) {
52  startServer(QHostAddress::Any, get_SpecServerPort());
53  } else {
54  stopServer();
55  }
56  }
57 }

Here is the caller graph for this function:

void QxrdServer::serverPortChanged ( )
slot

Definition at line 59 of file qxrdserver.cpp.

Referenced by QxrdServer().

60 {
61  if (QThread::currentThread() != thread()) {
62  QMetaObject::invokeMethod(this, "serverPortChanged");
63  } else {
64  stopServer();
65 
66  if (get_RunSpecServer()) {
67  startServer(QHostAddress::Any, get_SpecServerPort());
68  }
69  }
70 }

Here is the caller graph for this function:

void QxrdServer::shutdown ( )
slot

Definition at line 83 of file qxrdserver.cpp.

84 {
85  close();
86 
87  thread()->exit();
88 }
void QxrdServer::writeSettings ( QSettings *  settings,
QString  section 
)
virtual

Definition at line 41 of file qxrdserver.cpp.

References QcepProperty::writeSettings().

42 {
43  QcepProperty::writeSettings(this, settings, section);
44 }
static void writeSettings(QObject *object, QSettings *settings, QString section)

Here is the call graph for this function:

Property Documentation

int QxrdServer::runSpecServer
readwrite

Definition at line 22 of file qxrdserver.h.

int QxrdServer::specServerPort
readwrite

Definition at line 25 of file qxrdserver.h.


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