Giter Club home page Giter Club logo

arduinoapiwebserver's People

Contributors

manicken avatar

Stargazers

 avatar

Watchers

 avatar

arduinoapiwebserver's Issues

Not Really An Issue

Hi Jannik,

I found your thread on the Arduino forum but it was closed. This was the next best thing to be able to talk to you!

Thank you for your Arduino IDE tool examples. They have been very helpful for me to understand what the hell is going on! I am a pretty novice Java programmer.

I wonder if you could shed some light on something I am trying to do. I want to have a webserver running as an IDE tool with one UI window that you can leave open all the time.

Changing window focus to another sketch would change some parameters in the web server (root directory, listen port etc).

So far I have a very janky solution. The init(Editor) method of the tool plugin uses a boolean set by processing.app.PreferencesData so it will only run the UI/webserver setup once. In the UI class setup method, a listening socket is set up and the port number returned to be stored by preferencesData. Subsequent executions of init(Editor) will skip calling the UI/webserver setup because of the boolean set, but pull the port number out of preferencesData so they can all talk to the same instance of the UI over the socket.

This works but seems very complicated. I would like to have my UI and webserver in other classes and just create one instance of them. I've tried using the UI/webserver classes statically and using singleton pattern, but the IDE always seems to ignore it all and I get another instance for every sketch window.

Do you have any clues as to how to prevent this? I have spent quite a while scrolling through the processing/arduino IDE source but to be honest I'm not really sure what I'm looking at most of the time!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.