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

0.8.1-beta and menu control

Postby epascual » Sun Jul 06, 2014 2:03 pm

Hi,

I'm used to take advantage of the menu suspend feature to be able to start my programs directly from Eclipse, using the sshexec Ant task.

In the previous version it worked fine, the LCD refresh done by leJOS being suspended at program start, and restored at the end by writing the appropriate byte into the special file controlling it. In 0.8.1 it seems not to be working anymore, the LCD keeping flashing between my outputs and leJOS graphical menu ones.

As a complement to what someone have said about controlling the overlays (I use stdout too for execution trace), would it be possible to have some LCD usage control API, allowing to have a better control of all these situations ? I could understand that somebody from leJOS team was not fan of letting programs control LCD overlays. If this is right, I'm afraid not sharing this opinion. We, the developers, are supposed to be responsible adults ;) ) so this kind of controls could be labeled as "for advanced users" and "to be use at your own risks", if you wish, but seems to be something that should exist to give a maximum of freedom to application developers.

Tanks in advance for any feedback.

Best 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 » Sun Jul 06, 2014 8:02 pm

Why do you need any sort of API for this? The code already exists in the form of the LCDManager, what more does an advanced user need? Also it is very simple for you to control the destination of stdout/stderr etc. Simply redirect them within your program then you can control where they go easily. Simply use System.setOut, System.setErr.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4118
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: 0.8.1-beta and menu control

Postby epascual » Sun Jul 06, 2014 8:40 pm

Sorry Andy, I was not aware of all these new features. Where have they been announced and were are they documented ?

I have been away from leJOS these last months since not having very much free time for robotics :/

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 » Sun Jul 06, 2014 9:28 pm

The System.* methods are just standard Java, the LCDManager features are not documented (after all they are advanced features, for advanced users), but as with all of leJOS the source code (which does include documentation) is available for you to see...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4118
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: 0.8.1-beta and menu control

Postby epascual » Sun Jul 06, 2014 9:46 pm

The System.* methods are just standard Java
I knew this, thanks ;)
but as with all of leJOS the source code (which does include documentation) is available for you to see...
Sure. But as I said, when you have not that much free time, it is not obvious to start by browsing the whole source code for each new release to see what is new or changed. And the last version I played with was two levels lower :? I've looked for change logs (using the usual file names) but could not find them, apart for jnalib and DBus parts.

Anyway, no need to elaborate more on this. You've informed me that the feature exists, that's fine. I'll go and study it.
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 06, 2014 10:02 pm

The git checkin history is much better than any manually produced changelog, that will give you a pretty good idea of what is new/changed in a release:
https://sourceforge.net/p/lejos/ev3/ci/ ... log/?path=
You can then use this as a starting point to explore the details of a change. We do try and make notes of the major features that impact most users, but we also don't have as much time as we would like.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4118
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: 0.8.1-beta and menu control

Postby epascual » Sun Jul 06, 2014 10:14 pm

gloomyandy wrote:The git checkin history is much better than any manually produced changelog, that will give you a pretty good idea of what is new/changed in a release:
Knew this too, but lots of entries there.
gloomyandy wrote:We do try and make notes of the major features that impact most users, but we also don't have as much time as we would like.
I can understand this, and I don't blame you at all. It's just that I found your initial reaction a bit rude, thus my remark about changes not being that obvious to notice. Maybe I've interpreted your words the wrong way.

Anyway, I've added the appropriate stuff to avoid having stdout been displayed on the LCD, and it's ok now for this point, but it still keeps flashing as if the menu display has not been suspended (I did it as before, by writing a 's' in /home/root/lejos/bin/utils/menufifo. I must be missing something.
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 06, 2014 10:30 pm

What happens if you suspend the menu manually? Does it still flash then?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4118
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: 0.8.1-beta and menu control

Postby epascual » Sun Jul 06, 2014 10:39 pm

gloomyandy wrote:What happens if you suspend the menu manually? Does it still flash then?
Yes, still flashing.

I tried by disabling auto refresh and adding manual refresh each time the display is changed, but now I don't see my outputs. They appear briefly and then to LCD goes empty.
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 » Mon Jul 07, 2014 7:32 pm

When you said you tried disabling autorefresh do you mean in your program? That will not help, the problem is in the menu. I'm surprised that suspending the menu manually (via the menu system command) does not work.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4118
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: 0.8.1-beta and menu control

Postby epascual » Tue Jul 08, 2014 11:03 pm

Here are some more details on how to reproduce the problem with version 0.8.1-beta.

Code: Select all
package testlcd;

import lejos.hardware.Button;
import lejos.hardware.ev3.EV3;
import lejos.hardware.ev3.LocalEV3;
import lejos.hardware.lcd.GraphicsLCD;
import lejos.hardware.lcd.LCD;

public class TestLCD {
    protected static EV3 ev3 = LocalEV3.get();
    protected static GraphicsLCD g = ev3.getGraphicsLCD();

    public static void main(String[] args) {
            g.clear();
            g.drawString(
                "Press a button",
                LCD.SCREEN_WIDTH / 2,
                LCD.SCREEN_HEIGHT / 2,
                GraphicsLCD.BASELINE | GraphicsLCD.HCENTER
                );
            Button.waitForAnyPress();
    }
}

When running this program using ssh, the LCD flashes as expected, alternatively showing leJOS graphical menu and the "Press a button" message.

If issuing the command echo "s" > /home/root/lejos/bin/utils/menufifo via ssh before starting the program, it still flashes but without displaying leJOS graphical menu this time, as if the same phenomenon as before occurs, but displaying a blank screen instead of the graphical menu.

While looking at EV3LCDManager sources, I noticed that line 291 (lcd.write(0, hwBuffer, 0, hwBuffer.length);) in EV3LCDManager.update() seems in excess, since repeated at line 299, which is always executed. I've tried removing it, but it does not change anything. BTW this should not have any effect, since the we were just doing the same copy of the buffer to LCD twice.
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 7:04 am

As before, what happens if you use the menu command to disable the menu display rather then the fifo?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4118
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: 0.8.1-beta and menu control

Postby epascual » Wed Jul 09, 2014 8:58 am

Sorry if this sounds stupid as a question, but which "menu command" are you referring to ?

Is it something provided by the API ? If yes, sorry but I was not (yet) aware of its existence, and I'll try it ASAP. Where does it live ?
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 lawrie » Wed Jul 09, 2014 2:43 pm

There is a suspend option in the system menu. That is what Andy is referring to.
lawrie
leJOS Team Member
 
Posts: 922
Joined: Mon Feb 05, 2007 1:27 pm

Re: 0.8.1-beta and menu control

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

The LCD goes blank.

BTW the last time I tried it, I could not recover, even by writing 'r' in the FIFO. I had to reboot the brick.

If the function of this control is to suspend the menu, I don't really understand in which use case it is supposed to be used. When starting programs from the menu, all works fine and there is no need to suspend the menu since it is done for you. On the other side, you need to control the suspend by program when you launch it using ssh, and thus don't want to interact physically with the brick.

What am I misunderstanding here ?
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)

Next

Return to EV3 Software

Who is online

Users browsing this forum: Baidu [Spider], Yahoo [Bot] and 4 guests

more stuff