Commit f26797ed authored by Xavier de Blas's avatar Xavier de Blas

improved rj execute window

	show/hide checkbox for tv/tc
	added arrows, better info jumps/time, nicer window
	simulated mode now uses the avg progressbars

written SqliteJumps.FindBadRjs for find old rjs with different number of tcs than tvs
parent d31f1e67
CHANGELOG:
1 jan 2006
improved rj execute window
show/hide checkbox for tv/tc
added arrows, better info jumps/time, nicer window
simulated mode now uses the avg progressbars
written SqliteJumps.FindBadRjs for find old rjs with different number of tcs than tvs
30 des 2005
window for jump reactive executing with realtime info done.
......
No preview for this file type
......@@ -13004,7 +13004,7 @@ If you need more, just repeat the operation later</property>
<child>
<widget class="GtkTable" id="table26">
<property name="visible">True</property>
<property name="n_rows">5</property>
<property name="n_rows">7</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">4</property>
......@@ -13097,6 +13097,7 @@ If you need more, just repeat the operation later</property>
<property name="orientation">GTK_PROGRESS_TOP_TO_BOTTOM</property>
<property name="fraction">0</property>
<property name="pulse_step">0.10000000149</property>
<property name="text" translatable="yes"></property>
<property name="ellipsize">PANGO_ELLIPSIZE_END</property>
</widget>
<packing>
......@@ -13233,8 +13234,7 @@ If you need more, just repeat the operation later</property>
</child>
<child>
<widget class="GtkLabel" id="label187">
<property name="visible">True</property>
<widget class="GtkLabel" id="label_tv_tc">
<property name="label" translatable="yes">TV/TC</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
......@@ -13261,8 +13261,7 @@ If you need more, just repeat the operation later</property>
</child>
<child>
<widget class="GtkHBox" id="hbox125">
<property name="visible">True</property>
<widget class="GtkHBox" id="hbox_tv_tc">
<property name="homogeneous">True</property>
<property name="spacing">8</property>
......@@ -13371,10 +13370,9 @@ If you need more, just repeat the operation later</property>
</child>
<child>
<widget class="GtkVBox" id="vbox60">
<property name="visible">True</property>
<widget class="GtkVBox" id="vbox_tv_tc">
<property name="homogeneous">False</property>
<property name="spacing">65</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label192">
......@@ -13401,6 +13399,23 @@ If you need more, just repeat the operation later</property>
</packing>
</child>
<child>
<widget class="GtkImage" id="image1467">
<property name="visible">True</property>
<property name="stock">gtk-go-up</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label193">
<property name="visible">True</property>
......@@ -13440,7 +13455,7 @@ If you need more, just repeat the operation later</property>
<widget class="GtkVBox" id="vbox59">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">65</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label190">
......@@ -13467,6 +13482,23 @@ If you need more, just repeat the operation later</property>
</packing>
</child>
<child>
<widget class="GtkImage" id="image1466">
<property name="visible">True</property>
<property name="stock">gtk-go-down</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label191">
<property name="visible">True</property>
......@@ -13502,24 +13534,11 @@ If you need more, just repeat the operation later</property>
</packing>
</child>
<child>
<widget class="GtkHSeparator" id="hseparator10">
<property name="visible">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox58">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">65</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label189">
......@@ -13546,6 +13565,23 @@ If you need more, just repeat the operation later</property>
</packing>
</child>
<child>
<widget class="GtkImage" id="image1465">
<property name="visible">True</property>
<property name="stock">gtk-go-up</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label188">
<property name="visible">True</property>
......@@ -13580,75 +13616,193 @@ If you need more, just repeat the operation later</property>
<property name="y_options">fill</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox126">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">4</property>
<child>
<widget class="GtkCheckButton" id="checkbutton_show_tv_tc">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">show TV/TC</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<signal name="clicked" handler="on_checkbutton_show_tv_tc_clicked" last_modification_time="Sat, 31 Dec 2005 13:34:38 GMT"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkProgressBar" id="progressbar_jumps">
<widget class="GtkVBox" id="vbox64">
<property name="visible">True</property>
<property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
<property name="fraction">0</property>
<property name="pulse_step">0.10000000149</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkProgressBar" id="progressbar_execution">
<property name="width_request">148</property>
<property name="visible">True</property>
<property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
<property name="fraction">0</property>
<property name="pulse_step">0.10000000149</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label_extra_value">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label_extra">
<widget class="GtkHSeparator" id="hseparator10">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button_finish">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Finish jump (save jump until this moment)</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-goto-last</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_finish_clicked" last_modification_time="Fri, 30 Dec 2005 12:13:43 GMT"/>
<child>
<widget class="GtkImage" id="image1468">
<property name="visible">True</property>
<property name="stock">gtk-goto-last</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox63">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label_progress_name">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label_extra_name">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">fill</property>
</packing>
</child>
</widget>
......
......@@ -10,7 +10,6 @@ chronojump 0.5
- edit reactive jump and intervalic run [DONE]
- stats checkboxes selectable by an outside combo with (all, none, invert, man, woman, ...) [DONE]
- chronojump should be able of reading from usb with a serial-usb cable (usually /dev/ttyUSB0), and with a pcmcia (usually /dev/ttyS1) or others. Store in sqlite preferences [DONE]
- web: add a printed from in the print pages (without the "print" directory), add a little image in the print
chronojump 0.6
--------------
......
......@@ -277,6 +277,8 @@ public class ChronoJump
} else {
Sqlite.AddChronopicPortNameIfNotExists();
Console.WriteLine ( Catalog.GetString ("tables already created") );
//check for bad Rjs (activate if program crashes and you use it in the same db before v.0.41)
//SqliteJump.FindBadRjs();
}
cpRunning = false;
......@@ -1624,7 +1626,7 @@ public class ChronoJump
//if user clicked in finish earlier
if(currentJumpRj.Finish) {
currentJumpRj.Jumps = Util.GetNumberOfJumps(currentJumpRj.TvString);
currentJumpRj.Jumps = Util.GetNumberOfJumps(currentJumpRj.TvString, false);
if(currentJumpRj.JumpsLimited) {
currentJumpRj.Limited = currentJumpRj.Jumps.ToString() + "J";
} else {
......@@ -1899,7 +1901,7 @@ public class ChronoJump
//if user clicked in finish earlier
if(currentRunInterval.Finish) {
currentRunInterval.Tracks = Util.GetNumberOfJumps(currentRunInterval.IntervalTimesString);
currentRunInterval.Tracks = Util.GetNumberOfJumps(currentRunInterval.IntervalTimesString, false);
if(currentRunInterval.TracksLimited) {
currentRunInterval.Limited = currentRunInterval.Tracks.ToString() + "R";
} else {
......
......@@ -604,7 +604,7 @@ public class RepairJumpRjWindow
//calculate other variables needed for jumpRj creation
int jumps = Util.GetNumberOfJumps(tvString);
int jumps = Util.GetNumberOfJumps(tvString, false);
string limitString = "";
if(jumpType.FixedValue > 0) {
......@@ -1263,7 +1263,7 @@ public class JumpsRjMoreWindow
}
//--------------------------------------------------------
//---------------- JUMP RJ DOING WIDGET ------------------
//---------------- JUMP RJ EXECUTE WIDGET ----------------
//--------------------------------------------------------
public class JumpRjExecuteWindow
......@@ -1272,7 +1272,9 @@ public class JumpRjExecuteWindow
[Widget] Gtk.Label label_jumper;
[Widget] Gtk.Label label_jumptype;
[Widget] Gtk.Label label_extra;
[Widget] Gtk.Label label_progress_name;
[Widget] Gtk.Label label_extra_name;
[Widget] Gtk.Label label_extra_value;
[Widget] Gtk.ProgressBar progressbar_tv_current;
[Widget] Gtk.ProgressBar progressbar_tc_current;
......@@ -1283,7 +1285,12 @@ public class JumpRjExecuteWindow
[Widget] Gtk.ProgressBar progressbar_tv_tc_avg_1up;
[Widget] Gtk.ProgressBar progressbar_tv_tc_avg_0;
[Widget] Gtk.ProgressBar progressbar_jumps;
[Widget] Gtk.ProgressBar progressbar_execution;
[Widget] Gtk.CheckButton checkbutton_show_tv_tc;
[Widget] Gtk.Box hbox_tv_tc;
[Widget] Gtk.Box vbox_tv_tc;
[Widget] Gtk.Label label_tv_tc;
[Widget] Gtk.Button button_cancel;
[Widget] Gtk.Button button_finish;
......@@ -1291,6 +1298,7 @@ public class JumpRjExecuteWindow
int pDN;
double limit;
bool jumpsLimited;
static bool showTvTc = false;
static JumpRjExecuteWindow JumpRjExecuteWindowBox;
Gtk.Window parent;
......@@ -1300,6 +1308,9 @@ public class JumpRjExecuteWindow
gladeXML.Autoconnect(this);
this.parent = parent;
//in first rj jump in a session, always doesn't show the tv/tc
//showTvTc = false;
}
static public JumpRjExecuteWindow Show (Gtk.Window parent, string jumperName, string jumpType,
......@@ -1323,7 +1334,7 @@ public class JumpRjExecuteWindow
this.jumpsLimited = jumpsLimited;
this.label_jumper.Text = jumperName;
this.label_jumptype.Text = jumpType;
this.label_extra.Text = "";
this.label_extra_value.Text = "";
progressbar_tv_current.Fraction = 0;
progressbar_tc_current.Fraction = 0;
......@@ -1333,7 +1344,7 @@ public class JumpRjExecuteWindow
progressbar_tc_avg.Fraction = 0;
progressbar_tv_tc_avg_1up.Fraction = 0;
progressbar_tv_tc_avg_0.Fraction = 0;
progressbar_jumps.Fraction = 0;
progressbar_execution.Fraction = 0;
progressbar_tv_current.Text = "";
progressbar_tc_current.Text = "";
......@@ -1343,10 +1354,41 @@ public class JumpRjExecuteWindow
progressbar_tc_avg.Text = "";
progressbar_tv_tc_avg_1up.Text = "";
progressbar_tv_tc_avg_0.Text = "";
progressbar_jumps.Text = "";
progressbar_execution.Text = "";
button_finish.Sensitive = true;
button_cancel.Sensitive = true;
if(showTvTc) {
tv_tc_show_hide(true);
checkbutton_show_tv_tc.Active = true;
} else {
tv_tc_show_hide(false);
checkbutton_show_tv_tc.Active = false;
}
}
void on_checkbutton_show_tv_tc_clicked (object o, EventArgs args)
{
if(checkbutton_show_tv_tc.Active) {
tv_tc_show_hide(true);
showTvTc = true;
} else {
tv_tc_show_hide(false);
showTvTc = false;
}
}
void tv_tc_show_hide (bool show) {
if(show) {
hbox_tv_tc.Show();
vbox_tv_tc.Show();
label_tv_tc.Show();
} else {
hbox_tv_tc.Hide();
vbox_tv_tc.Hide();
label_tv_tc.Hide();
}
}
public void JumpEndedHideButtons() {
......@@ -1355,7 +1397,7 @@ public class JumpRjExecuteWindow
//if it was an unlimited jump, put the jumpsBar at end
if(limit == -1) {
progressbar_jumps.Fraction = 1.0;
progressbar_execution.Fraction = 1.0;
}
}
......@@ -1382,12 +1424,13 @@ public class JumpRjExecuteWindow
JumpRjExecuteWindowBox = null;
}
public void ProgressbarJumps (double jumps, double time)
public void ProgressbarExecution (double jumps, double time)
{
if(limit == -1) { //unlimited jump (until 'finish' is clicked)
progressbar_jumps.Pulse();
label_extra.Text = string.Format("{0}j {1}s", jumps.ToString(),
progressbar_execution.Pulse();
label_progress_name.Text = "";
label_extra_name.Text = "";
label_extra_value.Text = string.Format(Catalog.GetString("{0} jumps; {1} seconds"), jumps.ToString(),
Util.TrimDecimals(time.ToString(), pDN));
} else {
double myFraction;
......@@ -1401,17 +1444,19 @@ public class JumpRjExecuteWindow
else if(myFraction < 0)
myFraction = 0;
progressbar_jumps.Fraction = myFraction;
progressbar_execution.Fraction = myFraction;
if(jumpsLimited) {
progressbar_jumps.Text = jumps.ToString() +
" / " + limit.ToString() + Catalog.GetString("jumps");
label_extra.Text = Util.TrimDecimals(time.ToString(), pDN) + "s";
label_progress_name.Text = Catalog.GetString("Jumps");
progressbar_execution.Text = jumps.ToString() + " / " + limit.ToString();
label_extra_name.Text = Catalog.GetString("Time");
label_extra_value.Text = Util.TrimDecimals(time.ToString(), pDN);
}
else {
progressbar_jumps.Text = Util.TrimDecimals(time.ToString(), pDN) +
" / " + limit.ToString() + Catalog.GetString("seconds");
label_extra.Text = jumps + "j";
label_progress_name.Text = Catalog.GetString("Time");
progressbar_execution.Text = Util.TrimDecimals(time.ToString(), pDN) + " / " + limit.ToString();
label_extra_name.Text = Catalog.GetString("Jumps");
label_extra_value.Text = jumps.ToString();
}
}
}
......
......@@ -537,10 +537,6 @@ public class PersonAddWindow {
PersonAddWindowBox = null;
}
void on_combobox_prova_changed (object o, EventArgs args) {
Console.WriteLine("changed!!");
}
void on_button_accept_clicked (object o, EventArgs args)
{
//separate by '/' for not confusing with the ':' separation between the other values
......
......@@ -487,7 +487,7 @@ public class RepairRunIntervalWindow
//calculate other variables needed for runInterval creation
int runs = Util.GetNumberOfJumps(timeString); //don't need a GetNumberOfRuns, this works
int runs = Util.GetNumberOfJumps(timeString, false); //don't need a GetNumberOfRuns, this works
string limitString = "";
if(runType.FixedValue > 0) {
......
......@@ -547,8 +547,12 @@ public class JumpRj : Jump
jumpRjExecuteWin.ProgressbarTvCurrent = 0;
}
//in simulated only show the progressbarJumps at the end
jumpRjExecuteWin.ProgressbarJumps(limitAsDouble, Util.GetTotalTime(tcString, tvString));
//in simulated only show the progressbarExecution, and the AVGs at the end
jumpRjExecuteWin.ProgressbarExecution(limitAsDouble, Util.GetTotalTime(tcString, tvString));
jumpRjExecuteWin.ProgressbarTcAvg = Util.GetAverage(tcString);
jumpRjExecuteWin.ProgressbarTvAvg = Util.GetAverage(tvString);
jumpRjExecuteWin.ProgressbarTvTcAvg =
Util.GetAverage(tvString) / Util.GetAverage(tcString);
//write jump
write();
......@@ -622,7 +626,7 @@ public class JumpRj : Jump
do {
//update the progressBar if limit is time (and it's not an unlimited reactive jump)
if ( ! jumpsLimited && limitAsDouble != -1) {
jumpRjExecuteWin.ProgressbarJumps(tvCount, Util.GetTotalTime(tcString, tvString));
jumpRjExecuteWin.ProgressbarExecution(tvCount, Util.GetTotalTime(tcString, tvString));
}
respuesta = cp.Read_event(out timestamp, out platformState);
......@@ -684,12 +688,12 @@ public class JumpRj : Jump
//if reactive jump is "unlimited" not limited by jumps, nor time,
//then play with the progress bar until finish button is pressed
if(limitAsDouble == -1) {
jumpRjExecuteWin.ProgressbarJumps(tvCount, Util.GetTotalTime(tcString, tvString));
jumpRjExecuteWin.ProgressbarExecution(tvCount, Util.GetTotalTime(tcString, tvString));
}
else {
jumpRjExecuteWin.ProgressbarJumps(tvCount, Util.GetTotalTime(tcString, tvString));
jumpRjExecuteWin.ProgressbarExecution(tvCount, Util.GetTotalTime(tcString, tvString));
if(Util.GetNumberOfJumps(tvString) >= limitAsDouble)
if(Util.GetNumberOfJumps(tvString, false) >= limitAsDouble)
{
write();
success = true;
......@@ -706,7 +710,7 @@ public class JumpRj : Jump
} while ( ! success && ! cancel && ! finish );
if (finish) {
if(Util.GetNumberOfJumps(tcString) >= 1 && Util.GetNumberOfJumps(tvString) >= 1) {
if(Util.GetNumberOfJumps(tcString, false) >= 1 && Util.GetNumberOfJumps(tvString, false) >= 1) {
write();
} else {
//cancel a jump if clicked finish before any events done
......@@ -728,7 +732,7 @@ public class JumpRj : Jump
//if user clicked in finish earlier
if(finish) {
jumps = Util.GetNumberOfJumps(tvString);
jumps = Util.GetNumberOfJumps(tvString, false);
//if user clicked finish and last event was tc, probably there are more TCs than TVs
//if last event was tc, it has no sense, it should be deleted
......
......@@ -565,7 +565,7 @@ public class RunInterval : Run
//if user clicked in finish earlier
if(finish) {
tracks = Util.GetNumberOfJumps(intervalTimesString);
tracks = Util.GetNumberOfJumps(intervalTimesString, false);
if(tracksLimited) {
limitString = tracks.ToString() + "R";
} else {
......
......@@ -308,34 +308,45 @@ class SqliteJump : Sqlite
return myJump;
}
public static void Update(string jumpTable, int jumpID, int personID, double weight, string description)
//checks if there are Rjs with different number of TCs than TVs
//then repair database manually, and look if the jump is jumpLimited, and how many jumps there are defined
public static void FindBadRjs()
{
dbcon.Open();
dbcmd.CommandText = "UPDATE " + jumpTable +
" SET personID = " + personID +
", weight = " + Util.ConvertToPoint(weight) +
", description = '" + description +
"' WHERE uniqueID == " + jumpID ;
dbcmd.CommandText = "SELECT uniqueID, tcstring, tvstring, jumps, limited FROM jumpRj";
Console.WriteLine(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
dbcon.Close();
SqliteDataReader reader;
reader = dbcmd.ExecuteReader();
reader.Read();