Skip to content

Change options header remove from M600 #4236

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

Closed
wants to merge 3 commits into from
Closed

Change options header remove from M600 #4236

wants to merge 3 commits into from

Conversation

clexpert
Copy link
Contributor

@clexpert clexpert commented Jul 7, 2016

We removed optins header text for auto filament change from display to stay only two menu options without question due to problem with invisible cursor on static text.
MSG_FILAMENT_CHANGE_OPTION_HEADER in translate file removed
@MarlinFirmware/language-team

@thinkyhead
Copy link
Member

thinkyhead commented Jul 7, 2016

See if this fixes the issue with the cursor being stuck on the top item:

   #define STATIC_ITEM(label, args...) \
     if (_menuItemNr == _lineNr) { \
-      if (encoderLine == _menuItemNr && _menuItemNr < LCD_HEIGHT - 1) \
+      if (encoderLine == _menuItemNr && _menuItemNr < LCD_HEIGHT - 1) { \
         encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
+        lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \
+      } \
       if (lcdDrawUpdate) \
         lcd_implementation_drawmenu_static(_drawLineNr, PSTR(label), ## args); \
     } \

…which is …

  #define STATIC_ITEM(label, args...) \
    if (_menuItemNr == _lineNr) { \
      if (encoderLine == _menuItemNr && _menuItemNr < LCD_HEIGHT - 1) { \
        encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
        lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \
      } \
      if (lcdDrawUpdate) \
        lcd_implementation_drawmenu_static(_drawLineNr, PSTR(label), ## args); \
    } \
    _menuItemNr++

@petrzjunior
Copy link
Contributor

@thinkyhead Oh, thank you, yesterday we did some tests and couldn't achieve this, but your solution is working! So maybe we can keep the options menu as it is and don't merge it. I'm just not sure, if this behaviour is good for About Printer. You must scroll down (which nobody knows) and when scrolling up you must rotate encoder much longer than the way down.

@thinkyhead
Copy link
Member

thinkyhead commented Jul 8, 2016

I agree that the ability to scroll is not obvious at all. On the other hand, all menus suffer from this same issue. After all, no menu that fills the screen can be assumed to be complete, so it's natural to scroll. Right now all these M600 menus are short (under 4 items) so I'm not too worried about the scrolling issue.

I've also been concerned about screens like lcd_info_printer_menu which has 6 static items, where no cursor appears at all. If you test this (even with my patch above) you should see that it scrolls down fine, but scrolling up should stop at the 4th item. The logic I added to STATIC_ITEM doesn't account for the need to scroll back up!

The only (universal) way to fix this is to note the direction moved and apply different cursor corrections depending on that. (i.e., when scrolling down, make sure encoderLine >= LCD_HEIGHT-1, and when scrolling up, make sure encoderLine <= _menuItemNr - (LCD_HEIGHT-1).)

"Fiddly" stuff…

@thinkyhead
Copy link
Member

Feel free to try #4243 to see if it scrolls better with the About Printer screens. It scrolls in a simpler way on screens that only have STATIC_ITEMs in them.

@thinkyhead
Copy link
Member

thinkyhead commented Jul 9, 2016

On graphical displays the first STATIC_ITEM could be displayed in inverted text. Hmm…

@petrzjunior
Copy link
Contributor

I tried #4243 and the scrolling looks much better. but sadly it breaks the other menus. They are all moved one line down, so the first line (where should return be) is empty (and return is on line 2). You must either reset or find long menu to scroll down.

@thinkyhead
Copy link
Member

@petrzjunior Do you mean that the normal menus are moved down, or that only the menus that have a static item above them are moved down?

Remind me, are you using a character display or a graphical display?

Meanwhile, I made some additional changes today that may or may not make a difference. I couldn't find the exact logical change that would draw on the wrong lines. But maybe the var I changed from unsigned to signed will do the trick.

@petrzjunior
Copy link
Contributor

petrzjunior commented Jul 10, 2016

@thinkyhead I tested it right now and it worked! There is only one bug left: If you enter the static menu (eg. Printer info) and then go back (About printer) cursor is on second item and first (Back) item is not visible and there's empty line a bottom.
Btw. I use graphical display.

EDIT: Found out it only happens on Printer Info (the only one longer than LCD)

@thinkyhead
Copy link
Member

cursor is on second item

That makes sense, perhaps. There are a couple of things I can imagine being involved. I've added some more commits to #4243 that I think may help. Let me know if it works any better with the added tweaks.

@petrzjunior
Copy link
Contributor

petrzjunior commented Jul 11, 2016

Great! Now everything works perfectly and as expected. 👏
The very last thing: I would change the invertion in Filament change options to make it visibly separated from first (selected) option.

static void lcd_filament_change_option_menu() {
      START_MENU();
      #if LCD_HEIGHT > 2
-       STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, true);
+       STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false);
      #endif
      MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_filament_change_resume_print);
      MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_EXTRUDE, lcd_filament_change_extrude_more);
      END_MENU();
    }

Then we will close this PR, since it's redundant.

@thinkyhead thinkyhead closed this Jul 12, 2016
@jbrazio jbrazio modified the milestone: 1.1.0 Jul 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants