ImpulseAdventure / GUIslice

GUIslice drag & drop embedded GUI in C for touchscreen TFT on Arduino, Raspberry Pi, ARM, ESP8266 / ESP32 / M5stack using Adafruit-GFX / TFT_eSPI / UTFT / SDL
https://www.impulseadventure.com/elec/guislice-gui.html
MIT License
1.19k stars 211 forks source link

GUIslice Builder - tool for GUI code generation #79

Closed ImpulseAdventure closed 4 years ago

ImpulseAdventure commented 6 years ago

I am pleased to announce that @PConti31 has managed to create a front-end GUIslice Builder desktop application that can help generate GUIslice layouts!

The cross-platform program includes a graphical editor that enables drag & drop placement of UI elements. Once a GUI has been laid out, the Builder can then generate the functional GUIslice skeleton framework code, for both Arduino and LINUX targets.

The generated output code (.c, .ino) includes all of the necessary defines, UI storage elements and initialization in addition to the placement of the UI elements. This should greatly improve the ease in creating a new GUI.

image

One nice feature is that the user is then able to add their custom application code to the framework and then continue to make UI revisions within the Builder.

Status: The GUIslice Builder tool is in very early beta testing at the moment. Initial beta release will include a java archive (.jar), with full source to follow later. Further updates will be posted to this issue.

Documentation: GUIslice Builder wiki (in progress)

Acknowledgements: A huge thanks again to Paul for taking the initiative on this!

espHorst commented 6 years ago

This is really cool! Very useful!

Some thoughts on this:

ImpulseAdventure commented 6 years ago

Good feedback... I think Paul might be able to offer a more informed perspective (at least based on what exists today and with knowledge of the implementation), but in the interim, here are some of my thoughts. Keep in mind that I'm not yet familiar at depth with the design nor the potential challenges.

ImpulseAdventure commented 6 years ago

For reference, a wiki page has been created that will address the usage of the Builder in greater detail. More documentation will be appearing soon. GUIslice Builder wiki

Pconti31 commented 6 years ago

I had discounted this early on because of the need to add various callbacks on a round trip basis. It would be easy if I only allowed you one shot to get your UI correct.😊

There is a great deal that goes on behind the scenes that could break.

Right now the builder knows if you added code to the button callback or not. If not it adds a new callback for example. It can add a next page api call to the button callback if you check the box on the button's property list. It also adds new call-backs as you add UI widgets that need them.

I'm hopeful, even more automatic code generation could take place in the future.

Of course, It might still be possible and I'm open to ideas but I really suggest you try and use the builder as is first before any changes. I suspect there will be more than enough work keeping up with bug fixers at first.

By the way, another thought I had at the beginning of this project was to take the opposite approach and construct applications as include files and having the .ino or .c something you don't need to edit. For example:

[Ed: applied code format markdown] appl.cpp

#include <appl.h>
void blink(){
  static byte lastState ;
  pinMode ( 13, OUTPUT );
  if (lastState != HIGH){
    digitalWrite ( 13, HIGH ); 
    lastState = HIGH;
  }
  else {
    digitalWrite ( 13, LOW ); 
    lastState = LOW;
  }
}  

void app_setup() {
  pinMode(13, OUTPUT);
}

void app_loop() {
  blink();
  delay(500);
}

appl.h

#ifndef _APP_H
#define _APP_H
#include <Arduino.h>

extern void blink();
extern void app_setup();
extern void app_loop();
#endif

test1.ino

#include <appl.h>

void setup() {
  app_setup();
}

void loop() {
  app_loop();
}

Of course, A GUIslice builder would have added the various guislice includes and api calls to the .ino file.

Sorry, but the java based builder as a web based application seems like a very bad idea. Running java based applications on the web? Oracle and Openjdk have as of java 11 killed tools for such apps. Google chrome, and Microsoft Edge both prevent running java from their browers because of all of the security hacks that have taken place over the years. If everyone was nice it would a great idea. Even if you could get around the blocks within the browsers users would be opened up to to some very serious danger.

IMHO, The correct way to do the Web based implementation is the same as I have done for commercial clients, using Javascript, HTML5 and Ajax. That's a major undertaking, from past experience I would guess it would take 3 or 4 developers 9 months to a year. The Java version took one person (me) working part time from March 2018, so you can see effort required.

However, other languages could be used that could greatly speed up a web based builder creation, like ruby or python that might make it a much faster implementation. I'm no longer an expert in web based design so take anything I said here with a grain of salt. 😊

ImpulseAdventure commented 6 years ago

First public beta release of the GUIslice Builder binaries (0.10.4-beta4) has been uploaded to the repository: /builder/ (UPDATE 2018/11/18: now attached to release notes)

Documentation at GUIslice Builder wiki includes installation and link to user-guide.

Please file any bug reports during the beta release in #80 thanks

espHorst commented 6 years ago

@Pconti31: Thanks for the feedback on the feedback!

generated code is placed in a automatic_generated.h header file?

I see the issues with the callbacks - I did not consider this. But I'm happy that you have had the same idea at the beginning ;-)

java based builder as a web based application

As I never did any web applications I was not aware, that there is such a big difference in doing java for the web applications and for direct applications. I thought it is all the same. Now I see, that there is a big difference. But as the GUI builder is available for Linux, I will definitely use it for my next GUI project.

Thanks for this great tool!

ImpulseAdventure commented 6 years ago

GUIslice binary release (0.10.4-beta5) has been attached to the latest Release Notes:

Major changes:

Documentation at GUIslice Builder wiki includes installation and link to user-guide.

espHorst commented 6 years ago

This makes the installation much more convenient! Thanks!

ImpulseAdventure commented 5 years ago

A visual GUIslice Builder walkthrough tutorial has been now been posted to demonstrate how the builder can be used to create a basic GUI application. A second part, demonstrating round-trip edits, will follow later.

NOTE to those who have tried out the Builder beta: please feel free to send an email to guislice @ impulseadventure.com (no spaces) with any comments, questions or suggestions you might have -- I'd be most interested in hearing any feedback so that we can make the GUIslice + Builder process as easy as possible for users. Thanks!

ImpulseAdventure commented 5 years ago

GUIslice Builder binary release (0.10.4-beta7) has been attached to the latest Release Notes:

Major changes:

Documentation at GUIslice Builder wiki includes installation and link to user-guide. The installation guide and walkthrough have both been updated for this release.

ImpulseAdventure commented 5 years ago

Builder source code has now been uploaded to the repository at /builder

ImpulseAdventure commented 5 years ago

GUIslice Builder binary release (0.11.0-rc2) has been attached to the latest Release Notes:

Special thanks to VitorH, TonyP, DonK, RonB and AndersG for all the testing and feedback, and PaulC for the release!

Major changes since 0.10.4-beta7: The following lists the major feature additions and bugfixes in this release.

Documentation at GUIslice Builder wiki includes installation and link to user-guide.

ImpulseAdventure commented 5 years ago

GUIslice Builder binary release (0.11.0-rc3) has been attached to the latest Release Notes:

Major changes since 0.11.0-rc2: The following lists the major feature additions and bugfixes in this release.

Documentation at GUIslice Builder wiki includes installation and link to user-guide.

Pconti31 commented 5 years ago

GUIslice Builder binary release (0.11.0-rc4)

Major changes since 0.11.0-rc3: The following lists the major feature additions and bug fixes in this release.

rotdrop commented 5 years ago

Now that the builder source code has been removed from the GUISlice source tree, are there plans to keep the builder source code available? Thanks!

ImpulseAdventure commented 5 years ago

Absolutely! We are in the last stages of making GUIslice release 0.13.0 which includes a major update of the Builder. The Builder source was removed from the core library repo (and instead relocated to the following new repo) to reduce the size of the core library tree. The new repo containing the Builder source will be online as soon as we have completed the release:

https://github.com/ImpulseAdventure/GUIslice-Builder-source

pierbout commented 4 years ago

Wonderful tool! I love it. Is there any chance I could adapt it to a 2.2' 176x220 TFT screen (ILI9225 library)?

Thanks in advance for your help, and sorry if I didn't post in the best discussion...

ImpulseAdventure commented 4 years ago

Closing the original status issue as the Builder is now tracked in a separate repository.

he77PC011 commented 7 months ago

Now the interface is English, I want to translate into Chinese

Pconti31 commented 7 months ago

@he77PC011 Sounds good to me. Anything I can help you with let me know... Paul--