[chronojump] animation lights done (desc automatic, only one button, works!)



commit bf1aee32ad629a229965e0b7f63db6f39f5281d0
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sat May 28 11:55:43 2016 +0200

    animation lights done (desc automatic, only one button, works!)

 glade/chronojump.glade  |   86 +++++++++++++++++++++++++++++++----------------
 src/gui/chronojump.cs   |   31 +++++++++++-----
 src/gui/reactionTime.cs |    9 -----
 3 files changed, 78 insertions(+), 48 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 84f84e6..9c0b9a1 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -5168,20 +5168,6 @@ after time</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
-                                                            <child>
-                                                            <widget class="GtkButton" 
id="button_animation_lights_start">
-                                                            <property name="label">Start</property>
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property name="receives_default">True</property>
-                                                            <signal name="clicked" 
handler="on_button_animation_lights_start_clicked" swapped="no"/>
-                                                            </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>
@@ -5586,18 +5572,6 @@ after time</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
-                                                            <child>
-                                                            <widget class="GtkButton" 
id="button_discriminative_lights_start">
-                                                            <property name="label">Start</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property name="receives_default">True</property>
-                                                            </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>
@@ -16551,6 +16525,9 @@ on current Chronojump version.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -21234,6 +21211,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -22398,6 +22378,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -24054,6 +24037,9 @@ by you</property>
               <placeholder/>
             </child>
             <child>
+              <placeholder/>
+            </child>
+            <child>
               <widget class="GtkButton" id="button_video_url">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -24767,6 +24753,9 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -37692,6 +37681,24 @@ options</property>
                             <child>
                               <placeholder/>
                             </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </widget>
                         </child>
                       </widget>
@@ -40311,6 +40318,18 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -41572,9 +41591,6 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                                       <placeholder/>
                                     </child>
                                     <child>
-                                      <placeholder/>
-                                    </child>
-                                    <child>
                                       <widget class="GtkLabel" id="label218">
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
@@ -42738,6 +42754,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                                     <child>
                                       <placeholder/>
                                     </child>
+                                    <child>
+                                      <placeholder/>
+                                    </child>
                                   </widget>
                                 </child>
                               </widget>
@@ -46788,6 +46807,9 @@ It starts before and arrives there with some speed.</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                       <packing>
                         <property name="left_attach">2</property>
@@ -47616,6 +47638,9 @@ It starts before and arrives there with some speed.</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -48459,6 +48484,9 @@ It starts before and arrives there with some speed.</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 5ad9ecf..d35939d 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -4592,6 +4592,8 @@ public partial class ChronoJumpWindow
                                sep = " + ";
                        }
                }
+               else if(extra_window_radio_reaction_time_animation_lights.Active)
+                       description = spinbutton_flicker_lights_speed.Value.ToString() + " - " + 
label_animation_lights_interval.Text;
 
                currentEventExecute = new ReactionTimeExecute(currentPerson.UniqueID, currentPerson.Name, 
                                currentSession.UniqueID, 
@@ -4603,10 +4605,12 @@ public partial class ChronoJumpWindow
                        currentEventExecute.SimulateInitValues(rand);
        
                //not on simulated because results would be always 0
-               if(extra_window_radio_reaction_time_discriminative.Active && chronopicWin.Connected) {
-                       //TODO: do also for animation_lights and flickr
+               if( chronopicWin.Connected &&
+                               (extra_window_radio_reaction_time_discriminative.Active || 
+                                extra_window_radio_reaction_time_animation_lights.Active) )
+                       //TODO: do also for flickr
                        currentEventExecute.StartIn = false;
-               }
+               
                currentEventExecute.FakeButtonReactionTimeStart.Clicked += new 
EventHandler(on_event_execute_reaction_time_start);
 
                currentEventExecute.Manage(); //check that platform is ok
@@ -4622,14 +4626,21 @@ public partial class ChronoJumpWindow
        {
                currentEventExecute.FakeButtonReactionTimeStart.Clicked -= new 
EventHandler(on_event_execute_reaction_time_start);
 
-               //Fire leds or buzzer on discriminative (if not simulated)              
-               if(extra_window_radio_reaction_time_discriminative.Active && chronopicWin.Connected) {
-                       Thread.Sleep(Convert.ToInt32(discriminativeStartTime * 1000)); //in ms
-
-                       ChronopicAuto cs = new ChronopicStartReactionTimeAnimation();
-                       cs.CharToSend = discriminativeCharToSend;
-                       cs.Write(chronopicWin.SP, 0);
+               //Fire leds or buzzer on discriminative (if not simulated)
+               if(chronopicWin.Connected) {            
+                       if(extra_window_radio_reaction_time_discriminative.Active) {
+                               Thread.Sleep(Convert.ToInt32(discriminativeStartTime * 1000)); //in ms
 
+                               ChronopicAuto cs = new ChronopicStartReactionTimeAnimation();
+                               cs.CharToSend = discriminativeCharToSend;
+                               cs.Write(chronopicWin.SP, 0);
+                       }
+                       else if(extra_window_radio_reaction_time_animation_lights.Active) {
+                               int speed = Convert.ToInt32(spinbutton_animation_lights_speed.Value);
+                               ChronopicAuto cs = new ChronopicStartReactionTimeAnimation();
+                               cs.CharToSend = "l";
+                               cs.Write(chronopicWin.SP,speed);
+                       }
 
                        LogB.Information("opening port at gui/chronojump.cs");  
                        chronopicWin.SP.Open();
diff --git a/src/gui/reactionTime.cs b/src/gui/reactionTime.cs
index bc5bbaa..531e0ef 100644
--- a/src/gui/reactionTime.cs
+++ b/src/gui/reactionTime.cs
@@ -164,15 +164,6 @@ public partial class ChronoJumpWindow
 
        // ---- start buttons
 
-       private void on_button_animation_lights_start_clicked (object o, EventArgs args) {
-               int speed = Convert.ToInt32(spinbutton_animation_lights_speed.Value);
-               ChronopicAuto cs = new ChronopicStartReactionTimeAnimation();
-               cs.CharToSend = "l";
-               cs.Write(chronopicWin.SP,speed);
-
-               on_button_execute_test_clicked(o, args);
-       }
-       
        private void on_button_flicker_lights_start_clicked (object o, EventArgs args) {
                int speed = Convert.ToInt32(spinbutton_flicker_lights_speed.Value);
                ChronopicAuto cs = new ChronopicStartReactionTimeAnimation();


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