[chronojump] ForceSensor export manages ok when person has no data



commit 423dcd392cff891778605ebb80e09ad7eeff7b85
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Feb 18 10:52:36 2021 +0100

    ForceSensor export manages ok when person has no data

 src/forceSensor.cs | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index 07755af1..bada97f0 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -2465,6 +2465,7 @@ public class ForceSensorExport
 
        private static Thread thread;
        private static bool cancel;
+       private static bool noData;
        //private static double pulseFraction; unused because its managed on pulse, better because on thread 
is working 100% on R call
 
        List<ForceSensor> fs_l;
@@ -2514,6 +2515,7 @@ public class ForceSensorExport
                this.exportFilename = exportFilename;
 
                cancel = false;
+               noData = false;
                progressbar.Fraction = 0;
                notebook.CurrentPage = 1;
 
@@ -2557,6 +2559,8 @@ public class ForceSensorExport
 
                        if(cancel)
                                new DialogMessage(Constants.MessageTypes.INFO, 
Catalog.GetString("Cancelled."));
+                       else if (noData)
+                               new DialogMessage(Constants.MessageTypes.INFO, Catalog.GetString("Missing 
data."));
                        else
                                new DialogMessage(Constants.MessageTypes.INFO,
                                                string.Format("Exported to {0}", exportFilename)// +
@@ -2583,6 +2587,14 @@ public class ForceSensorExport
        private void forceSensorExportDo()
        {
                getData();
+
+               if(fs_l.Count == 0)
+               {
+                       LogB.Information("There's no data");
+                       noData = true;
+                       return;
+               }
+
 //             if(processForceSensorSets()) //false if cancelled
 //                     writeFile();
                processForceSensorSets();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]