Skip to content

Commit 14a200d

Browse files
committed
halscope: fixed some mixed whitespaces & indentations
1 parent f34122e commit 14a200d

1 file changed

Lines changed: 58 additions & 56 deletions

File tree

src/hal/utils/scope_vert.c

Lines changed: 58 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -535,20 +535,20 @@ static void init_chan_sel_window(void)
535535
color_array[0][j] = normal_colors[n][j];
536536
color_array[1][j] = selected_colors[n][j];
537537
}
538-
snprintf(buf, 4, "%ld", n + 1);
539-
/* define the button */
540-
button = gtk_toggle_button_new_with_label(buf);
538+
snprintf(buf, 4, "%ld", n + 1);
539+
/* define the button */
540+
button = gtk_toggle_button_new_with_label(buf);
541541

542542
style_with_css(button, color_array);
543-
/* put it in the window */
544-
gtk_box_pack_start(GTK_BOX(ctrl_usr->chan_sel_win), button, TRUE,
545-
TRUE, 0);
546-
gtk_widget_show(button);
547-
/* hook a callback function to it */
548-
g_signal_connect(button, "clicked",
549-
G_CALLBACK(chan_sel_button), (gpointer) n + 1);
550-
/* save the button pointer */
551-
vert->chan_sel_buttons[n] = button;
543+
/* put it in the window */
544+
gtk_box_pack_start(GTK_BOX(ctrl_usr->chan_sel_win), button, TRUE,
545+
TRUE, 0);
546+
gtk_widget_show(button);
547+
/* hook a callback function to it */
548+
g_signal_connect(button, "clicked",
549+
G_CALLBACK(chan_sel_button), (gpointer) n + 1);
550+
/* save the button pointer */
551+
vert->chan_sel_buttons[n] = button;
552552
}
553553
}
554554

@@ -804,26 +804,27 @@ static void chan_sel_button(GtkWidget * widget, gpointer gdata)
804804
chan = &(ctrl_usr->chan[chan_num - 1]);
805805

806806
if (ignore_click != 0) {
807-
ignore_click = 0;
808-
return;
807+
ignore_click = 0;
808+
return;
809809
}
810810
if (vert->chan_enabled[chan_num - 1] == 0 ) {
811-
/* channel is disabled, want to enable it */
812-
if (ctrl_shm->state != IDLE) {
813-
/* acquisition in progress, must restart it */
811+
/* channel is disabled, want to enable it */
812+
813+
if (ctrl_shm->state != IDLE) {
814+
/* acquisition in progress, must restart it */
814815
prepare_scope_restart();
815-
}
816-
count = 0;
817-
for (n = 0; n < 16; n++) {
818-
if (vert->chan_enabled[n]) {
819-
count++;
820-
}
821-
}
822-
if (count >= ctrl_shm->sample_len) {
823-
/* max number of channels already enabled */
824-
/* force the button to pop back out */
825-
ignore_click = 1;
826-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), FALSE);
816+
}
817+
count = 0;
818+
for (n = 0; n < 16; n++) {
819+
if (vert->chan_enabled[n]) {
820+
count++;
821+
}
822+
}
823+
if (count >= ctrl_shm->sample_len) {
824+
/* max number of channels already enabled */
825+
/* force the button to pop back out */
826+
ignore_click = 1;
827+
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), FALSE);
827828
dialog = gtk_message_dialog_new(GTK_WINDOW(ctrl_usr->main_win),
828829
GTK_DIALOG_MODAL,
829830
GTK_MESSAGE_INFO,
@@ -836,29 +837,30 @@ static void chan_sel_button(GtkWidget * widget, gpointer gdata)
836837
"the record length to allow for more channels"));
837838
gtk_dialog_run(GTK_DIALOG(dialog));
838839
gtk_widget_destroy(dialog);
839-
return;
840-
}
841-
if (chan->name == NULL) {
842-
/* need to assign a source */
843-
if (dialog_select_source(chan_num) != TRUE) {
844-
/* user failed to assign a source */
845-
/* force the button to pop back out */
846-
ignore_click = 1;
847-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), FALSE);
848-
return;
849-
}
850-
}
851-
vert->chan_enabled[chan_num - 1] = 1;
840+
return;
841+
}
842+
if (chan->name == NULL) {
843+
/* need to assign a source */
844+
845+
if (dialog_select_source(chan_num) != TRUE) {
846+
/* user failed to assign a source */
847+
/* force the button to pop back out */
848+
ignore_click = 1;
849+
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), FALSE);
850+
return;
851+
}
852+
}
853+
vert->chan_enabled[chan_num - 1] = 1;
852854
} else {
853-
/* channel was already enabled, user wants to select it */
854-
/* button should stay down, so we force it */
855-
ignore_click = 1;
856-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
855+
/* channel was already enabled, user wants to select it */
856+
/* button should stay down, so we force it */
857+
ignore_click = 1;
858+
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
857859
}
858860
if (vert->selected != chan_num) {
859-
/* make chan_num the selected channel */
860-
vert->selected = chan_num;
861-
channel_changed();
861+
/* make chan_num the selected channel */
862+
vert->selected = chan_num;
863+
channel_changed();
862864
}
863865
}
864866

@@ -1093,16 +1095,16 @@ void channel_changed(void)
10931095

10941096
vert = &(ctrl_usr->vert);
10951097
if ((vert->selected < 1) || (vert->selected > 16)) {
1096-
gtk_label_set_text_if(vert->scale_label, "----");
1097-
gtk_label_set_text_if(vert->chan_num_label, "--");
1098-
gtk_label_set_text_if(vert->source_name_label, "------");
1099-
request_display_refresh(1);
1100-
return;
1098+
gtk_label_set_text_if(vert->scale_label, "----");
1099+
gtk_label_set_text_if(vert->chan_num_label, "--");
1100+
gtk_label_set_text_if(vert->source_name_label, "------");
1101+
request_display_refresh(1);
1102+
return;
11011103
}
11021104
chan = &(ctrl_usr->chan[vert->selected - 1]);
11031105
/* set position slider based on new channel */
11041106
gtk_adjustment_set_value(GTK_ADJUSTMENT(vert->pos_adj),
1105-
chan->position * VERT_POS_RESOLUTION);
1107+
chan->position * VERT_POS_RESOLUTION);
11061108
/* set scale slider based on new channel */
11071109
adj = GTK_ADJUSTMENT(vert->scale_adj);
11081110
gtk_adjustment_set_lower(adj, chan->min_index);
@@ -1115,7 +1117,7 @@ void channel_changed(void)
11151117
gtk_label_set_text_if(vert->source_name_label, name);
11161118
/* update the offset display */
11171119
if (chan->data_type == HAL_BIT) {
1118-
snprintf(buf1, BUFLEN, "----");
1120+
snprintf(buf1, BUFLEN, "----");
11191121
} else {
11201122
if(chan->ac_offset) {
11211123
snprintf(buf1, BUFLEN, "(AC)");

0 commit comments

Comments
 (0)