[chronojump] Fixed recent bug on encoder analysis graph
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed recent bug on encoder analysis graph
- Date: Sat, 6 Dec 2014 23:11:14 +0000 (UTC)
commit 78e19634eab9793fc523adabb44b39d73dda2d4f
Author: Xavier de Blas <xaviblas gmail com>
Date: Sun Dec 7 00:10:31 2014 +0100
Fixed recent bug on encoder analysis graph
encoder/graph.R | 8 ++++----
src/gui/encoder.cs | 10 ----------
2 files changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 52cc3ac..daa5433 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -320,7 +320,7 @@ findCurves <- function(displacement, eccon, min_height, draw, title) {
#called on "ec" and "ce" to have a smoothingOneEC for every curve
#this smoothingOneEC has produce same speeds than smoothing "c"
-findSmoothingsEC <- function(displacement, curves, eccon, smoothingOneC) {
+findSmoothingsEC <- function(singleFile, displacement, curves, eccon, smoothingOneC) {
smoothings = NULL
n=length(curves[,1])
@@ -335,7 +335,7 @@ findSmoothingsEC <- function(displacement, curves, eccon, smoothingOneC) {
#on every curve...
for(i in 1:n) {
#maybe the global eccon == "ec" or "ce" but the individual eccon of each curve is
"c", then just do the same as above
- if(curves[i,8] == "c")
+ if( (singleFile && eccon == "c") || (! singleFile && curves[i,8] == "c") )
smoothings[i] = 0
else {
eccentric.concentric = displacement[curves[i,1]:curves[i,2]]
@@ -2484,7 +2484,7 @@ doProcess <- function(options) {
print(curves)
#find SmoothingsEC
- SmoothingsEC = findSmoothingsEC(displacement, curves, Eccon, SmoothingOneC)
+ SmoothingsEC = findSmoothingsEC(singleFile, displacement, curves, Eccon, SmoothingOneC)
} else { #singleFile == True. reads a signal file
displacement=scan(file=File,sep=",")
#if data file ends with comma. Last character will be an NA. remove it
@@ -2538,7 +2538,7 @@ doProcess <- function(options) {
}
#find SmoothingsEC
- SmoothingsEC = findSmoothingsEC(displacement, curves, Eccon, SmoothingOneC)
+ SmoothingsEC = findSmoothingsEC(singleFile, displacement, curves, Eccon, SmoothingOneC)
print(c("SmoothingsEC:",SmoothingsEC))
print("curves after reduceCurveBySpeed")
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index f1ed791..cc2f445 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -2188,11 +2188,9 @@ public partial class ChronoJumpWindow
if(! check_encoder_analyze_eccon_together.Active)
myEccon = "ecS";
int myCurveNum = -1;
-Log.Write(" A ");
if(sendAnalysis == "single")
myCurveNum = Convert.ToInt32(UtilGtk.ComboGetActive(
combo_encoder_analyze_curve_num_combo));
-Log.Write(" A ");
dataFileName = UtilEncoder.GetEncoderGraphInputMulti();
@@ -2279,16 +2277,13 @@ Log.Write(" A ");
EncoderExercise exTemp = (EncoderExercise)
SqliteEncoder.SelectEncoderExercises(
false , exerciseOld, false)[0];
-Log.Write(" A ");
sendAnalysis = "1RMAnyExercise";
analysisVariables = Util.ConvertToPoint(exTemp.speed1RM) + ";" +
SqlitePreferences.Select("encoder1RMMethod");
analysisOptions = "p";
-Log.Write(" A ");
}
}
-Log.Write(" A ");
//-1 because data will be different on any curve
ep = new EncoderParams(
-1,
@@ -2377,7 +2372,6 @@ Log.Write(" A ");
fullURL = eSQL.GetFullURL(true); //convertPathToR
}
-Log.Write(" A ");
writer.WriteLine(eSQL.status + "," +
Util.ChangeChars(seriesName,","," ") + "," + //person name
cannot have commas
ex.name + "," +
@@ -2405,15 +2399,12 @@ Log.Write(" A ");
EncoderExercise ex = (EncoderExercise) SqliteEncoder.SelectEncoderExercises(
false, getExerciseIDFromCombo(), false)[0];
-Log.Write(" A ");
sendAnalysis = "1RMAnyExercise";
analysisVariables = Util.ConvertToPoint(ex.speed1RM) + ";" +
SqlitePreferences.Select("encoder1RMMethod");
analysisOptions = "p";
-Log.Write(" A ");
}
-Log.Write(" A ");
ep = new EncoderParams(
(int) encoderCaptureOptionsWin.spin_encoder_capture_min_height.Value,
getExercisePercentBodyWeightFromCombo (),
@@ -2430,7 +2421,6 @@ Log.Write(" A ");
image_encoder_height,
preferences.CSVExportDecimalSeparator
);
-Log.Write(" A ");
dataFileName = UtilEncoder.GetEncoderDataTempFileName();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]