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

Read all parameters (route, autoroute,...) from a given file and/or from command line #167

Closed
ReportX opened this issue Feb 11, 2023 · 4 comments

Comments

@ReportX
Copy link

ReportX commented Feb 11, 2023

Every time I have to use freerouting I have to make two simple changes in the Parameter->Route and Parameter->Autoroute settings which is currently preventing to use the -do option to do it automatically.

It would be wonderful to provide a way to set those settings from command line and/or save them permanently as "Parameter" default settings from GUI.

@andrasfuchs
Copy link
Collaborator

We have a similar functionality with the Save GUI settings as default command that saves a gui_defaults.par file and stores some settings.
image

But as I tested it, it doesn't save the settings from the parameter menu.

I think it would be great to extend this function in order to:

  1. Save non-GUI settings as well
  2. Use JSON format instead of the current DSN-like formatting
  3. Let the user define the settings filename to load with a command line argument
  4. Look for settings.json or freerouting.json by default

@andrasfuchs andrasfuchs added this to To do in Freerouting Project Board via automation Oct 4, 2023
@andrasfuchs andrasfuchs self-assigned this Oct 4, 2023
@andrasfuchs andrasfuchs added this to the 1.9 milestone Oct 4, 2023
@andrasfuchs
Copy link
Collaborator

We have now two configuration files that are saved in a format similar to Specctra DSN (gui_defaults.par and *.rules files). It would be great to have a more modern, more future-proof, more commonly used format like JSON for this purpose.

For this to happen, I'll need to have Java classes that represent these settings, load and save them when needed and I still need to keep the load functionality of the older format to provide backward compatibility.

It would probably make sense to save gui_defaults inside our current global settings file freerouting.json automatically when they are changed by the user.

Rules files would be saved next to their DSN files, since they are board specific. Should they also be saved automatically or should we confirm this with the user using a pop-up dialog (as we do now)?

We have a command line argument -dr already that loads a .rules file for the board, and the gui_defaults should be loaded at application startup.

@andrasfuchs
Copy link
Collaborator

After investigating to code further I had to realize that this is a change that affects many parts of Freerouting and it probably took a week or two to complete. The good news is that if it's done, we can finally unlock a few long-waited features like headless execution or a RESTful API interface.

The first step will be to create independent serializable classes to represent all the settings. The fields/properties of these classes should be two-way bound to the GUI elements. These classes also should be able to report if any of their property values changed, or at least we will need a method to compare and diff two such classes.

Until it gets implemented the gui_defaults.par and .rules files can be used just as before.

@andrasfuchs andrasfuchs modified the milestones: 1.9, Future Oct 24, 2023
Copy link

Hey there!👋 This issue is stale because it has been inactive for 60 days. If this matter is still relevant, feel free to remove the stale label or add a comment. Otherwise, it will be closed in 7 days. But remember, with thousands of monthly active users, someone might just have the solution you need. This is a community-driven project, and your active participation is crucial. If the issue is critical for your work, consider contributing a fix yourself or hiring someone to help. I'm here to support your efforts and will review and merge pull requests as quickly as I can. Let's collaborate to keep improving our project! 🚀 Your involvement is invaluable, and together, we can ensure the continuous growth and success of our community. Thank you for being an integral part of this journey. Your engagement is what drives our project forward!

Freerouting Project Board automation moved this from To do to Done Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants