Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New GUI front-end #12

Closed
wants to merge 90 commits into from
Closed

New GUI front-end #12

wants to merge 90 commits into from

Conversation

jpt13653903
Copy link
Owner

Issue: #10

A pre-emptive pull-request in order to obtain email-notifications on commits to this branch.

@jpt13653903 jpt13653903 added the enhancement New feature or request label Nov 18, 2018
@jpt13653903
Copy link
Owner Author

Think you can work the new feature into the new GUI?

Farzeen added 5 commits November 21, 2018 19:21
Stuck at GObject.
Simple POD structs need to be wrapped in GObject boilerplate for
adding to Gio::ListStore :(
@jpt13653903
Copy link
Owner Author

First time using Meson -- I can see the appeal :-)

I'm having some trouble building with it... How do I specify a search path for libraries?

It's complaining that it cannot find GLFW, even though it is there.

That doesn't come with the library binaries, but those are easy enough to get and install to where the compiler can find it (if I can provide the build system with a path...).

@itsfarseen
Copy link

I haven't built it on Windows. The GUI is not complete yet.
Hopefully will complete the GUI today and build for windows tomorrow. :)

@jpt13653903
Copy link
Owner Author

I haven't built it on Windows. The GUI is not complete yet.
Hopefully will complete the GUI today and build for windows tomorrow. :)

No worries -- I just wanted to get my build-chain set up so long. It'll be amazing progress if it's "complete" by the end of today ;-)

The main source is not Linux-compatible at the moment. I think it's only the JFile class that is still obsolete -- the rest should be cross-platform, but I'm not sure... I want to replace them with the Toolbox anyway, and will do so soon -- after I've updated it to be platform independent.

Anyway. You can delete your Illustrations folder and do any updates to the concept directly in Docs/GUI/Concept.

I have a read-me there with a couple ideas and questions...

@jpt13653903
Copy link
Owner Author

I've ported the base Source to Linux... See #15

@itsfarseen
Copy link

I made some changes to meson.build file.
Now it should build under MSYS2 MinGW environment.
The compiler provided by tdm-gcc was released in 2015.
I had used some C++17 features in the code. That might prevent it from compiling under tdm-gcc.
Should I rewrite it for C++11?

@itsfarseen
Copy link

Build.zip
Here's the executable with required dependencies.

Still to implement: Background layer color, -page_size option, output file selection, execution of final batch script.
Currently, generated batch script is printed to terminal when clicking save batch file button.

@itsfarseen
Copy link

The combine checkbox is replaced with a new page separator. Thanks for the idea. It made the UI more intuitive.
The color button will let us input RGB and A also.
Background color selector is on the way.
For loading a saved configuration, let me think of some ways to re-parse the exported batch script.

@jpt13653903
Copy link
Owner Author

I made some changes to meson.build file.
Now it should build under MSYS2 MinGW environment.
The compiler provided by tdm-gcc was released in 2015.
I had used some C++17 features in the code. That might prevent it from compiling under tdm-gcc.
Should I rewrite it for C++11?

Might not be a bad idea to down-port to C++14. GCC version 5 (the current MinGW) has full support.


Build.zip
Here's the executable with required dependencies.

Still to implement: Background layer color, -page_size option, output file selection, execution of final batch script.
Currently, generated batch script is printed to terminal when clicking save batch file button.

This is fine -- you are at prototype (pre-alpha) stage anyway. There's lots of work left on the layout, but this can happen later (after all the functionality is in).

Feel free to merge master into your feature/GUI so that you can test the new stuff... Also makes merging back to master easier later on.


The combine checkbox is replaced with a new page separator. Thanks for the idea. It made the UI more intuitive.
The color button will let us input RGB and A also.
Background color selector is on the way.
For loading a saved configuration, let me think of some ways to re-parse the exported batch script.

Random idea for loading a saved configuration -- export a JSON string. You can export to a separate file, or to a "rem" line in the batch script.

I wrote a little JSON abstraction some time ago -- submodule the Toolbox. You can have a look at the unit test on how to use it. It's not the most versatile or well-written library, so feel free to suggest a different one.

Farzeen and others added 2 commits November 24, 2018 12:33
Color buttons not working properly
Made file chooser address bar accept user input.
Aded background layer color, page size and stroke to fill options
@jpt13653903
Copy link
Owner Author

Some preliminary thoughts:

  • I really like what you've done with it (conceptually). I like that you're aiming for touch-screen compliance (big buttons, etc.). Do try for consistency, however -- all buttons the same height, for instance.
  • You can add an icon (only in the window title bar -- it looks terrible when used as part of the GUI itself).
  • You can remove the *.gbr filter. Very few CAD tools export with the gbr extension. Some export with grb, others with the layer name (*.top, *.bot, etc.).
  • I would love to be able to drag-and-drop within the file list - that makes it easier to re-order the files. In the interim (because getting drag-drop to work right is a bit of a pain) a simple "move up" and "move down" button will do.
  • Try for cultural ambiguity (icons instead of words). I'd like it to be multi-lingual without having to do any translation... See this idea for details (my icons are terrible, but you get the idea...).
  • I REALLY like the colour pop-up info box :-)
  • My converter will not like files starting with file://
  • Last time I used GLFW it only supported one window... I hope they've improved matters, because it would be really nice if the select-file dialogue box can float over the main window instead of inside it.
  • Please add a "draw" trigger to the "on-resize" event -- very disconcerting when you resize the window and the content doesn't live-update.

@jpt13653903
Copy link
Owner Author

I'm starting to think it might be a good idea to re-factor my converter so that you can statically link the engine into the GUI. This will make it easier for the user to set up the system (no need for special paths, etc.)

Eventually I might even want to link the two into a single project -- the GUI loads when you run the executable with no parameters; and the converter works as it does at the moment (i.e. terminal only) when you have parameters present.

Let me think on it a bit more...

@itsfarseen
Copy link

I'm not sure I handled strokes2fills correctly..
Shall I synchronize the checkboxes if a file appears multiple times?
That is, checking one of the boxes will check the boxes of same file appearing elsewhere in the list

@jpt13653903
Copy link
Owner Author

Shouldn't file list have an address bar at the top for manually entering the path?
Does working folder mean the same? or is it where convert.bat and output.pdf are generated?

Don't follow the sketch exactly -- that's just me fooling around with ideas ;-) The finer details are up to you.

My idea is that the working folder is the "current folder", i.e. the folder of the files in the "File List", as well as the location of the output files in the case where they carry no paths. When the user uses the file list to browse, the working folder updates accordingly.

The user can also save the output files to a different location by specifying a path, or browsing by using the three-dot icons.

It might be a better idea to leave the "working folder" at the top of the "File List", giving the user a stronger association with what it means...

@jpt13653903
Copy link
Owner Author

I'm not sure I handled strokes2fills correctly..
Shall I synchronize the checkboxes if a file appears multiple times?
That is, checking one of the boxes will check the boxes of same file appearing elsewhere in the list

That is the idea, yes. All instances of the same file must have the same stroke-to-fills setting.

@jpt13653903
Copy link
Owner Author

The drag-and-drop is working beautifully :-) You can drop the "Up" and "Down" button idea.

At some later stage you can make it all nice with shadows and animation and stuff, but for now it's great.

@itsfarseen
Copy link

itsfarseen commented Jan 13, 2019

When generating batch script, is it okay if I specify strokes2fills multiple times?
Like

-stroke2fills file1.gbr 
file2.gbr 
-stroke2fills file1.gbr 
file3.gbr
-stroke2fills file1.gbr

@jpt13653903
Copy link
Owner Author

When generating batch script, is it okay if I specify strokes2fills multiple times?
Like

Yes - specifying it multiple times is fine.

The problem lies in how the Engine does caching. It reuses the render results of the first instance and simply changes the colour. If the first instance is filled, all other instances will also be filled, and vice versa.

What I should actually do is change that so that the strokes-to-fills becomes another condition of reuse, in addition to the file name... Let me see if I can fit that in today... I'll let you know.

This merge removes the limitation where -strokes2fills applies the same
setting to all instances of the Gerber file.
@jpt13653903
Copy link
Owner Author

That was much easier than I thought it would be... You can remove the -strokes2fills linking. The new version of the Engine applies the ConvertStrokesToFills to the next Run, and then resets to default immediately afterwards.

Sorry for making you do extra work and then asking you to undo it again half a day later!

@itsfarseen
Copy link

It's okay.. It was only a small work :)

@jpt13653903
Copy link
Owner Author

Hello,

I'm busy with an update to the Engine and merged in what I've done so far... I've checked that the Engine compiles under both Windows and Linux, but please also check that it compiles and links correctly on your side.

Nothing changed on the interface you're using. In summary, I've done the following:

  • Pulled in the Toolbox submodule
  • Ripped out the obsolete JFile and JString classes in favour of std::string and a better-implemented FileWrapper class (part of the Toolbox submodule)
  • Changed the apertures fixed array to std::map (i.e. an associative array)
  • Implemented Unicode file-name support (UTF-8 or UTF-16 under Windows and UTF-8 under Linux)

@itsfarseen
Copy link

Hi, I am sorry that I got really busy with college stuff..
I hope I will be able to work full time from April onwards, when my vacations begin

@jpt13653903
Copy link
Owner Author

No worries -- college should take priority ;-)

I'm looking forward to what you come up with during the holidays -- maybe we can launch the first beta-version at the end of it...

@jpt13653903
Copy link
Owner Author

Hello,

Long time no see...

Anyway -- I have good news. T-Dragon has released MinGW for Windows based on GCC-9.

You should therefore be able to rip out the Boost dependency and use C++17 directly... When you get a chance, please could you do so?

@itsfarseen
Copy link

Hi,
That sounds awesome!
Will look into it as soon as possible :)

@jpt13653903
Copy link
Owner Author

I'm closing this as "obsolete"

@jpt13653903 jpt13653903 closed this Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants