Summary of problem:
Can not save a custom preset with “auto” as the focus height after having a custom value.
Steps to reproduce problem:
Create an engraving preset for a raster image.
Choose a custom focus height
save - works as expected, the custom focus height is saved
Select a proof-grade material
select the custom engraving preset
DELETE the value in focus height
Save the preset
Reload the page, or select another preset and return to the custom preset
The “auto” value is gone and the unwanted numeric custom value stays
when I delete the value set in focus height AUTO should be saved
Ergo: by having no custom focus height set I want the default focus height that is tied to the proofgrade material.
I suspect this problem happens because the server POST variable for the custom preset save() action AJAX call is empty, hence POST[‘focus_height’] is null or empty and no code has been written to handle this the way a human would expect, ergo the old value I have typed in returns preventing me from “deleting” the value and allowing the default value of “auto” to work as expected.
Suggestions for fix:
Write conditional code to handle the fact that humans may want to delete the value saved in focus_height and what that should mean to the machine is “we want nothing here, make this value return to the default of auto”. This good practice can be accomplished simply be checking if the value is numeric, and if not, well then it should be empty and save over the user’s previous value.
Or- create a session variable for the AUTO value of focus height for the material selected, and show it to us so we know “oh, ok, the auto value for this material is X for the focus height”
Or- drop in a checkbox next to focus height so we can send you a Boolean value of T/F if we want to use the AUTO value of the material we have selected.
Custom preset with focus height
ATTEMPT TO SAVE WITH NO VALUE IN FOCUS HEIGHT: Expected AUTO will save
UNWANTED VALUE RETURNS
Simple patch idea: Add a checkbox that says “use default” and now you dont have to get crazy with conditional statements for null POST values.
GUI Improvement Note-
As a user I should be informed of “what auto is” when I select a material, either here [below], in the material selection area, or, on some kind of inspection/info panel that tells me what you have decided “auto” means. (visually disambiguate the ambiguous reference to the variable use of the word ‘AUTO’ somewhere on the page for the user to understand what it’s value is based on the material they select)