0.8.1-beta and menu control

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

Re: 0.8.1-beta and menu control

Postby gloomyandy » Wed Jul 09, 2014 4:14 pm

The command is there for people that want to use ssh, it basically asks the menu to get out of the way but allows it still to respond to remote commands, no messing around with fifos and the like. The menu is re-activated with a key combination (the standard leJOS abort seq). What do you mean the "LCD goes blank", that is expected but does it also interfere with your program run via ssh (note do not mess around with the fifo in your test program, just use the menu suspend command). What we are trying to do is establish, if the this is a problem with the fifo side of things or a more general issue with suspending the menu. It was supposed to be a quick test for you to try, but it has not turned out that way.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4172
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: 0.8.1-beta and menu control

Postby epascual » Wed Jul 09, 2014 4:51 pm

OK, I understand now the operating mode you had in mind. Unfortunately, I had not the same :)

I was still with the previous behavior, in which the suspend mode was supposed to be used only for the run on the program. With this in mind, the program suspends the menu when starting and then restores it to its normal behavior when exiting. It was working fine.

Things are supposed to be handled differently now. You have to put the brick in suspend mode by using the menu command, and then menus are no more visible even after the program has ended. This lasts until you use the 'magic" button combo to restore the menu display. The problem is that I was not aware of the fact that things were supposed to be done this way now :? Hence our reciprocal misunderstanding :oops:

I'll check tonight when back home and keep you informed.

Regards

Eric
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Re: 0.8.1-beta and menu control

Postby gloomyandy » Wed Jul 09, 2014 5:00 pm

No you still have it wrong. Both modes should work (the menu command and the fifo), both are valid, but different use cases. What we wanted to establish was if both are broken, or just the fifo way of doing things, as I said the test was supposed to be something you could quickly try, but it has not turned out that way...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4172
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: 0.8.1-beta and menu control

Postby epascual » Wed Jul 09, 2014 6:16 pm

OK, things are not that easy...

Here are the tests I just made :

1/ suspend menu using the menu command
- LCD goes empty
- program display OK
** I don't know how to switch the LCD back to normal mode (tried different button chords, but no way). I had to kill the EV3Menu program and re-started it. I guess that reading EV3Menu sources will give me the magic combo.

2/ suspend menu by writing in the FIFO from the program
- LCD goes empty
- sometimes the program display is ok, sometimes no display at all, sometimes LCD blinks with the program display. I could not succeed in finding a pattern to reproduce the same behavior in a predictable way
- normal menu display recovered at program end, whatever was the previous behavior

At a moment it was like launching the program from the ssh terminal or the sshexec Ant task gave different results, but I could not reproduce it in a reliable way, so it is certainly a wrong feeling.

I hope this will help. Let me know if you want me to try other tests.

Eric
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Re: 0.8.1-beta and menu control

Postby gloomyandy » Wed Jul 09, 2014 6:36 pm

I think the chord is enter+down. There is nothing you can do in your program to stop the screen from flickering, anything that makes it look better is simply luck in that you are obtaining some sort of synchronization with the menu refresh. It is the menu trying to refresh the screen at the same time that is causing the problem, the fix needs to be in the menu code. I'm pretty sure it is simply a case of turning auto refresh off in the fifo code.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4172
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: 0.8.1-beta and menu control

Postby epascual » Wed Jul 09, 2014 9:28 pm

gloomyandy wrote:I think the chord is enter+down.
That's it (found at line 1475 of GraphicMenu.java).
gloomyandy wrote:It is the menu trying to refresh the screen at the same time that is causing the problem, the fix needs to be in the menu code. I'm pretty sure it is simply a case of turning auto refresh off in the fifo code.
I'm studying it. Some attempts made, but no result so far.
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Re: 0.8.1-beta and menu control

Postby epascual » Sun Jul 13, 2014 5:09 pm

Hi,

Finally found time to work seriously on the point. Andy you were right (of course :)), it was just a matter of suspending the LCD refresh (the way all these parts cooperate was not fully clear for me before). The fix is nothing mode than adding the appropriate calls in PipeReader.run() :
Code: Select all
if (c == 's') {
        GraphicStartup.this.suspend();
        lcd.setAutoRefresh(false); // ADDED
        System.out.println("Menu suspended");
} else if (c == 'r') {
        lcd.setAutoRefresh(true); // ADDED
        GraphicStartup.this.resume();
        System.out.println("Menu resumed");
}

It works the same now whatever method is used to start the program : graphical menu, ssh terminal or sshexec Ant task.

The last thing I'd like to solve is knowing if the program has been started by the menu or not, so that not having System.out outputs going to the LCD. Or maybe I should use something else that System.out.println() for execution trace messages.
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Re: 0.8.1-beta and menu control

Postby gloomyandy » Sun Jul 13, 2014 5:33 pm

You can probably determine this if you really need to. The Ev3 menu runs your program by actually running a class called EV3Wrapper:
https://sourceforge.net/p/lejos/ev3/ci/ ... apper.java
This is the class that creates the extra LCD layers and redirects stdout etc. So an obvious way to check for this code being active would be to ask the LCD Layer manager if the layers used for stdout etc. exist. At the moment this interface is internal (but you can still call it), so it may change. I suspect that at some point we may provide a more piblic access to it via the LocalEV3 class/interface.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4172
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: 0.8.1-beta and menu control

Postby epascual » Sun Jul 13, 2014 5:43 pm

Thanks for the clue.

I've played a bit with LCDManager some time ago and I just forgot that I noticed at that time that the list of available layers was not the same depending on the case. Inserting this couple of lines at the very beginning of the program does the trick... until the moment it will no more be public :)
Code: Select all
        for (LCDLayer layer : EV3LCDManager.getLocalLCDManager().getLayers()) {
            if (layer.getName() != "LCD") {
                layer.setVisible(false);
            }
        }       
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Re: 0.8.1-beta and menu control

Postby rafalmag » Sun Sep 14, 2014 9:38 am

Thanks epascual. I am using loggers (with console appenders) + lejos.utility.TextMenu as UI in my Ev3 Clock application. The trick with LCDLayer and EV3LCDManager helped me a lot to keep just menu on LCD.
LCDLayer and EV3LCDManager generates restriction warnings. Is there an more official option to configure system out redirection?
rafalmag
New User
 
Posts: 10
Joined: Mon Feb 10, 2014 11:40 pm

Previous

Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff