This commit is contained in:
2021-10-14 13:47:35 +02:00
commit 6625a8dfaa
4026 changed files with 844291 additions and 0 deletions
@@ -0,0 +1,999 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">1</property>
<property name="upper">999</property>
<property name="value">4</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<property name="upper">100</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment3">
<property name="upper">100</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkDialog" id="dialog-common-gnd-ref">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Common Ground and Reference</property>
<property name="window_position">center</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;big&gt;Connect to Common Ground&lt;/big&gt;</property>
<property name="use_markup">True</property>
<property name="justify">center</property>
</object>
<packing>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton-gnd-blockA">
<property name="label" translatable="yes">Block A (yellow)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton-gnd-blockB">
<property name="label" translatable="yes">Block B (red)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton-gnd-blockC">
<property name="label" translatable="yes">Block C (blue)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton-gnd-blockD">
<property name="label" translatable="yes">Block D (green)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator4">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkTable" id="table3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;big&gt;Connect to Common Reference&lt;/big&gt;</property>
<property name="use_markup">True</property>
<property name="justify">center</property>
</object>
<packing>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton-ref-blockA">
<property name="label" translatable="yes">Block A (yellow)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton-ref-blockB">
<property name="label" translatable="yes">Block B (red)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton-ref-blockC">
<property name="label" translatable="yes">Block C (blue)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton-ref-blockD">
<property name="label" translatable="yes">Block D (green)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkDialog" id="dialog-filters">
<property name="can_focus">False</property>
<property name="border_width">7</property>
<property name="title" translatable="yes">Amplifier Filters</property>
<property name="window_position">center</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;big&gt;Notch filter&lt;/big&gt;
Type - Order - [Low Pass; High Pass] - Frequency</property>
<property name="use_markup">True</property>
<property name="justify">center</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox-notch">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">liststore1</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator5">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;big&gt;Band Pass filter&lt;/big&gt;
Type - Order - [Low Cut; High Cut] - Frequency</property>
<property name="use_markup">True</property>
<property name="justify">center</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox-band-pass">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">liststore2</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext2"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkListStore" id="liststore1">
<columns>
<!-- column-name filter -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="liststore2">
<columns>
<!-- column-name filter -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="model1">
<columns>
<!-- column-name gchararray -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">32</col>
</row>
<row>
<col id="0" translatable="yes">64</col>
</row>
<row>
<col id="0" translatable="yes">128</col>
</row>
<row>
<col id="0" translatable="yes">256</col>
</row>
<row>
<col id="0" translatable="yes">512</col>
</row>
<row>
<col id="0" translatable="yes">600</col>
</row>
<row>
<col id="0" translatable="yes">1200</col>
</row>
<row>
<col id="0" translatable="yes">2400</col>
</row>
<row>
<col id="0" translatable="yes">4800</col>
</row>
<row>
<col id="0" translatable="yes">9600</col>
</row>
<row>
<col id="0" translatable="yes">19200</col>
</row>
<row>
<col id="0" translatable="yes">38400</col>
</row>
</data>
</object>
<object class="GtkListStore" id="model2">
<columns>
<!-- column-name gchararray -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">unspecified</col>
</row>
<row>
<col id="0" translatable="yes">female</col>
</row>
<row>
<col id="0" translatable="yes">male</col>
</row>
<row>
<col id="0" translatable="yes">unknown</col>
</row>
</data>
</object>
<object class="GtkListStore" id="model3">
<columns>
<!-- column-name gchararray -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkDialog" id="openvibe-acquisition-server-settings">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Device configuration</property>
<property name="window_position">center</property>
<property name="type_hint">dialog</property>
<property name="gravity">center</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK</property>
<property name="spacing">8</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button_apply">
<property name="label">gtk-apply</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button_cancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">g.Tec gUSBamp</property>
<property name="justify">center</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">8</property>
<property name="spacing">8</property>
<child>
<object class="GtkHBox" id="hbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">8</property>
<child>
<object class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">10</property>
<property name="n_columns">2</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkSpinButton" id="spinbutton_number_of_channels">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="adjustment">adjustment1</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_number_of_channels">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Number of channels :</property>
<property name="justify">right</property>
<property name="single_line_mode">True</property>
</object>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_master_device">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Master device :</property>
<property name="justify">right</property>
<property name="single_line_mode">True</property>
</object>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox_sampling_frequency">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">model1</property>
<child>
<object class="GtkCellRendererText" id="renderer1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_sampling_frequency">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Sampling frequency :</property>
<property name="justify">right</property>
<property name="single_line_mode">True</property>
</object>
<packing>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox_gender">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">model2</property>
<child>
<object class="GtkCellRendererText" id="renderer2"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox_master_device">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">model3</property>
<child>
<object class="GtkCellRendererText" id="renderer3"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton_identifier">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="adjustment">adjustment2</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton_age">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="adjustment">adjustment3</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_identifier">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Identifier :</property>
<property name="justify">right</property>
<property name="single_line_mode">True</property>
</object>
</child>
<child>
<object class="GtkLabel" id="label_age">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Age :</property>
<property name="justify">right</property>
<property name="single_line_mode">True</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_gender">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Gender :</property>
<property name="justify">right</property>
<property name="single_line_mode">True</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton_EventChannel">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_event_channel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Event channel</property>
</object>
<packing>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_bipolar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Bipolar electrodes</property>
</object>
<packing>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton_Bipolar">
<property name="label" translatable="yes">1-2=1,...,15-16=15</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_padding">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_Calibrationsignal">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Calibration signal</property>
</object>
<packing>
<property name="top_attach">8</property>
<property name="bottom_attach">9</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton_CalibrationSignal">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">8</property>
<property name="bottom_attach">9</property>
<property name="x_padding">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label-impedance">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Check impedance :</property>
</object>
<packing>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton_impedance">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton_ShowDeviceName">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">10</property>
<property name="bottom_attach">11</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_show_device_name">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Show device name</property>
</object>
<packing>
<property name="top_attach">10</property>
<property name="bottom_attach">11</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button_calibrate">
<property name="label" translatable="yes">Auto calibrate in 4 seconds...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator2">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button-common-gnd-ref">
<property name="label" translatable="yes">Connect to Common Gnd and Ref</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button-filters">
<property name="label" translatable="yes">Set Amplifier Filters</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator3">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button_change_channel_names">
<property name="label" translatable="yes">Change channel names...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">6</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator1">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-10">button_apply</action-widget>
<action-widget response="-6">button_cancel</action-widget>
</action-widgets>
</object>
</interface>
@@ -0,0 +1,401 @@
#if defined TARGET_HAS_ThirdPartyGUSBampCAPI
#include "CConfigurationGTecGUSBamp.hpp"
#include <windows.h>
#include <gUSBamp.h>
#include <iostream>
#include <sstream>
namespace OpenViBE {
namespace AcquisitionServer {
static void ApplyFiltersPressedCB(GtkButton* /*button*/, void* data) { static_cast<CConfigurationGTecGUSBamp*>(data)->buttonFiltersApplyPressedCB(); }
static void CalibratePressedCB(GtkButton* /*button*/, void* data) { static_cast<CConfigurationGTecGUSBamp*>(data)->buttonCalibratePressedCB(); }
static void CommonGndRefPressedCB(GtkButton* /*button*/, void* data) { static_cast<CConfigurationGTecGUSBamp*>(data)->buttonCommonGndRefPressedCB(); }
static void FiltersPressedCB(GtkButton* /*button*/, void* data) { static_cast<CConfigurationGTecGUSBamp*>(data)->buttonFiltersPressedCB(); }
static gboolean idle_calibrate_cb(void* data)
{
static_cast<CConfigurationGTecGUSBamp*>(data)->idleCalibrateCB();
return FALSE;
}
CConfigurationGTecGUSBamp::CConfigurationGTecGUSBamp(const char* gtkBuilderFilename, uint8_t& commonGndAndRefBitmap, int& notchFilterIdx,
int& bandPassFilterIdx, bool& triggerInput, const std::vector<std::string>& devicesSerials,
std::string& masterDeviceIndex, bool& bipolar, bool& calibrationSignalEnabled, bool& showDeviceName)
: CConfigurationBuilder(gtkBuilderFilename), m_commonGndAndRefBitmap(commonGndAndRefBitmap), m_notchFilterIdx(notchFilterIdx),
m_bandPassFilterIdx(bandPassFilterIdx), m_triggerInput(triggerInput), m_devicesSerials(devicesSerials), m_masterDeviceIdx(masterDeviceIndex),
m_bipolarEnabled(bipolar), m_calibrationSignalEnabled(calibrationSignalEnabled), m_showDeviceName(showDeviceName) {}
bool CConfigurationGTecGUSBamp::preConfigure()
{
if (!CConfigurationBuilder::preConfigure()) { return false; }
GtkCheckButton* hardwareTagging = GTK_CHECK_BUTTON(gtk_builder_get_object(m_builder, "checkbutton_EventChannel"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hardwareTagging), m_triggerInput);
GtkCheckButton* bipolar = GTK_CHECK_BUTTON(gtk_builder_get_object(m_builder, "checkbutton_Bipolar"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bipolar), m_bipolarEnabled);
GtkCheckButton* showDeviceName = GTK_CHECK_BUTTON(gtk_builder_get_object(m_builder, "checkbutton_ShowDeviceName"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(showDeviceName), m_showDeviceName);
GtkCheckButton* calibrationMode = GTK_CHECK_BUTTON(gtk_builder_get_object(m_builder, "checkbutton_CalibrationSignal"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(calibrationMode), m_calibrationSignalEnabled);
GtkComboBox* comboBox = GTK_COMBO_BOX(gtk_builder_get_object(m_builder, "combobox_master_device"));
// Default active device is the last one
if (!m_devicesSerials.empty()) { gtk_combo_box_set_active(comboBox, m_devicesSerials.size() - 1); }
// If a device is already set, try to use that as the combo box selection; if not found, use last (set above).
int masterIndex = int(m_devicesSerials.size()) - 1;
for (size_t i = 0; i < m_devicesSerials.size(); ++i)
{
gtk_combo_box_append_text(comboBox, m_devicesSerials[i].c_str());
if (this->m_masterDeviceIdx == m_devicesSerials[i]) { masterIndex = i; }
}
if (masterIndex >= 0) { gtk_combo_box_set_active(comboBox, masterIndex); }
// Sets the channel limits depending on the number of amps
GtkSpinButton* numChannels = GTK_SPIN_BUTTON(gtk_builder_get_object(m_builder, "spinbutton_number_of_channels"));
gtk_spin_button_set_range(numChannels, 1, m_devicesSerials.size() * 16); // GTEC_NUM_CHANNELS
const size_t count = this->m_devicesSerials.size();
/*
char buffer[1024];
int count=0;
bool selected=false;*/
// autodetection of the connected device
/*for (uint32_t i=1; i<11; ++i)
{
::HANDLE handle=::GT_OpenDevice(i);
if(handle)
{
::GT_CloseDevice(&handle);
sprintf(buffer, "USB port %i", i);
::gtk_combo_box_append_text(comboBox, buffer);
if(m_usbIdx==i)
{
::gtk_combo_box_set_active(comboBox, count);
selected=true;
}
count++;
}
}
*/
//if(!selected && count!=0) { ::gtk_combo_box_set_active(comboBox, 0); }
g_signal_connect(gtk_builder_get_object(m_builder, "button_calibrate"), "pressed", G_CALLBACK(CalibratePressedCB), this);
g_signal_connect(gtk_builder_get_object(m_builder, "button-common-gnd-ref"), "pressed", G_CALLBACK(CommonGndRefPressedCB), this);
g_signal_connect(gtk_builder_get_object(m_builder, "button-filters"), "pressed", G_CALLBACK(FiltersPressedCB), this);
GtkWidget* dialog = GTK_WIDGET(gtk_builder_get_object(m_builder, "dialog-common-gnd-ref"));
gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_APPLY, GTK_RESPONSE_APPLY);
gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
dialog = GTK_WIDGET(gtk_builder_get_object(m_builder, "dialog-filters"));
GtkWidget* buttonApplyFilters = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_APPLY, GTK_RESPONSE_APPLY);
g_signal_connect(buttonApplyFilters, "pressed", G_CALLBACK(ApplyFiltersPressedCB), this);
gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
GtkToggleButton* checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-gnd-blockA"));
gtk_toggle_button_set_active(checkBox, (m_commonGndAndRefBitmap & 1));
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-gnd-blockB"));
gtk_toggle_button_set_active(checkBox, (m_commonGndAndRefBitmap & (1 << 1)));
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-gnd-blockC"));
gtk_toggle_button_set_active(checkBox, (m_commonGndAndRefBitmap & (1 << 2)));
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-gnd-blockD"));
gtk_toggle_button_set_active(checkBox, (m_commonGndAndRefBitmap & (1 << 3)));
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-ref-blockA"));
gtk_toggle_button_set_active(checkBox, (m_commonGndAndRefBitmap & (1 << 4)));
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-ref-blockB"));
gtk_toggle_button_set_active(checkBox, (m_commonGndAndRefBitmap & (1 << 5)));
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-ref-blockC"));
gtk_toggle_button_set_active(checkBox, (m_commonGndAndRefBitmap & (1 << 6)));
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-ref-blockD"));
gtk_toggle_button_set_active(checkBox, (m_commonGndAndRefBitmap & (1 << 7)));
if (count == 0)
{
// deactivate the buttons
GtkWidget* button = GTK_WIDGET(gtk_builder_get_object(m_builder, "button-filters"));
gtk_widget_set_sensitive(button, false);
button = GTK_WIDGET(gtk_builder_get_object(m_builder, "button-common-gnd-ref"));
gtk_widget_set_sensitive(button, false);
}
return true;
}
bool CConfigurationGTecGUSBamp::postConfigure()
{
GtkComboBox* comboBox = GTK_COMBO_BOX(gtk_builder_get_object(m_builder, "combobox_master_device"));
if (m_applyConfig)
{
/*
int usbIdx=0;
const char* usbIdx=::gtk_combo_box_get_active_text(comboBox);
if(usbIdx) { if(sscanf(usbIdx, "USB port %i", &usbIdx)==1) { m_usbIdx=(uint32_t)usbIdx; } }
*/
if (this->m_devicesSerials.size() > 1)
{
char* selectedSerial = gtk_combo_box_get_active_text(comboBox);
m_masterDeviceIdx = (selectedSerial == nullptr) ? "" : selectedSerial;
}
GtkToggleButton* checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-gnd-blockA"));
m_commonGndAndRefBitmap = (gtk_toggle_button_get_active(checkBox) ? 1 : 0);
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-gnd-blockB"));
m_commonGndAndRefBitmap = m_commonGndAndRefBitmap + (gtk_toggle_button_get_active(checkBox) ? (1 << 1) : 0);
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-gnd-blockC"));
m_commonGndAndRefBitmap = m_commonGndAndRefBitmap + (gtk_toggle_button_get_active(checkBox) ? (1 << 2) : 0);
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-gnd-blockD"));
m_commonGndAndRefBitmap = m_commonGndAndRefBitmap + (gtk_toggle_button_get_active(checkBox) ? (1 << 3) : 0);
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-ref-blockA"));
m_commonGndAndRefBitmap = m_commonGndAndRefBitmap + (gtk_toggle_button_get_active(checkBox) ? (1 << 4) : 0);
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-ref-blockB"));
m_commonGndAndRefBitmap = m_commonGndAndRefBitmap + (gtk_toggle_button_get_active(checkBox) ? (1 << 5) : 0);
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-ref-blockC"));
m_commonGndAndRefBitmap = m_commonGndAndRefBitmap + (gtk_toggle_button_get_active(checkBox) ? (1 << 6) : 0);
checkBox = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_builder, "checkbutton-ref-blockD"));
m_commonGndAndRefBitmap = m_commonGndAndRefBitmap + (gtk_toggle_button_get_active(checkBox) ? (1 << 7) : 0);
GtkComboBox* notch = GTK_COMBO_BOX(gtk_builder_get_object(m_builder, "combobox-notch"));
if (gtk_combo_box_get_active(notch) >= 0)
{
// Only update the filter index if the user chose something. This is needed so going to the Configuration menu doesn't
// change previous filter choices.
m_notchFilterIdx = ((gtk_combo_box_get_active(notch) == 0) ? -1 : m_comboBoxNotchFilterIdx[gtk_combo_box_get_active(notch) - 1]
); //-1 because there is one more in the beginning
}
GtkComboBox* bandPass = GTK_COMBO_BOX(gtk_builder_get_object(m_builder, "combobox-band-pass"));
if (gtk_combo_box_get_active(bandPass) >= 0)
{
// Only update the filter index if the user chose something -1 because there is one more in the beginning
m_bandPassFilterIdx = ((gtk_combo_box_get_active(bandPass) == 0) ? -1 : int(m_comboBoxBandPassFilterIdx[gtk_combo_box_get_active(bandPass) - 1]));
}
GtkCheckButton* hardwareTagging = GTK_CHECK_BUTTON(gtk_builder_get_object(m_builder, "checkbutton_EventChannel"));
m_triggerInput = (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hardwareTagging)) ? true : false);
GtkCheckButton* showDeviceName = GTK_CHECK_BUTTON(gtk_builder_get_object(m_builder, "checkbutton_ShowDeviceName"));
m_showDeviceName = (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(showDeviceName)) ? true : false);
GtkCheckButton* bipolar = GTK_CHECK_BUTTON(gtk_builder_get_object(m_builder, "checkbutton_Bipolar"));
m_bipolarEnabled = (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(bipolar)) ? true : false);
GtkCheckButton* calibrationSignal = GTK_CHECK_BUTTON(gtk_builder_get_object(m_builder, "checkbutton_CalibrationSignal"));
m_calibrationSignalEnabled = (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(calibrationSignal)) ? true : false);
}
if (!CConfigurationBuilder::postConfigure()) { return false; }
return true;
}
void CConfigurationGTecGUSBamp::buttonCalibratePressedCB()
{
g_idle_add(idle_calibrate_cb, this);
m_calibrateDialog = gtk_message_dialog_new(nullptr, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, "Calibrating...");
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(m_calibrateDialog), "Please wait a few seconds...");
gtk_dialog_run(GTK_DIALOG(m_calibrateDialog));
gtk_widget_destroy(m_calibrateDialog);
if (m_calibrationDone)
{
GtkWidget* dialog = gtk_message_dialog_new(nullptr, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, "Calibration finished !");
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
}
else
{
GtkWidget* dialog = gtk_message_dialog_new(nullptr, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, "Calibration failed !");
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
}
}
void CConfigurationGTecGUSBamp::idleCalibrateCB()
{
GtkComboBox* comboBox = GTK_COMBO_BOX(gtk_builder_get_object(m_builder, "combobox_master_device"));
m_calibrationDone = false;
//calibrate all detected devices
for (uint32_t i = 0; i < this->m_devicesSerials.size(); ++i)
{
LPSTR serial = const_cast<char*>(m_devicesSerials[i].c_str());
HANDLE handle = GT_OpenDeviceEx(serial);
if (handle)
{
m_calibrationDone = true;
SCALE calibration;
if (!GT_Calibrate(handle, &calibration)) { std::cout << "err GT_Calibrate\n", m_calibrationDone = false; }
if (!GT_SetScale(handle, &calibration))
{
std::cout << "err GT_SetScale\n";
m_calibrationDone = false;
}
GT_CloseDevice(&handle);
}
}
gtk_dialog_response(GTK_DIALOG(m_calibrateDialog), 0);
}
void CConfigurationGTecGUSBamp::buttonCommonGndRefPressedCB()
{
GtkWidget* dialog = GTK_WIDGET(gtk_builder_get_object(m_builder, "dialog-common-gnd-ref"));
gint resp = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_hide(dialog);
}
void CConfigurationGTecGUSBamp::buttonFiltersPressedCB()
{
GtkWidget* dialog = GTK_WIDGET(gtk_builder_get_object(m_builder, "dialog-filters"));
setHardwareFiltersDialog();
gint resp = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_hide(dialog);
}
void CConfigurationGTecGUSBamp::setHardwareFiltersDialog()
{
m_comboBoxBandPassFilterIdx.clear();
m_comboBoxNotchFilterIdx.clear();
GtkComboBox* comboBoxBandPass = GTK_COMBO_BOX(gtk_builder_get_object(m_builder, "combobox-band-pass"));
GtkTreeModel* bandPassListStore = gtk_combo_box_get_model(comboBoxBandPass);
gtk_list_store_clear(GTK_LIST_STORE(bandPassListStore));
GtkComboBox* comboBoxNotch = GTK_COMBO_BOX(gtk_builder_get_object(m_builder, "combobox-notch"));
GtkTreeModel* notchListStore = gtk_combo_box_get_model(comboBoxNotch);
gtk_list_store_clear(GTK_LIST_STORE(notchListStore));
// To check for available filters in the amplifier, we must connect to it.
if (!m_devicesSerials[0].empty())
{
LPSTR serial = const_cast<char*>(m_devicesSerials[0].c_str());
HANDLE handle = GT_OpenDeviceEx(serial);
int nBandPassFilters, nNotchFilters;
if (!GT_GetNumberOfFilter(&nBandPassFilters)) { std::cout << "err GT_GetNumberOfFilter\n"; }
if (nBandPassFilters == 0) { std::cout << "err No band pass filters found at all!\n"; }
if (!GT_GetNumberOfNotch(&nNotchFilters)) { std::cout << "err GT_GetNumberOfNotch\n"; }
if (nNotchFilters == 0) { std::cout << "err No notch filters found at all!\n"; }
FILT* bpFilterSpec = new FILT[nBandPassFilters];
FILT* notchFilterSpec = new FILT[nNotchFilters];
if (!GT_GetFilterSpec(bpFilterSpec)) { std::cout << "err GT_GetFilterSpec\n"; }
if (!GT_GetNotchSpec(notchFilterSpec)) { std::cout << "err GT_GetNotchSpec\n"; }
//Set BandPass filter list
std::stringstream desc;
desc << "no band pass filter.";
GtkTreeIter it;
gtk_list_store_append(GTK_LIST_STORE(bandPassListStore), &it);
gtk_list_store_set(GTK_LIST_STORE(bandPassListStore), &it, 0, desc.str().c_str(), -1);
desc.clear();
desc.str("");
gchar* sSampling = gtk_combo_box_get_active_text(GTK_COMBO_BOX(m_sampling));
const uint32_t sampling = (sSampling ? atoi(sSampling) : 0);
int cbBandPassSelectedIdx = -1;
// std::cout << "The device reports " << nBandPassFilters << " band pass filters and " << nNotchFilters << " notch filters\n";
if (nBandPassFilters > 0)
{
for (int i = 0; i < nBandPassFilters; ++i)
{
if (sampling == uint32_t(bpFilterSpec[i].fs))
{
if (bpFilterSpec[i].type == 1) { desc << "Butterworth - "; }
if (bpFilterSpec[i].type == 2) { desc << "Chebyshev - "; }
desc << bpFilterSpec[i].order << " - [" << bpFilterSpec[i].fu << "; " << bpFilterSpec[i].fo << "] - " << bpFilterSpec[i].fs;
GtkTreeIter iter;
gtk_list_store_append(GTK_LIST_STORE(bandPassListStore), &iter);
gtk_list_store_set(GTK_LIST_STORE(bandPassListStore), &iter, 0, desc.str().c_str(), -1);
desc.clear();
desc.str("");
m_comboBoxBandPassFilterIdx.push_back(i);
//here a previous selection is loaded
if (cbBandPassSelectedIdx == -1 && i == m_bandPassFilterIdx) { cbBandPassSelectedIdx = int(m_comboBoxBandPassFilterIdx.size()) - 1; }
}
}
}
gtk_combo_box_set_active(comboBoxBandPass, cbBandPassSelectedIdx + 1); // +1 because -1 is for "no filter".
//Set Notch filter List
desc << "no notch filter.";
gtk_list_store_append(GTK_LIST_STORE(notchListStore), &it);
gtk_list_store_set(GTK_LIST_STORE(notchListStore), &it, 0, desc.str().c_str(), -1);
desc.clear();
desc.str("");
int cbNotchSelectedIndex = -1;
if (nNotchFilters > 0)
{
for (int i = 0; i < nNotchFilters; ++i)
{
if (sampling == int(notchFilterSpec[i].fs))
{
if (notchFilterSpec[i].type == 1) { desc << "Butterworth - "; }
if (notchFilterSpec[i].type == 2) { desc << "Chebyshev - "; }
desc << notchFilterSpec[i].order << " - [" << notchFilterSpec[i].fu << "; " << notchFilterSpec[i].fo << "] - " << notchFilterSpec[i].fs;
GtkTreeIter iter;
gtk_list_store_append(GTK_LIST_STORE(notchListStore), &iter);
gtk_list_store_set(GTK_LIST_STORE(notchListStore), &iter, 0, desc.str().c_str(), -1);
desc.clear();
desc.str("");
m_comboBoxNotchFilterIdx.push_back(i);
//here a previous selection is loaded
if (cbNotchSelectedIndex == -1 && i == m_notchFilterIdx) { cbNotchSelectedIndex = int(m_comboBoxNotchFilterIdx.size()) - 1; }
}
}
}
gtk_combo_box_set_active(comboBoxNotch, cbNotchSelectedIndex + 1); // +1 because -1 is for "no filter".
delete bpFilterSpec;
delete notchFilterSpec;
GT_CloseDevice(&handle);
}
}
void CConfigurationGTecGUSBamp::buttonFiltersApplyPressedCB()
{
GtkComboBox* comboBoxBandPass = GTK_COMBO_BOX(gtk_builder_get_object(m_builder, "combobox-band-pass"));
//-1 because there is one more in the beginning
m_bandPassFilterIdx = (gtk_combo_box_get_active(comboBoxBandPass) == -1 || gtk_combo_box_get_active(comboBoxBandPass) == 0) ? -1
: int(m_comboBoxBandPassFilterIdx[gtk_combo_box_get_active(comboBoxBandPass) - 1]);
GtkComboBox* comboBoxNotch = GTK_COMBO_BOX(gtk_builder_get_object(m_builder, "combobox-notch"));
//-1 because there is one more in the beginning
m_notchFilterIdx = (gtk_combo_box_get_active(comboBoxNotch) == -1 || gtk_combo_box_get_active(comboBoxNotch) == 0) ? -1
: int(m_comboBoxNotchFilterIdx[gtk_combo_box_get_active(comboBoxNotch) - 1]);
}
} // namespace AcquisitionServer
} // namespace OpenViBE
#endif // TARGET_HAS_ThirdPartyGUSBampCAPI
@@ -0,0 +1,53 @@
#pragma once
#if defined TARGET_HAS_ThirdPartyGUSBampCAPI
#include "../ovasCConfigurationBuilder.h"
#include <gtk/gtk.h>
#include <string>
#include <vector>
namespace OpenViBE
{
namespace AcquisitionServer
{
class CConfigurationGTecGUSBamp final : public CConfigurationBuilder
{
public:
CConfigurationGTecGUSBamp(const char* gtkBuilderFilename, uint8_t& commonGndAndRefBitmap, int& notchFilterIdx, int& bandPassFilterIdx,
bool& triggerInput, const std::vector<std::string>& devicesSerials, std::string& masterDeviceIndex, bool& bipolar,
bool& calibrationSignalEnabled, bool& showDeviceName);
bool preConfigure() override;
bool postConfigure() override;
void buttonCalibratePressedCB();
void idleCalibrateCB();
void buttonCommonGndRefPressedCB();
void buttonFiltersPressedCB();
void setHardwareFiltersDialog();
void buttonFiltersApplyPressedCB();
protected:
uint8_t& m_commonGndAndRefBitmap;
int& m_notchFilterIdx;
int& m_bandPassFilterIdx;
bool& m_triggerInput;
std::vector<std::string> m_devicesSerials;
std::string& m_masterDeviceIdx;
std::vector<size_t> m_comboBoxBandPassFilterIdx;
std::vector<size_t> m_comboBoxNotchFilterIdx;
bool& m_bipolarEnabled;
bool& m_calibrationSignalEnabled;
bool& m_showDeviceName;
GtkWidget* m_calibrateDialog = nullptr;
bool m_calibrationDone = false;
};
} // namespace AcquisitionServer
} // namespace OpenViBE
#endif // TARGET_HAS_ThirdPartyGUSBampCAPI
@@ -0,0 +1,183 @@
#pragma once
#if defined TARGET_HAS_ThirdPartyGUSBampCAPI
#include "ovasIDriver.h"
#include "../ovasCHeader.h"
#include "../ovasCSettingsHelper.h"
#include "../ovasCSettingsHelperOperators.h"
#include <Windows.h>
#include "ringbuffer.h"
#include <gtk/gtk.h>
#include <vector>
//threading
#include <thread>
#include <mutex>
#include <condition_variable>
#include <memory> // unique_ptr
#include <deque>
namespace OpenViBE
{
namespace AcquisitionServer
{
/**
* \class CDriverGTecGUSBamp
* \author Anton Andreev, Gipsa-lab, VIBS team
* \date 19/07/2012
* \brief GTEC driver
*
* This driver was rewritten to match the code provided by Guger as much as possible. There are several things
* that all must work together so that higher frequencies are supported and no hardware triggers are lost.
*
* This driver supports several buffers so that the more than one GT_GetData can be executed in the beginning (QUEUE_SIZE)
* and then calls to GT_GetData are queued. This allows data to be processed by OpenVibe while waiting for the next result of
* a previously issued GT_GetData. The extra thread is added to support this and to allow for async IO.
*
* Hardware triggers on the parallel port are supported.
*
* The driver supports several g.tec devices working with the provided async cables. There are several requirements for async
* acquisition to work properly and these are checked in verifySyncMode().
*/
#ifndef __GDEVICE_H__
#define __GDEVICE_H__
struct GDevice
{
HANDLE handle;
std::string serial;
};
#endif
class CDriverGTecGUSBamp final : public IDriver
{
public:
explicit CDriverGTecGUSBamp(IDriverContext& ctx);
void release() { delete this; }
const char* getName() override { return "g.tec gUSBamp Gipsa-lab"; }
bool initialize(const uint32_t nSamplePerSentBlock, IDriverCallback& callback) override;
bool uninitialize() override;
bool start() override;
bool stop() override;
bool loop() override;
bool isConfigurable() override { return true; }
bool configure() override;
const IHeader* getHeader() override { return &m_header; }
bool CDriverGTecGUSBamp::acquire();
void configFiltering(HANDLE device);
protected:
static const int BUFFER_SIZE_SECONDS = 2; //the size of the GTEC ring buffer in seconds
static const int GTEC_NUM_CHANNELS = 16; //the number of channels without countig the trigger channel
static const int QUEUE_SIZE =
8; //4 default //the number of GT_GetData calls that will be queued during acquisition to avoid loss of data
static const int NUMBER_OF_SCANS =
32; //the number of scans that should be received simultaneously (depending on the _sampleRate; see C-API documentation for this value!)
size_t numDevices() const { return m_devices.size(); }
static const uint32_t N_POINTS = NUMBER_OF_SCANS * (GTEC_NUM_CHANNELS + 1);
int m_validPoints = 0;
static const DWORD BUFFER_SIZE_BYTES;
SettingsHelper m_settings;
IDriverCallback* m_callback = nullptr;
CHeader m_header;
float* m_sample = nullptr;
uint32_t m_nSamplePerSentBlock = 0;
uint32_t m_globalImpedanceIdx = 0;
uint8_t m_commonGndAndRefBitmap = 0;
int m_notchFilterIdx = -1;
int m_bandPassFilterIdx = -1;
bool m_triggerInputEnabled = false;
bool m_bipolarEnabled =
false; //electrodes are substracted in sepecific sequence 1-2=1, ... 15-16=15 which results in 8 instead of 16 electrodes - used for EMG
bool m_calibrationSignalEnabled = false;
bool m_showDeviceName = false; //adds the amplifier serial number to the name of the channel
bool m_reconfigurationRequired = false; // After some gt calls, we may need reconfig
uint32_t m_nAcquiredChannel = GTEC_NUM_CHANNELS; //number of channels specified by the user, never counts the event channels
uint32_t m_totalHardwareStimulations = 0; //since start button clicked
uint32_t m_totalDriverChunksLost = 0; //since start button clicked
uint32_t m_totalDriverTimeouts = 0; //since start button clicked
uint32_t m_totalRingBufferOverruns = 0;
uint32_t m_totalDataUnavailable = 0;
//contains buffer per device and then QUEUE_SIZE buffers so that several calls to GT_GetData can be supported
BYTE*** m_buffers = nullptr;
OVERLAPPED** m_overlapped = nullptr;
bool m_flagIsFirstLoop = true;
bool m_bufferOverrun = false;
//ring buffer provided by Guger
CRingBuffer<float> m_ringBuffer;
uint32_t m_currentQueueIdx = 0;
std::unique_ptr<std::thread> m_threadPtr;
bool m_isThreadRunning = false;
std::mutex m_io_mutex;
float* m_bufferReceivedData = nullptr;
std::condition_variable m_itemAvailable;
bool configureDevice(uint32_t deviceNumber);
bool verifySyncMode();//Checks if devices are configured correctly when acquiring data from multiple devices
//Selects which device to become the new master, used only when more than 1 device is available
bool setMasterDevice(const std::string& targetMasterSerial); //0 first device
void detectDevices();
uint32_t m_mastersCnt = 0;
uint32_t m_slavesCnt = 0;
std::string m_masterSerial = "";
void remapChannelNames(); // Converts channel names while appending the device name and handling event channels
void restoreChannelNames(); // Restores channel names without the device name
std::vector<std::string> m_originalChannelNames; // Channel names without the device name inserted
std::vector<GDevice> m_devices; // List of amplifiers
std::string CDriverGTecGUSBamp::getSerialByHandler(HANDLE device);
// Stores information related to each channel available in the recording system
struct SChannel
{
int idx; // Channel index in openvibe Designer, -1 is unused
int oldIdx; // Channel index in the user-settable channel name list
int gtecDeviceIdx; // Device index of the gtec amplifier this channel is in
int gtecChannelIdx; // Channel index in the device-specific numbering
bool isEventChannel; // Is this the special digital channel?
};
// Channel indexes are seen as a sequence [dev1chn1, dev1chn2,...,dev1chnN, dev2chn1, dev2chn2, ..., dev2chnN, ...]
// The following vector is used to map these 'system indexes' to openvibe channels
std::vector<SChannel> m_channels;
};
} // namespace AcquisitionServer
} // namespace OpenViBE
#endif // TARGET_HAS_ThirdPartyGUSBampCAPI