sequence length can be changed from the UI

This commit is contained in:
Oleksiy
2025-03-11 20:27:50 +02:00
parent d59993d494
commit 47e4babcf6
3 changed files with 31 additions and 12 deletions

View File

@ -301,16 +301,30 @@ void updateScreen() {
valueStr = F("PATTERN B");
valueStr = valueStr + String(pattern - 7);
}
u8g2.drawUTF8(8, 5, valueStr.c_str() );
u8g2.drawUTF8(8, 6, valueStr.c_str() );
valueStr = F("L: ");
u8g2.drawUTF8(100, 5, valueStr.c_str() );
//u8g2.drawUTF8(100, 5, valueStr.c_str() );
if (!isRecording && stepNumSelected == -1) {
u8g2.drawButtonUTF8(97, 6, U8G2_BTN_BW1|U8G2_BTN_INV, 5, 1, 2, valueStr.c_str() );
} else {
u8g2.drawButtonUTF8(97, 6, U8G2_BTN_BW0, 5, 1, 2, valueStr.c_str() );
}
valueStr = String(sequences[patternToEdit].length + 1);
u8g2.drawUTF8(110, 5, valueStr.c_str() );
//u8g2.drawUTF8(110, 5, valueStr.c_str() );
if (!isRecording && stepNumSelected == -1 && (menuItemSelected || shiftBtnPushed)) {
u8g2.drawButtonUTF8(110, 6, U8G2_BTN_BW1, 8, 1, 2, valueStr.c_str() );
} else if (!isRecording && stepNumSelected == -1 && (!menuItemSelected || !shiftBtnPushed)) {
u8g2.drawButtonUTF8(110, 6, U8G2_BTN_BW1|U8G2_BTN_INV, 8, 1, 2, valueStr.c_str() );
} else {
u8g2.drawButtonUTF8(110, 6, U8G2_BTN_BW0, 8, 1, 2, valueStr.c_str() );
}
u8g2.drawHLine(0, 8, 128);
for (byte i = 0; i <= sequences[patternToEdit].length; i++) {
u8g2.drawUTF8(19 + (i % 8)*12, 18 + ((i / 8) * 11), (bitRead(sequences[patternToEdit].sequence, i) ? "q" : "p"));
}
if (!isRecording) {
if (!isRecording && stepNumSelected >= 0) {
u8g2.drawFrame(16 + (stepNumSelected % 8)*12, 10 + ((stepNumSelected / 8) * 11), 11, 11); //cursor
}