[chronojump] multi almost. Need update graphs and no sync if unchecked



commit ab2e21cda7f7c61f4d00eb3e98ddbf07b9c469eb
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Apr 1 14:59:13 2011 +0200

    multi almost. Need update graphs and no sync if unchecked

 glade/chronojump.glade        |  343 +++++++++++++++++++++++++----------------
 src/execute/event.cs          |   13 +-
 src/execute/multiChronopic.cs |    3 +-
 src/gui/chronojump.cs         |  114 +++++++++-----
 src/gui/eventExecute.cs       |   17 +--
 src/gui/multiChronopic.cs     |   81 ++++++++++
 src/gui/usefulObjects.cs      |   10 +-
 src/multiChronopicType.cs     |   10 +-
 src/utilGtk.cs                |    6 +
 9 files changed, 393 insertions(+), 204 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 9df4e76..6ef3e8b 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -14127,7 +14127,6 @@ Chronopic</property>
                               <widget class="GtkNotebook" id="notebook_execute">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="show_tabs">False</property>
                                 <property name="show_border">False</property>
                                 <child>
                                   <widget class="GtkFrame" id="frame2">
@@ -15835,156 +15834,109 @@ Chronopic</property>
                                   </packing>
                                 </child>
                                 <child>
-                                  <widget class="GtkHBox" id="hbox_multi_chronopic_buttons">
+                                  <widget class="GtkFrame" id="frame12">
                                     <property name="visible">True</property>
-                                    <property name="spacing">14</property>
-                                    <child>
-                                      <widget class="GtkHBox" id="hbox3">
-                                        <property name="visible">True</property>
-                                        <child>
-                                          <widget class="GtkCheckButton" id="check_multi_sync">
-                                            <property name="label" translatable="yes">Sync</property>
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">True</property>
-                                            <property name="receives_default">False</property>
-                                            <property name="has_tooltip">True</property>
-                                            <property name="tooltip" translatable="yes">Synchronize chronopics</property>
-                                            <property name="use_underline">True</property>
-                                            <property name="active">True</property>
-                                            <property name="draw_indicator">True</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">False</property>
-                                            <property name="fill">False</property>
-                                            <property name="position">0</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkCheckButton" id="check_multi_delete_first">
-                                            <property name="label" translatable="yes">Delete first</property>
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">True</property>
-                                            <property name="receives_default">False</property>
-                                            <property name="has_tooltip">True</property>
-                                            <property name="tooltip" translatable="yes">Delete first TC and TF of each chronopic</property>
-                                            <property name="use_underline">True</property>
-                                            <property name="active">True</property>
-                                            <property name="draw_indicator">True</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">False</property>
-                                            <property name="fill">False</property>
-                                            <property name="position">1</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkButton" id="button_multi_chronopic_start">
-                                            <property name="label" translatable="yes">Multi Chronopic test</property>
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">True</property>
-                                            <property name="receives_default">True</property>
-                                            <property name="use_underline">True</property>
-                                            <signal name="clicked" handler="on_multi_chronopic_start_clicked"/>
-                                            <signal name="enter" handler="on_button_enter"/>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">False</property>
-                                            <property name="fill">False</property>
-                                            <property name="position">2</property>
-                                          </packing>
-                                        </child>
-                                      </widget>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">False</property>
-                                        <property name="padding">4</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
+                                    <property name="label_xalign">0</property>
+                                    <property name="label_yalign">0.69999998807907104</property>
+                                    <property name="shadow_type">out</property>
                                     <child>
-                                      <widget class="GtkHBox" id="hbox4">
+                                      <widget class="GtkAlignment" id="alignment11">
                                         <property name="visible">True</property>
+                                        <property name="left_padding">6</property>
                                         <child>
-                                          <widget class="GtkHBox" id="hbox348">
+                                          <widget class="GtkVBox" id="vbox58">
                                             <property name="visible">True</property>
-                                            <property name="spacing">6</property>
                                             <child>
-                                              <widget class="GtkLabel" id="label696">
+                                              <widget class="GtkHBox" id="hbox4">
                                                 <property name="visible">True</property>
-                                                <property name="label" translatable="yes">Total distance</property>
+                                                <child>
+                                                  <widget class="GtkRadioButton" id="extra_window_radio_multichronopic_start">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">True</property>
+                                                    <property name="receives_default">False</property>
+                                                    <property name="relief">none</property>
+                                                    <property name="active">True</property>
+                                                    <property name="draw_indicator">False</property>
+                                                    <signal name="toggled" handler="on_extra_window_multichronopic_test_changed"/>
+                                                    <child>
+                                                      <widget class="GtkLabel" id="label_extra_window_radio_multichronopic_start">
+                                                        <property name="visible">True</property>
+                                                        <property name="label" translatable="yes">Multi Chronopic test</property>
+                                                      </widget>
+                                                    </child>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <widget class="GtkRadioButton" id="extra_window_radio_multichronopic_run_analysis">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">True</property>
+                                                    <property name="receives_default">False</property>
+                                                    <property name="relief">none</property>
+                                                    <property name="active">True</property>
+                                                    <property name="draw_indicator">False</property>
+                                                    <property name="group">extra_window_radio_multichronopic_start</property>
+                                                    <child>
+                                                      <widget class="GtkLabel" id="label_extra_window_radio_multichronopic_run_analysis">
+                                                        <property name="visible">True</property>
+                                                        <property name="label" translatable="yes">Run analysis</property>
+                                                      </widget>
+                                                    </child>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
                                               </widget>
                                               <packing>
-                                                <property name="expand">False</property>
-                                                <property name="fill">False</property>
                                                 <property name="position">0</property>
                                               </packing>
                                             </child>
                                             <child>
-                                              <widget class="GtkHBox" id="hbox349">
+                                              <widget class="GtkHBox" id="hbox3">
                                                 <property name="visible">True</property>
+                                                <property name="spacing">8</property>
                                                 <child>
-                                                  <widget class="GtkEntry" id="entry_run_analysis_distance">
+                                                  <widget class="GtkLabel" id="label65">
                                                     <property name="visible">True</property>
-                                                    <property name="can_focus">True</property>
-                                                    <property name="max_length">4</property>
-                                                    <property name="invisible_char">â??</property>
-                                                    <property name="width_chars">4</property>
-                                                    <signal name="changed" handler="on_entry_run_analysis_distance_changed"/>
+                                                    <property name="label" translatable="yes">Selected:</property>
                                                   </widget>
                                                   <packing>
                                                     <property name="expand">False</property>
-                                                    <property name="fill">False</property>
                                                     <property name="position">0</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkLabel" id="label697">
+                                                  <widget class="GtkLabel" id="extra_window_multichronopic_label_selected">
                                                     <property name="visible">True</property>
-                                                    <property name="label">cm</property>
+                                                    <property name="label" translatable="yes">the selected test</property>
                                                   </widget>
                                                   <packing>
                                                     <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="pack_type">end</property>
                                                 <property name="position">1</property>
                                               </packing>
                                             </child>
                                           </widget>
-                                          <packing>
-                                            <property name="expand">False</property>
-                                            <property name="padding">4</property>
-                                            <property name="pack_type">end</property>
-                                            <property name="position">2</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkButton" id="button_run_analysis">
-                                            <property name="label" translatable="yes">Run analysis</property>
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">True</property>
-                                            <property name="receives_default">True</property>
-                                            <property name="use_underline">True</property>
-                                            <signal name="clicked" handler="on_multi_chronopic_start_clicked"/>
-                                            <signal name="enter" handler="on_button_enter"/>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">False</property>
-                                            <property name="fill">False</property>
-                                            <property name="pack_type">end</property>
-                                            <property name="position">0</property>
-                                          </packing>
                                         </child>
                                       </widget>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkLabel" id="label31">
+                                        <property name="visible">True</property>
+                                        <property name="label" translatable="yes">&lt;b&gt;Select test&lt;/b&gt;</property>
+                                        <property name="use_markup">True</property>
+                                      </widget>
                                       <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">False</property>
-                                        <property name="position">1</property>
+                                        <property name="type">label_item</property>
                                       </packing>
                                     </child>
                                   </widget>
@@ -16030,7 +15982,6 @@ Chronopic</property>
                                             <child>
                                               <widget class="GtkNotebook" id="notebook_options">
                                                 <property name="visible">True</property>
-                                                <property name="show_tabs">False</property>
                                                 <property name="show_border">False</property>
                                                 <child>
                                                   <widget class="GtkVBox" id="vbox11">
@@ -16941,9 +16892,146 @@ weight</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkLabel" id="label31">
+                                                  <widget class="GtkVBox" id="vbox55">
                                                     <property name="visible">True</property>
