|
@@ -19,9 +19,11 @@
|
|
|
|
|
|
=============================================================================*/
|
|
|
|
|
|
+// CTK includes
|
|
|
+#include "ctkDicomAppService.h"
|
|
|
#include "ctkDicomAbstractHost.h"
|
|
|
#include "ctkDicomHostServer.h"
|
|
|
-#include "ctkDicomAppService.h"
|
|
|
+#include <ctkDicomObjectLocatorCache.h>
|
|
|
|
|
|
class ctkDicomAbstractHostPrivate
|
|
|
{
|
|
@@ -34,6 +36,7 @@ public:
|
|
|
int AppPort;
|
|
|
ctkDicomHostServer* Server;
|
|
|
ctkDicomAppInterface* AppService;
|
|
|
+ ctkDicomObjectLocatorCache ObjectLocatorCache;
|
|
|
// ctkDicomAppHosting::Status
|
|
|
};
|
|
|
|
|
@@ -45,11 +48,11 @@ ctkDicomAbstractHostPrivate::ctkDicomAbstractHostPrivate(
|
|
|
ctkDicomAbstractHost* hostInterface, int hostPort, int appPort) : HostPort(hostPort), AppPort(appPort)
|
|
|
{
|
|
|
// start server
|
|
|
- if (this->HostPort==0)
|
|
|
+ if (this->HostPort == 0)
|
|
|
{
|
|
|
this->HostPort = 8080;
|
|
|
}
|
|
|
- if (this->AppPort==0)
|
|
|
+ if (this->AppPort == 0)
|
|
|
{
|
|
|
this->AppPort = 8081;
|
|
|
}
|
|
@@ -78,6 +81,11 @@ ctkDicomAbstractHost::ctkDicomAbstractHost(int hostPort, int appPort) :
|
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
+ctkDicomAbstractHost::~ctkDicomAbstractHost()
|
|
|
+{
|
|
|
+}
|
|
|
+
|
|
|
+//----------------------------------------------------------------------------
|
|
|
int ctkDicomAbstractHost::getHostPort() const
|
|
|
{
|
|
|
Q_D(const ctkDicomAbstractHost);
|
|
@@ -92,13 +100,39 @@ int ctkDicomAbstractHost::getAppPort() const
|
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
-ctkDicomAbstractHost::~ctkDicomAbstractHost()
|
|
|
+ctkDicomAppInterface* ctkDicomAbstractHost::getDicomAppService() const
|
|
|
{
|
|
|
+ Q_D(const ctkDicomAbstractHost);
|
|
|
+ return d->AppService;
|
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
-ctkDicomAppInterface* ctkDicomAbstractHost::getDicomAppService() const
|
|
|
+QList<ctkDicomAppHosting::ObjectLocator> ctkDicomAbstractHost::getData(
|
|
|
+ const QList<QUuid>& objectUUIDs,
|
|
|
+ const QList<QString>& acceptableTransferSyntaxUIDs,
|
|
|
+ bool includeBulkData)
|
|
|
+{
|
|
|
+ return this->objectLocatorCache()->getData(objectUUIDs, acceptableTransferSyntaxUIDs, includeBulkData);
|
|
|
+}
|
|
|
+
|
|
|
+//----------------------------------------------------------------------------
|
|
|
+ctkDicomObjectLocatorCache* ctkDicomAbstractHost::objectLocatorCache()const
|
|
|
{
|
|
|
Q_D(const ctkDicomAbstractHost);
|
|
|
- return d->AppService;
|
|
|
+ return const_cast<ctkDicomObjectLocatorCache*>(&d->ObjectLocatorCache);
|
|
|
+}
|
|
|
+
|
|
|
+//----------------------------------------------------------------------------
|
|
|
+bool ctkDicomAbstractHost::publishData(const ctkDicomAppHosting::AvailableData& availableData, bool lastData)
|
|
|
+{
|
|
|
+ if (!this->objectLocatorCache()->isCached(availableData))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ bool success = this->getDicomAppService()->notifyDataAvailable(availableData, lastData);
|
|
|
+ if(!success)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|