Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instead of keeping a value it changes to zero after hitting enter. #93

Open
bcarriveau opened this issue Jan 13, 2024 · 3 comments
Open

Comments

@bcarriveau
Copy link

bcarriveau commented Jan 13, 2024

XTOUCH V0.9.58

Found when selecting nozzle or bed temps , if you dont change anything but hit enter, it will default to zero instead of keeping the current value.

At first I didnt realise it happen, but got it heating back up before anything bad happened lol.

Maybe it can give a confirmation question apon a value change before applying? Then one could say cancel or confirm?

20240112_194917_1.mp4
@heelsmj
Copy link

heelsmj commented Jan 27, 2024

I second this one. This actually messed up a couple prints for me before I realized what was happening because my nozzle temp went to zero while printing.

@xperiments
Copy link
Collaborator

Will check

@xperiments xperiments reopened this Jun 5, 2024
@lalala-code
Copy link

src\ui\components\ui_comp_temperaturecomponent.c

I modified the conditional code in the ui_event_comp_temperatureComponent_numpadKeyOk function in the file under the directory above. It now checks if any input was provided. I suspect that when there is no input, atoi converts it to 0.

if (ui_temperatureComponent_input_target == bed)
{
const char *data = lv_textarea_get_text(bed);
if (data && data[0] != '\0')
{
controlMode.target_bed_temper = atoi(data);
lv_msg_send(XTOUCH_COMMAND_BED_TARGET_TEMP, NULL);
}
lv_textarea_set_text(bed, "");
}
else if (ui_temperatureComponent_input_target == nozzle)
{
const char *data = lv_textarea_get_text(nozzle);
if (data && data[0] != '\0')
{
controlMode.target_nozzle_temper = atoi(data);
lv_msg_send(XTOUCH_COMMAND_NOZZLE_TARGET_TEMP, NULL);
}
lv_textarea_set_text(nozzle, "");
}
else if (ui_temperatureComponent_input_target == part)
{
const char *data = lv_textarea_get_text(part);
if (data && data[0] != '\0')
{
bambuStatus.cooling_fan_speed = atoi(data) * 255 / 100;
lv_msg_send(XTOUCH_COMMAND_PART_FAN_SPEED, NULL);
}
lv_textarea_set_text(part, "");
}
else if (ui_temperatureComponent_input_target == aux)
{
const char *data = lv_textarea_get_text(aux);
if (data && data[0] != '\0')
{
bambuStatus.big_fan1_speed = atoi(data) * 255 / 100;
lv_msg_send(XTOUCH_COMMAND_AUX_FAN_SPEED, NULL);
}
lv_textarea_set_text(aux, "");
}
else if (ui_temperatureComponent_input_target == chamber)
{
const char *data = lv_textarea_get_text(chamber);
if (data && data[0] != '\0')
{
bambuStatus.big_fan2_speed = atoi(data) * 255 / 100;
lv_msg_send(XTOUCH_COMMAND_CHAMBER_FAN_SPEED, NULL);
}
lv_textarea_set_text(chamber, "");
}

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

No branches or pull requests

4 participants