20 #include "QApplication" 33 std::vector<PropertyPtr> retval;
44 bool defaultValue =
true;
46 bool defaultValue =
false;
50 "Run streamer in a separate process",
52 retval->setAdvanced(
false);
53 retval->setGroup(
"Connection");
59 QString filename =
"OpenIGTLinkServer";
64 QStringList paths = QStringList() << qApp->applicationDirPath();
72 "Name of server executable, used only if Run Local Server is set.",
76 retval->setAdvanced(
false);
77 retval->setGroup(
"Connection");
93 QStringList cmdlineArguments;
94 for (StringMap::iterator i=args.begin(); i!=args.end(); ++i)
95 cmdlineArguments << i->first << i->second;
98 QString localServer = localServerProp->getEmbeddedPath().getAbsoluteFilepath();
99 boost::shared_ptr<LocalServerStreamer> streamer;
106 mServerName(serverName),
107 mServerArguments(serverArguments)
109 mLocalVideoServerProcess.reset(
new ProcessWrapper(QString(
"Local Video Server: %1").arg(mServerName)));
112 int defaultport = 18333;
113 igtLinkStreamer->setAddress(
"Localhost", defaultport);
114 mBase = igtLinkStreamer;
125 mLocalVideoServerProcess->launchWithRelativePath(mServerName, mServerArguments.split(
" "));
128 void LocalServerStreamer::processStateChanged()
130 if(mLocalVideoServerProcess->isRunning())
131 mBase->startStreaming(
mSender);
136 mBase->stopStreaming();
138 if (mLocalVideoServerProcess->getProcess())
140 mLocalVideoServerProcess->getProcess()->close();
141 mLocalVideoServerProcess.reset();
147 return localVideoServerIsRunning();
150 bool LocalServerStreamer::localVideoServerIsRunning()
152 if (!mLocalVideoServerProcess || !mLocalVideoServerProcess->getProcess())
154 return this->mLocalVideoServerProcess->isRunning();
static BoolPropertyPtr initialize(const QString &uid, QString name, QString help, bool value, QDomNode root=QDomNode())
FilePathPropertyPtr getLocalServerNameOption(QDomElement root)
virtual void stopStreaming()
static StreamerPtr createStreamerIfEnabled(QDomElement root, StringMap args)
LocalServerStreamer(QString serverName, QString serverArguments)
BoolPropertyBasePtr getRunLocalServerOption(QDomElement root)
virtual void startStreaming(SenderPtr sender)
std::map< QString, QString > StringMap
boost::shared_ptr< class BoolPropertyBase > BoolPropertyBasePtr
virtual bool isStreaming()
static FilePathPropertyPtr initialize(const QString &uid, QString name, QString help, QString value, QStringList paths, QDomNode root=QDomNode())
virtual ~LocalServerStreamer()
boost::shared_ptr< class FilePathProperty > FilePathPropertyPtr
boost::shared_ptr< class BoolProperty > BoolPropertyPtr
boost::shared_ptr< Sender > SenderPtr
static QString getBundlePath()
return the folder where the bundle or executable are located.
boost::shared_ptr< class Streamer > StreamerPtr
std::vector< PropertyPtr > getSettings(QDomElement root)
Namespace for all CustusX production code.