Skip to content

add scope more channel_count#71

Open
hsb689 wants to merge 1 commit intosgl-org:mainfrom
hsb689:main
Open

add scope more channel_count#71
hsb689 wants to merge 1 commit intosgl-org:mainfrom
hsb689:main

Conversation

@hsb689
Copy link
Collaborator

@hsb689 hsb689 commented Mar 3, 2026

scope = sgl_scope_create(parent);
sgl_obj_set_pos(scope, 90, 160);
sgl_obj_set_size(scope, 200, 100);

// 设置为 2 通道模式
sgl_scope_set_channel_count(scope, 2);

// 为每个通道设置数据缓冲区
sgl_scope_set_channel_data_buffer(scope, 0, scope_buffer1, SGL_ARRAY_SIZE(scope_buffer1));
sgl_scope_set_channel_data_buffer(scope, 1, scope_buffer2, SGL_ARRAY_SIZE(scope_buffer2));

// 设置通道颜色(通道 0 为绿色,通道 1 为红色)
sgl_scope_set_channel_waveform_color(scope, 0, sgl_rgb(0, 255, 0));
sgl_scope_set_channel_waveform_color(scope, 1, sgl_rgb(255, 0, 0));

sgl_scope_set_bg_color(scope, sgl_rgb(26, 26, 26));
sgl_scope_set_line_width(scope, 1); // 设置线条宽度为 1 像素
sgl_scope_enable_auto_scale(scope, 1);
//sgl_scope_set_range(scope, 0, 10000);
sgl_scope_set_max_display_points(scope, 100); // 设置最大显示点数为 100
sgl_scope_set_alpha(scope, 200);
sgl_scope_set_grid_color(scope, sgl_rgb(127, 50, 50));    // 浅灰色网格线
sgl_scope_show_y_labels(scope, 1);// 显示 Y 轴标签
sgl_scope_set_y_label_font(scope, &ChironGoRoundTC_700B_12);
sgl_scope_set_y_label_color(scope, sgl_rgb(150, 150, 150));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant