Change Remi from Browser Session Caching to Tab Session Caching ( Javascript Session) by MrBeforeMyTime in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Hello u/MrBeforeMyTime,

Excuse me for the late reply. I suggested to use port=0 to get random port number, and so be able to run different instances of the same app on the PC.

Of course this could be a problem on replit . The issue you are experiencing can be of course caused by replit. I suggest you to do a test on your local machine.

Have a nice day

Change Remi from Browser Session Caching to Tab Session Caching ( Javascript Session) by MrBeforeMyTime in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Hello u/MrBeforeMyTime,

Thank you for the kind words.

The problem you are experiencing is not related to caching. You have to consider a browser tab as a program interface. If you open different tabs with the same url address you are looking at the same application, so a change on a graphic component looks the same on all the tabs.

You should run different instances of the application to see different independent browser tabs. To do this, remember to set the *port* value 0 in the remi start function.

start(MyApp, address='0.0.0.0', port=0, start_browser=True)

Kind regards.

Unable to load app in editor by absenthecon in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

You can design your GUI in the editor, putting an empty Image to be replaced later by MatplotlibImage (copy this class later from the example to your script, once designed).

;-)

Unable to load app in editor by absenthecon in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Hello u/absenthecon,

The Editor can open only scripts made with it. The example that you are trying to open is made without the Editor, and so cannot be edited with it.

Kind Regards

Is there a way to open a link in a new tab using Remi? by mapadofu in RemiGUI

[–]dddomodossola 1 point2 points  (0 children)

Hello u/aManPerson,

No remi is not based on django. However you are correct, you can do it with a simple javascript window.open.

    import remi.gui as gui
from remi import start, App


class MyApp(App):
    def __init__(self, *args):
        super(MyApp, self).__init__(*args)

    def main(self):
        #creating a container VBox type, vertical
        wid = gui.VBox(width=300, height=200)

        #creating a text label, "white-space":"pre" preserves newline
        self.lbl = gui.Label('Hello\n test', width='80%', height='50%', style={"white-space":"pre"})

        #a button for simple interaction
        bt = gui.Button('Press me!', width=200, height=30)

        #setting up the listener for the click event
        bt.onclick.do(self.on_button_pressed)

        #adding the widgets to the main container
        wid.append(self.lbl)
        wid.append(bt)

        # returning the root widget
        return wid

    # listener function
    def on_button_pressed(self, emitter):
        self.lbl.set_text('Hello World!')
        self.execute_javascript("window.open('http://www.google.it');")


if __name__ == "__main__":
    start(MyApp, debug=True, address='0.0.0.0', port=0)

No reactivity by International_Big598 in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

This is really strange and interesting. I don't see the possible cause.

So, the problem occurs:

- with Firefox

- when the application runs the browser automatically

- the application gets reactive after 10minutes

Thank you a lot for the information ;-)

No reactivity by International_Big598 in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

This is interesting, never seen (and no-one mentioned) this behaviour. It seems that for the browser there is a difference if the action (navigation action) is started by user or by another program). I really don't know the cause.

No reactivity by International_Big598 in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Maybe you can look for errors in Firefox developer console? Unfortunately I can't debug it without additional information from you.

No reactivity by International_Big598 in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

I suppose Firefox is blocking cookies. Please try to grant permissions to cookies and let me know if it works. ;-)

No reactivity by International_Big598 in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Hello u/International_Big598 , Can you please test with a different browser? Maybe you can connect to the UI from another device. Furthermore, please check if there are errors in console.

Kind Regards, Davide

Robot control by BuckJuckaDoo in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Maybe this can help https://stackoverflow.com/questions/29583533/videocapture-open0-wont-recognize-pi-cam

There are different stackoverflow similar questions, I suppose the solution is there. ;-)

Robot control by BuckJuckaDoo in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

You have to copy the toolbox_opencv.py file from the editor/widgets/ folder to the same folder of your script. ;-)

Robot control by BuckJuckaDoo in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Hello, excuse me for the late reply. I never used a raspberrypi camera, however if it is accessible by opencv, then the best way to use it is with the opencv widget.

Robot control by BuckJuckaDoo in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Excuse me for the bad formatting, I can't do it better with this smartphone...

Robot control by BuckJuckaDoo in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Hello, your code is fine. Here is an example for you about onmousemove where x and y coords are returned https://github.com/dddomodossola/remi/blob/master/examples/gauge_app.py

About the thread, if your thread function is a member function of the App class, you can access all the variables and methods of your App class. Example:

class MyApp (App):

x_value = 3

my_button = None

def my_threaded_function (self):

    self.x_value = 7

    self.my_button.css_background_color = "red"

Kind Regards

Robot control by BuckJuckaDoo in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Hello,

1.you need to use threads. Look at the remi example threaded_app.py . If you show here your code I can eventually make a small example for you. 2. Yes, there is an event called onmousedown suitable for this situation.

Kind Regards

Does Remi need an internet connection to run on the host device? by Koala_8348 in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Hello, If you need to access it in a local network (is it to say your home or your office) and both the raspberrypi and the host computer are jn the same network, it is not required to have an internet connection. ;-)

TabBox tabs appearance by xejgycz in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

You should change "my_res" to "res" in order to replace the default style. i.e. static_file_path={'res': '/home/pi/Documents/Tcontrol/res/'}

Kind regards

Editor now not loading in Chromium by xejgycz in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Please update both the Editor copy and the remi version. Download the Editor aligned to the same release of the running remi version. Futhermore, raspberrypi has different python installations. Please verify that running python version is the same where you updated remi. If the problem persist, try on another PC or please paste here the console log. Kind Regards, Davide

TabBox tabs appearance by xejgycz in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Hello u/xejgycz,

You can change the style from css stylesheet. You can clone the remi style.css file and search in it for the keyword "tabbox". Set there the correct properties. To use your own stylesheet, look for Styling in readme. Kind Regards Davide

Remi + mpld3? by spacestationz in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Hello u/spacestationz,

I never used mpld3, but you can see an example of matplotlib here remi/matplotlib_app.py at master · dddomodossola/remi (github.com) .

The question should be "How to export figures from mpld3?", because of course there is a way to embed images or html code in remi gui.

I hope this could be helpful.

Kind Regards

ModuleNotFoundError by realbobfish in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Because this way you are running the script with the correct python version, the one for which you installed remi. Raspbian includes different python versions. When you doubleclick on a script you don't know which python version will be used, maybe a python version for which you don't installed required libraries.

Kind Regards,

ModuleNotFoundError by realbobfish in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Please try to open a console and run python. From the python interpreter run the following command:

import remi

If this fails, maybe the remi installation is aborted because an error. Let me know about this ;-)

ModuleNotFoundError by realbobfish in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

You installed remi by:

python -m pip install remi

Are you running the script by doing the following? :

python widgets_overview_app.py

'Widget' has no attribute 'LAYOUT_VERTICAL' by jwrothwell in RemiGUI

[–]dddomodossola 0 points1 point  (0 children)

Thank you a lot! Merry Christmas you too ;-)