ctkDicomExchangeService.cpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #include "ctkDicomExchangeService.h"
  16. #include "ctkDicomServicePrivate.h"
  17. #include "ctkDicomAppHostingTypesHelper.h"
  18. ctkDicomExchangeService::ctkDicomExchangeService(ushort port, QString path)
  19. : d(new ctkDicomServicePrivate(port, path))
  20. {
  21. }
  22. ctkDicomExchangeService::~ctkDicomExchangeService()
  23. {
  24. delete d;
  25. d = NULL;
  26. }
  27. bool ctkDicomExchangeService::notifyDataAvailable(
  28. ctkDicomAppHosting::AvailableData data, bool lastData)
  29. {
  30. //Q_D(ctkDicomService);
  31. QList<QtSoapType*> list;
  32. list << new ctkDicomSoapAvailableData("data", data);
  33. list << new ctkDicomSoapBool("lastData", lastData);
  34. const QtSoapType & result = d->askHost("notifyDataAvailable",list);
  35. return ctkDicomSoapBool::getBool(result);
  36. }
  37. QList<ctkDicomAppHosting::ObjectLocator>* ctkDicomExchangeService::getData(
  38. QList<QUuid> objectUUIDs,
  39. QList<QString> acceptableTransferSyntaxUIDs, bool includeBulkData)
  40. {
  41. //Q_D(ctkDicomService);
  42. QList<QtSoapType*> list;
  43. list << new ctkDicomSoapArrayOfUUIDS("objectUUIDS",objectUUIDs);
  44. list << new ctkDicomSoapArrayOfStringType("UID","acceptableTransferSyntaxUIDs", acceptableTransferSyntaxUIDs);
  45. list << new ctkDicomSoapBool("includeBulkData", includeBulkData);
  46. const QtSoapType & result = d->askHost("getData",list);
  47. return ctkDicomSoapArrayOfObjectLocators::getArray(static_cast<const QtSoapArray &>(result));
  48. }
  49. void ctkDicomExchangeService::releaseData(QList<QUuid> objectUUIDs)
  50. {
  51. Q_UNUSED(objectUUIDs)
  52. }