I'm creating an HMI using GUI Guider (used both version 1.80 and 1.90 with the same results). I'm using a FRDM-RW612 board and I started from the "Screen Transitions" Widget, to which I made some changes. The problem I'm having is that I can't get rid of some custom code that keeps getting generated no matter what I do.
Specifically, in custom.c, ALL of this code I didn't want, and no longer have any widgets that use it, they were all removed:
/*
* Copyright 2024 NXP
* NXP Proprietary. This software is owned or controlled by NXP and may only be used strictly in
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
* terms, then you may not retain, install, activate or otherwise use the software.
*/
/*********************
* INCLUDES
*********************/
#include <stdio.h>
#include <stdlib.h>
#include "lvgl.h"
#include "custom.h"
/*********************
* DEFINES
*********************/
#define CHART1_POINTS 100
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
static int32_t speed = 0;
static bool is_increase = true;
static int16_t spd_chart[CHART1_POINTS] = {0};
static bool is_up = true;
/**
* Create a demo application
*/
void custom_init(lv_ui *ui)
{
/* Add your codes here */
}
/**********************
* STATIC FUNCTIONS
**********************/
void speed_meter_timer_cb(lv_timer_t * t)
{
lv_ui * gui = t->user_data;
if(speed >= 110) is_increase = false;
if(speed <= 70) is_increase = true;
lv_meter_set_indicator_value(gui->speed_meter_board, gui->speed_meter_board_scale_0_ndline_0, speed);
lv_label_set_text_fmt(gui->speed_label_digit, "%"LV_PRId32, speed);
if(is_increase)
{
speed ++;
}else
{
speed --;
}
}
void record_chart_timer_cb(lv_timer_t * t)
{
lv_obj_t * obj = t->user_data;
lv_chart_series_t * ser = lv_chart_get_series_next(obj, NULL);
lv_coord_t * ser_array = lv_chart_get_y_array(obj, ser);
for(int i = 0; i < CHART1_POINTS - 1; i++)
{
spd_chart[i] = spd_chart[i+1];
ser_array[i] = spd_chart[i];
}
if(spd_chart[CHART1_POINTS - 1] > 110) is_up = false;
if(spd_chart[CHART1_POINTS - 1] < 70) is_up = true;
if(is_up)
{
spd_chart[CHART1_POINTS - 1] += lv_rand(0, 5);
}else
{
spd_chart[CHART1_POINTS - 1] -= lv_rand(0, 5);
}
ser_array[CHART1_POINTS - 1] = spd_chart[CHART1_POINTS - 1];
lv_chart_refresh(obj);
}
Same problem for custom.h, I want all this custom code gone:
/*
* Copyright 2024 NXP
* NXP Proprietary. This software is owned or controlled by NXP and may only be used strictly in
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
* terms, then you may not retain, install, activate or otherwise use the software.
*/
#ifndef __CUSTOM_H_
#define __CUSTOM_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "gui_guider.h"
void custom_init(lv_ui *ui);
void speed_meter_timer_cb(lv_timer_t * t);
void record_chart_timer_cb(lv_timer_t * t);
#ifdef __cplusplus
}
#endif
#endif /* EVENT_CB_H_ */
All the original widgets on the graphing screen were deleted, see screenshot in the attachments. The widgets were first removed (didn't get rid of the code), then the screen name was changed, other widgets were added (still got the custom code). There are no events that contain this code in the event viewer. So, I don't know where the code is getting generated from.
I can't edit it directly in the code editor either. If I make any changes, they disappear as soon as I clock on another file, even if I go to File->Save or generate code. I also tried cleaning up the code and generating again, but still get the code. I checked the custom code for both screens under the custom code tab, but those are already empty (see screenshot).
W