曲线绘制,间隔1500ms绘制下一个数据点

This commit is contained in:
吴俊潮 2025-02-06 14:48:58 +08:00
parent 34fddfbc9d
commit 5431f6d9ab
370 changed files with 84437 additions and 39919 deletions

View File

@ -2,7 +2,7 @@
* @Author: wujunchao wujunchao@wuxismart.com * @Author: wujunchao wujunchao@wuxismart.com
* @Date: 2024-12-27 11:51:06 * @Date: 2024-12-27 11:51:06
* @LastEditors: wujunchao wujunchao@wuxismart.com * @LastEditors: wujunchao wujunchao@wuxismart.com
* @LastEditTime: 2025-02-05 14:33:58 * @LastEditTime: 2025-02-06 14:13:18
* @FilePath: \signal_generator\App\APP_WU\Inc\apps_gather.h * @FilePath: \signal_generator\App\APP_WU\Inc\apps_gather.h
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -121,6 +121,7 @@ void battery_show(void); //电池电量显示
void key_functions_main(void); //按键功能,主界面 void key_functions_main(void); //按键功能,主界面
void key_functions_setting(void); //按键功能,详细设置菜单界面 void key_functions_setting(void); //按键功能,详细设置菜单界面
void num_twinkle(void); //数值闪烁数值发生变化后开始闪烁10秒无动作后闪烁停止游标移动后恢复前一时刻位置的数值 void num_twinkle(void); //数值闪烁数值发生变化后开始闪烁10秒无动作后闪烁停止游标移动后恢复前一时刻位置的数值
void plot_drawing(void); //实时曲线绘制
typedef enum typedef enum
{ {
@ -176,6 +177,31 @@ typedef struct
//screen_setting //screen_setting
}MENU_DATA; }MENU_DATA;
typedef struct
{
//lv_chart_set_range(ui->screen_main_chart_1, LV_CHART_AXIS_PRIMARY_Y, y_pri_low, y_pri_up);
int y_pri_up; //纵轴(主)上限
int y_pri_low; //纵轴(主)下限
float32 yreal_pri_up; //实际值y上限
float32 yreal_pri_low; //实际值y下限
//lv_chart_set_range(ui->screen_main_chart_1, LV_CHART_AXIS_SECONDARY_Y, y_scd_low, y_scd_up);
int y_scd_up; //纵轴(副)上限
int y_scd_low; //纵轴(副)下限
float32 yreal_scd_up; //实际值y上限
float32 yreal_scd_low; //实际值y下限
//lv_chart_set_next_value(ui->screen_main_chart_1, ui->screen_main_chart_1_0, 1);
int y_pri_value; //0号曲线的下一个点主y轴
float32 yreal_pri_value; //0号曲线的下一个实际值
//lv_chart_set_next_value(ui->screen_main_chart_1, ui->screen_main_chart_1_1, 1);
int y_scd_value; //1号曲线的下一个点副y轴
float32 yreal_scd_value; //1号曲线的下一个实际值
}PLOT_DATA;
/**********test5**********/ /**********test5**********/

View File

