[chronojump] Encoder capture cont nicer and easier to finish



commit 1bd45e48826232c7b4e0101e89e0c0825e122c05
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Jul 13 10:11:06 2016 +0200

    Encoder capture cont nicer and easier to finish

 glade/chronojump.glade |  154 ++++++++++++++++++++++++++++++++++++++++--------
 src/gui/encoder.cs     |   32 ++++++++---
 2 files changed, 154 insertions(+), 32 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 336819b..cc3779c 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -13010,6 +13010,9 @@ low ressistance</property>
                                                 <child>
                                                   <placeholder/>
                                                 </child>
+                                                <child>
+                                                  <placeholder/>
+                                                </child>
                                               </widget>
                                               <packing>
                                                 <property name="expand">False</property>
@@ -14265,16 +14268,33 @@ low ressistance</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
-                                                            <widget class="GtkVBox" id="vbox83">
+                                                            <widget class="GtkHBox" id="hbox168">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">8</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" 
id="hbox_encoder_capture_wait">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">8</property>
+                                                            <child>
+                                                            <widget class="GtkVBox" id="vbox8">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
+                                                            <property name="spacing">2</property>
                                                             <child>
-                                                            <widget class="GtkCheckButton" 
id="checkbutton_encoder_cont">
-                                                            <property name="label">Cont</property>
+                                                            <widget class="GtkHBox" id="hbox199">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_encoder_capture_1set">
+                                                            <property name="label" translatable="yes">1 
set</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">Capture 1 set</property>
+                                                            <property name="active">True</property>
                                                             <property name="draw_indicator">False</property>
                                                             </widget>
                                                             <packing>
@@ -14283,6 +14303,23 @@ low ressistance</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_encoder_capture_cont">
+                                                            <property name="label" 
translatable="yes">cont</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="tooltip" 
translatable="yes">Capture continuously</property>
+                                                            <property name="draw_indicator">False</property>
+                                                            <property 
name="group">radio_encoder_capture_1set</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -14291,16 +14328,6 @@ low ressistance</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox168">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">8</property>
-                                                            <child>
-                                                            <widget class="GtkHBox" 
id="hbox_encoder_capture_wait">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">8</property>
-                                                            <child>
                                                             <widget class="GtkButton" 
id="button_encoder_capture">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
@@ -14312,15 +14339,15 @@ low ressistance</property>
                                                             <signal name="clicked" 
handler="on_button_encoder_capture_clicked" swapped="no"/>
                                                             <accelerator key="space" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
                                                             <child>
-                                                            <widget class="GtkVBox" id="vbox8">
+                                                            <widget class="GtkHBox" id="hbox206">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
                                                             <child>
-                                                            <widget class="GtkImage" id="image10">
+                                                            <widget class="GtkLabel" id="label90">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="stock">gtk-apply</property>
-                                                            <property name="icon-size">3</property>
+                                                            <property name="label" 
translatable="yes">Capture</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">True</property>
@@ -14329,10 +14356,11 @@ low ressistance</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkLabel" id="label90">
+                                                            <widget class="GtkImage" id="image10">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="label" 
translatable="yes">Capture</property>
+                                                            <property name="stock">gtk-apply</property>
+                                                            <property name="icon-size">3</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">True</property>
@@ -14346,6 +14374,13 @@ low ressistance</property>
                                                             <packing>
                                                             <property name="expand">True</property>
                                                             <property name="fill">True</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>
@@ -14597,11 +14632,21 @@ low ressistance</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_encoder_capture_finish_cont">
+                                                            <property name="label" translatable="yes">Finish 
continuous mode</property>
+                                                            <property name="sensitive">False</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="use_underline">True</property>
+                                                            <signal name="clicked" 
handler="on_button_encoder_capture_finish_cont_clicked" swapped="no"/>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">True</property>
                                                             <property name="fill">True</property>
-                                                            <property name="position">1</property>
+                                                            <property name="position">2</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
@@ -14618,6 +14663,13 @@ low ressistance</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>
                                                           </widget>
                                                           <packing>
                                                             <property name="expand">True</property>
@@ -17864,6 +17916,9 @@ low ressistance</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -22613,6 +22668,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -23843,6 +23901,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -25565,6 +25626,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>
@@ -26344,6 +26408,9 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -39676,6 +39743,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>
@@ -42559,6 +42644,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>
@@ -43754,9 +43851,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>
@@ -44986,6 +45080,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>
@@ -49102,6 +49199,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>
@@ -49996,6 +50096,9 @@ It starts before and arrives there with some speed.</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -50905,6 +51008,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/encoder.cs b/src/gui/encoder.cs
index dfa3f35..2d39c7d 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -65,6 +65,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_encoder_bell;
        [Widget] Gtk.Button button_encoder_capture_cancel;
        [Widget] Gtk.Button button_encoder_capture_finish;
+       [Widget] Gtk.Button button_encoder_capture_finish_cont;
        [Widget] Gtk.Button button_encoder_recalculate;
        [Widget] Gtk.Button button_encoder_load_signal;
        [Widget] Gtk.Button button_encoder_load_signal_on_analyze;
@@ -78,7 +79,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.MenuItem menuitem_export_encoder_signal;
        [Widget] Gtk.Label label_encoder_curve_action;
        [Widget] Gtk.Button button_encoder_delete_signal;
-       [Widget] Gtk.CheckButton checkbutton_encoder_cont;
+       [Widget] Gtk.RadioButton radio_encoder_capture_cont;
        
        [Widget] Gtk.VPaned vpaned_encoder_main;
        [Widget] Gtk.VPaned vpaned_encoder_capture_video_and_set_graph;