-                                                    <property name="label">c</property>
+                                                    <property name="spacing">1</property>
+                                                    <child>
+                                                      <widget class="GtkTextView" id="extra_window_textview_multichronopic_need_two">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">True</property>
+                                                        <property name="editable">False</property>
+                                                        <property name="wrap_mode">word</property>
+                                                        <property name="justification">center</property>
+                                                        <property name="text" translatable="yes">Need to connect two Chronopics</property>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">False</property>
+                                                        <property name="padding">12</property>
+                                                        <property name="position">0</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkVBox" id="vbox57">
+                                                        <property name="visible">True</property>
+                                                        <property name="spacing">6</property>
+                                                        <child>
+                                                          <widget class="GtkCheckButton" id="extra_window_check_multichronopic_sync">
+                                                            <property name="label" translatable="yes">Synchronize</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">False</property>
+                                                            <property name="has_tooltip">True</property>
+                                                            <property name="tooltip" translatable="yes">Synchronize chronopics</property>
+                                                            <property name="use_underline">True</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkCheckButton" id="extra_window_check_multichronopic_delete_first">
+                                                            <property name="label" translatable="yes">Delete first</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">False</property>
+                                                            <property name="has_tooltip">True</property>
+                                                            <property name="tooltip" translatable="yes">Delete first TC and TF of each chronopic</property>
+                                                            <property name="use_underline">True</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">2</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkTextView" id="extra_window_textview_run_analysis_cps_order">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="editable">False</property>
+                                                            <property name="wrap_mode">word</property>
+                                                            <property name="justification">center</property>
+                                                            <property name="text" translatable="yes">First Chronopic should be connected to photocells.
+Second Chronopic to platforms.</property>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="padding">12</property>
+                                                            <property name="position">3</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkHBox" id="extra_window_hbox_run_analysis_total_distance">
+                                                            <property name="visible">True</property>
+                                                            <property name="spacing">9</property>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label696">
+                                                            <property name="visible">True</property>
+                                                            <property name="label" translatable="yes">Total distance</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox349">
+                                                            <property name="visible">True</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkSpinButton" id="extra_window_spin_run_analysis_distance">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="invisible_char">â??</property>
+                                                            <property name="adjustment">1000 600 10000 1 10 0</property>
+                                                            <property name="numeric">True</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label697">
+                                                            <property name="visible">True</property>
+                                                            <property name="label">cm</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <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="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="padding">8</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">-1</property>
+                                                          </packing>
+                                                        </child>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">False</property>
+                                                        <property name="fill">False</property>
+                                                        <property name="position">1</property>
+                                                      </packing>
+                                                    </child>
                                                   </widget>
                                                   <packing>
                                                     <property name="position">6</property>
@@ -17234,30 +17322,13 @@ weight</property>
                                               </packing>
                                             </child>
                                             <child>
-                                              <widget class="GtkHBox" id="hbox353">
+                                              <widget class="GtkTextView" id="event_execute_textview_message">
                                                 <property name="visible">True</property>
-                                                <property name="spacing">10</property>
-                                                <child>
-                                                  <widget class="GtkLabel" id="event_execute_label_message1">
-                                                    <property name="visible">True</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="fill">False</property>
-                                                    <property name="position">0</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
-                                                  <widget class="GtkLabel" id="event_execute_label_message2">
-                                                    <property name="visible">True</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="fill">False</property>
-                                                    <property name="position">1</property>
-                                                  </packing>
-                                                </child>
+                                                <property name="can_focus">True</property>
+                                                <property name="editable">False</property>
+                                                <property name="wrap_mode">word</property>
                                               </widget>
                                               <packing>
-                                                <property name="expand">False</property>
                                                 <property name="position">1</property>
                                               </packing>
                                             </child>
diff --git a/src/execute/event.cs b/src/execute/event.cs
index 5070f58..6d30a2c 100644
--- a/src/execute/event.cs
+++ b/src/execute/event.cs
@@ -21,6 +21,7 @@
 using System;
 using System.Data;
 using System.Text; //StringBuilder
+using Gtk;
 
 using System.Threading;
 using System.IO.Ports;
@@ -313,8 +314,7 @@ public class EventExecute
 		}
 		
 		if(needShowSyncMessage) {
-			//app1.ShowSyncMessage(syncMessage);
-			egd.Label_sync_message.Text = syncMessage;
+			egd.Textview_message.Buffer = UtilGtk.TextViewPrint(syncMessage);
 			needShowSyncMessage = false;
 		}
 		
@@ -330,13 +330,14 @@ public class EventExecute
 	}
 	
 	private void runATouchPlatform() {
-		egd.Label_message1.Text = "<b>" + "Always remember to touch platform at ending. If you don't do it, Chronojump will crash at next execution.\nAt this version, this message doesn't quit." + "</b>";
-		egd.Label_message1.UseMarkup = true;
+		string message = Catalog.GetString("Always remember to touch platform at ending. If you don't do it, Chronojump will crash at next execution.") + "\n" + 
+			Catalog.GetString("At this version, this message doesn't quit.");
+		egd.Textview_message.Buffer = UtilGtk.TextViewPrint(message);
 	}
 
 	public void RunANoStrides() {
-		egd.Label_message2.Text = "<b>" + "This Run Analysis is not valid because there are no strides." + "</b>";
-		egd.Label_message2.UseMarkup = true;
+		string message = Catalog.GetString("This Run Analysis is not valid because there are no strides.");
+		egd.Textview_message.Buffer = UtilGtk.TextViewPrint(message);
 	}
 	
 	protected void progressBarEventOrTimePreExecution (bool isEvent, bool percentageMode, double events) 
diff --git a/src/execute/multiChronopic.cs b/src/execute/multiChronopic.cs
index 04c1101..79b5cf8 100644
--- a/src/execute/multiChronopic.cs
+++ b/src/execute/multiChronopic.cs
@@ -417,7 +417,8 @@ public class MultiChronopicExecute : EventExecute
 					}
 					else if (syncing == syncStates.CONTACTED && myPS == Chronopic.Plataforma.OFF && myLS == States.ON) {
 						syncing = syncStates.DONE;
-						syncMessage = Catalog.GetString("Synchronization done.");
+						syncMessage = Catalog.GetString("Synchronization done.") + "\n" + 
+							Catalog.GetString("Test starts now.");
 						needShowSyncMessage = true;
 					}
 					else {
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 07cc381..0976ed2 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -148,13 +148,13 @@ public partial class ChronoJumpWindow
 	[Widget] Gtk.Button button_edit_selected_multi_chronopic;
 	[Widget] Gtk.Button button_video_play_selected_multi_chronopic;
 	[Widget] Gtk.Button button_delete_selected_multi_chronopic;
-	[Widget] Gtk.Box hbox_multi_chronopic_buttons;
-	[Widget] Gtk.Button button_multi_chronopic_start;
-	[Widget] Gtk.Button button_run_analysis;
-	[Widget] Gtk.Entry entry_run_analysis_distance;
-	[Widget] Gtk.CheckButton check_multi_sync;
-	[Widget] Gtk.CheckButton check_multi_delete_first;
-	[Widget] Gtk.Entry entry_multi_chronopic_cp2;
+//	[Widget] Gtk.Box hbox_multi_chronopic_buttons;
+//	[Widget] Gtk.Button button_multi_chronopic_start;
+//	[Widget] Gtk.Button button_run_analysis;
+//	[Widget] Gtk.Entry extra_window_spin_run_analysis_distance;
+//	[Widget] Gtk.CheckButton extra_window_check_multichronopic_sync;
+//	[Widget] Gtk.CheckButton extra_window_check_multichronopic_delete_first;
+//	[Widget] Gtk.Entry entry_multi_chronopic_cp2;
 
 	//tools
 	[Widget] Gtk.MenuItem menuitem_preferences;
@@ -440,8 +440,12 @@ public partial class ChronoJumpWindow
 		createComboRunsInterval();
 		//reaction_times has no combo
 		createComboPulses();
-		createComboMultiChronopic();
+		//createComboMultiChronopic();
 		createdStatsWin = false;
+		
+		repetitiveConditionsWin = RepetitiveConditionsWindow.Create();
+
+		createChronopicWindow(false);
 	
 		on_extra_window_jumps_test_changed(new object(), new EventArgs());
 		on_extra_window_jumps_rj_test_changed(new object(), new EventArgs());
@@ -449,13 +453,9 @@ public partial class ChronoJumpWindow
 		on_extra_window_runs_interval_test_changed(new object(), new EventArgs());
 		on_extra_window_reaction_times_test_changed(new object(), new EventArgs());
 		on_extra_window_pulses_test_changed(new object(), new EventArgs());
+		on_extra_window_multichronopic_test_changed(new object(), new EventArgs());
 		changeTestImage("", "", "LOGO");
 
-		
-		repetitiveConditionsWin = RepetitiveConditionsWindow.Create();
-
-		createChronopicWindow(false);
-
 		//We have no session, mark some widgets as ".Sensitive = false"
 		sensitiveGuiNoSession();
 		definedSession = false;
@@ -628,6 +628,12 @@ public partial class ChronoJumpWindow
 		UtilGtk.ColorsRadio(extra_window_radio_pulses_free);
 		UtilGtk.ColorsRadio(extra_window_radio_pulses_custom);
 
+		//multichronopic changes
+		UtilGtk.ColorsTestLabel(label_extra_window_radio_multichronopic_start);
+		UtilGtk.ColorsTestLabel(label_extra_window_radio_multichronopic_run_analysis);
+		UtilGtk.ColorsRadio(extra_window_radio_multichronopic_start);
+		UtilGtk.ColorsRadio(extra_window_radio_multichronopic_run_analysis);
+
 
 		//persons buttons
 		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameNew1);
@@ -1955,12 +1961,14 @@ public partial class ChronoJumpWindow
 		combo_pulses.Sensitive = false;
 	}
 
+	/*
 	private void createComboMultiChronopic() 
 	{
 		button_multi_chronopic_start.Sensitive = false;
 		button_run_analysis.Sensitive = false;
-		entry_run_analysis_distance.Sensitive = false;
+		extra_window_spin_run_analysis_distance.Sensitive = false;
 	}
+	*/
 
 	private void on_combo_jumps_changed(object o, EventArgs args) {
 		//combo_jumps.Changed -= new EventHandler (on_combo_jumps_changed);
@@ -2890,6 +2898,9 @@ Console.WriteLine("X");
 		else if(radio_mode_pulses.Active) {
 			on_pulse_activate (o, args);
 		}
+		else if(radio_mode_multi_chronopic.Active) {
+			on_multi_chronopic_start_clicked(o, args);
+		}
 
 		//if a test has been deleted
 		//notebook_results_data changes to page 8: "deleted test"
@@ -3928,17 +3939,21 @@ Log.WriteLine("AAAAA");
 	
 	private void on_chronopic_window_connected_or_done (object o, EventArgs args) {
 Log.WriteLine("BBBBBB");
-		chronopicWin.FakeWindowDone.Clicked -= new EventHandler(on_chronopic_window_connected_or_done);
+		//chronopicWin.FakeWindowDone.Clicked -= new EventHandler(on_chronopic_window_connected_or_done);
 		int cps = chronopicWin.NumConnected();
+	
+		on_extra_window_multichronopic_test_changed(new object(), new EventArgs());
+		/*
 		if(cps >= 2) {	
 			button_multi_chronopic_start.Sensitive = true;
-			entry_run_analysis_distance.Sensitive = true;
-			on_entry_run_analysis_distance_changed (o, args);
+			extra_window_spin_run_analysis_distance.Sensitive = true;
+			on_extra_window_spin_run_analysis_distance_changed (o, args);
 		} else {
 			button_multi_chronopic_start.Sensitive = false;
-			entry_run_analysis_distance.Sensitive = false;
+			extra_window_spin_run_analysis_distance.Sensitive = false;
 			button_run_analysis.Sensitive = false;
 		}
+		*/
 		
 		chronopicLabels(cps);
 	}
@@ -3967,14 +3982,16 @@ Log.WriteLine("CCCCC");
 	}
 
 
