diff Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp @ 1448:dad6a2fe6fc7 loader-injection-feature

Added setters to control relative priority of CT series loader requests.
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 02 Jun 2020 13:16:40 +0200
parents afdd5be8731c
children 30deba7bc8e2
line wrap: on
line diff
--- a/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp	Tue Jun 02 12:34:27 2020 +0200
+++ b/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp	Tue Jun 02 13:16:40 2020 +0200
@@ -322,7 +322,7 @@
       {
         std::unique_ptr<OrthancStone::ILoadersContext::ILock> lock(loadersContext_.Lock());
         boost::shared_ptr<IObserver> observer(GetSharedObserver());
-        lock->Schedule(observer, 0, command.release()); // TODO: priority!
+        lock->Schedule(observer, sliceSchedulingPriority_, command.release());
       }
     }
     else
@@ -479,6 +479,33 @@
     SetSliceContent(GetSliceIndexPayload(message.GetOrigin()), message.GetImage(), quality);
   }
 
+
+  void  OrthancSeriesVolumeProgressiveLoader::SetMetadataSchedulingPriority(int p)
+  {
+    medadataSchedulingPriority_ = p;
+  }
+
+  int   OrthancSeriesVolumeProgressiveLoader::GetMetadataSchedulingPriority() const
+  {
+    return medadataSchedulingPriority_;
+  }
+
+  void  OrthancSeriesVolumeProgressiveLoader::SetSliceSchedulingPriority(int p)
+  {
+    sliceSchedulingPriority_ = p;
+  }
+    
+  int   OrthancSeriesVolumeProgressiveLoader::GetSliceSchedulingPriority() const
+  {
+    return sliceSchedulingPriority_;
+  }
+
+  void  OrthancSeriesVolumeProgressiveLoader::SetSchedulingPriority(int p)
+  {
+    medadataSchedulingPriority_ = p;
+    sliceSchedulingPriority_ = p;
+  }
+
   OrthancSeriesVolumeProgressiveLoader::OrthancSeriesVolumeProgressiveLoader(
     OrthancStone::ILoadersContext& loadersContext,
     boost::shared_ptr<OrthancStone::DicomVolumeImage> volume,
@@ -490,6 +517,8 @@
     , volume_(volume)
     , sorter_(new OrthancStone::BasicFetchingItemsSorter::Factory)
     , volumeImageReadyInHighQuality_(false)
+    , medadataSchedulingPriority_(0)
+    , sliceSchedulingPriority_(0)
   {
   }
 
@@ -560,7 +589,7 @@
       {
         std::unique_ptr<OrthancStone::ILoadersContext::ILock> lock(loadersContext_.Lock());
         boost::shared_ptr<IObserver> observer(GetSharedObserver());
-        lock->Schedule(observer, 0, command.release()); //TODO: priority!
+        lock->Schedule(observer, medadataSchedulingPriority_, command.release());
       }
     }
   }