[chronojump] AutoDetect encoder on progressbar
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] AutoDetect encoder on progressbar
- Date: Sun, 5 Apr 2015 13:12:41 +0000 (UTC)
commit f38c0a8069bbf43833fccacb95c4b5101c016099
Author: Xavier de Blas <xaviblas gmail com>
Date: Sun Apr 5 15:11:18 2015 +0200
AutoDetect encoder on progressbar
glade/chronojump.glade | 502 ++++++++++++++++++++-------------
src/Makefile.am | 1 -
src/chronopicDialogAutoController.cs | 63 +++--
src/constants.cs | 4 +
src/gui/chronojump.cs | 27 ++-
src/gui/chronopicAuto.cs | 58 ----
src/gui/encoder.cs | 5 +-
src/gui/helpPorts.cs | 7 +-
8 files changed, 383 insertions(+), 284 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index bd7060c..72889a1 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -6615,6 +6615,12 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">True</property>
@@ -7480,6 +7486,12 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
<child>
@@ -8597,6 +8609,12 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">2</property>
@@ -9355,6 +9373,12 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">4</property>
@@ -13273,45 +13297,105 @@ on current Chronojump version.</property>
<property name="can_focus">False</property>
<property name="spacing">20</property>
<child>
- <widget class="GtkRadioButton"
id="radio_mode_encoder_capture_small">
+ <widget class="GtkHBox"
id="hbox_encoder_sup_capture_analyze_two_buttons">
<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_radio_mode_encoder_capture_small_toggled" swapped="no"/>
+ <property name="can_focus">False</property>
+ <property name="spacing">20</property>
<child>
- <widget class="GtkHBox" id="hbox134">
+ <widget class="GtkRadioButton"
id="radio_mode_encoder_capture_small">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">10</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_radio_mode_encoder_capture_small_toggled" swapped="no"/>
<child>
- <widget class="GtkImage" id="image_mode_encoder_capture">
+ <widget class="GtkHBox" id="hbox134">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-execute</property>
+ <property name="spacing">10</property>
+ <child>
+ <widget class="GtkImage"
id="image_mode_encoder_capture">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-execute</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel"
id="label_mode_encoder_capture">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Capture</property>
+ <property name="justify">center</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton"
id="radio_mode_encoder_analyze_small">
+ <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_radio_mode_encoder_analyze_small_toggled" swapped="no"/>
<child>
- <widget class="GtkLabel" id="label_mode_encoder_capture">
+ <widget class="GtkHBox" id="hbox135">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label"
translatable="yes">Capture</property>
- <property name="justify">center</property>
+ <property name="spacing">10</property>
+ <child>
+ <widget class="GtkImage" id="image_stats_win_graph3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-missing-image</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="label_mode_encoder_analyze">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Analyze</property>
+ <property name="justify">center</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">True</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>
@@ -13321,24 +13405,32 @@ on current Chronojump version.</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton"
id="radio_mode_encoder_analyze_small">
- <property name="visible">True</property>
+ <widget class="GtkButton" id="button_encoder_maximize">
+ <property name="label">gtk-zoom-fit</property>
<property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="relief">none</property>
- <property name="draw_indicator">False</property>
- <property
name="group">radio_mode_encoder_capture_small</property>
- <signal name="toggled"
handler="on_radio_mode_encoder_analyze_small_toggled" swapped="no"/>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked"
handler="on_button_encoder_maximize_clicked" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
- <widget class="GtkHBox" id="hbox135">
- <property name="visible">True</property>
+ <widget class="GtkHBox" id="hbox_chronopic_encoder_detecting">
<property name="can_focus">False</property>
- <property name="spacing">10</property>
+ <property name="spacing">4</property>
<child>
- <widget class="GtkImage" id="image_stats_win_graph3">
+ <widget class="GtkProgressBar"
id="progressbar_chronopic_encoder_detecting">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="text" translatable="yes">Detecting
...</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -13347,11 +13439,12 @@ on current Chronojump version.</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label_mode_encoder_analyze">
+ <widget class="GtkButton"
id="button_chronopic_encoder_detecting_cancel">
+ <property name="label">gtk-cancel</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label"
translatable="yes">Analyze</property>
- <property name="justify">center</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -13359,53 +13452,86 @@ on current Chronojump version.</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <widget class="GtkButton"
id="button_chronopic_encoder_detecting_info">
+ <property name="label">gtk-info</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">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>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkViewport" id="viewport_chronopic_encoder">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="shadow_type">none</property>
<child>
- <widget class="GtkHBox" id="hbox_chronopic_encoder">
+ <widget class="GtkViewport" id="viewport_chronopic_encoder">
<property name="visible">True</property>
- <property name="app_paintable">True</property>
- <property name="can_focus">True</property>
- <property name="spacing">10</property>
+ <property name="can_focus">False</property>
+ <property name="shadow_type">none</property>
<child>
- <widget class="GtkHBox" id="hbox75">
+ <widget class="GtkHBox" id="hbox_chronopic_encoder">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">2</property>
+ <property name="app_paintable">True</property>
+ <property name="can_focus">True</property>
+ <property name="spacing">10</property>
<child>
<widget class="GtkHBox" id="hbox95">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="spacing">2</property>
<child>
- <widget class="GtkImage"
id="image_chronopic_encoder_no">
+ <widget class="GtkHBox" id="hbox133">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkImage"
id="image_chronopic_encoder_no">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-no</property>
<property name="icon-size">2</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkImage"
id="image_chronopic_encoder_yes">
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-yes</property>
+ <property name="icon-size">3</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkImage"
id="image_chronopic_encoder_yes">
+ <widget class="GtkLabel"
id="label_chronopic_encoder">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-yes</property>
- <property name="icon-size">3</property>
+ <property name="xpad">5</property>
+ <property name="label"
translatable="yes">Encoder disconnected</property>
+ <property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -13421,80 +13547,48 @@ on current Chronojump version.</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label_chronopic_encoder">
+ <widget class="GtkButton"
id="button_activate_chronopics_encoder">
+ <property name="width_request">50</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xpad">5</property>
- <property name="label" translatable="yes">Encoder
disconnected</property>
- <property name="use_markup">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip" translatable="yes">Connect
encoder</property>
+ <property name="relief">half</property>
+ <signal name="clicked"
handler="on_chronopic_encoder_clicked" swapped="no"/>
+ <child>
+ <widget class="GtkImage" id="image15">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-connect</property>
+ <property name="icon-size">2</property>
+ </widget>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton"
id="button_activate_chronopics_encoder">
- <property name="width_request">50</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">True</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip" translatable="yes">Connect
encoder</property>
- <property name="relief">half</property>
- <signal name="clicked"
handler="on_chronopic_encoder_clicked" swapped="no"/>
- <child>
- <widget class="GtkImage" id="image15">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-connect</property>
- <property name="icon-size">2</property>
- </widget>
- </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">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="button_encoder_maximize">
- <property name="label">gtk-zoom-fit</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- <signal name="clicked"
handler="on_button_encoder_maximize_clicked" swapped="no"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -18695,84 +18789,6 @@ Just select port and then close this window.</property>
</widget>
</child>
</widget>
- <widget class="GtkDialog" id="dialog_chronopic_auto">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="resizable">False</property>
- <property name="modal">True</property>
- <property name="type_hint">dialog</property>
- <signal name="delete_event" handler="on_delete_event" swapped="no"/>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox8">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">2</property>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area8">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="button_cancel">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- <signal name="clicked" handler="on_button_cancel_clicked" swapped="no"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">8</property>
- <child>
- <widget class="GtkLabel" id="label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Autodetecting hardware ...</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkProgressBar" id="progressbar">
- <property name="visible">True</property>
- <property name="can_focus">False</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">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
<widget class="GtkDialog" id="dialog_help_ports">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -19974,6 +19990,12 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -20640,6 +20662,12 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -21798,6 +21826,12 @@ by you</property>
<placeholder/>
</child>
<child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
<widget class="GtkButton" id="button_video_url">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -22013,6 +22047,12 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">True</property>
@@ -31948,6 +31988,42 @@ options</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -33994,6 +34070,12 @@ 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>
</widget>
</child>
</widget>
@@ -34698,6 +34780,12 @@ 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>
</widget>
</child>
</widget>
@@ -37368,6 +37456,12 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="left_attach">2</property>
@@ -37698,6 +37792,12 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -38043,6 +38143,12 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
diff --git a/src/Makefile.am b/src/Makefile.am
index 136717c..46b3a00 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -7,7 +7,6 @@ LINK = $(REF_DEP_CHRONOJUMP)
SOURCES = \
gui/chronojump.cs\
gui/chronopic.cs\
- gui/chronopicAuto.cs\
gui/confirm.cs\
gui/encoder.cs\
gui/encoderTreeviews.cs\
diff --git a/src/chronopicDialogAutoController.cs b/src/chronopicDialogAutoController.cs
index 29500de..99399b0 100644
--- a/src/chronopicDialogAutoController.cs
+++ b/src/chronopicDialogAutoController.cs
@@ -25,30 +25,41 @@ using Gtk;
public class ChronopicDialogAutoController
{
- ChronopicDialogAuto cp_dialog_auto;
Thread thread;
+ Gtk.ProgressBar progressbar;
+ Gtk.Button button_cancel;
+ Gtk.Button button_info;
+
private static bool cancel;
- public string Detected;
+ public bool Detecting; //used to block closing chronojump window if true
+ public string Detected; //readed from chronojump window
public Gtk.Button FakeButtonDone;
- public ChronopicDialogAutoController ()
+ public ChronopicDialogAutoController (Gtk.ProgressBar progressbar, Gtk.Button button_cancel,
Gtk.Button button_info)
{
- cp_dialog_auto = new ChronopicDialogAuto();
- cp_dialog_auto.button_cancel.Clicked += new EventHandler(on_button_cancel_clicked);
+ this.progressbar = progressbar;
+ this.button_cancel = button_cancel;
+ this.button_info = button_info;
+ button_cancel.Clicked += new EventHandler(on_button_cancel_clicked);
+ button_info.Clicked += new EventHandler(on_button_info_clicked);
+
FakeButtonDone = new Gtk.Button();
+ Detecting = false;
}
public void Detect(string mode)
{
if(mode == "ENCODER") {
LogB.Information("Detecting encoder... ");
-
+
+ //set variables
cancel = false;
Detected = "";
-
+ Detecting = true;
+
thread = new Thread(new ThreadStart(detectEncoder));
GLib.Idle.Add (new GLib.IdleHandler (PulseGTK));
@@ -59,23 +70,26 @@ public class ChronopicDialogAutoController
private void detectEncoder()
{
- /*
+ //simulateDriverProblem(); //uncomment to check cancel, info buttons behaviour
+
+ ChronopicAutoDetect cad =
+ new ChronopicAutoDetect(ChronopicAutoDetect.ChronopicType.ENCODER);
+
+ Detected = cad.Detected;
+ }
+
+ private void simulateDriverProblem()
+ {
//testing a fault in drivers
int count = 0;
bool crash = true;
while(crash) {
count ++;
- if(count >= 10000) {
+ if(count >= 40000) {
LogB.Debug(" at detectEncoder\n ");
count = 0;
}
}
- */
-
- ChronopicAutoDetect cad =
- new ChronopicAutoDetect(ChronopicAutoDetect.ChronopicType.ENCODER);
-
- Detected = cad.Detected;
}
private bool PulseGTK ()
@@ -86,14 +100,14 @@ public class ChronopicDialogAutoController
if(cancel)
thread.Abort();
- cp_dialog_auto.Done(); //close dialog window
FakeButtonDone.Click(); //send signal to gui/chronojump.cs to read Detected
+ Detecting = false;
LogB.ThreadEnded();
return false;
}
- cp_dialog_auto.progressbar.Pulse();
+ progressbar.Pulse();
Thread.Sleep (50);
LogB.Debug(thread.ThreadState.ToString());
@@ -102,11 +116,24 @@ public class ChronopicDialogAutoController
private void on_button_cancel_clicked (object o, EventArgs args)
{
- cp_dialog_auto.button_cancel.Clicked -= new EventHandler(on_button_cancel_clicked);
+ button_cancel.Clicked -= new EventHandler(on_button_cancel_clicked);
Detected = "Cancelled";
cancel = true;
}
+
+ private void on_button_info_clicked (object o, EventArgs args)
+ {
+ string str = Constants.FindDriverNeed;
+
+ if(UtilAll.IsWindows())
+ str += "\n\n" + Constants.FindDriverWindows;
+ else
+ str += "\n\n" + Constants.FindDriverOthers;
+
+ new DialogMessage(Constants.MessageTypes.INFO, str);
+ }
+
~ChronopicDialogAutoController() {}
}
diff --git a/src/constants.cs b/src/constants.cs
index e893890..4e3b29b 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -490,6 +490,10 @@ public class Constants
public static string FoundUSBSerialPortsString = Catalog.GetString("USB-serial ports found:");
public static string NotFoundUSBSerialPortsString = Catalog.GetString("Not found any USB-serial
ports.") + " " + Catalog.GetString("Is Chronopic connected?");
+ public static string FindDriverNeed = Catalog.GetString("Chronopic driver has to be installed.");
+ public static string FindDriverWindows = Catalog.GetString("If you have problems connecting with
Chronopic, ensure you have the <b>driver</b> installed at 'Windows Start Menu / Chronojump / Install
Chronopic driver'.");
+ public static string FindDriverOthers = Catalog.GetString("Check Chronojump software website.");
+
// public static System.Media.SystemSound SoundCanStart = System.Media.SystemSounds.Question;
// public static System.Media.SystemSounds SoundGood = System.Media.SystemSounds.Exclamation;
// public static System.Media.SystemSounds SoundBad = System.Media.SystemSounds.Beep;
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index e22ceae..4f735c8 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -208,8 +208,10 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Label label_connected_chronopics;
[Widget] Gtk.Label label_chronopics_multitest;
[Widget] Gtk.Image image_simulated_warning;
- //[Widget] Gtk.TextView textview_message_connected_chronopics;
- //[Widget] Gtk.Image image_connected_chronopics;
+ [Widget] Gtk.Box hbox_chronopic_encoder_detecting;
+ [Widget] Gtk.ProgressBar progressbar_chronopic_encoder_detecting;
+ [Widget] Gtk.Button button_chronopic_encoder_detecting_cancel;
+ [Widget] Gtk.Button button_chronopic_encoder_detecting_info;
[Widget] Gtk.Viewport viewport_chronopic_encoder;
[Widget] Gtk.Label label_chronopic_encoder;
[Widget] Gtk.Image image_chronopic_encoder_no;
@@ -2345,6 +2347,11 @@ public partial class ChronoJumpWindow
private void on_delete_event (object o, DeleteEventArgs args) {
args.RetVal = true;
+
+ //cannot terminate chronojump untile press 'cancel' if autodetect encoder is working
+ if(cp_dialog_auto_c != null && cp_dialog_auto_c.Detecting == true)
+ return;
+
on_quit1_activate (new object(), new EventArgs ());
}
@@ -2366,7 +2373,7 @@ public partial class ChronoJumpWindow
private void on_quit2_activate (object o, EventArgs args) {
LogB.Information("Bye!");
-
+
if(chronopicWin.Connected == true) {
chronopicWin.SerialPortsClose();
}
@@ -2886,7 +2893,15 @@ public partial class ChronoJumpWindow
{
if(m == menuitem_modes.POWER)
{
- cp_dialog_auto_c = new ChronopicDialogAutoController();
+ main_menu.Sensitive = false;
+ hbox_chronopic_encoder_detecting.Visible = true;
+ viewport_chronopic_encoder.Visible = false;
+
+ cp_dialog_auto_c = new ChronopicDialogAutoController(
+ progressbar_chronopic_encoder_detecting,
+ button_chronopic_encoder_detecting_cancel,
+ button_chronopic_encoder_detecting_info
+ );
cp_dialog_auto_c.Detect("ENCODER");
@@ -2901,6 +2916,10 @@ public partial class ChronoJumpWindow
private void on_autoDetectChronopic_done(object o, EventArgs args)
{
cp_dialog_auto_c.FakeButtonDone.Clicked -= new EventHandler(on_autoDetectChronopic_done);
+
+ main_menu.Sensitive = true;
+ hbox_chronopic_encoder_detecting.Visible = false;
+ viewport_chronopic_encoder.Visible = true;
string str = cp_dialog_auto_c.Detected;
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 4455317..ffd1820 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -49,6 +49,7 @@ public partial class ChronoJumpWindow
//[Widget] Gtk.SpinButton spin_encoder_capture_inertial;
[Widget] Gtk.Box hbox_encoder_sup_capture_analyze;
+ [Widget] Gtk.Box hbox_encoder_sup_capture_analyze_two_buttons;
[Widget] Gtk.Box hbox_encoder_configuration;
[Widget] Gtk.Box hbox_encoder_capture_options;
@@ -3803,7 +3804,7 @@ public partial class ChronoJumpWindow
LogB.Debug(option.ToString());
//columns
- //c0 button_encoder_capture, hbox_encoder_sup_capture_analyze,
+ //c0 button_encoder_capture, hbox_encoder_sup_capture_analyze_two_buttons,
// hbox_encoder_configuration, hbox_encoder_capture_options
//c1 button_encoder_recalculate
//c2 button_encoder_load_signal
@@ -3864,7 +3865,7 @@ public partial class ChronoJumpWindow
}
button_encoder_capture.Sensitive = Util.IntToBool(table[0]);
- hbox_encoder_sup_capture_analyze.Sensitive = Util.IntToBool(table[0]);
+ hbox_encoder_sup_capture_analyze_two_buttons.Sensitive = Util.IntToBool(table[0]);
hbox_encoder_configuration.Sensitive = Util.IntToBool(table[0]);
hbox_encoder_capture_options.Sensitive = Util.IntToBool(table[0]);
diff --git a/src/gui/helpPorts.cs b/src/gui/helpPorts.cs
index cd1d94c..fb3fa39 100644
--- a/src/gui/helpPorts.cs
+++ b/src/gui/helpPorts.cs
@@ -78,13 +78,14 @@ public class HelpPorts
if(UtilAll.IsWindows()) {
label_help_info.Text =
- Catalog.GetString("If you have problems connecting with Chronopic, ensure you
have the <b>driver</b> installed at 'Windows Start Menu / Chronojump / Install Chronopic driver'.") + "\n\n"
+
+ Constants.FindDriverWindows + "\n\n" +
Catalog.GetString("Ports above COM4 may not work.") + "\n" +
Catalog.GetString("If you want a safer port, press:") + "\n" +
Catalog.GetString("Force Chronopic to port <b>COM1 - COM4</b>'.");
- label_help_info.UseMarkup = true;
} else
- label_help_info.Visible = false;
+ label_help_info.Text = Constants.FindDriverOthers;
+
+ label_help_info.UseMarkup = true;
label_help_manual.Text =
Catalog.GetString("More information on <b>Chronojump Manual</b>") + "\n" +
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]