[chronojump] Networks encoder loss upload same criteria (do not use rep with low ROM)
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Networks encoder loss upload same criteria (do not use rep with low ROM)
- Date: Tue, 3 Mar 2020 15:58:54 +0000 (UTC)
commit 985b872c0443f043f01b4da4d7eb26b08b5f1125
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Mar 3 16:57:46 2020 +0100
Networks encoder loss upload same criteria (do not use rep with low ROM)
src/encoder.cs | 10 ++++++++--
src/json/compujumpEncoder.cs | 9 +++++++--
2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/src/encoder.cs b/src/encoder.cs
index dfe2ac03..e332d673 100644
--- a/src/encoder.cs
+++ b/src/encoder.cs
@@ -647,15 +647,17 @@ public class EncoderSignal
{
double lowest = 100000;
double highest = 0;
+ int highestPos = 0;
double eccValue = 0;
double conValue = 0;
bool ecc = true;
- //int i = 0;
+ int i = 0;
foreach (EncoderCurve curve in curves)
{
if(ecc)
{
ecc = false;
+ i++;
continue;
}
@@ -668,13 +670,17 @@ public class EncoderSignal
if(compareTo > highest)
{
highest = compareTo;
+ highestPos = i;
needChangeLowest = true; //min rep has to be after max
- } if(needChangeLowest || compareTo < lowest)
+ } if(needChangeLowest || (compareTo < lowest &&
+ ((EncoderCurve) curves[i]).GetParameter(Constants.Range) >=
.7 * ((EncoderCurve) curves[highestPos]).GetParameter(Constants.Range)
+ ))
lowest = compareTo;
//LogB.Information(string.Format("Loss ecc/con (by con) of {0}; i: {1} is: {2}",
variable, i++,
// Convert.ToInt32(UtilAll.DivideSafe(100.0 * (highest -
lowest), highest))));
+ i++;
ecc = true;
}
return Convert.ToInt32(UtilAll.DivideSafe(100.0 * (highest - lowest), highest));
diff --git a/src/json/compujumpEncoder.cs b/src/json/compujumpEncoder.cs
index 0daf98d2..3ceeb4e7 100644
--- a/src/json/compujumpEncoder.cs
+++ b/src/json/compujumpEncoder.cs
@@ -254,8 +254,9 @@ public class UploadEncoderDataObject
{
double lowest = 100000;
double highest = 0;
+ int highestPos = 0;
- //int i=0;
+ int i=0;
foreach (EncoderCurve curve in curves)
{
double compareTo = curve.MeanSpeedD;
@@ -266,12 +267,16 @@ public class UploadEncoderDataObject
if(compareTo > highest)
{
highest = compareTo;
+ highestPos = i;
needChangeLowest = true; //min rep has to be after max
}
- if(needChangeLowest || compareTo < lowest)
+ if(needChangeLowest || (compareTo < lowest &&
+ ((EncoderCurve) curves[i]).GetParameter(Constants.Range) >=
.7 * ((EncoderCurve) curves[highestPos]).GetParameter(Constants.Range)
+ ))
lowest = compareTo;
//LogB.Information(string.Format("Loss (con) of {0}; i: {1} is: {2}", by.ToString(),
i++, Convert.ToInt32(UtilAll.DivideSafe(100.0 * (highest - lowest), highest))));
+ i ++;
}
return Convert.ToInt32(UtilAll.DivideSafe(100.0 * (highest - lowest), highest));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]