[chronojump] Fix on list_d



commit 3e45135d3413e07beb3ad66c36ddf1e9fa0b19b9
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Aug 2 13:15:51 2015 +0200

    Fix on list_d

 src/encoder.cs        |   10 +++++++++-
 src/sqlite/encoder.cs |    2 ++
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/encoder.cs b/src/encoder.cs
index 10160c9..06f0b51 100644
--- a/src/encoder.cs
+++ b/src/encoder.cs
@@ -1272,13 +1272,21 @@ public class EncoderConfiguration {
                        this.extraWeightGrams = Convert.ToInt32(strFull[9]);
                        this.extraWeightLength = Convert.ToDouble(Util.ChangeDecimalSeparator(strFull[10]));
                        if(strFull.Length > 11) //this param starts at 1.5.3
-                               list_d = readList_d(strFull[11]);
+                               this.list_d = readList_d(strFull[11]);
                } else {
                        this.inertiaTotal =     inertiaMachine;
                        this.extraWeightN =     0;
                        this.extraWeightGrams = 0;
                        this.extraWeightLength = 1;
                }
+
+               //if we load a signal previous to 1.5.3, put d in list_d to have something to be sent to R
+               if(this.list_d.Count == 0)
+                       this.list_d.Add(d);
+               else if (this.list_d.Count == 1 && this.list_d[0] == 0) {
+                       //check if diameter is zero is safest because some tests have been done while list_d 
has been completely implemented
+                       this.list_d[0] = this.d;
+               }
        }
        //list_d contains the different diameters (byt eh anchorages). They are stored as '='
        private List<double> readList_d(string listFromSQL) 
diff --git a/src/sqlite/encoder.cs b/src/sqlite/encoder.cs
index 4a7231d..79a100a 100644
--- a/src/sqlite/encoder.cs
+++ b/src/sqlite/encoder.cs
@@ -270,6 +270,8 @@ class SqliteEncoder : Sqlite
                                (Constants.EncoderConfigurationNames) 
                                Enum.Parse(typeof(Constants.EncoderConfigurationNames), strFull[0]) );
                        econf.ReadParamsFromSQL(strFull);
+
+                       LogB.Debug("EncoderConfiguration = " + 
econf.ToStringOutput(EncoderConfiguration.Outputs.SQL));
                        
                        //if there's no video, will be "".
                        //if there's video, will be with full path



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