-	private void on_entry_run_analysis_distance_changed (object o, EventArgs args) {
-		if(Util.IsNumber(entry_run_analysis_distance.Text, false) && entry_run_analysis_distance.Text != "0" &&
+	/*
+	private void on_extra_window_spin_run_analysis_distance_changed (object o, EventArgs args) {
+		if(Util.IsNumber(extra_window_spin_run_analysis_distance.Text, false) && extra_window_spin_run_analysis_distance.Text != "0" &&
 				chronopicWin.NumConnected()>=2) {
 			button_run_analysis.Sensitive = true;
 		} else {
 			button_run_analysis.Sensitive = false;
 		}
 	}
+	*/
 
 	private void on_multi_chronopic_start_clicked (object o, EventArgs args) {
 		Log.WriteLine("multi chronopic accepted");
@@ -3984,6 +4001,12 @@ Log.WriteLine("CCCCC");
 //		else if(o == (object) button_run_analysis || o == (object) menuitem_run_analysis)
 //			currentMultiChronopicType = new MultiChronopicType(Constants.RunAnalysisName);
 
+
+		bool syncAvailable = false;
+		if(currentMultiChronopicType.SyncAvailable && extra_window_check_multichronopic_sync.Active)
+			syncAvailable = true;
+
+
 		//used by cancel and finish
 		currentEventType = new MultiChronopicType();
 			
@@ -4025,53 +4048,55 @@ Log.WriteLine("CCCCC");
 		event_execute_ButtonUpdate.Clicked += new EventHandler(on_update_clicked);
 
 
-		bool syncNeeded = false;
-		if(currentMultiChronopicType.SyncNeeded && check_multi_sync.Active)
-			syncNeeded = true;
+		/*
+		bool syncAvailable = false;
+		if(currentMultiChronopicType.SyncAvailable && extra_window_check_multichronopic_sync.Active)
+			syncAvailable = true;
+			*/
 
 		int numConnected = chronopicWin.NumConnected();
 
 		if(numConnected == 1)
 			currentEventExecute = new MultiChronopicExecute(
-//					eventExecuteWin, currentPerson.UniqueID, currentPerson.Name, 
+					//eventExecuteWin, 
 					currentPerson.UniqueID, currentPerson.Name, 
 					currentSession.UniqueID, currentMultiChronopicType.Name, 
 					chronopicWin.CP, 
-					syncNeeded, check_multi_delete_first.Active, 
-					entry_run_analysis_distance.Text.ToString(),
+					syncAvailable, extra_window_check_multichronopic_delete_first.Active, 
+					extra_window_spin_run_analysis_distance.Value.ToString(),
 					appbar2, app1, 
 					//progressbarlimit, 
 					egd);
 		else if(numConnected == 2)
 			currentEventExecute = new MultiChronopicExecute(
-					//eventExecuteWin, currentPerson.UniqueID, currentPerson.Name, 
+					//eventExecuteWin, 
 					currentPerson.UniqueID, currentPerson.Name, 
 					currentSession.UniqueID, currentMultiChronopicType.Name,  
 					chronopicWin.CP, chronopicWin.CP2, 
-					syncNeeded, check_multi_delete_first.Active, 
-					entry_run_analysis_distance.Text.ToString(),
+					syncAvailable, extra_window_check_multichronopic_delete_first.Active, 
+					extra_window_spin_run_analysis_distance.Value.ToString(),
 					appbar2, app1, 
 					//progressbarlimit, 
 					egd);
 		else if(numConnected == 3)
 			currentEventExecute = new MultiChronopicExecute(
-					//eventExecuteWin, currentPerson.UniqueID, currentPerson.Name, 
+					//eventExecuteWin, 
 					currentPerson.UniqueID, currentPerson.Name, 
 					currentSession.UniqueID, currentMultiChronopicType.Name,
 					chronopicWin.CP, chronopicWin.CP2, chronopicWin.CP3, 
-					syncNeeded, check_multi_delete_first.Active, 
-					entry_run_analysis_distance.Text.ToString(),
+					syncAvailable, extra_window_check_multichronopic_delete_first.Active, 
+					extra_window_spin_run_analysis_distance.Value.ToString(),
 					appbar2, app1, 
 					//progressbarlimit, 
 					egd);
 		else if(numConnected == 4)
 			currentEventExecute = new MultiChronopicExecute(
-					//eventExecuteWin, currentPerson.UniqueID, currentPerson.Name, 
+					//eventExecuteWin, 
 					currentPerson.UniqueID, currentPerson.Name, 
 					currentSession.UniqueID, currentMultiChronopicType.Name,
 					chronopicWin.CP, chronopicWin.CP2, chronopicWin.CP3, chronopicWin.CP4,
-					syncNeeded, check_multi_delete_first.Active, 
-					entry_run_analysis_distance.Text.ToString(),
+					syncAvailable, extra_window_check_multichronopic_delete_first.Active, 
+					extra_window_spin_run_analysis_distance.Value.ToString(),
 					appbar2, app1, 
 					//progressbarlimit, 
 					egd);
@@ -4084,6 +4109,8 @@ Log.WriteLine("CCCCC");
 		multiFinishing = false;
 		currentEventExecute.Manage();
 
+		currentEventExecute.FakeButtonUpdateGraph.Clicked += 
+			new EventHandler(on_event_execute_update_graph_in_progress_clicked);
 		currentEventExecute.FakeButtonEventEnded.Clicked += new EventHandler(on_event_execute_EventEnded);
 //		currentEventExecute.FakeButtonRunATouchPlatform.Clicked += new EventHandler(on_event_execute_RunATouchPlatform);
 		currentEventExecute.FakeButtonFinished.Clicked += new EventHandler(on_multi_chronopic_finished);
@@ -4152,6 +4179,8 @@ Console.WriteLine("X");
 		Console.WriteLine("RR3");
 		sensitiveGuiEventDone();
 		Console.WriteLine("RR4");
+		
+		event_execute_textview_message.Buffer = UtilGtk.TextViewPrint("");
 	}
 		
 
@@ -5125,6 +5154,17 @@ Console.WriteLine("X");
 		else if(notebook_execute.CurrentPage == 5)
 			changeTestImage(EventType.Types.PULSE.ToString(), 
 					currentPulseType.Name, currentPulseType.ImageFileName);
+		else if(notebook_execute.CurrentPage == 6) {
+			changeTestImage(EventType.Types.MULTICHRONOPIC.ToString(), 
+					currentMultiChronopicType.Name, currentMultiChronopicType.ImageFileName);
+		}
+	
+		//button_execute_test have to be non sensitive in multichronopic without two cps
+		//else has to be sensitive	
+		if(notebook_execute.CurrentPage == 6 && chronopicWin.NumConnected() < 2)
+			extra_window_multichronopic_can_do(false);
+		else 
+			extra_window_multichronopic_can_do(true);
 
 		stats_win_change_test_type(notebook_execute.CurrentPage);
 	}
@@ -5332,7 +5372,7 @@ Console.WriteLine("X");
 		hbox_pulses.Sensitive = false;
 		hbox_this_test_buttons.Sensitive = false;
 		
-		hbox_multi_chronopic_buttons.Sensitive = false;
+		//hbox_multi_chronopic_buttons.Sensitive = false;
 	}
    
 	private void sensitiveGuiEventDone () {
@@ -5343,7 +5383,7 @@ Console.WriteLine("X");
 		table_runs.Sensitive = true;
 		hbox_runs_interval.Sensitive = true;
 		hbox_pulses.Sensitive = true;
-		hbox_multi_chronopic_buttons.Sensitive = true;
+		//hbox_multi_chronopic_buttons.Sensitive = true;
 		hbox_this_test_buttons.Sensitive = true;
 
 		//allow repeat last jump or run (check also if it wasn't cancelled)
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 62f1012..66f8622 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -45,7 +45,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.Label event_execute_label_sync_message;
+	[Widget] Gtk.TextView event_execute_textview_message;
 	[Widget] Gtk.Label event_graph_label_graph_person;
 	[Widget] Gtk.Label event_graph_label_graph_test;
 	
@@ -139,9 +139,6 @@ public partial class ChronoJumpWindow
 	[Widget] Gtk.Image event_execute_image_run_interval_time_good;
 	[Widget] Gtk.Image event_execute_image_run_interval_time_bad;
 	
-	[Widget] Gtk.Label event_execute_label_message1;
-	[Widget] Gtk.Label event_execute_label_message2;
-		
 	[Widget] Gtk.Notebook notebook_results_data;
 	
 	[Widget] Gtk.DrawingArea event_execute_drawingarea;
@@ -258,7 +255,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.Title = windowTitle;
 		//this.event_execute_personName.Text = event_execute_personName; 	//"Jumps" (rjInterval), "Runs" (runInterval), "Ticks" (pulses), 
@@ -275,10 +273,6 @@ public partial class ChronoJumpWindow
 //		this.pDN = pDN;
 //		this.event_execute_limit = event_execute_limit;
 
-		event_execute_label_message1.Text = "";
-		event_execute_label_message2.Text = "";
-			
-
 		//finish not sensitive for all events. 
 		//Later reactive, interval and pulse will sensitive it when a subevent is done
 		event_execute_button_finish.Sensitive = false;
@@ -325,8 +319,7 @@ public partial class ChronoJumpWindow
 		
 		ExecutingGraphData executingGraphData = new ExecutingGraphData(
 				event_execute_button_cancel, event_execute_button_finish, 
-				event_execute_label_sync_message,  
-				event_execute_label_message1,  event_execute_label_message2,
+				event_execute_textview_message,  
 				event_execute_label_event_value,  event_execute_label_time_value,
 				event_execute_progressbar_event,  event_execute_progressbar_time);
 		return executingGraphData;
@@ -496,7 +489,7 @@ public partial class ChronoJumpWindow
 
 	/*
 	public void ShowSyncMessage(string str) {
-		event_execute_label_sync_message.Text = str;
+		event_execute_textview_sync_message.Text = str;
 	}
 	*/
 		
diff --git a/src/gui/multiChronopic.cs b/src/gui/multiChronopic.cs
index 6c64f49..ddd2766 100644
--- a/src/gui/multiChronopic.cs
+++ b/src/gui/multiChronopic.cs
@@ -29,6 +29,87 @@ using Mono.Unix;
 
 
 
+public partial class ChronoJumpWindow 
+{
+	[Widget] Gtk.RadioButton extra_window_radio_multichronopic_start;
+	[Widget] Gtk.RadioButton extra_window_radio_multichronopic_run_analysis;
+	[Widget] Gtk.Label label_extra_window_radio_multichronopic_start;
+	[Widget] Gtk.Label label_extra_window_radio_multichronopic_run_analysis;
+
+	[Widget] Gtk.Label extra_window_multichronopic_label_selected;
+
+	[Widget] Gtk.TextView extra_window_textview_multichronopic_need_two;
+
+	[Widget] Gtk.CheckButton extra_window_check_multichronopic_sync;
+	[Widget] Gtk.CheckButton extra_window_check_multichronopic_delete_first;
+
+	//run analysis
+	[Widget] Gtk.HBox extra_window_hbox_run_analysis_total_distance;
+	[Widget] Gtk.SpinButton extra_window_spin_run_analysis_distance;
+	[Widget] Gtk.TextView extra_window_textview_run_analysis_cps_order;
+	
+	int extra_window_multichronopic_distance = 1000; //1000cm: 10m
+
+	private void on_extra_window_multichronopic_test_changed(object o, EventArgs args)
+	{
+		if(extra_window_radio_multichronopic_start.Active) 
+			currentMultiChronopicType = new MultiChronopicType(Constants.MultiChronopicName);
+		else if(extra_window_radio_multichronopic_run_analysis.Active) 
+			currentMultiChronopicType = new MultiChronopicType(Constants.RunAnalysisName);
+		
+		if(chronopicWin.NumConnected() < 2) 
+			extra_window_multichronopic_can_do(false);
+		else
+			extra_window_multichronopic_can_do(true);
+		
+		extra_window_multichronopic_initialize(currentMultiChronopicType);
+	}
+
+	private void extra_window_multichronopic_initialize(MultiChronopicType myMultiChronopicType) 
+	{
+		extra_window_multichronopic_label_selected.Text = "<b>" + 
+			Catalog.GetString(myMultiChronopicType.Name) + "</b>";
+		extra_window_multichronopic_label_selected.UseMarkup = true; 
+		currentEventType = myMultiChronopicType;
+		changeTestImage(EventType.Types.MULTICHRONOPIC.ToString(), 
+				myMultiChronopicType.Name, myMultiChronopicType.ImageFileName);
+		bool hasOptions = false;
+
+		extra_window_spin_run_analysis_distance.Value = extra_window_multichronopic_distance;
+		bool showSyncAndDeleteFirst = false;
+		bool showRunDistance = false;
+		if(myMultiChronopicType.Name == Constants.MultiChronopicName) {
+			showSyncAndDeleteFirst = true;
+		} else if(myMultiChronopicType.Name == Constants.RunAnalysisName) {
+			showRunDistance = true;
+		}
+		extra_window_multichronopic_showSyncAndDeleteFirst(showSyncAndDeleteFirst);
+		extra_window_multichronopic_showRunDistance(showRunDistance);
+	}
+
+
+	private void extra_window_multichronopic_can_do(bool can_do) {
+		button_execute_test.Sensitive = can_do;
+		extra_window_textview_multichronopic_need_two.Visible = ! can_do;
+		
+		extra_window_check_multichronopic_sync.Sensitive = can_do;
+		extra_window_check_multichronopic_delete_first.Sensitive = can_do;
+		extra_window_hbox_run_analysis_total_distance.Sensitive = can_do;
+		extra_window_textview_run_analysis_cps_order.Sensitive = can_do;
+	}
+
+	private void extra_window_multichronopic_showSyncAndDeleteFirst(bool show) {
+		extra_window_check_multichronopic_sync.Visible = show;
+		extra_window_check_multichronopic_delete_first.Visible = show;
+	}
+	private void extra_window_multichronopic_showRunDistance(bool show) {
+		extra_window_hbox_run_analysis_total_distance.Visible = show;
+		extra_window_textview_run_analysis_cps_order.Visible = show;
+	}
+
+
+}
+
 //--------------------------------------------------------
 //---------------- EDIT MULTI CHRONOPIC WIDGET -----------
 //--------------------------------------------------------
diff --git a/src/gui/usefulObjects.cs b/src/gui/usefulObjects.cs
index f5259bb..4b80a1d 100644
--- a/src/gui/usefulObjects.cs
+++ b/src/gui/usefulObjects.cs
@@ -27,9 +27,7 @@ public class ExecutingGraphData
 {
 	public Gtk.Button Button_cancel;
 	public Gtk.Button Button_finish;
-	public Gtk.Label Label_sync_message;
-	public Gtk.Label Label_message1;
-	public Gtk.Label Label_message2;
+	public Gtk.TextView Textview_message;
 	public Gtk.Label Label_event_value;
 	public Gtk.Label Label_time_value;
 	public Gtk.ProgressBar Progressbar_event;
@@ -37,15 +35,13 @@ public class ExecutingGraphData
 	
 	public ExecutingGraphData(
 			Gtk.Button Button_cancel, Gtk.Button Button_finish, 
-			Gtk.Label Label_sync_message, Gtk.Label Label_message1, Gtk.Label Label_message2,
+			Gtk.TextView Textview_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.Label_sync_message =  Label_sync_message;
-		this.Label_message1 =  Label_message1;
-		this.Label_message2 =  Label_message2;
+		this.Textview_message =  Textview_message;
 		this.Label_event_value =  Label_event_value;
 		this.Label_time_value =  Label_time_value;
 		this.Progressbar_event =  Progressbar_event;
diff --git a/src/multiChronopicType.cs b/src/multiChronopicType.cs
index 6fd91bc..51ea75e 100644
--- a/src/multiChronopicType.cs
+++ b/src/multiChronopicType.cs
@@ -27,7 +27,7 @@ public class MultiChronopicType : EventType
 	   if false, a type doesn't need sync
 	   if true, it can be synced or not depending on checkbox active by user
 	   */
-	bool syncNeeded;
+	bool syncAvailable;
 
 	public MultiChronopicType() {
 		type = Types.MULTICHRONOPIC;
@@ -42,17 +42,17 @@ public class MultiChronopicType : EventType
 		
 		//if this changes, sqlite/pulseType.cs initialize table should change
 		if(name == Constants.MultiChronopicName) {
-			syncNeeded = true;
+			syncAvailable = true;
 			imageFileName = "multiChronopic.png";
 
 		} else if(name == Constants.RunAnalysisName) {
-			syncNeeded = false;
+			syncAvailable = false;
 			imageFileName = "run_analysis.png";
 		}
 	}
 
-	public bool SyncNeeded {
-		get { return syncNeeded; }
+	public bool SyncAvailable {
+		get { return syncAvailable; }
 	}
 }
 
diff --git a/src/utilGtk.cs b/src/utilGtk.cs
index 75cccd1..91abc57 100644
--- a/src/utilGtk.cs
+++ b/src/utilGtk.cs
@@ -218,4 +218,10 @@ public class UtilGtk
 		r.ModifyBg(StateType.Prelight, BLUE_CLEAR);
 	}
 
+	public static TextBuffer TextViewPrint(string message) {
+		TextBuffer tb = new TextBuffer (new TextTagTable());
+		tb.Text = message;
+		return tb;
+	}
+
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]