changeset 3216:c9a71eb4edcf

fix basic plugin sample
author s.jodogne@gmail.com
date Tue, 12 Feb 2019 17:27:33 +0100
parents 4924972bce77
children cf8cbeb35f33 fcc2b99feaaf
files Plugins/Include/orthanc/OrthancCPlugin.h Plugins/Samples/Basic/Plugin.c
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Include/orthanc/OrthancCPlugin.h	Mon Feb 11 06:46:19 2019 +0100
+++ b/Plugins/Include/orthanc/OrthancCPlugin.h	Tue Feb 12 17:27:33 2019 +0100
@@ -175,7 +175,7 @@
 /**
  * For Microsoft Visual Studio, a compatibility "stdint.h" can be
  * downloaded at the following URL:
- * https://orthanc.googlecode.com/hg/Resources/ThirdParty/VisualStudio/stdint.h
+ * https://bitbucket.org/sjodogne/orthanc/raw/default/Resources/ThirdParty/VisualStudio/stdint.h
  **/
 #include <stdint.h>
 
--- a/Plugins/Samples/Basic/Plugin.c	Mon Feb 11 06:46:19 2019 +0100
+++ b/Plugins/Samples/Basic/Plugin.c	Tue Feb 12 17:27:33 2019 +0100
@@ -318,9 +318,9 @@
   }
 
   json = OrthancPluginEncodeDicomWebXml(context,
-                                         OrthancPluginGetInstanceData(context, instance),
-                                         OrthancPluginGetInstanceSize(context, instance),
-                                         DicomWebBinaryCallback);
+                                        OrthancPluginGetInstanceData(context, instance),
+                                        OrthancPluginGetInstanceSize(context, instance),
+                                        DicomWebBinaryCallback);
   if (first)
   {
     printf("[%s]\n", json);
@@ -337,10 +337,11 @@
                                                             OrthancPluginResourceType resourceType,
                                                             const char* resourceId)
 {
+  char info[1024];
+
   OrthancPluginMemoryBuffer tmp;
   memset(&tmp, 0, sizeof(tmp));
 
-  char info[1024];
   sprintf(info, "Change %d on resource %s of type %d", changeType,
           (resourceId == NULL ? "<none>" : resourceId), resourceType);
   OrthancPluginLogWarning(context, info);
@@ -425,7 +426,8 @@
 ORTHANC_PLUGINS_API void RefreshMetrics()
 {
   static unsigned int count = 0;
-  OrthancPluginSetMetricsValue(context, "sample_counter", count++, OrthancPluginMetricsType_Default); 
+  OrthancPluginSetMetricsValue(context, "sample_counter", 
+	  (float) (count++), OrthancPluginMetricsType_Default); 
 }