@@ -5361,7 +5361,7 @@ int osc_plot_ini_read_handler (OscPlot *plot, int line, const char *section,
5361
5361
gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (priv -> builder , "labelYMax" )));
5362
5362
gtk_widget_hide (priv -> y_axis_min );
5363
5363
gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (priv -> builder , "labelYMin" )));
5364
- }
5364
+ }
5365
5365
} else if (MATCH_NAME ("user_y_axis_max" ))
5366
5366
gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv -> y_axis_max ), atof (value ));
5367
5367
else if (MATCH_NAME ("user_y_axis_min" ))
@@ -6109,18 +6109,31 @@ static gint channel_compare(gconstpointer a, gconstpointer b)
6109
6109
static GSList * math_expression_get_iio_channel_list (const char * expression , struct iio_context * ctx , const char * device , bool * has_invalid_ch )
6110
6110
{
6111
6111
GSList * chn_list = NULL ;
6112
- GRegex * regex ;
6113
- GMatchInfo * info ;
6112
+ GRegex * regex , * regex_i , * regex_q ;
6113
+ GMatchInfo * info , * info_i , * info_q ;
6114
6114
gchar * chn_name ;
6115
6115
struct iio_device * iio_dev ;
6116
6116
struct iio_channel * iio_chn ;
6117
- gboolean invalid_list = false, is_match ;
6117
+ gboolean invalid_list = false, is_match = false, match_q , match_i , match ;
6118
6118
6119
6119
if (!device || !(iio_dev = iio_context_find_device (ctx , device )))
6120
6120
return NULL ;
6121
6121
6122
6122
regex = g_regex_new ("voltage[0-9]+" , 0 , 0 , NULL );
6123
- is_match = g_regex_match (regex , expression , 0 , & info );
6123
+ regex_i = g_regex_new ("voltage[0-9]+_i" , 0 , 0 , NULL );
6124
+ regex_q = g_regex_new ("voltage[0-9]+_q" , 0 , 0 , NULL );
6125
+ match = g_regex_match (regex , expression , 0 , & info );
6126
+ match_i = g_regex_match (regex_i , expression , 0 , & info_i );
6127
+ match_q = g_regex_match (regex_q , expression , 0 , & info_q );
6128
+
6129
+
6130
+ if (match_i || match_q || match )
6131
+ is_match = true;
6132
+ if (match_i )
6133
+ info = info_i ;
6134
+ if (match_q )
6135
+ info = info_q ;
6136
+
6124
6137
if (!is_match ) {
6125
6138
invalid_list = true;
6126
6139
} else {
@@ -6137,7 +6150,11 @@ static GSList * math_expression_get_iio_channel_list(const char *expression, str
6137
6150
} while (g_match_info_next (info , NULL ) && !invalid_list );
6138
6151
}
6139
6152
g_match_info_free (info );
6153
+ g_match_info_free (info_q );
6154
+ g_match_info_free (info_i );
6140
6155
g_regex_unref (regex );
6156
+ g_regex_unref (regex_i );
6157
+ g_regex_unref (regex_q );
6141
6158
6142
6159
if (invalid_list ) {
6143
6160
if (chn_list )
@@ -7039,7 +7056,7 @@ static void create_plot(OscPlot *plot)
7039
7056
g_error_free (err );
7040
7057
gtk_css_provider_load_from_path (GTK_CSS_PROVIDER (plot -> priv -> provider ),OSC_STYLE_FILE_PATH "styles.css" ,NULL );
7041
7058
}
7042
-
7059
+
7043
7060
//gtk_css_provider_load_from_path(GTK_CSS_PROVIDER(plot->priv->provider),"styles.css",NULL);
7044
7061
gtk_style_context_add_provider_for_screen (screen , GTK_STYLE_PROVIDER (plot -> priv -> provider ), GTK_STYLE_PROVIDER_PRIORITY_USER );
7045
7062
style_context = gtk_widget_get_style_context (GTK_WIDGET (priv -> databox ));
0 commit comments