[chronojump] Simulated gui lot better.Execute jump shows height
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Simulated gui lot better.Execute jump shows height
- Date: Mon, 7 Jan 2013 12:36:06 +0000 (UTC)
commit 519ce5a48cb9b4bf5aead75d9a6c6d3e490a2cf7
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Jan 7 13:33:33 2013 +0100
Simulated gui lot better.Execute jump shows height
glade/chronojump.glade | 256 ++++++++++++++++++++++++++---------------
src/constants.cs | 2 +-
src/execute/event.cs | 30 ++++--
src/execute/jump.cs | 17 +--
src/execute/multiChronopic.cs | 12 +--
src/execute/pulse.cs | 7 +-
src/execute/reactionTime.cs | 7 +-
src/execute/run.cs | 14 +--
src/gui/chronojump.cs | 58 ++++++---
src/gui/eventExecute.cs | 20 +++-
src/gui/usefulObjects.cs | 6 +-
src/util.cs | 16 +++-
src/utilGtk.cs | 35 +++++-
13 files changed, 310 insertions(+), 170 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 40ddfff..e73aa23 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -283,78 +283,86 @@
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox77">
+ <widget class="GtkViewport" id="viewport_chronopics">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">8</property>
+ <property name="shadow_type">none</property>
<child>
- <widget class="GtkHBox" id="hbox91">
+ <widget class="GtkHBox" id="hbox_chronopics">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">4</property>
+ <property name="app_paintable">True</property>
+ <property name="can_focus">True</property>
+ <property name="spacing">8</property>
<child>
- <widget class="GtkLabel" id="label_chronopics">
+ <widget class="GtkHBox" id="hbox91">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xpad">5</property>
- <property name="label" translatable="yes">Chronopics</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkLabel" id="label_chronopics">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes">Chronopics</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label_connected_chronopics">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>0</b></property>
+ <property name="use_markup">True</property>
+ <property name="ellipsize">end</property>
+ <property name="max_width_chars">25</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label_connected_chronopics">
+ <widget class="GtkButton" id="button_activate_chronopics">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>0</b></property>
- <property name="use_markup">True</property>
- <property name="ellipsize">end</property>
- <property name="max_width_chars">25</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip" translatable="yes">Connect Chronopics</property>
+ <property name="use_action_appearance">False</property>
+ <property name="relief">half</property>
+ <signal name="clicked" handler="on_chronopic_clicked" swapped="no"/>
+ <child>
+ <widget class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-connect</property>
+ </widget>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="button_activate_chronopics">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">True</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip" translatable="yes">Connect Chronopics</property>
- <property name="use_action_appearance">False</property>
- <property name="relief">half</property>
- <signal name="clicked" handler="on_chronopic_clicked" swapped="no"/>
- <child>
- <widget class="GtkImage" id="image5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-connect</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
</child>
</widget>
<packing>
@@ -6013,48 +6021,23 @@ Second Chronopic to platforms.</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox105">
+ <widget class="GtkLabel" id="event_execute_label_message">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">4</property>
- <child>
- <widget class="GtkTextView" id="event_execute_textview_message">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="wrap_mode">word</property>
- <property name="cursor_visible">False</property>
- </widget>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkImage" id="image_simulated_warning">
- <property name="can_focus">False</property>
- <property name="stock">gtk-dialog-warning</property>
- <property name="icon-size">2</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="use_markup">True</property>
+ <property name="ellipsize">end</property>
+ <property name="single_line_mode">True</property>
</widget>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="fill">True</property>
<property name="padding">2</property>
<property name="position">0</property>
</packing>
@@ -6296,7 +6279,7 @@ Second Chronopic to platforms.</property>
<widget class="GtkTable" id="event_execute_table_jump_simple_values">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="column_spacing">2</property>
<property name="row_spacing">2</property>
@@ -6309,8 +6292,8 @@ Second Chronopic to platforms.</property>
<property name="justify">center</property>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">GTK_EXPAND</property>
<property name="y_options"/>
</packing>
@@ -6325,8 +6308,8 @@ Second Chronopic to platforms.</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">GTK_EXPAND</property>
<property name="y_options"/>
</packing>
@@ -6341,8 +6324,8 @@ Second Chronopic to platforms.</property>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">GTK_EXPAND</property>
<property name="y_options"/>
</packing>
@@ -6357,6 +6340,8 @@ Second Chronopic to platforms.</property>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_EXPAND</property>
<property name="y_options"/>
</packing>
@@ -6369,6 +6354,8 @@ Second Chronopic to platforms.</property>
<property name="justify">center</property>
</widget>
<packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_EXPAND</property>
<property name="y_options"/>
</packing>
@@ -6383,6 +6370,48 @@ Second Chronopic to platforms.</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_EXPAND</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="event_execute_label_jump_simple_height_now">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="justify">center</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_EXPAND</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="event_execute_label_jump_simple_height_person">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="justify">center</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_EXPAND</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="event_execute_label_jump_simple_height_session">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="justify">center</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
<property name="x_options">GTK_EXPAND</property>
<property name="y_options"/>
</packing>
@@ -6400,7 +6429,7 @@ Second Chronopic to platforms.</property>
<widget class="GtkTable" id="event_execute_table_jump_simple">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">4</property>
<property name="row_spacing">2</property>
@@ -6408,13 +6437,14 @@ Second Chronopic to platforms.</property>
<widget class="GtkLabel" id="label282">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
<property name="label" translatable="yes">TC</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
@@ -6433,8 +6463,8 @@ Second Chronopic to platforms.</property>
</child>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
@@ -6453,6 +6483,8 @@ Second Chronopic to platforms.</property>
</child>
</widget>
<packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
@@ -6467,6 +6499,40 @@ Second Chronopic to platforms.</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEventBox" id="event_execute_eventbox_jump_simple_height">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkLabel" id="event_execute_label_jump_simple_height">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"> </property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label107">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Height</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
diff --git a/src/constants.cs b/src/constants.cs
index 5c53cb3..8e1a34f 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -462,7 +462,7 @@ public class Constants
};
public static int Simulated = -1;
- public static string SimulatedMessage = Catalog.GetString("Tests are SIMULATED until Chronopic is connected.");
+ public static string SimulatedMessage = Catalog.GetString("Tests are <b>simulated</b> until Chronopic is connected.");
public static string SimulatedTreeview = " (" + Catalog.GetString("Simulated") + ")";
public static string ChronopicOne = Catalog.GetString("All tests available except MultiChronopic.");
diff --git a/src/execute/event.cs b/src/execute/event.cs
index 1dd9095..84f7618 100644
--- a/src/execute/event.cs
+++ b/src/execute/event.cs
@@ -44,8 +44,6 @@ public class EventExecute
OFF
}
- protected Gtk.Image image_simulated_warning;
-
//don't make the waitEvent update the progressBars, just flag this variable
//and make the PulseGTK do it
protected bool needUpdateEventProgressBar;
@@ -111,7 +109,7 @@ public class EventExecute
protected States loggedState; //log of last state
//protected Gtk.ProgressBar progressBar;
- protected Gtk.TextView event_execute_textview_message;
+ protected Gtk.Label event_execute_label_message;
protected Gtk.Window app;
protected int pDN;
@@ -319,13 +317,23 @@ public class EventExecute
if(needShowCountDown)
{
feedbackMessage = countDownMessage();
- egd.Textview_message.Buffer = UtilGtk.TextViewPrint(feedbackMessage);
+ //egd.Textview_message.Buffer = UtilGtk.TextViewPrint(feedbackMessage);
+ UtilGtk.PrintLabelWithTooltip(egd.Label_message, feedbackMessage);
+ /*
+ egd.Label_message.Text = feedbackMessage;
+ egd.Label_message.UseMarkup = true;
+ egd.Label_message.TooltipText = feedbackMessage;
+ */
}
else if(needShowFeedbackMessage)
{
- egd.Textview_message.Buffer = UtilGtk.TextViewPrint(feedbackMessage);
+ //egd.Textview_message.Buffer = UtilGtk.TextViewPrint(feedbackMessage);
+ /*
+ egd.Label_message.Text = feedbackMessage;
+ egd.Label_message.TooltipText = feedbackMessage;
+ */
+ UtilGtk.PrintLabelWithTooltip(egd.Label_message, feedbackMessage);
needShowFeedbackMessage = false;
- image_simulated_warning.Visible = (feedbackMessage == Constants.SimulatedMessage);
}
@@ -338,12 +346,18 @@ public class EventExecute
private void runATouchPlatform() {
string message = Catalog.GetString("Always remember to touch platform at ending. If you don't do it, Chronojump will crash at next execution.");
- egd.Textview_message.Buffer = UtilGtk.TextViewPrint(message);
+ //egd.Textview_message.Buffer = UtilGtk.TextViewPrint(message);
+// egd.Label_message.Text = message;
+// egd.Label_message.TooltipText = feedbackMessage;
+ UtilGtk.PrintLabelWithTooltip(egd.Label_message, feedbackMessage);
}
public void RunANoStrides() {
string message = Catalog.GetString("This Run Analysis is not valid because there are no strides.");
- egd.Textview_message.Buffer = UtilGtk.TextViewPrint(message);
+ //egd.Textview_message.Buffer = UtilGtk.TextViewPrint(message);
+// egd.Label_message.Text = message;
+// egd.Label_message.TooltipText = feedbackMessage;
+ UtilGtk.PrintLabelWithTooltip(egd.Label_message, feedbackMessage);
}
protected void progressBarEventOrTimePreExecution (bool isEvent, bool percentageMode, double events)
diff --git a/src/execute/jump.cs b/src/execute/jump.cs
index 063b145..26c5a07 100644
--- a/src/execute/jump.cs
+++ b/src/execute/jump.cs
@@ -49,9 +49,8 @@ public class JumpExecute : EventExecute
//jump execution
public JumpExecute(int personID, string personName, int sessionID, string type, double fall, double weight,
- Chronopic cp, Gtk.TextView event_execute_textview_message, Gtk.Window app, int pDN, bool volumeOn,
- double progressbarLimit, ExecutingGraphData egd, string description,
- Gtk.Image image_simulated_warning
+ Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool volumeOn,
+ double progressbarLimit, ExecutingGraphData egd, string description
)
{
this.personID = personID;
@@ -62,7 +61,7 @@ public class JumpExecute : EventExecute
this.weight = weight;
this.cp = cp;
- this.event_execute_textview_message = event_execute_textview_message;
+ this.event_execute_label_message = event_execute_label_message;
this.app = app;
this.pDN = pDN;
@@ -70,8 +69,6 @@ public class JumpExecute : EventExecute
this.progressbarLimit = progressbarLimit;
this.egd = egd;
this.description = description;
- this.image_simulated_warning = image_simulated_warning;
-
if(TypeHasFall) {
hasFall = true;
@@ -460,10 +457,9 @@ public class JumpRjExecute : JumpExecute
public JumpRjExecute(int personID, string personName,
int sessionID, string type, double fall, double weight,
double limitAsDouble, bool jumpsLimited,
- Chronopic cp, Gtk.TextView event_execute_textview_message, Gtk.Window app, int pDN, bool allowFinishAfterTime,
+ Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool allowFinishAfterTime,
bool volumeOn, RepetitiveConditionsWindow repetitiveConditionsWin,
- double progressbarLimit, ExecutingGraphData egd,
- Gtk.Image image_simulated_warning
+ double progressbarLimit, ExecutingGraphData egd
)
{
this.personID = personID;
@@ -482,7 +478,7 @@ public class JumpRjExecute : JumpExecute
}
this.cp = cp;
- this.event_execute_textview_message = event_execute_textview_message;
+ this.event_execute_label_message = event_execute_label_message;
this.app = app;
this.pDN = pDN;
@@ -491,7 +487,6 @@ public class JumpRjExecute : JumpExecute
this.repetitiveConditionsWin = repetitiveConditionsWin;
this.progressbarLimit = progressbarLimit;
this.egd = egd;
- this.image_simulated_warning = image_simulated_warning;
if(TypeHasFall) { hasFall = true; }
else { hasFall = false; }
diff --git a/src/execute/multiChronopic.cs b/src/execute/multiChronopic.cs
index 51bfb93..b6d1348 100644
--- a/src/execute/multiChronopic.cs
+++ b/src/execute/multiChronopic.cs
@@ -78,7 +78,7 @@ public class MultiChronopicExecute : EventExecute
public MultiChronopicExecute(int personID, string personName, int sessionID, string type,
Chronopic cp, bool syncFirst, bool deleteFirst, string vars, Gtk.Window app,
//double progressbarLimit,
- ExecutingGraphData egd, Gtk.Image image_simulated_warning
+ ExecutingGraphData egd
) {
this.personID = personID;
this.personName = personName;
@@ -93,7 +93,6 @@ public class MultiChronopicExecute : EventExecute
this.app = app;
// this.progressbarLimit = progressbarLimit;
this.egd = egd;
- this.image_simulated_warning = image_simulated_warning;
chronopics = 1;
initValues();
@@ -102,7 +101,7 @@ public class MultiChronopicExecute : EventExecute
public MultiChronopicExecute(int personID, string personName, int sessionID, string type,
Chronopic cp, Chronopic cp2, bool syncFirst, bool deleteFirst, string vars, Gtk.Window app,
//double progressbarLimit,
- ExecutingGraphData egd, Gtk.Image image_simulated_warning
+ ExecutingGraphData egd
) {
this.personID = personID;
this.personName = personName;
@@ -118,7 +117,6 @@ public class MultiChronopicExecute : EventExecute
this.app = app;
// this.progressbarLimit = progressbarLimit;
this.egd = egd;
- this.image_simulated_warning = image_simulated_warning;
chronopics = 2;
initValues();
@@ -128,7 +126,7 @@ public class MultiChronopicExecute : EventExecute
Chronopic cp, Chronopic cp2, Chronopic cp3, bool syncFirst, bool deleteFirst, string vars,
Gtk.Window app,
//double progressbarLimit,
- ExecutingGraphData egd, Gtk.Image image_simulated_warning
+ ExecutingGraphData egd
) {
this.personID = personID;
@@ -146,7 +144,6 @@ public class MultiChronopicExecute : EventExecute
this.app = app;
// this.progressbarLimit = progressbarLimit;
this.egd = egd;
- this.image_simulated_warning = image_simulated_warning;
chronopics = 3;
initValues();
@@ -156,7 +153,7 @@ public class MultiChronopicExecute : EventExecute
Chronopic cp, Chronopic cp2, Chronopic cp3, Chronopic cp4, bool syncFirst, bool deleteFirst, string vars,
Gtk.Window app,
//double progressbarLimit,
- ExecutingGraphData egd, Gtk.Image image_simulated_warning
+ ExecutingGraphData egd
) {
this.personID = personID;
@@ -175,7 +172,6 @@ public class MultiChronopicExecute : EventExecute
this.app = app;
// this.progressbarLimit = progressbarLimit;
this.egd = egd;
- this.image_simulated_warning = image_simulated_warning;
chronopics = 4;
initValues();
diff --git a/src/execute/pulse.cs b/src/execute/pulse.cs
index ae941ed..5d57f6d 100644
--- a/src/execute/pulse.cs
+++ b/src/execute/pulse.cs
@@ -54,9 +54,9 @@ public class PulseExecute : EventExecute
//execution
public PulseExecute(int personID, string personName, int sessionID, string type, double fixedPulse, int totalPulsesNum,
- Chronopic cp, Gtk.TextView event_execute_textview_message, Gtk.Window app, int pDN, bool volumeOn,
+ Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool volumeOn,
//double progressbarLimit,
- ExecutingGraphData egd, Gtk.Image image_simulated_warning
+ ExecutingGraphData egd
)
{
this.personID = personID;
@@ -68,14 +68,13 @@ public class PulseExecute : EventExecute
this.cp = cp;
- this.event_execute_textview_message = event_execute_textview_message;
+ this.event_execute_label_message = event_execute_label_message;
this.app = app;
this.pDN = pDN;
this.volumeOn = volumeOn;
// this.progressbarLimit = progressbarLimit;
this.egd = egd;
- this.image_simulated_warning = image_simulated_warning;
fakeButtonUpdateGraph = new Gtk.Button();
fakeButtonEventEnded = new Gtk.Button();
diff --git a/src/execute/reactionTime.cs b/src/execute/reactionTime.cs
index c2208c5..0f10789 100644
--- a/src/execute/reactionTime.cs
+++ b/src/execute/reactionTime.cs
@@ -41,8 +41,8 @@ public class ReactionTimeExecute : EventExecute
//reactionTime execution
public ReactionTimeExecute(int personID, string personName, int sessionID,
- Chronopic cp, Gtk.TextView event_execute_textview_message, Gtk.Window app, int pDN, bool volumeOn,
- double progressbarLimit, ExecutingGraphData egd, Gtk.Image image_simulated_warning
+ Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool volumeOn,
+ double progressbarLimit, ExecutingGraphData egd
)
{
this.personID = personID;
@@ -50,14 +50,13 @@ public class ReactionTimeExecute : EventExecute
this.sessionID = sessionID;
this.cp = cp;
- this.event_execute_textview_message = event_execute_textview_message;
+ this.event_execute_label_message = event_execute_label_message;
this.app = app;
this.pDN = pDN;
this.volumeOn = volumeOn;
this.progressbarLimit = progressbarLimit;
this.egd = egd;
- this.image_simulated_warning = image_simulated_warning;
fakeButtonUpdateGraph = new Gtk.Button();
fakeButtonEventEnded = new Gtk.Button();
diff --git a/src/execute/run.cs b/src/execute/run.cs
index 7b136cc..2c394b6 100644
--- a/src/execute/run.cs
+++ b/src/execute/run.cs
@@ -54,12 +54,12 @@ public class RunExecute : EventExecute
//run execution
public RunExecute(int personID, int sessionID, string type, double distance,
- Chronopic cp, Gtk.TextView event_execute_textview_message, Gtk.Window app,
+ Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app,
int pDN, bool metersSecondsPreferred, bool volumeOn,
double progressbarLimit, ExecutingGraphData egd,
bool checkDoubleContact, int checkDoubleContactTime,
Constants.DoubleContact checkDoubleContactMode,
- bool speedStartArrival, Gtk.Image image_simulated_warning
+ bool speedStartArrival
)
{
this.personID = personID;
@@ -68,7 +68,7 @@ public class RunExecute : EventExecute
this.distance = distance;
this.cp = cp;
- this.event_execute_textview_message = event_execute_textview_message;
+ this.event_execute_label_message = event_execute_label_message;
this.app = app;
this.pDN = pDN;
@@ -80,7 +80,6 @@ public class RunExecute : EventExecute
this.checkDoubleContactTime = checkDoubleContactTime;
this.checkDoubleContactMode = checkDoubleContactMode;
this.speedStartArrival = speedStartArrival;
- this.image_simulated_warning = image_simulated_warning;
fakeButtonUpdateGraph = new Gtk.Button();
fakeButtonEventEnded = new Gtk.Button();
@@ -467,12 +466,12 @@ public class RunIntervalExecute : RunExecute
//run execution
public RunIntervalExecute(int personID, int sessionID, string type, double distanceInterval, double limitAsDouble, bool tracksLimited,
- Chronopic cp, Gtk.TextView event_execute_textview_message, Gtk.Window app, int pDN, bool metersSecondsPreferred,
+ Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool metersSecondsPreferred,
bool volumeOn, RepetitiveConditionsWindow repetitiveConditionsWin,
double progressbarLimit, ExecutingGraphData egd ,
bool checkDoubleContact, int checkDoubleContactTime,
Constants.DoubleContact checkDoubleContactMode,
- bool speedStartArrival, Gtk.Image image_simulated_warning
+ bool speedStartArrival
)
{
this.personID = personID;
@@ -499,7 +498,7 @@ public class RunIntervalExecute : RunExecute
this.cp = cp;
- this.event_execute_textview_message = event_execute_textview_message;
+ this.event_execute_label_message = event_execute_label_message;
this.app = app;
this.metersSecondsPreferred = metersSecondsPreferred;
@@ -512,7 +511,6 @@ public class RunIntervalExecute : RunExecute
this.checkDoubleContactTime = checkDoubleContactTime;
this.checkDoubleContactMode = checkDoubleContactMode;
this.speedStartArrival = speedStartArrival;
- this.image_simulated_warning = image_simulated_warning;
fakeButtonUpdateGraph = new Gtk.Button();
fakeButtonEventEnded = new Gtk.Button();
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index aed65ca..181c888 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -147,6 +147,9 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Box hbox_execute_test;
[Widget] Gtk.Button button_execute_test;
+ [Widget] Gtk.Viewport viewport_chronopics;
+ [Widget] Gtk.Box hbox_chronopics;
+ [Widget] Gtk.Label label_chronopics;
[Widget] Gtk.Label label_connected_chronopics;
[Widget] Gtk.Image image_simulated_warning;
//[Widget] Gtk.TextView textview_message_connected_chronopics;
@@ -3115,8 +3118,12 @@ Console.WriteLine("X");
currentEventExecute = new JumpExecute(currentPerson.UniqueID, currentPerson.Name,
currentSession.UniqueID, currentJumpType.Name, myFall, jumpWeight,
- chronopicWin.CP, event_execute_textview_message, app1, prefsDigitsNumber, volumeOn,
- progressbarLimit, egd, description, image_simulated_warning);
+ chronopicWin.CP, event_execute_label_message, app1, prefsDigitsNumber, volumeOn,
+ progressbarLimit, egd, description);
+
+
+ UtilGtk.ChronopicColors(viewport_chronopics, label_chronopics, label_connected_chronopics, chronopicWin.Connected);
+
if (!chronopicWin.Connected)
currentEventExecute.SimulateInitValues(rand);
@@ -3288,9 +3295,10 @@ Log.WriteLine("DDD 2");
currentEventExecute = new JumpRjExecute(currentPerson.UniqueID, currentPerson.Name,
currentSession.UniqueID, currentJumpRjType.Name, myFall, jumpWeight,
progressbarLimit, currentJumpRjType.JumpsLimited,
- chronopicWin.CP, event_execute_textview_message, app1, prefsDigitsNumber,
- checkbutton_allow_finish_rj_after_time.Active, volumeOn, repetitiveConditionsWin, progressbarLimit,
- egd, image_simulated_warning);
+ chronopicWin.CP, event_execute_label_message, app1, prefsDigitsNumber,
+ checkbutton_allow_finish_rj_after_time.Active, volumeOn,
+ repetitiveConditionsWin, progressbarLimit, egd
+ );
//suitable for limited by jump and time
@@ -3442,13 +3450,13 @@ Log.WriteLine("DDD 2");
currentEventExecute = new RunExecute(
currentPerson.UniqueID, currentSession.UniqueID,
currentRunType.Name, myDistance,
- chronopicWin.CP, event_execute_textview_message, app1,
+ chronopicWin.CP, event_execute_label_message, app1,
prefsDigitsNumber, metersSecondsPreferred, volumeOn,
progressbarLimit, egd,
checkbutton_runs_prevent_double_contact.Active,
(int) spinbutton_runs_prevent_double_contact.Value,
getDoubleContactModes(true), //true: runSimple
- radio_runs_speed_start_arrival.Active, image_simulated_warning
+ radio_runs_speed_start_arrival.Active
);
if (!chronopicWin.Connected)
@@ -3564,13 +3572,13 @@ Log.WriteLine("DDD 2");
currentEventExecute = new RunIntervalExecute(
currentPerson.UniqueID, currentSession.UniqueID, currentRunIntervalType.Name,
distanceInterval, progressbarLimit, currentRunIntervalType.TracksLimited,
- chronopicWin.CP, event_execute_textview_message, app1,
+ chronopicWin.CP, event_execute_label_message, app1,
prefsDigitsNumber, metersSecondsPreferred, volumeOn, repetitiveConditionsWin,
progressbarLimit, egd,
checkbutton_runs_i_prevent_double_contact.Active,
(int) spinbutton_runs_i_prevent_double_contact.Value,
getDoubleContactModes(false), //false: not runSimple
- radio_runs_i_speed_start_arrival.Active, image_simulated_warning
+ radio_runs_i_speed_start_arrival.Active
);
@@ -3682,8 +3690,9 @@ Log.WriteLine("DDD 2");
currentEventExecute = new ReactionTimeExecute(currentPerson.UniqueID, currentPerson.Name,
currentSession.UniqueID,
- chronopicWin.CP, event_execute_textview_message, app1, prefsDigitsNumber, volumeOn,
- progressbarLimit, egd, image_simulated_warning);
+ chronopicWin.CP, event_execute_label_message, app1, prefsDigitsNumber, volumeOn,
+ progressbarLimit, egd
+ );
if (!chronopicWin.Connected)
currentEventExecute.SimulateInitValues(rand);
@@ -3786,8 +3795,9 @@ Log.WriteLine("DDD 2");
currentEventExecute = new PulseExecute(currentPerson.UniqueID, currentPerson.Name,
currentSession.UniqueID, currentPulseType.Name, pulseStep, totalPulses,
- chronopicWin.CP, event_execute_textview_message, app1, prefsDigitsNumber, volumeOn,
- egd, image_simulated_warning);
+ chronopicWin.CP, event_execute_label_message,
+ app1, prefsDigitsNumber, volumeOn, egd
+ );
if(!chronopicWin.Connected)
currentEventExecute.SimulateInitValues(rand);
@@ -3865,7 +3875,7 @@ Log.WriteLine("DDD 2");
chronopicWin = ChronopicWindow.Create(cpd, recreate, volumeOn);
//chronopicWin.FakeButtonCancelled.Clicked += new EventHandler(on_chronopic_window_cancelled);
- chronopicLabels(0);
+ chronopicLabels(0, recreate);
}
private void on_chronopic_clicked (object o, EventArgs args) {
@@ -3904,12 +3914,16 @@ Log.WriteLine("DDD 2");
if(radio_mode_multi_chronopic_small.Active)
on_extra_window_multichronopic_test_changed(new object(), new EventArgs());
- chronopicLabels(cps);
+ chronopicLabels(cps, true);
}
- private void chronopicLabels(int cps) {
+ private void chronopicLabels(int cps, bool colorize) {
label_connected_chronopics.Text = "<b>" + cps.ToString() + "</b>";
label_connected_chronopics.UseMarkup = true;
+
+ if(colorize)
+ UtilGtk.ChronopicColors(viewport_chronopics, label_chronopics,
+ label_connected_chronopics, chronopicWin.Connected);
/*
string myMessage = "";
@@ -3986,7 +4000,8 @@ Log.WriteLine("DDD 2");
chronopicWin.CP,
syncAvailable, extra_window_check_multichronopic_delete_first.Active,
extra_window_spin_run_analysis_distance.Value.ToString(),
- app1, egd, image_simulated_warning);
+ app1, egd
+ );
else if(numConnected == 2)
currentEventExecute = new MultiChronopicExecute(
currentPerson.UniqueID, currentPerson.Name,
@@ -3994,7 +4009,8 @@ Log.WriteLine("DDD 2");
chronopicWin.CP, chronopicWin.CP2,
syncAvailable, extra_window_check_multichronopic_delete_first.Active,
extra_window_spin_run_analysis_distance.Value.ToString(),
- app1, egd, image_simulated_warning);
+ app1, egd
+ );
else if(numConnected == 3)
currentEventExecute = new MultiChronopicExecute(
currentPerson.UniqueID, currentPerson.Name,
@@ -4002,7 +4018,8 @@ Log.WriteLine("DDD 2");
chronopicWin.CP, chronopicWin.CP2, chronopicWin.CP3,
syncAvailable, extra_window_check_multichronopic_delete_first.Active,
extra_window_spin_run_analysis_distance.Value.ToString(),
- app1, egd, image_simulated_warning);
+ app1, egd
+ );
else if(numConnected == 4)
currentEventExecute = new MultiChronopicExecute(
currentPerson.UniqueID, currentPerson.Name,
@@ -4010,7 +4027,8 @@ Log.WriteLine("DDD 2");
chronopicWin.CP, chronopicWin.CP2, chronopicWin.CP3, chronopicWin.CP4,
syncAvailable, extra_window_check_multichronopic_delete_first.Active,
extra_window_spin_run_analysis_distance.Value.ToString(),
- app1, egd, image_simulated_warning);
+ app1, egd
+ );
//if(!chronopicWin.Connected)
// currentEventExecute.SimulateInitValues(rand);
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 4e1c03b..00ce3e3 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -44,7 +44,7 @@ public partial class ChronoJumpWindow
// [Widget] Gtk.Label event_execute_label_person;
// [Widget] Gtk.Label event_execute_label_event_type;
[Widget] Gtk.Label event_execute_label_phases_name;
- [Widget] Gtk.TextView event_execute_textview_message;
+ [Widget] Gtk.Label event_execute_label_message;
[Widget] Gtk.Label event_graph_label_graph_person;
[Widget] Gtk.Label event_graph_label_graph_test;
@@ -100,6 +100,9 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Label event_execute_label_jump_simple_tf_now;
[Widget] Gtk.Label event_execute_label_jump_simple_tf_person;
[Widget] Gtk.Label event_execute_label_jump_simple_tf_session;
+ [Widget] Gtk.Label event_execute_label_jump_simple_height_now;
+ [Widget] Gtk.Label event_execute_label_jump_simple_height_person;
+ [Widget] Gtk.Label event_execute_label_jump_simple_height_session;
[Widget] Gtk.Label event_execute_label_jump_reactive_tc_now;
[Widget] Gtk.Label event_execute_label_jump_reactive_tc_avg;
@@ -215,7 +218,8 @@ public partial class ChronoJumpWindow
event_graph_label_graph_person.Text = personName;
event_graph_label_graph_test.Text = event_execute_eventType;
- event_execute_textview_message.Buffer = UtilGtk.TextViewPrint("");
+ //event_execute_textview_message.Buffer = UtilGtk.TextViewPrint("");
+ event_execute_label_message.Text = "";
//this.event_execute_personName.Text = event_execute_personName; //"Jumps" (rjInterval), "Runs" (runInterval), "Ticks" (pulses),
this.event_execute_label_phases_name.Text = phasesName; //"Jumps" (rjInterval), "Runs" (runInterval), "Ticks" (pulses),
@@ -269,7 +273,7 @@ public partial class ChronoJumpWindow
ExecutingGraphData executingGraphData = new ExecutingGraphData(
event_execute_button_cancel, event_execute_button_finish,
- event_execute_textview_message,
+ event_execute_label_message,
event_execute_label_event_value, event_execute_label_time_value,
event_execute_progressbar_event, event_execute_progressbar_time);
return executingGraphData;
@@ -343,6 +347,9 @@ public partial class ChronoJumpWindow
event_execute_label_jump_simple_tf_now.Text = "";
event_execute_label_jump_simple_tf_person.Text = "";
event_execute_label_jump_simple_tf_session.Text = "";
+ event_execute_label_jump_simple_height_now.Text = "";
+ event_execute_label_jump_simple_height_person.Text = "";
+ event_execute_label_jump_simple_height_session.Text = "";
notebook_results_data.CurrentPage = 0;
}
@@ -1050,6 +1057,13 @@ Log.WriteLine("Preparing reactive A");
event_execute_label_jump_simple_tf_now.Text = Util.TrimDecimals(tvNow.ToString(), prefsDigitsNumber);
event_execute_label_jump_simple_tf_person.Text = Util.TrimDecimals(tvPerson.ToString(), prefsDigitsNumber);
event_execute_label_jump_simple_tf_session.Text = Util.TrimDecimals(tvSession.ToString(), prefsDigitsNumber);
+
+ event_execute_label_jump_simple_height_now.Text = Util.TrimDecimals(
+ Util.GetHeightInCentimeters(tvNow.ToString()) , prefsDigitsNumber);
+ event_execute_label_jump_simple_height_person.Text = Util.TrimDecimals(
+ Util.GetHeightInCentimeters(tvPerson.ToString()) , prefsDigitsNumber);
+ event_execute_label_jump_simple_height_session.Text = Util.TrimDecimals(
+ Util.GetHeightInCentimeters(tvSession.ToString()) , prefsDigitsNumber);
}
private void printLabelsRunSimple (double timeNow, double timePerson, double timeSession, double speedNow, double speedPerson, double speedSession) {
diff --git a/src/gui/usefulObjects.cs b/src/gui/usefulObjects.cs
index 7aa0b64..e664460 100644
--- a/src/gui/usefulObjects.cs
+++ b/src/gui/usefulObjects.cs
@@ -27,7 +27,7 @@ public class ExecutingGraphData
{
public Gtk.Button Button_cancel;
public Gtk.Button Button_finish;
- public Gtk.TextView Textview_message;
+ public Gtk.Label Label_message;
public Gtk.Label Label_event_value;
public Gtk.Label Label_time_value;
public Gtk.ProgressBar Progressbar_event;
@@ -35,13 +35,13 @@ public class ExecutingGraphData
public ExecutingGraphData(
Gtk.Button Button_cancel, Gtk.Button Button_finish,
- Gtk.TextView Textview_message,
+ Gtk.Label Label_message,
Gtk.Label Label_event_value, Gtk.Label Label_time_value,
Gtk.ProgressBar Progressbar_event, Gtk.ProgressBar Progressbar_time)
{
this.Button_cancel = Button_cancel;
this.Button_finish = Button_finish;
- this.Textview_message = Textview_message;
+ this.Label_message = Label_message;
this.Label_event_value = Label_event_value;
this.Label_time_value = Label_time_value;
this.Progressbar_event = Progressbar_event;
diff --git a/src/util.cs b/src/util.cs
index b4e1089..85d5a40 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -228,7 +228,7 @@ public class Util
return 90;
else
return Convert.ToInt32(System.Math.Atan(height / (distance * 1.0))
- * 180 / System.Math.PI);;
+ * 180 / System.Math.PI);
}
//useful for jumpType and jumpRjType, because the third value is the same
@@ -305,6 +305,20 @@ public class Util
else
return myString;
}
+
+ public static string RemoveMarkup(string s)
+ {
+ bool done = false;
+ while(! done) {
+ int tagStart = s.IndexOf('<');
+ int tagEnd = s.IndexOf('>');
+ if(tagStart != -1 && tagEnd != -1 && tagEnd > tagStart)
+ s = s.Remove(tagStart, tagEnd-tagStart+1);
+ else
+ done = true;
+ }
+ return s;
+ }
public static string ChangeEqualForColon(string myString)
{
diff --git a/src/utilGtk.cs b/src/utilGtk.cs
index 73a3c8f..d8b534d 100644
--- a/src/utilGtk.cs
+++ b/src/utilGtk.cs
@@ -31,7 +31,6 @@ public class UtilGtk
public static Gdk.Color BLACK = new Gdk.Color(0x00,0x00,0x00);
public static Gdk.Color BLUE = new Gdk.Color(0x6c,0x77,0xab);
public static Gdk.Color BLUE_CLEAR = new Gdk.Color(0xa0,0xa7,0xca);
- public static Gdk.Color GREEN = new Gdk.Color(0xa8,0xaf,0xd0);
public static void ResizeIfNeeded(Gtk.Window win) {
int winX, winY;
@@ -219,13 +218,14 @@ public class UtilGtk
combo.Sensitive = true;
}
+
public static void ColorsMenuLabel(Gtk.Label l) {
- l.ModifyFg(StateType.Active, UtilGtk.WHITE);
- l.ModifyFg(StateType.Normal, UtilGtk.BLACK);
+ l.ModifyFg(StateType.Active, WHITE);
+ l.ModifyFg(StateType.Normal, BLACK);
}
public static void ColorsTestLabel(Gtk.Label l) {
- l.ModifyFg(StateType.Active, UtilGtk.WHITE);
+ l.ModifyFg(StateType.Active, WHITE);
}
public static void ColorsRadio(Gtk.RadioButton r) {
@@ -241,6 +241,28 @@ public class UtilGtk
}
+ private static Gdk.Color chronopicViewportDefaultBg;
+ private static Gdk.Color chronopicLabelsDefaultFg;
+
+ public static void ChronopicColors(Gtk.Viewport v, Gtk.Label l1, Gtk.Label l2, bool connected) {
+ if(! v.Style.Background(StateType.Normal).Equal(BLUE))
+ chronopicViewportDefaultBg = v.Style.Background(StateType.Normal);
+ if(! l1.Style.Foreground(StateType.Normal).Equal(WHITE))
+ chronopicLabelsDefaultFg = l1.Style.Foreground(StateType.Normal);
+
+ if(connected) {
+ v.ModifyBg(StateType.Normal, chronopicViewportDefaultBg);
+ l1.ModifyFg(StateType.Normal, chronopicLabelsDefaultFg);
+ l2.ModifyFg(StateType.Normal, chronopicLabelsDefaultFg);
+ } else {
+ v.ModifyBg(StateType.Normal, BLUE);
+ l1.ModifyFg(StateType.Normal, WHITE);
+ l2.ModifyFg(StateType.Normal, WHITE);
+ }
+ }
+
+
+
public static TextBuffer TextViewPrint(string message) {
TextBuffer tb = new TextBuffer (new TextTagTable());
tb.Text = message;
@@ -272,5 +294,10 @@ public class UtilGtk
return "{0," + (start + inc).ToString() + ":0" + decS;
}
+ public static void PrintLabelWithTooltip (Gtk.Label l, string s) {
+ l.Text = s;
+ l.UseMarkup = true;
+ l.TooltipText = Util.RemoveMarkup(s);
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]