Engidea/FreeRoutingNew

does not take file name provided as argument

aurabindo opened this issue · 7 comments

Earlier versions worked straight out of the box in kicad, as it would open the design automatically. Now freerouting fails to open the file exported by kicad. Manually launching freeroute file.dsn did not open any files.

I have committed a fix, note that apparently you need to declare the option as -de and then the filename
If you may try it and report if it is good, it would be nice.

I tried the latest changes, and the ability to open designs directly from KiCad is back. However, the open file dialog also shows up first. Once I cancel the dialog, the actual design shows up!

Added a small change so the open file dialog does not show up if a fname is given

wez commented

This diff seems to make the dialog behavior work correctly for me when launching this from kicad, and when running it from the command line:

diff --git a/src/freert/main/MainApplication.java b/src/freert/main/MainApplication.java
index 12344e5..c65b328 100644
--- a/src/freert/main/MainApplication.java
+++ b/src/freert/main/MainApplication.java
@@ -157,21 +157,19 @@ public class MainApplication extends JFrame
     */
    private DesignFile open_dialog()
    {
-      JFileChooser file_chooser = new JFileChooser(main_options.design_dir_name);
-      FileFilter file_filter = new FileFilter(DesignFile.all_file_extensions);
-      file_chooser.setFileFilter(file_filter);
-      file_chooser.showOpenDialog(null);
-
      File curr_design_file;

      if ( haveArgsFname() )
      {
        curr_design_file = new File (main_options.design_file_name );
+       return new DesignFile(stat, curr_design_file, null);
      }
-      else
-         {
+     JFileChooser file_chooser = new JFileChooser(main_options.design_dir_name);
+     FileFilter file_filter = new FileFilter(DesignFile.all_file_extensions);
+     file_chooser.setFileFilter(file_filter);
+
+     file_chooser.showOpenDialog(null);
      curr_design_file = file_chooser.getSelectedFile();
-         }

      if (curr_design_file == null) return null;
wez commented

Note that even with the latest build 51920fe this needs the patch above, otherwise it will pop open a dialog to choose the file, even if the -de parameter is provided

Ok, adjusted, let me know if it is fine

wez commented

Looks good, thanks!