@ -2,7 +2,7 @@
* @Author: wujunchao wujunchao@wuxismart.com * @Author: wujunchao wujunchao@wuxismart.com
* @Date: 2024-12-27 11:50:56 * @Date: 2024-12-27 11:50:56
* @LastEditors: wujunchao wujunchao@wuxismart.com * @LastEditors: wujunchao wujunchao@wuxismart.com
* @LastEditTime: 2025-02-05 16:53:58 * @LastEditTime: 2025-02-06 14:38:05
* @FilePath: \signal_generator\App\APP_WU\Src\apps_gather.c * @FilePath: \signal_generator\App\APP_WU\Src\apps_gather.c
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -12,6 +12,7 @@
#if 1 #if 1
/**********test5**********/ /**********test5**********/
MENU_DATA m5data; MENU_DATA m5data;
PLOT_DATA pltdata;
// char buff_io[2]; // char buff_io[2];
void menu_data_init(void) void menu_data_init(void)
{ {
@ -26,25 +27,44 @@ void menu_data_init(void)
m5data.scr_init_cnt = 0; m5data.scr_init_cnt = 0;
//screen_main //screen_main
m5data.runtime_seconds = 0;
m5data.runtime_minutes = 0;
m5data.runtime_hours = 0;
m5data.battery_cnt = 0;
m5data.io_cursor = 3; //当前游标位置,[000,000]:0~5
m5data.io_cursor_prv = 3; //前一时刻游标位置
m5data.twk_flag = 0; //0停止闪烁1开始闪烁
m5data.io_mode = IO_OUTPUT; //默认工作模式0输入IN1输出OUT
for(uint8_t i = 0; i < 6; i++)
{ {
m5data.io_numbers[i] = 0; m5data.runtime_seconds = 0;
} m5data.runtime_minutes = 0;
m5data.input_mode = SIG_VOLTAGE; m5data.runtime_hours = 0;
m5data.input_mode_type = VOLTAGE_MV; m5data.battery_cnt = 0;
m5data.output_mode = SIG_VOLTAGE; m5data.io_cursor = 3; //当前游标位置,[000,000]:0~5
m5data.output_mode_type = VOLTAGE_MV; m5data.io_cursor_prv = 3; //前一时刻游标位置
m5data.twk_flag = 0; //0停止闪烁1开始闪烁
// memset(buff_io,0,2); m5data.io_mode = IO_OUTPUT; //默认工作模式0输入IN1输出OUT
for(uint8_t i = 0; i < 6; i++)
{
m5data.io_numbers[i] = 0;
}
m5data.input_mode = SIG_VOLTAGE;
m5data.input_mode_type = VOLTAGE_MV;
m5data.output_mode = SIG_VOLTAGE;
m5data.output_mode_type = VOLTAGE_MV;
// memset(buff_io,0,2); //用于lvgl文本显示
//图标显示值int
pltdata.y_pri_low = 0;
pltdata.y_pri_up = 100;
pltdata.y_scd_low = 0;
pltdata.y_scd_up = 100;
pltdata.y_pri_value = 0;
pltdata.y_scd_value = 0;
//实际物理量float32
pltdata.yreal_pri_low = 4;
pltdata.yreal_pri_up = 20;
pltdata.yreal_scd_low = 4;
pltdata.yreal_scd_up = 20;
pltdata.yreal_pri_value = 0;
pltdata.yreal_scd_value = 0;
}
//screen_setting //screen_setting
} }
@ -739,7 +759,8 @@ void scr_main_run(void) //主界面
battery_show(); battery_show();
//动态曲线绘制 //动态曲线绘制
plot_drawing();
//当前输出值、工作模式、IN/OUT、ON/OFF、当前工作模式的单位或类型。该部分内容已迁移至按键功能按键按下后再对显示内容进行设置 //当前输出值、工作模式、IN/OUT、ON/OFF、当前工作模式的单位或类型。该部分内容已迁移至按键功能按键按下后再对显示内容进行设置
//数值闪烁 //数值闪烁
num_twinkle(); num_twinkle();
@ -1002,6 +1023,22 @@ void num_twinkle(void) //数值闪烁
} }
void plot_drawing(void) //实时曲线绘制
{
if(plot_1500ms_flag)
{
plot_1500ms_flag = 0;
pltdata.yreal_pri_value = m5data.io_numbers[0]*100 + m5data.io_numbers[1]*10 + m5data.io_numbers[2] + \
m5data.io_numbers[3]*(float32)0.1 + m5data.io_numbers[4]*(float32)0.01 + m5data.io_numbers[5]*(float32)0.001;
pltdata.y_pri_value = ( pltdata.y_pri_up - pltdata.y_pri_low ) * \
( pltdata.yreal_pri_value - pltdata.yreal_pri_low ) / ( pltdata.yreal_pri_up - pltdata.yreal_pri_low );
lv_chart_set_next_value(guider_ui.screen_main_chart_1, guider_ui.screen_main_chart_1_0, pltdata.y_pri_value);
}
}
void scr_setting_run(void) //详细设置界面 void scr_setting_run(void) //详细设置界面
{ {

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More