use of com.willwinder.universalgcodesender.types.Macro in project Universal-G-Code-Sender by winder.
the class MacroPanel method update.
/**
* Updates a macro and saves it in the settings.
* @param index macro index
* @param field field to update
* @param text updated text
*/
private void update(int index, MACRO_FIELD field, String text) {
Settings s = backend.getSettings();
Macro macro = s.getMacro(index);
switch(field) {
case NAME:
macro.setName(text);
break;
case CODE:
macro.setGcode(text);
break;
case DESCRIPTION:
macro.setDescription(text);
break;
}
s.updateMacro(index, macro);
}
Aggregations