[chronojump] ForceSensor webcam play done!



commit 984cb71af517636d655a9f260bcabab071008ffd
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Sep 10 16:51:39 2019 +0200

    ForceSensor webcam play done!

 src/gui/chronojump.cs  | 14 ++++++++++++--
 src/gui/forceSensor.cs |  7 +++++++
 src/gui/webcam.cs      | 11 +++++++++++
 3 files changed, 30 insertions(+), 2 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index e0907dfe..6a8051b1 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -7444,7 +7444,6 @@ LogB.Debug("mc finished 5");
                hbox_other_mc.Sensitive = true;
                hbox_other_pulses.Sensitive = true;
                //hbox_multi_chronopic_buttons.Sensitive = true;
-               sensitiveLastTestButtons(true);
                
                button_activate_chronopics.Sensitive = true;
                button_threshold.Sensitive = true;
@@ -7453,6 +7452,16 @@ LogB.Debug("mc finished 5");
                notebook_options_top.Sensitive = true;
                event_execute_button_update.Sensitive = true;
 
+               //forceSensor does not use currentEventExecute
+               if(current_menuitem_mode == Constants.Menuitem_modes.FORCESENSOR)
+               {
+                       sensitiveLastTestButtons(! forceProcessCancel && ! forceProcessError);
+                       LogB.Information(" sensitiveGuiEventDone end (forceSensor)");
+                       return;
+               }
+
+               sensitiveLastTestButtons(true);
+
                //allow repeat last jump or run (check also if it wasn't cancelled)
                if(currentEventExecute != null && ! currentEventExecute.Cancel) {
                        switch (currentEventType.Type) {
@@ -7474,12 +7483,13 @@ LogB.Debug("mc finished 5");
                else
                        sensitiveLastTestButtons(false);
 
-               LogB.Information(" sensitiveGuiEventDone end ");
+               LogB.Information(" sensitiveGuiEventDone end (not forceSensor)");
        }
 
        //to sensitive on and off the play_this_test and delete_this_test
        private void sensitiveLastTestButtons(bool sensitive)
        {
+               LogB.Information("sensitiveLastTestButtons: " + sensitive.ToString());
                vbox_last_test_buttons.Sensitive = sensitive;
        }
        /*
diff --git a/src/gui/forceSensor.cs b/src/gui/forceSensor.cs
index dbc09fe3..d9d175a8 100644
--- a/src/gui/forceSensor.cs
+++ b/src/gui/forceSensor.cs
@@ -925,6 +925,7 @@ LogB.Information(" re B ");
                if(! forceCaptureThread.IsAlive || forceProcessFinish || forceProcessCancel || 
forceProcessError)
                {
 LogB.Information(" re C ");
+                       button_video_play_this_test.Sensitive = false;
                        if(forceProcessFinish)
                        {
                                if(capturingForce != arduinoCaptureStatus.COPIED_TO_TMP)
@@ -955,9 +956,11 @@ LogB.Information(" re C ");
                                                                currentForceSensor.UniqueID);
                                                SqliteForceSensor.Update(false, currentForceSensor);
                                                label_video_feedback.Text = "";
+                                               button_video_play_this_test.Sensitive = true;
                                        }
 
                                        Thread.Sleep (250); //Wait a bit to ensure is copied
+                                       sensitiveLastTestButtons(true);
 
                                        fscPoints.InitRealWidthHeight();
 
@@ -982,6 +985,7 @@ LogB.Information(" re C ");
                        {
                                //stop the camera (and do not save)
                                webcamEnd (Constants.TestTypes.FORCESENSOR, -1);
+                               sensitiveLastTestButtons(false);
 
                                if(forceProcessCancel)
                                        event_execute_label_message.Text = "Cancelled.";
@@ -1336,6 +1340,9 @@ LogB.Information(" re R ");
                assignCurrentForceSensorExercise();
                forceSensorCopyTempAndDoGraphs();
 
+               button_video_play_this_test.Sensitive = (fs.VideoURL != "");
+               sensitiveLastTestButtons(true);
+
                //if drawingarea has still not shown, don't paint graph because GC screen is not defined
                if(force_sensor_ai_drawingareaShown)
                {
diff --git a/src/gui/webcam.cs b/src/gui/webcam.cs
index 01734af9..e9cc05f2 100644
--- a/src/gui/webcam.cs
+++ b/src/gui/webcam.cs
@@ -232,6 +232,7 @@ public partial class ChronoJumpWindow
        }
        private void button_video_play_this_test_sensitive (WebcamManage.GuiContactsEncoder 
guiContactsEncoder, bool s)
        {
+               LogB.Information("button_video_play_this_test_sensitive: " + s.ToString());
                if(guiContactsEncoder == WebcamManage.GuiContactsEncoder.CONTACTS)
                        button_video_play_this_test.Sensitive = s;
                else
@@ -741,6 +742,16 @@ public partial class ChronoJumpWindow
 
        private void on_video_play_last_test_clicked (object o, EventArgs args)
        {
+               if(current_menuitem_mode == Constants.Menuitem_modes.FORCESENSOR)
+               {
+                       if(currentForceSensor == null || currentForceSensor.UniqueID == -1)
+                               new DialogMessage(Constants.MessageTypes.WARNING, "Sorry, file not found");
+                       else
+                               playVideo(Util.GetVideoFileName(currentSession.UniqueID, 
Constants.TestTypes.FORCESENSOR, currentForceSensor.UniqueID));
+
+                       return;
+               }
+
                Constants.TestTypes type = Constants.TestTypes.JUMP;
                int id = 0;
                switch (currentEventType.Type) {


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