瀏覽代碼

ENH: some corrections and debug output mainly regarding urls

ivowolf 14 年之前
父節點
當前提交
e610de5a70

+ 8 - 3
Applications/ctkExampleHostedApp/ctkExampleHostedAppMain.cpp

@@ -47,12 +47,14 @@ void print_usage()
 int main(int argv, char** argc)
 int main(int argv, char** argc)
 {
 {
   QApplication app(argv, argc);
   QApplication app(argv, argc);
+  qDebug() << "################################################################";
 
 
   qApp->setOrganizationName("CTK");
   qApp->setOrganizationName("CTK");
   qApp->setOrganizationDomain("commontk.org");
   qApp->setOrganizationDomain("commontk.org");
   qApp->setApplicationName("ctkExampleHost");
   qApp->setApplicationName("ctkExampleHost");
 
 
   // parse the command line
   // parse the command line
+  qDebug() << "################################################################";
 
 
   if(qApp->arguments().size() < 5)
   if(qApp->arguments().size() < 5)
   {
   {
@@ -68,6 +70,7 @@ int main(int argv, char** argc)
     exit(1);
     exit(1);
   }
   }
   QString hostURL = qApp->arguments().at(2);
   QString hostURL = qApp->arguments().at(2);
+  qDebug() << "hostURL is: " << hostURL << " . Extracted port is: " << QUrl(hostURL).port();
 
 
   if(qApp->arguments().at(3) != "--applicationURL")
   if(qApp->arguments().at(3) != "--applicationURL")
   {
   {
@@ -76,6 +79,7 @@ int main(int argv, char** argc)
     exit(1);
     exit(1);
   }
   }
   QString appURL = qApp->arguments().at(4);
   QString appURL = qApp->arguments().at(4);
+  qDebug() << "appURL is: " << appURL << " . Extracted port is: " << QUrl(appURL).port();
 
 
   // setup the plugin framework
   // setup the plugin framework
   ctkPluginFrameworkFactory fwFactory;
   ctkPluginFrameworkFactory fwFactory;
@@ -148,12 +152,12 @@ int main(int argv, char** argc)
     qCritical() << "  Plugin path: " << pluginPath;
     qCritical() << "  Plugin path: " << pluginPath;
     exit(3);
     exit(3);
   }
   }
-
+qCritical() << "app about to start 1";
   // setup the communication infrastructure: DicomAppServer and DicomHostService
   // setup the communication infrastructure: DicomAppServer and DicomHostService
   ctkDicomAppServer * appServer = new ctkDicomAppServer(QUrl(appURL).port()); // accesses the app-plugin via getService("ctkDicomAppInterface");
   ctkDicomAppServer * appServer = new ctkDicomAppServer(QUrl(appURL).port()); // accesses the app-plugin via getService("ctkDicomAppInterface");
   ctkDicomHostInterface * hostInterface = new ctkDicomHostService(QUrl(hostURL).port());
   ctkDicomHostInterface * hostInterface = new ctkDicomHostService(QUrl(hostURL).port());
   framework->getPluginContext()->registerService(QStringList("ctkDicomHostInterface"), hostInterface);
   framework->getPluginContext()->registerService(QStringList("ctkDicomHostInterface"), hostInterface);
-
+qCritical() << "app about to start 2";
   // install and start the plugin with the business logic and remember pointer to start it later
   // install and start the plugin with the business logic and remember pointer to start it later
   ctkPlugin* plugin;
   ctkPlugin* plugin;
   try
   try
@@ -166,8 +170,9 @@ int main(int argv, char** argc)
     qCritical() << e.what();
     qCritical() << e.what();
   }
   }
 
 
+qCritical() << "app about to start 3";
   framework->start();
   framework->start();
-
+qCritical() << "app about to start 4";
   //QWidget placeholder;
   //QWidget placeholder;
   //placeholder.show();
   //placeholder.show();
 
 

+ 6 - 0
Plugins/org.commontk.dicom.examplehost/ctkDicomExampleHost.cpp

@@ -13,6 +13,12 @@ void ctkDicomExampleHost::StartApplication(QString AppPath, const QUrl& App_URL)
     l.append(QString("http://localhost:") + QString::number(this->getPort()) );
     l.append(QString("http://localhost:") + QString::number(this->getPort()) );
     l.append("--applicationURL");
     l.append("--applicationURL");
     l.append(App_URL.toString());
     l.append(App_URL.toString());
+    l.append("dicomapp"); // the app plugin to use - has to be changed later
+    if (!QProcess::startDetached (
+            AppPath,l))
+    {
+        qCritical() << "application failed to start!";
+    }
     qDebug() << "starting application: " << AppPath << " " << l;
     qDebug() << "starting application: " << AppPath << " " << l;
 
 
     this->appProcess.start(AppPath,l);
     this->appProcess.start(AppPath,l);

+ 3 - 3
Plugins/org.commontk.dicom.wg23.core/ctkDicomServicePrivate.cpp

@@ -53,7 +53,7 @@ QtSoapType ctkDicomServicePrivate::askHost(const QString& methodName, QtSoapType
 
 
   http.submitRequest(request, "/IHostService");
   http.submitRequest(request, "/IHostService");
 
 
-  qDebug() << "Submitted request GetAvailableScreen";
+  qDebug() << "Submitted request " << methodName;
 
 
   QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
   QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 
 
@@ -74,8 +74,8 @@ QtSoapType ctkDicomServicePrivate::askHost(const QString& methodName, QtSoapType
 
 
   const QtSoapType &meth = response.method();
   const QtSoapType &meth = response.method();
 
 
-  if (!meth.isValid() || meth.type() != QtSoapType::Struct)
-    qDebug() << "SOAP returning NIL: invalid or type != Struct";
+  if (!meth.isValid())
+    qDebug() << "SOAP returning invalid.";
 
 
   const QtSoapStruct &m = dynamic_cast<const QtSoapStruct &>(meth);
   const QtSoapStruct &m = dynamic_cast<const QtSoapStruct &>(meth);
   if (m.count() == 0)
   if (m.count() == 0)