@@ -283,6 +284,7 @@ public partial class ChronoJumpWindow
        private static bool encoderProcessCancel;
        private static bool encoderProcessProblems;
        private static bool encoderProcessFinish;
+       private static bool encoderProcessFinishContMode;
 
        EncoderCaptureOptionsWindow encoderCaptureOptionsWin;
        EncoderConfigurationWindow encoder_configuration_win;
@@ -847,6 +849,12 @@ public partial class ChronoJumpWindow
        {
                eCapture.Finish();
                encoderProcessFinish = true;
+                       
+       }
+       void on_button_encoder_capture_finish_cont_clicked (object o, EventArgs args) 
+       {
+               encoderProcessFinishContMode = true;
+               on_button_encoder_capture_finish_clicked (o, args); 
        }
 
        void on_button_encoder_recalculate_clicked (object o, EventArgs args) {
@@ -2035,15 +2043,17 @@ public partial class ChronoJumpWindow
                        eCapture = new EncoderCaptureGravitatory();
                
                int recordingTime = (int) encoderCaptureOptionsWin.spin_encoder_capture_time.Value;
-               if(checkbutton_encoder_cont.Active)
+               if(radio_encoder_capture_cont.Active)  {
                        recordingTime = 0;
+                       encoderProcessFinishContMode = false; //will be true when finish button is pressed
+               }
                
                eCapture.InitGlobal( 
                                encoder_capture_signal_drawingarea.Allocation.Width,
                                encoder_capture_signal_drawingarea.Allocation.Height,
                                recordingTime, 
                                (int) encoderCaptureOptionsWin.spin_encoder_capture_inactivity_end_time.Value,
-                               checkbutton_encoder_cont.Active,
+                               radio_encoder_capture_cont.Active,
                                findEccon(true),
                                chronopicWin.GetEncoderPort()
                                );
@@ -3832,6 +3842,7 @@ public partial class ChronoJumpWindow
                button_encoder_analyze_cancel.Sensitive = Util.IntToBool(table[7]);
                
                button_encoder_capture_finish.Sensitive = Util.IntToBool(table[8]);
+               button_encoder_capture_finish_cont.Sensitive = Util.IntToBool(table[8]);
        }
        
        private void button_encoder_analyze_sensitiveness() {
@@ -3877,7 +3888,7 @@ public partial class ChronoJumpWindow
                        return;
 
                //continuous mode not show the capture line
-               if(checkbutton_encoder_cont.Active)
+               if(radio_encoder_capture_cont.Active)
                        return;
 
                bool refreshAreaOnly = false;
@@ -4453,7 +4464,7 @@ public partial class ChronoJumpWindow
                                treeview_encoder_capture_curves.Sensitive = true;
 
                                //on continuous mode do not erase at beginning of capture in order to see 
last bars
-                               if(action == encoderActions.CAPTURE && checkbutton_encoder_cont.Active) {
+                               if(action == encoderActions.CAPTURE && radio_encoder_capture_cont.Active) {
                                        prepareEncoderGraphs(false);
                                        plotCurvesGraphDoPlotMessage("Previous set");
                                } else
@@ -4465,7 +4476,7 @@ public partial class ChronoJumpWindow
                                        encoderStartVideoRecord();
 
                                        //remove treeview columns
-                                       if( ! (action == encoderActions.CAPTURE && 
checkbutton_encoder_cont.Active) )
+                                       if( ! (action == encoderActions.CAPTURE && 
radio_encoder_capture_cont.Active) )
                                                treeviewEncoderCaptureRemoveColumns();
 
                                        encoderCaptureStringR = new List<string>();
@@ -4599,6 +4610,10 @@ public partial class ChronoJumpWindow
        void encoderShowCaptureDoingButtons(bool show) {
                hbox_encoder_capture_wait.Visible = ! show;
                vbox_encoder_capture_doing.Visible = show;
+
+               button_encoder_capture_cancel.Visible = ! radio_encoder_capture_cont.Active;
+               button_encoder_capture_finish.Visible = ! radio_encoder_capture_cont.Active;
+               button_encoder_capture_finish_cont.Visible = radio_encoder_capture_cont.Active;
        }
 
        void prepareEncoderGraphs(bool eraseFirst) {
@@ -4905,6 +4920,7 @@ public partial class ChronoJumpWindow
                        //don't allow to press cancel or finish
                        button_encoder_capture_cancel.Sensitive = false;
                        button_encoder_capture_finish.Sensitive = false;
+                       button_encoder_capture_finish_cont.Sensitive = false;
 
                        capturingCsharp = encoderCaptureProcess.STOPPED;
                } else {        //STOPPED       
@@ -5002,7 +5018,7 @@ public partial class ChronoJumpWindow
        
        private void updatePulsebar (encoderActions action) 
        {
-               if(action == encoderActions.CAPTURE && checkbutton_encoder_cont.Active) {
+               if(action == encoderActions.CAPTURE && radio_encoder_capture_cont.Active) {
                        encoder_pulsebar_capture.Text = "";
                        encoder_pulsebar_capture.Pulse();
                        return;
@@ -5497,7 +5513,7 @@ public partial class ChronoJumpWindow
                
                        encoderShowCaptureDoingButtons(false);
                
-                       if(action == encoderActions.CURVES_AC && checkbutton_encoder_cont.Active)
+                       if(action == encoderActions.CURVES_AC && radio_encoder_capture_cont.Active && ! 
encoderProcessFinishContMode)
                                on_button_encoder_capture_clicked (new object (), new EventArgs ());
 
                } else { //ANALYZE


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