瀏覽代碼

ENH: Added missing host methods.

Yves 14 年之前
父節點
當前提交
77d763ebe5

+ 35 - 10
Plugins/org.commontk.dicom.wg23.host/ctkDicomHostServerPrivate.cpp

@@ -19,7 +19,6 @@
 
 =============================================================================*/
 
-
 #include "ctkDicomHostServerPrivate.h"
 
 #include <ctkDicomHostInterface.h>
@@ -42,10 +41,8 @@ ctkDicomHostServerPrivate::ctkDicomHostServerPrivate(ctkDicomHostInterface* host
   }
 }
 
-
-
-void ctkDicomHostServerPrivate::incomingSoapMessage(const QtSoapMessage& message,
-                                              QtSoapMessage* reply)
+void ctkDicomHostServerPrivate::incomingSoapMessage(
+  const QtSoapMessage& message, QtSoapMessage* reply)
 {
   const QtSoapType& method = message.method();
   QString methodName = method.name().name();
@@ -56,18 +53,32 @@ void ctkDicomHostServerPrivate::incomingSoapMessage(const QtSoapMessage& message
   {
     processGetAvailableScreen(message, reply);
   }
-  if (methodName == "notifyStateChanged")
+  else if (methodName == "notifyStateChanged")
   {
     processNotifyStateChanged(message, reply);
   }
-  if (methodName == "notifyStatus")
+  else if (methodName == "notifyStatus")
   {
     processNotifyStatus(message, reply);
   }
+  else if (methodName == "generateUID")
+  {
+    processGenerateUID(message, reply);
+  }
+  else if (methodName == "getOutputLocation")
+  {
+    processGetOutputLocation(message, reply);
+  }
+  else
+  {
+    // error
+    reply->setFaultCode( QtSoapMessage::Server );
+    reply->setFaultString( "Unknown method." );
+  }
 }
 
 void ctkDicomHostServerPrivate::processGetAvailableScreen(
-    const QtSoapMessage &message, QtSoapMessage *reply)
+    const QtSoapMessage &message, QtSoapMessage *reply) const
 {
   const QtSoapType& preferredScreenType = message.method()["preferredScreen"];
   const QRect preferredScreen = ctkDicomSoapRectangle::getQRect(preferredScreenType);
@@ -80,15 +91,29 @@ void ctkDicomHostServerPrivate::processGetAvailableScreen(
 }
 
 void ctkDicomHostServerPrivate::processNotifyStateChanged(
-    const QtSoapMessage &message, QtSoapMessage * /* reply */)
+    const QtSoapMessage &message, QtSoapMessage * /* reply */) const
 {
     const QtSoapType& stateType = message.method()["state"];
     hostInterface->notifyStateChanged(ctkDicomSoapState::getState(stateType));
 }
 
 void ctkDicomHostServerPrivate::processNotifyStatus(
-    const QtSoapMessage &message, QtSoapMessage * /* reply */)
+    const QtSoapMessage &message, QtSoapMessage * /* reply */) const
 {
     const QtSoapType& status = message.method()["status"];
     hostInterface->notifyStatus(ctkDicomSoapStatus::getStatus(status));
 }
+
+void ctkDicomHostServerPrivate::processGenerateUID(
+  const QtSoapMessage& message, QtSoapMessage* reply) const
+{
+  Q_UNUSED(message)
+  Q_UNUSED(reply)
+}
+
+void ctkDicomHostServerPrivate::processGetOutputLocation(
+  const QtSoapMessage& message, QtSoapMessage* reply) const
+{
+  Q_UNUSED(message)
+  Q_UNUSED(reply)
+}

+ 7 - 7
Plugins/org.commontk.dicom.wg23.host/ctkDicomHostServerPrivate.h

@@ -49,15 +49,15 @@ public slots:
 private:
 
   void processGetAvailableScreen(const QtSoapMessage& message,
-                                 QtSoapMessage* reply);
+                                 QtSoapMessage* reply) const;
   void processNotifyStateChanged(const QtSoapMessage& message,
-                                 QtSoapMessage* reply);
+                                 QtSoapMessage* reply) const;
   void processNotifyStatus(const QtSoapMessage& message,
-                                 QtSoapMessage* reply);
-  //void processGenerateUID(const QtSoapMessage& message,
-  //                               QtSoapMessage* reply);
-
-  ctkDicomHostInterface* serviceBinding;
+                                 QtSoapMessage* reply) const;
+  void processGenerateUID(const QtSoapMessage& message,
+                                 QtSoapMessage* reply) const;
+  void processGetOutputLocation(const QtSoapMessage& message,
+                                 QtSoapMessage* reply) const;
 
 };