Commit 30784ee4 authored by Xavier de Blas's avatar Xavier de Blas

0.7.4 chronojump_mini prints data suitable to be on a csv (separated by

0.7.4
chronojump_mini prints data suitable to be on a csv (separated by ';')
chronojump_mini small text improvements
chronojump sorts ok countries translated
done: 543782 Pulses optimization. AVGs at difference. And
explanation on what "difference" does on every pulse type

svn path=/trunk/; revision=404
parent c483a8dd
......@@ -69,6 +69,8 @@ RESOURCES_IMAGES = -resource:images/mini/no_image.png,mini/no_image.png \
-resource:images/jump_rj_in.png,jump_rj_in.png -resource:images/mini/jump_rj_in.png,mini/jump_rj_in.png \
-resource:images/run_simple.png,run_simple.png -resource:images/mini/run_simple.png,mini/run_simple.png \
-resource:images/run_interval.png,run_interval.png -resource:images/mini/run_interval.png,mini/run_interval.png \
-resource:images/pulse_free.png,pulse_free.png -resource:images/mini/pulse_free.png,mini/pulse_free.png \
-resource:images/pulse_custom.png,pulse_custom.png -resource:images/mini/pulse_custom.png,mini/pulse_custom.png \
-resource:images/stock_bell.png,stock_bell.png \
-resource:images/stock_bell_green.png,stock_bell_green.png \
-resource:images/stock_bell_red.png,stock_bell_red.png \
......
......@@ -16,5 +16,5 @@ exit
:ExecuteChronojump
cd ..\data
"%monoFullPath%" "chronojump_mini.prg %*"
"%monoFullPath%" "chronojump_mini.prg"
pause
CHRONOJUMP DETAILED CHANGELOG:
27 jul 2008
0.7.4
chronojump_mini prints data suitable to be on a csv (separated by ';')
chronojump_mini small text improvements
chronojump sorts ok countries translated
done: 543782 Pulses optimization. AVGs at difference. And
explanation on what "difference" does on every pulse type
23 jul 2008
0.7.3.5
done: 543783 chronojump_mini output file and params
......
......@@ -12265,6 +12265,7 @@ options</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_pulse_free_activate" last_modification_time="Mon, 01 May 2006 17:43:47 GMT"/>
<signal name="enter" handler="on_button_enter" last_modification_time="Sat, 26 Jul 2008 22:08:49 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
......@@ -12283,6 +12284,7 @@ options</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_pulse_custom_activate" last_modification_time="Mon, 01 May 2006 17:44:15 GMT"/>
<signal name="enter" handler="on_button_enter" last_modification_time="Sat, 26 Jul 2008 22:09:00 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
......
......@@ -67,6 +67,7 @@ class Test {
//output file stuff
fileName = manageFileName(fileName, defaultFileName);
writer = File.CreateText(fileName);
//detection of ports
string messageInfo;
......@@ -160,7 +161,10 @@ class Test {
Console.WriteLine(Catalog.GetString("Press CTRL-c for ending session"));
Console.WriteLine("-----------------------------------------");
int count = 1;
double count = 1.0;
Console.WriteLine("\tcount\tTC(ms)\tTF(ms)");
writer.WriteLine("count;TC(ms);TF(ms)");
while(true) {
//-- Esperar a que llegue una trama
......@@ -184,8 +188,8 @@ class Test {
toff = timestamp;
//-- Imprimir informacion
Console.WriteLine(count + " TF: {0:f1} ms",toff);
writer.WriteLine(count + " TF: {0:f1} ms",toff);
Console.WriteLine("{0:f1}",toff);
writer.WriteLine("{0:f1}",toff);
}
break;
......@@ -201,15 +205,15 @@ class Test {
ton = timestamp;
//-- Imprimir informacion
Console.WriteLine(count + " TC: {0:f1} ms",ton);
writer.WriteLine(count + " TC: {0:f1} ms",ton);
Console.Write(count + "\t{0:f1}\t",ton);
writer.Write(count + ";{0:f1};",ton);
}
break;
}
writer.Flush();
count ++;
count += .5;
}
}
......@@ -270,6 +274,8 @@ class Test {
Console.WriteLine(Catalog.GetString("Do you want to output data to a file?") + " [y/n]");
string option=Console.ReadLine();
if(option == "Y" || option == "y") {
Console.WriteLine(Catalog.GetString("If you want to open it with an Spreadsheet like Gnumeric, OpenOffice or MS Office, we recomend to use .csv extension.\neg: 'test.csv'"));
Console.WriteLine(string.Format(Catalog.GetString("File will be available at directory: {0}"), Path.GetFullPath(".." + Path.DirectorySeparatorChar + "data")));
Console.WriteLine(Catalog.GetString("Please, write filename:"));
fileName=Console.ReadLine();
}
......
......@@ -120,6 +120,7 @@ public class ChronoJumpWindow
[Widget] Gtk.Button button_run_interval_by_time;
[Widget] Gtk.Button button_run_interval_unlimited;
[Widget] Gtk.Button button_reaction_time_execute;
[Widget] Gtk.Button button_pulse_free;
[Widget] Gtk.Button button_pulse_custom;
[Widget] Gtk.Button button_pulse_more;
......@@ -2228,9 +2229,13 @@ Log.WriteLine("+++++++++++++++++ 7 ++++++++++++++++");
currentEventType = new RunType("byTime");
} else if(o == (object) button_run_interval_unlimited) {
currentEventType = new RunType("unlimited");
}
//reactionTime
//pulse
} else if(o == (object) button_pulse_free) {
currentEventType = new PulseType("Free");
} else if(o == (object) button_pulse_custom) {
currentEventType = new PulseType("Custom");
}
changeTestImage(currentEventType.Type.ToString(), currentEventType.Name, currentEventType.ImageFileName);
}
......
......@@ -1033,6 +1033,8 @@ public class PersonAddModifyWindow
countriesTranslated[i++] = myStrFull[2];
}
}
//sort array (except first row)
System.Array.Sort(countriesTranslated, 1, countriesTranslated.Length-1);
UtilGtk.ComboUpdate(combo_countries, countriesTranslated, "");
combo_countries.Active = UtilGtk.ComboMakeActive(countriesTranslated,
......
......@@ -21,6 +21,7 @@
using System;
using System.Data;
using Mono.Unix;
public class PulseType : EventType
{
......@@ -38,9 +39,22 @@ public class PulseType : EventType
this.name = name;
//if this changes, sqlite/pulseType.cs initialize table should change
if(name == "Free" || name == "Custom") {
if(name == "Free") {
fixedPulse = -1;
totalPulsesNum = -1;
imageFileName = "pulse_free.png";
description = Catalog.GetString("Pulse free");
longDescription =
Catalog.GetString("User executes a pulse without a predefined tempo. <i>Difference</i> will show the difference between a pulse and it's preceeding pulse.");
} else if(name == "Custom") {
fixedPulse = -1;
totalPulsesNum = -1;
imageFileName = "pulse_custom.png";
description = Catalog.GetString("Pulse custom");
longDescription =
Catalog.GetString("User executes a pulse trying to follow a predefined tempo and optionally with a fixed number of pulsations. <i>Difference</i> will show the difference between a a pulse and the predefined pulse.");
}
}
......
......@@ -102,19 +102,8 @@ public class TreeViewPulses : TreeViewEvent
{
Pulse newPulse = (Pulse)myObject;
//check the time
string [] myStringFull = newPulse.TimesString.Split(new char[] {'='});
string timeInterval = myStringFull[lineCount];
//if fixedPulse is not defined, comparate each pulse with the averave
double pulseToComparate = 0;
if(newPulse.FixedPulse == -1)
pulseToComparate = Util.GetAverage(newPulse.TimesString);
else
pulseToComparate = newPulse.FixedPulse;
string timeInterval = getTimeInterval(newPulse, lineCount);
double pulseToComparate = getPulseToComparate(newPulse);
double absoluteError = Convert.ToDouble(timeInterval) - pulseToComparate;
double relativeError = absoluteError * 100 / pulseToComparate;
......@@ -154,8 +143,8 @@ public class TreeViewPulses : TreeViewEvent
int count = 0;
myData[count++] = Catalog.GetString("AVG");
myData[count++] = Util.TrimDecimals( Util.GetAverage(newPulse.TimesString).ToString(), pDN );
myData[count++] = "";
myData[count++] = "";
myData[count++] = "|" + Util.TrimDecimals( getAVGDifference(newPulse, false).ToString(), pDN ) + "|";
myData[count++] = "|" + Util.TrimDecimals( getAVGDifference(newPulse, true).ToString(), pDN ) + "|";
myData[count++] = "";
myData[count++] = newPulse.UniqueID.ToString();
......@@ -191,4 +180,41 @@ public class TreeViewPulses : TreeViewEvent
return myStringFull.Length;
}
private string getTimeInterval(Pulse newPulse, int lineCount) {
//check the time
string [] myStringFull = newPulse.TimesString.Split(new char[] {'='});
return myStringFull[lineCount];
}
private double getPulseToComparate(Pulse newPulse) {
//if fixedPulse is not defined, comparate each pulse with the averave
double pulseToComparate = 0;
if(newPulse.FixedPulse == -1)
pulseToComparate = Util.GetAverage(newPulse.TimesString);
else
pulseToComparate = newPulse.FixedPulse;
return pulseToComparate;
}
//gets the absolute (positive) value of differences and makes avg
private double getAVGDifference(Pulse newPulse, bool percent) {
double pulseToComparate = getPulseToComparate(newPulse);
double error = 0;
double errorCount = 0;
string [] times = newPulse.TimesString.Split(new char[] {'='});
foreach(string myTime in times) {
error = Math.Abs(Convert.ToDouble(myTime) - pulseToComparate);
if(percent)
error = error * 100 / pulseToComparate;
errorCount += error;
}
return errorCount / (double) times.Length;
}
}
......@@ -861,4 +861,12 @@ public class Util
return result;
}
/*
//converts all values to positive
public static string StringValuesAbsolute (string myString) {
return myString.Trim('-');
}
*/
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment