diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 36dc7a0..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -freerouting.freerouting \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf3..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index e206d70..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.idea/libraries/java_help.xml b/.idea/libraries/java_help.xml deleted file mode 100644 index 7e583ce..0000000 --- a/.idea/libraries/java_help.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/javaws.xml b/.idea/libraries/javaws.xml deleted file mode 100644 index 35528bd..0000000 --- a/.idea/libraries/javaws.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b..0000000 --- a/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index f6cd5ef..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,487 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - localhost - 5050 - - - - - - - - - - 1403984491365 - 1403984491365 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No facets are configured - - - - - - - - - - - - - - - 1.7 - - - - - - - - freerouting.freerouting - - - - - - - - javaws - - - - - - - - - diff --git a/LICENSE b/LICENSE index 70566f2..7d75849 100644 --- a/LICENSE +++ b/LICENSE @@ -100,7 +100,7 @@ public, and in some countries other activities as well. parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. - An interactive user interface displays "Appropriate Legal Notices" + An eu.mihosoft.freerouting.interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the @@ -227,8 +227,8 @@ terms of section 4, provided that you also meet all of these conditions: permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive + d) If the work has eu.mihosoft.freerouting.interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has eu.mihosoft.freerouting.interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. @@ -331,7 +331,7 @@ requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and +adversely affects the operation of the network or violates the eu.mihosoft.freerouting.rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, @@ -650,7 +650,7 @@ the "copyright" line and a pointer to where the full notice is found. Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: +notice like this when it starts in an eu.mihosoft.freerouting.interactive mode: {project} Copyright (C) {year} {fullname} This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. @@ -667,8 +667,8 @@ For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you +into proprietary programs. If your program is a subroutine eu.mihosoft.freerouting.library, you may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General +the eu.mihosoft.freerouting.library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . \ No newline at end of file diff --git a/README.md b/README.md index 8364010..d28c1c2 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Java Based Printed Circuit Board Routing Software from FreeRouting.net written b http://www.freerouting.net/fen/viewtopic.php?f=4&t=255 -by alfons » Sat Mar 08, 2014 12:07 pm +by alfons � Sat Mar 08, 2014 12:07 pm Because I am no more maintaining the Freerouting project since 4 years and future Java versions may block my Freerouting Java Web Start application completely, I finally decided to open the source of the Freerouting project under the GNU public license version 3. @@ -37,21 +37,21 @@ Introduction: This software can be used together with all host PCB design software systems containing a standard Specctra or Electra DSN interface. It imports .dsn-files generated by the Specctra interface of the host system and exports Specctra session files.(There exists also an interface to Cadsoft-Eagle.) -There are three modes for routing traces: 90 degree, 45 degree and free angle. The interactive router is production stable and unsurpassed in its free angle capabilities. An autorouter is currently under development and already stable in the conventional 45 degree mode. +There are three modes for routing traces: 90 degree, 45 degree and free angle. The eu.mihosoft.freerouting.interactive router is production stable and unsurpassed in its free angle capabilities. An autorouter is currently under development and already stable in the conventional 45 degree mode. After launching the router a window appears with buttons to display some router demonstrations, to open a sample design, or to open a design of your own. -After opening a design you can start the autorouter with the button in the toolbar on top of the board window. +After opening a design you can start the autorouter with the button in the toolbar on top of the eu.mihosoft.freerouting.board window. -The board editor has three different interactive states. You can switch between this states with the buttons Select, Route and Drag on the left of the toolbar. +The eu.mihosoft.freerouting.board editor has three different eu.mihosoft.freerouting.interactive states. You can switch between this states with the buttons Select, Route and Drag on the left of the toolbar. -In the beginning the board editor is in the select state. In this state you can select single board items by picking them with the left mouse button or select items in a rectangle by dragging the left mouse button. Only item types switched on in the select parameter sheet will be selected. After selecting some items the toolbar displays options for showing and manipulating these items. If you push the info button for example a window with text information about the selected items is displayed. After clicking a blue word in this text a new window with further information pops up. To return to the select state push the cancel button or click somewhere in the empty space of the board window. +In the beginning the eu.mihosoft.freerouting.board editor is in the select state. In this state you can select single eu.mihosoft.freerouting.board items by picking them with the left mouse button or select items in a rectangle by dragging the left mouse button. Only item types switched on in the select parameter sheet will be selected. After selecting some items the toolbar displays options for showing and manipulating these items. If you push the info button for example a window with text information about the selected items is displayed. After clicking a blue word in this text a new window with further information pops up. To return to the select state push the cancel button or click somewhere in the empty space of the eu.mihosoft.freerouting.board window. -By pushing the Route button you get into the state for interactive routing. In this state you can start a new trace by picking an item belonging to a net, for example a pin. Then you can follow the displayed airline with the mouse until you have reached the target item at the other end of the airline. The trace will be connected automatically to the target, if it is on the same layer. If you want to change to a different layer during interactive routing, select "change layer" and then the name of the new layer in the popup menu under the right mouse button. Then a via will be inserted, if that is possible, and a new trace starts on the new layer. You can also change the layer by pressing a number key. +By pushing the Route button you get into the state for eu.mihosoft.freerouting.interactive routing. In this state you can start a new trace by picking an item belonging to a net, for example a pin. Then you can follow the displayed airline with the mouse until you have reached the target item at the other end of the airline. The trace will be connected automatically to the target, if it is on the same layer. If you want to change to a different layer during eu.mihosoft.freerouting.interactive routing, select "change layer" and then the name of the new layer in the popup menu under the right mouse button. Then a via will be inserted, if that is possible, and a new trace starts on the new layer. You can also change the layer by pressing a number key. After pushing the Drag button you get into the state for changing the location of vias, components or traces. In this state you can select vias or components and drag them with the left mouse button to a different location. The connected route is updated automatically. You can also move traces by pushing them from behind out of the empty space with the left mouse button pressed. That works on the current layer, which can be changed in the select parameter sheet. In this way you can make space for example to insert a new component. -For more information please use the online help in the board editor. From here you can download also a printable version of the online help. +For more information please use the online help in the eu.mihosoft.freerouting.board editor. From here you can download also a printable version of the online help. If you have further questions or want some feedback, please sent an Email to support@ FreeRouting.net or visit our forum. @@ -84,7 +84,7 @@ Here are some instructions how to run the Freerouting project in the NetBeans ID 5) Build your new project in NetBeans. -6) To get rid of the undefined's download and unzip the attached library jh.jar. It is the system library of the Java Help system. +6) To get rid of the undefined's download and unzip the attached eu.mihosoft.freerouting.library jh.jar. It is the system eu.mihosoft.freerouting.library of the Java Help system. 7) Right click on the name of your new project on the left of NetBeans and select Properties. @@ -94,6 +94,6 @@ Here are some instructions how to run the Freerouting project in the NetBeans ID 10) Build the project again. The router should run now. -For optional parameters of the Freerouting outfile check the usage of the variable p_args in the source file gui/MainApplication.java. +For optional parameters of the Freerouting outfile check the usage of the variable p_args in the source file eu.mihosoft.freerouting.gui/MainApplication.java. diff --git a/launch4j.xml b/launch4j.xml index 9cd7d47..24c5a71 100644 --- a/launch4j.xml +++ b/launch4j.xml @@ -1,7 +1,7 @@ false - gui + eu.mihosoft.freerouting.gui F:\stuff\freerouting.freerouting\build\FreeRouting.jar FreeRouting.exe diff --git a/lib/jh.jar b/lib/jh.jar deleted file mode 100644 index 185d942..0000000 Binary files a/lib/jh.jar and /dev/null differ diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/AutorouteSettings.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/AutorouteSettings.java deleted file mode 100644 index cb79e0b..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/AutorouteSettings.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * AutorouteSettings.java - * - * Created on 1. Maerz 2007, 07:10 - * - */ -package designformats.specctra; - -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - -/** - * - * @author Alfons Wirtz - */ -public class AutorouteSettings -{ - - static interactive.AutorouteSettings read_scope(Scanner p_scanner, LayerStructure p_layer_structure) - { - interactive.AutorouteSettings result = new interactive.AutorouteSettings(p_layer_structure.arr.length); - boolean with_fanout = false; - boolean with_autoroute = true; - boolean with_postroute = true; - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_scanner.next_token(); - } catch (java.io.IOException e) - { - System.out.println("AutorouteSettings.read_scope: IO error scanning file"); - return null; - } - if (next_token == null) - { - System.out.println("AutorouteSettings.read_scope: unexpected end of file"); - return null; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.FANOUT) - { - with_fanout = DsnFile.read_on_off_scope(p_scanner); - } - else if (next_token == Keyword.AUTOROUTE) - { - with_autoroute = DsnFile.read_on_off_scope(p_scanner); - } - else if (next_token == Keyword.POSTROUTE) - { - with_postroute = DsnFile.read_on_off_scope(p_scanner); - } - else if (next_token == Keyword.VIAS) - { - result.set_vias_allowed(DsnFile.read_on_off_scope(p_scanner)); - } - else if (next_token == Keyword.VIA_COSTS) - { - result.set_via_costs(DsnFile.read_integer_scope(p_scanner)); - } - else if (next_token == Keyword.PLANE_VIA_COSTS) - { - result.set_plane_via_costs(DsnFile.read_integer_scope(p_scanner)); - } - else if (next_token == Keyword.START_RIPUP_COSTS) - { - result.set_start_ripup_costs(DsnFile.read_integer_scope(p_scanner)); - } - else if (next_token == Keyword.START_PASS_NO) - { - result.set_pass_no(DsnFile.read_integer_scope(p_scanner)); - } - else if (next_token == Keyword.LAYER_RULE) - { - result = read_layer_rule(p_scanner, p_layer_structure, result); - if (result == null) - { - return null; - } - } - else - { - ScopeKeyword.skip_scope(p_scanner); - } - } - } - result.set_with_fanout(with_fanout); - result.set_with_autoroute(with_autoroute); - result.set_with_postroute(with_postroute); - return result; - } - - static interactive.AutorouteSettings read_layer_rule(Scanner p_scanner, LayerStructure p_layer_structure, - interactive.AutorouteSettings p_settings) - { - p_scanner.yybegin(SpecctraFileScanner.NAME); - Object next_token; - try - { - next_token = p_scanner.next_token(); - } catch (java.io.IOException e) - { - System.out.println("AutorouteSettings.read_layer_rule: IO error scanning file"); - return null; - } - if (!(next_token instanceof String)) - { - System.out.println("AutorouteSettings.read_layer_rule: String expected"); - return null; - } - int layer_no = p_layer_structure.get_no((String) next_token); - if (layer_no < 0) - { - System.out.println("AutorouteSettings.read_layer_rule: layer not found"); - return null; - } - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_scanner.next_token(); - } catch (java.io.IOException e) - { - System.out.println("AutorouteSettings.read_layer_rule: IO error scanning file"); - return null; - } - if (next_token == null) - { - System.out.println("AutorouteSettings.read_layer_rule: unexpected end of file"); - return null; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.ACTIVE) - { - p_settings.set_layer_active(layer_no, DsnFile.read_on_off_scope(p_scanner)); - } - else if (next_token == Keyword.PREFERRED_DIRECTION) - { - try - { - boolean pref_dir_is_horizontal = true; - next_token = p_scanner.next_token(); - if (next_token == Keyword.VERTICAL) - { - pref_dir_is_horizontal = false; - } - else if (next_token != Keyword.HORIZONTAL) - { - System.out.println("AutorouteSettings.read_layer_rule: unexpected key word"); - return null; - } - p_settings.set_preferred_direction_is_horizontal(layer_no, pref_dir_is_horizontal); - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("AutorouteSettings.read_layer_rule: uclosing bracket expected"); - return null; - } - } catch (java.io.IOException e) - { - System.out.println("AutorouteSettings.read_layer_rule: IO error scanning file"); - return null; - } - } - else if (next_token == Keyword.PREFERRED_DIRECTION_TRACE_COSTS) - { - p_settings.set_preferred_direction_trace_costs(layer_no, DsnFile.read_float_scope(p_scanner)); - } - else if (next_token == Keyword.AGAINST_PREFERRED_DIRECTION_TRACE_COSTS) - { - p_settings.set_against_preferred_direction_trace_costs(layer_no, DsnFile.read_float_scope(p_scanner)); - } - else - { - ScopeKeyword.skip_scope(p_scanner); - } - } - } - return p_settings; - } - - static void write_scope(IndentFileWriter p_file, interactive.AutorouteSettings p_settings, - board.LayerStructure p_layer_structure, IdentifierType p_identifier_type) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("autoroute_settings"); - p_file.new_line(); - p_file.write("(fanout "); - if (p_settings.get_with_fanout()) - { - p_file.write("on)"); - } - else - { - p_file.write("off)"); - } - p_file.new_line(); - p_file.write("(autoroute "); - if (p_settings.get_with_autoroute()) - { - p_file.write("on)"); - } - else - { - p_file.write("off)"); - } - p_file.new_line(); - p_file.write("(postroute "); - if (p_settings.get_with_postroute()) - { - p_file.write("on)"); - } - else - { - p_file.write("off)"); - } - p_file.new_line(); - p_file.write("(vias "); - if (p_settings.get_vias_allowed()) - { - p_file.write("on)"); - } - else - { - p_file.write("off)"); - } - p_file.new_line(); - p_file.write("(via_costs "); - { - Integer via_costs = p_settings.get_via_costs(); - p_file.write(via_costs.toString()); - } - p_file.write(")"); - p_file.new_line(); - p_file.write("(plane_via_costs "); - { - Integer via_costs = p_settings.get_plane_via_costs(); - p_file.write(via_costs.toString()); - } - p_file.write(")"); - p_file.new_line(); - p_file.write("(start_ripup_costs "); - { - Integer ripup_costs = p_settings.get_start_ripup_costs(); - p_file.write(ripup_costs.toString()); - } - p_file.write(")"); - p_file.new_line(); - p_file.write("(start_pass_no "); - { - Integer pass_no = p_settings.get_pass_no(); - p_file.write(pass_no.toString()); - } - p_file.write(")"); - for (int i = 0; i < p_layer_structure.arr.length; ++i) - { - board.Layer curr_layer = p_layer_structure.arr[i]; - p_file.start_scope(); - p_file.write("layer_rule "); - p_identifier_type.write(curr_layer.name, p_file); - p_file.new_line(); - p_file.write("(active "); - if (p_settings.get_layer_active(i)) - { - p_file.write("on)"); - } - else - { - p_file.write("off)"); - } - p_file.new_line(); - p_file.write("(preferred_direction "); - if (p_settings.get_preferred_direction_is_horizontal(i)) - { - p_file.write("horizontal)"); - } - else - { - p_file.write("vertical)"); - } - p_file.new_line(); - p_file.write("(preferred_direction_trace_costs "); - Float trace_costs = (float) p_settings.get_preferred_direction_trace_costs(i); - p_file.write(trace_costs.toString()); - p_file.write(")"); - p_file.new_line(); - p_file.write("(against_preferred_direction_trace_costs "); - trace_costs = (float) p_settings.get_against_preferred_direction_trace_costs(i); - p_file.write(trace_costs.toString()); - p_file.write(")"); - p_file.end_scope(); - } - p_file.end_scope(); - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Circle.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Circle.java deleted file mode 100644 index 81c08e8..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Circle.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Circle.java - * - * Created on 20. Mai 2004, 09:22 - */ - -package designformats.specctra; - -import geometry.planar.IntPoint; -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - -/** - * Class for reading and writing circle scopes from dsn-files. - * - * @author alfons - */ -public class Circle extends Shape -{ - /** - * Creates a new circle from the input parameters. - * p_coor is an array of dimension 3. - * p_coor [0] is the radius of the circle, - * p_coor [1] is the x coordinate of the circle, - * p_coor [2] is the y coordinate of the circle. - */ - public Circle(Layer p_layer, double [] p_coor) - { - super(p_layer); - coor = p_coor; - } - - public Circle(Layer p_layer, double p_radius, double p_center_x, double p_center_y) - { - super(p_layer); - coor = new double[3]; - coor[0] = p_radius; - coor[1] = p_center_x; - coor[2] = p_center_y; - } - - public geometry.planar.Shape transform_to_board(CoordinateTransform p_coordinate_transform) - { - double [] location = new double[2]; - location[0] = coor[1]; - location[1] = coor[2]; - IntPoint center = p_coordinate_transform.dsn_to_board(location).round(); - int radius = (int) Math.round(p_coordinate_transform.dsn_to_board(coor[0]) / 2); - return new geometry.planar.Circle(center, radius); - } - - public geometry.planar.Shape transform_to_board_rel(CoordinateTransform p_coordinate_transform) - { - int [] new_coor = new int[3]; - new_coor[0] = (int) Math.round(p_coordinate_transform.dsn_to_board(coor[0]) / 2); - for (int i = 1; i < 3; ++i) - { - new_coor[i] = (int) Math.round(p_coordinate_transform.dsn_to_board(coor[i])); - } - return new geometry.planar.Circle(new IntPoint(new_coor[1], new_coor[2]), new_coor[0]); - } - - public Rectangle bounding_box() - { - double[] bounds = new double[4]; - bounds[0] = coor[1] - coor[0]; - bounds[1] = coor[2] - coor[0]; - bounds[2] = coor[1] + coor[0]; - bounds[3] = coor[2] + coor[0]; - return new Rectangle(layer, bounds); - } - - public void write_scope(IndentFileWriter p_file, IdentifierType p_identifier_type) throws java.io.IOException - { - p_file.new_line(); - p_file.write("(circle "); - p_identifier_type.write(this.layer.name, p_file); - for (int i = 0; i < coor.length; ++i) - { - p_file.write(" "); - p_file.write(new Double(coor[i]).toString()); - } - p_file.write(")"); - } - - public void write_scope_int(IndentFileWriter p_file, IdentifierType p_identifier_type) throws java.io.IOException - { - p_file.new_line(); - p_file.write("(circle "); - p_identifier_type.write(this.layer.name, p_file); - for (int i = 0; i < coor.length; ++i) - { - p_file.write(" "); - Integer curr_coor = (int) Math.round(coor[i]); - p_file.write(curr_coor.toString()); - } - p_file.write(")"); - } - - public final double[] coor; -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Circuit.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Circuit.java deleted file mode 100644 index f2c126b..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Circuit.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Circuit.java - * - * Created on 30. Mai 2005, 06:30 - * - */ - -package designformats.specctra; - -/** - * - * @author Alfons Wirtz - */ -public class Circuit -{ - /** - * Currently only the length matching rule is read from a circuit scope. - * If the scope does not contain a length matching rule, nulll is returned. - */ - public static ReadScopeResult read_scope( Scanner p_scanner) - { - Object next_token = null; - double min_trace_length = 0; - double max_trace_length = 0; - java.util.Collection use_via = new java.util.LinkedList(); - java.util.Collection use_layer = new java.util.LinkedList(); - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Circuit.read_scope: IO error scanning file"); - return null; - } - if (next_token == null) - { - System.out.println("Circuit.read_scope: unexpected end of file"); - return null; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.LENGTH) - { - LengthMatchingRule length_rule = read_length_scope(p_scanner); - if (length_rule != null) - { - min_trace_length = length_rule.min_length; - max_trace_length = length_rule.max_length; - } - } - else if (next_token == Keyword.USE_VIA) - { - use_via.addAll(Structure.read_via_padstacks(p_scanner)); - } - else if (next_token == Keyword.USE_LAYER) - { - use_layer.addAll(DsnFile.read_string_list_scope(p_scanner)); - } - else - { - ScopeKeyword.skip_scope(p_scanner); - } - } - } - return new ReadScopeResult(max_trace_length, min_trace_length, use_via, use_layer); - } - - static LengthMatchingRule read_length_scope( Scanner p_scanner) - { - LengthMatchingRule result = null; - double[] length_arr = new double[2]; - Object next_token = null; - for (int i = 0; i < 2; ++i) - { - try - { - next_token = p_scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Circuit.read_length_scope: IO error scanning file"); - return null; - } - if (next_token instanceof Double) - { - length_arr[i] = ((Double) next_token).doubleValue(); - } - else if (next_token instanceof Integer) - { - length_arr[i] = ((Integer) next_token).intValue(); - } - else - { - System.out.println("Circuit.read_length_scope: number expected"); - return null; - } - } - result = new LengthMatchingRule(length_arr[0], length_arr[1]); - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Circuit.read_length_scope: IO error scanning file"); - return null; - } - if (next_token == null) - { - System.out.println("Circuit.read_length_scope: unexpected end of file"); - return null; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == Keyword.OPEN_BRACKET) - { - ScopeKeyword.skip_scope(p_scanner); - } - } - return result; - } - - /** A max_length of -1 indicates, tha no maximum length is defined. */ - public static class ReadScopeResult - { - public ReadScopeResult(double p_max_length, double p_min_length, java.util.Collection p_use_via, java.util.Collection p_use_layer) - { - max_length = p_max_length; - min_length = p_min_length; - use_via = p_use_via; - use_layer = p_use_layer; - } - - public final double max_length; - public final double min_length; - public final java.util.Collection use_via; - public final java.util.Collection use_layer; - } - - /** A max_length of -1 indicates, tha no maximum length is defined. */ - private static class LengthMatchingRule - { - public LengthMatchingRule(double p_max_length, double p_min_length) - { - max_length = p_max_length; - min_length = p_min_length; - } - - public final double max_length; - public final double min_length; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Component.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Component.java deleted file mode 100644 index 7e35641..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Component.java +++ /dev/null @@ -1,430 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Component.java - * - * Created on 20. Mai 2004, 07:32 - */ - -package designformats.specctra; - - -/** - * Handels the placement bata of a library component. - * - * @author alfons - */ -public class Component extends ScopeKeyword -{ - - /** Creates a new instance of Component */ - public Component() - { - super("component"); - } - - /** - * Overwrites the function read_scope in ScopeKeyword - */ - public boolean read_scope(ReadScopeParameter p_par) - { - try - { - ComponentPlacement component_placement = read_scope(p_par.scanner); - if(component_placement == null) - { - return false; - } - p_par.placement_list.add(component_placement); - } - catch (java.io.IOException e) - { - System.out.println("Component.read_scope: IO error scanning file"); - return false; - } - return true; - } - - /** - * Used also when reading a session file. - */ - public static ComponentPlacement read_scope(Scanner p_scanner) throws java.io.IOException - { - Object next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Component.read_scope: component name expected"); - return null; - } - String name = (String) next_token; - ComponentPlacement component_placement = new ComponentPlacement(name); - Object prev_token = next_token; - next_token = p_scanner.next_token(); - while ( next_token != Keyword.CLOSED_BRACKET) - { - if (prev_token == Keyword.OPEN_BRACKET && next_token == Keyword.PLACE) - { - ComponentPlacement.ComponentLocation next_location = read_place_scope(p_scanner); - if (next_location != null) - { - component_placement.locations.add(next_location); - } - } - prev_token = next_token; - next_token = p_scanner.next_token(); - } - return component_placement; - } - - public static void write_scope(WriteScopeParameter p_par, board.Component p_component) - throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("place "); - p_par.file.new_line(); - p_par.identifier_type.write(p_component.name, p_par.file); - if (p_component.is_placed()) - { - double [] coor = p_par.coordinate_transform.board_to_dsn(p_component.get_location().to_float()); - for (int i = 0; i < coor.length; ++i) - { - p_par.file.write(" "); - p_par.file.write((new Double(coor[i])).toString()); - } - if (p_component.placed_on_front()) - { - p_par.file.write(" front "); - } - else - { - p_par.file.write(" back "); - } - int rotation = (int) Math.round(p_component.get_rotation_in_degree()); - p_par.file.write((new Integer(rotation).toString())); - } - if (p_component.position_fixed) - { - p_par.file.new_line(); - p_par.file.write(" (lock_type position)"); - } - int pin_count = p_component.get_package().pin_count(); - for (int i = 0; i < pin_count; ++i) - { - write_pin_info(p_par, p_component, i); - } - write_keepout_infos(p_par, p_component); - p_par.file.end_scope(); - } - - private static void write_pin_info(WriteScopeParameter p_par, board.Component p_component, int p_pin_no) - throws java.io.IOException - { - if (!p_component.is_placed()) - { - return; - } - library.Package.Pin package_pin = p_component.get_package().get_pin(p_pin_no); - if (package_pin == null) - { - System.out.println("Component.write_pin_info: package pin not found"); - return; - } - board.Pin component_pin = p_par.board.get_pin(p_component.no, p_pin_no); - if (component_pin == null) - { - System.out.println("Component.write_pin_info: component pin not found"); - return; - } - String cl_class_name = p_par.board.rules.clearance_matrix.get_name(component_pin.clearance_class_no()); - if (cl_class_name == null) - { - System.out.println("Component.write_pin_info: clearance class name not found"); - return; - } - p_par.file.new_line(); - p_par.file.write("(pin "); - p_par.identifier_type.write(package_pin.name, p_par.file); - p_par.file.write(" (clearance_class "); - p_par.identifier_type.write(cl_class_name, p_par.file); - p_par.file.write("))"); - } - - private static void write_keepout_infos(WriteScopeParameter p_par, board.Component p_component) - throws java.io.IOException - { - if (!p_component.is_placed()) - { - return; - } - library.Package.Keepout[] curr_keepout_arr; - String keepout_type; - for (int j = 0; j < 3; ++j) - { - if (j == 0) - { - curr_keepout_arr = p_component.get_package().keepout_arr; - keepout_type = "(keepout "; - } - else if (j == 1) - { - curr_keepout_arr = p_component.get_package().via_keepout_arr; - keepout_type = "(via_keepout "; - } - else - { - curr_keepout_arr = p_component.get_package().place_keepout_arr; - keepout_type = "(place_keepout "; - } - for (int i = 0; i < curr_keepout_arr.length; ++i) - { - library.Package.Keepout curr_keepout = curr_keepout_arr[i]; - board.ObstacleArea curr_obstacle_area = get_keepout(p_par.board, p_component.no, curr_keepout.name); - if (curr_obstacle_area == null || curr_obstacle_area.clearance_class_no() == 0) - { - continue; - } - String cl_class_name = p_par.board.rules.clearance_matrix.get_name(curr_obstacle_area.clearance_class_no()); - if (cl_class_name == null) - { - System.out.println("Component.write_keepout_infos: clearance class name not found"); - return; - } - p_par.file.new_line(); - p_par.file.write(keepout_type); - p_par.identifier_type.write(curr_keepout.name, p_par.file); - p_par.file.write(" (clearance_class "); - p_par.identifier_type.write(cl_class_name, p_par.file); - p_par.file.write("))"); - } - } - } - - private static board.ObstacleArea get_keepout(board.BasicBoard p_board, int p_component_no, String p_name) - { - java.util.Iterator it = p_board.item_list.start_read_object(); - for(;;) - { - board.Item curr_item = (board.Item)p_board.item_list.read_object(it); - if (curr_item == null) - { - break; - } - if (curr_item.get_component_no() == p_component_no && curr_item instanceof board.ObstacleArea) - { - board.ObstacleArea curr_area = (board.ObstacleArea) curr_item; - if (curr_area.name != null && curr_area.name.equals(p_name)) - { - return curr_area; - } - } - } - return null; - } - - - - private static ComponentPlacement.ComponentLocation read_place_scope(Scanner p_scanner) - { - try - { - java.util.Map pin_infos = - new java.util.TreeMap(); - java.util.Map keepout_infos = - new java.util.TreeMap(); - java.util.Map via_keepout_infos = - new java.util.TreeMap(); - java.util.Map place_keepout_infos = - new java.util.TreeMap(); - Object next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Component.read_place_scope: String expected"); - return null; - } - String name = (String) next_token; - double[] location = new double[2]; - for (int i = 0; i < 2; ++i) - { - next_token = p_scanner.next_token(); - if (next_token instanceof Double) - { - location[i] = ((Double) next_token).doubleValue(); - } - else if (next_token instanceof Integer) - { - location[i] = ((Integer) next_token).intValue(); - } - else if (next_token == Keyword.CLOSED_BRACKET) - { - // component is not yet placed - return new ComponentPlacement.ComponentLocation(name, null, true, 0, false, pin_infos, - keepout_infos, via_keepout_infos, place_keepout_infos); - } - else - { - System.out.println("Component.read_place_scope: number expected"); - return null; - } - } - next_token = p_scanner.next_token(); - boolean is_front = true; - if (next_token == Keyword.BACK) - { - is_front = false; - } - else if (next_token != Keyword.FRONT) - { - System.out.println("Component.read_place_scope: Keyword.FRONT expected"); - } - double rotation; - next_token = p_scanner.next_token(); - if (next_token instanceof Double) - { - rotation = ((Double) next_token).doubleValue(); - } - else if (next_token instanceof Integer) - { - rotation = ((Integer) next_token).intValue(); - } - else - { - System.out.println("Component.read_place_scope: number expected"); - return null; - } - boolean position_fixed = false; - next_token = p_scanner.next_token(); - while (next_token == Keyword.OPEN_BRACKET) - { - next_token = p_scanner.next_token(); - if (next_token == Keyword.LOCK_TYPE) - { - position_fixed = read_lock_type(p_scanner); - } - else if (next_token == Keyword.PIN) - { - ComponentPlacement.ItemClearanceInfo curr_pin_info = read_item_clearance_info(p_scanner); - if (curr_pin_info == null) - { - return null; - } - pin_infos.put(curr_pin_info.name, curr_pin_info); - } - else if (next_token == Keyword.KEEPOUT) - { - ComponentPlacement.ItemClearanceInfo curr_keepout_info = read_item_clearance_info(p_scanner); - if (curr_keepout_info == null) - { - return null; - } - keepout_infos.put(curr_keepout_info.name, curr_keepout_info); - } - else if (next_token == Keyword.VIA_KEEPOUT) - { - ComponentPlacement.ItemClearanceInfo curr_keepout_info = read_item_clearance_info(p_scanner); - if (curr_keepout_info == null) - { - return null; - } - via_keepout_infos.put(curr_keepout_info.name, curr_keepout_info); - } - else if (next_token == Keyword.PLACE_KEEPOUT) - { - ComponentPlacement.ItemClearanceInfo curr_keepout_info = read_item_clearance_info(p_scanner); - if (curr_keepout_info == null) - { - return null; - } - place_keepout_infos.put(curr_keepout_info.name, curr_keepout_info); - } - else - { - skip_scope(p_scanner); - } - next_token = p_scanner.next_token(); - } - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Component.read_place_scope: ) expected"); - return null; - } - ComponentPlacement.ComponentLocation result = - new ComponentPlacement.ComponentLocation(name, location, is_front, rotation, position_fixed, pin_infos, - keepout_infos, via_keepout_infos, place_keepout_infos); - return result; - } - catch (java.io.IOException e) - { - System.out.println("Component.read_scope: IO error scanning file"); - System.out.println(e); - return null; - } - } - - private static ComponentPlacement.ItemClearanceInfo read_item_clearance_info(Scanner p_scanner) throws java.io.IOException - { - p_scanner.yybegin(SpecctraFileScanner.NAME); - Object next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Component.read_item_clearance_info: String expected"); - return null; - } - String name = (String) next_token; - String cl_class_name = null; - next_token = p_scanner.next_token(); - while (next_token == Keyword.OPEN_BRACKET) - { - next_token = p_scanner.next_token(); - if (next_token == Keyword.CLEARANCE_CLASS) - { - cl_class_name = DsnFile.read_string_scope(p_scanner); - } - else - { - skip_scope(p_scanner); - } - next_token = p_scanner.next_token(); - } - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Component.read_item_clearance_info: ) expected"); - return null; - } - if (cl_class_name == null) - { - System.out.println("Component.read_item_clearance_info: clearance class name not found"); - return null; - } - return new ComponentPlacement.ItemClearanceInfo(name, cl_class_name); - } - - private static boolean read_lock_type(Scanner p_scanner) throws java.io.IOException - { - boolean result = false; - for (;;) - { - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - if (next_token == Keyword.POSITION) - { - result = true; - } - } - return result; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/ComponentPlacement.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/ComponentPlacement.java deleted file mode 100644 index 3633c2e..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/ComponentPlacement.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * ComponentPlacement.java - * - * Created on 20. Mai 2004, 07:43 - */ - -package designformats.specctra; - -import java.util.Collection; -import java.util.LinkedList; -import java.util.Map; - -/** - * Describes the placement data of a library component - * - * @author alfons - */ -public class ComponentPlacement -{ - - /** Creates a new instance of ComponentPlacement */ - public ComponentPlacement(String p_lib_name) - { - lib_name = p_lib_name; - locations = new LinkedList(); - } - - /** The name of the corresponding library component */ - public final String lib_name; - - /** The list of ComponentLocations of the library component on the board. */ - public final Collection locations; - - /** The structure of an entry in the list locations. */ - public static class ComponentLocation - { - ComponentLocation(String p_name, double[] p_coor, boolean p_is_front, double p_rotation, boolean p_position_fixed, - Map p_pin_infos, Map p_keepout_infos, - Map p_via_keepout_infos, Map p_place_keepout_infos) - { - name = p_name; - coor = p_coor; - is_front = p_is_front; - rotation = p_rotation; - position_fixed = p_position_fixed; - pin_infos = p_pin_infos; - keepout_infos = p_keepout_infos; - via_keepout_infos = p_via_keepout_infos; - place_keepout_infos = p_place_keepout_infos; - - } - - public final String name; - - /** the x- and the y-coordinate of the location. */ - public final double [] coor; - - /** - * True, if the component is placed at the component side. - * Else the component is placed at the solder side. - */ - public final boolean is_front; - - /** The rotation of the component in degree. */ - public final double rotation; - - /** If true, the component cannot be moved. */ - public final boolean position_fixed; - - /** - * The entries of this map are of type ItemClearanceInfo, the keys are the pin names. - */ - public final Map pin_infos; - - public final Map keepout_infos; - - public final Map via_keepout_infos; - - public final Map place_keepout_infos; - } - - public static class ItemClearanceInfo - { - ItemClearanceInfo( String p_name, String p_clearance_class) - { - name = p_name; - clearance_class = p_clearance_class; - } - public final String name; - public final String clearance_class; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/CoordinateTransform.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/CoordinateTransform.java deleted file mode 100644 index 1c291e5..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/CoordinateTransform.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * CoordinateTransform.java - * - * Created on 14. Mai 2004, 09:09 - */ - -package designformats.specctra; - -import geometry.planar.FloatPoint; -import geometry.planar.Vector; -import geometry.planar.Line; -import geometry.planar.IntBox; -import geometry.planar.PolylineShape; - -/** - * Computes transformations between a specctra dsn-file coordinates and board coordinates. - * - * @author Alfons Wirtz - */ -public class CoordinateTransform implements java.io.Serializable -{ - - /** - * Creates a new instance of CoordinateTransform. - * The base point of the dsn coordinate system will be translated to zero in the board - * coordinate system. - */ - public CoordinateTransform(double p_scale_factor, double p_base_x, double p_base_y) - { - scale_factor = p_scale_factor; - base_x = p_base_x; - base_y = p_base_y; - } - - /** - * Scale a value from the board to the dsn coordinate system - */ - public double board_to_dsn(double p_val) - { - return p_val / scale_factor; - } - - /** - * Scale a value from the dsn to the board coordinate system - */ - public double dsn_to_board(double p_val) - { - return p_val * scale_factor; - } - - /** - * Transforms a geometry.planar.FloatPoint to a tuple of doubles - * in the dsn coordinate system. - */ - public double[] board_to_dsn(FloatPoint p_point) - { - double [] result = new double[2]; - result [0] = board_to_dsn(p_point.x) + base_x; - result [1] = board_to_dsn(p_point.y) + base_y; - return result; - } - - /** - * Transforms a geometry.planar.FloatPoint to a tuple of doubles - * in the dsn coordinate system in relative (vector) coordinates. - */ - public double[] board_to_dsn_rel(FloatPoint p_point) - { - double [] result = new double[2]; - result [0] = board_to_dsn(p_point.x); - result [1] = board_to_dsn(p_point.y); - return result; - } - - /** - * Transforms an array of n geometry.planar.FloatPoints to - * an array of 2*n doubles in the dsn coordinate system. - */ - public double [] board_to_dsn(FloatPoint [] p_points) - { - double [] result = new double[2 * p_points.length]; - for (int i = 0; i < p_points.length; ++ i) - { - result[2 * i] = board_to_dsn(p_points[i].x) + base_x; - result[2 * i + 1] = board_to_dsn(p_points[i].y) + base_y; - } - return result; - } - - /** - * Transforms an array of n geometry.planar.Lines to - * an array of 4*n doubles in the dsn coordinate system. - */ - public double [] board_to_dsn(Line [] p_lines) - { - double [] result = new double[4 * p_lines.length]; - for (int i = 0; i < p_lines.length; ++ i) - { - FloatPoint a = p_lines[i].a.to_float(); - FloatPoint b = p_lines[i].b.to_float(); - result[4 * i] = board_to_dsn(a.x) + base_x; - result[4 * i + 1] = board_to_dsn(a.y) + base_y; - result[4 * i + 2] = board_to_dsn(b.x) + base_x; - result[4 * i + 3] = board_to_dsn(b.y) + base_y; - } - return result; - } - - /** - * Transforms an array of n geometry.planar.FloatPoints to - * an array of 2*n doubles in the dsn coordinate system in relative (vector) coordinates. - */ - public double [] board_to_dsn_rel(FloatPoint [] p_points) - { - double [] result = new double[2 * p_points.length]; - for (int i = 0; i < p_points.length; ++ i) - { - result[2 * i] = board_to_dsn(p_points[i].x); - result[2 * i + 1] = board_to_dsn(p_points[i].y); - } - return result; - } - - /** - * Transforms a geometry.planar.Vector to a tuple of doubles - * in the dsn coordinate system. - */ - public double[] board_to_dsn(Vector p_vector) - { - double [] result = new double[2]; - FloatPoint v = p_vector.to_float(); - result [0] = board_to_dsn(v.x); - result [1] = board_to_dsn(v.y); - return result; - } - - /** - * Transforms a dsn tuple to a geometry.planar.FloatPoint - */ - public FloatPoint dsn_to_board(double [] p_tuple) - { - double x = dsn_to_board(p_tuple[0] - base_x); - double y = dsn_to_board(p_tuple[1] - base_y); - return new FloatPoint(x, y); - } - - /** - * Transforms a dsn tuple to a geometry.planar.FloatPoint in relative (vector) coordinates. - */ - public FloatPoint dsn_to_board_rel(double [] p_tuple) - { - double x = dsn_to_board(p_tuple[0]); - double y = dsn_to_board(p_tuple[1]); - return new FloatPoint(x, y); - } - - /** - * Transforms a geometry.planar.Intbox to the coordinates of a Rectangle. - */ - public double [] board_to_dsn(IntBox p_box) - { - double [] result = new double[4]; - result[0] = p_box.ll.x / scale_factor + base_x; - result[1] = p_box.ll.y / scale_factor + base_y; - result[2] = p_box.ur.x / scale_factor + base_x; - result[3] = p_box.ur.y / scale_factor + base_y; - return result; - } - - /** - * Transforms a geometry.planar.Intbox to a Rectangle in relative (vector) coordinates. - */ - public double [] board_to_dsn_rel(IntBox p_box) - { - double [] result = new double[4]; - result[0] = p_box.ll.x / scale_factor; - result[1] = p_box.ll.y / scale_factor ; - result[2] = p_box.ur.x / scale_factor; - result[3] = p_box.ur.y / scale_factor; - return result; - } - - /** - * Transforms a board shape to a dsn shape. - */ - public Shape board_to_dsn(geometry.planar.Shape p_board_shape, Layer p_layer) - { - Shape result; - if (p_board_shape instanceof IntBox) - { - result = new Rectangle(p_layer, board_to_dsn((IntBox) p_board_shape)); - } - else if (p_board_shape instanceof PolylineShape) - { - FloatPoint [] corners = ((PolylineShape)p_board_shape).corner_approx_arr(); - double [] coors = board_to_dsn(corners); - result = new Polygon(p_layer, coors); - } - else if (p_board_shape instanceof geometry.planar.Circle) - { - geometry.planar.Circle board_circle = (geometry.planar.Circle) p_board_shape; - double diameter = 2 * board_to_dsn(board_circle.radius); - double [] center_coor = board_to_dsn(board_circle.center.to_float()); - result = new Circle(p_layer, diameter, center_coor[0], center_coor[1]); - } - else - { - System.out.println("CoordinateTransform.board_to_dsn not yet implemented for p_board_shape"); - result = null; - } - return result; - } - - /** - * Transforms the relative (vector) coordinates of a geometry.planar.Shape to a specctra dsn shape. - */ - public Shape board_to_dsn_rel(geometry.planar.Shape p_board_shape, Layer p_layer) - { - Shape result; - if (p_board_shape instanceof IntBox) - { - result = new Rectangle(p_layer, board_to_dsn_rel((IntBox) p_board_shape)); - } - else if (p_board_shape instanceof PolylineShape) - { - FloatPoint [] corners = ((PolylineShape)p_board_shape).corner_approx_arr(); - double [] coors = board_to_dsn_rel(corners); - result = new Polygon(p_layer, coors); - } - else if (p_board_shape instanceof geometry.planar.Circle) - { - geometry.planar.Circle board_circle = (geometry.planar.Circle) p_board_shape; - double diameter = 2 * board_to_dsn(board_circle.radius); - double [] center_coor = board_to_dsn_rel(board_circle.center.to_float()); - result = new Circle(p_layer, diameter, center_coor[0], center_coor[1]); - } - else - { - System.out.println("CoordinateTransform.board_to_dsn not yet implemented for p_board_shape"); - result = null; - } - return result; - } - - private final double scale_factor; - private final double base_x; - private final double base_y; -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/DsnFile.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/DsnFile.java deleted file mode 100644 index 77a3388..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/DsnFile.java +++ /dev/null @@ -1,430 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * InputDsnFile.java - * - * Created on 10. Mai 2004, 07:43 - */ -package designformats.specctra; - -import datastructures.IndentFileWriter; - -import board.BasicBoard; -import board.TestLevel; - -/** - * Class for reading and writing dsn-files. - * - * @author alfons - */ -public class DsnFile -{ - - public enum ReadResult - { - - OK, OUTLINE_MISSING, ERROR - } - - private DsnFile() { - } - - /** - * Creates a routing board from a Specctra dns file. - * The parameters p_item_observers and p_item_id_no_generator are used, - * in case the board is embedded into a host system. - * Returns false, if an error occured. - */ - public static ReadResult read(java.io.InputStream p_input_stream, interactive.IBoardHandling p_board_handling, - board.BoardObservers p_observers, datastructures.IdNoGenerator p_item_id_no_generator, TestLevel p_test_level) - { - Scanner scanner = new SpecctraFileScanner(p_input_stream); - Object curr_token = null; - for (int i = 0; i < 3; ++i) - { - try - { - curr_token = scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("DsnFile.read: IO error scanning file"); - System.out.println(e); - return ReadResult.ERROR; - } - boolean keyword_ok = true; - if (i == 0) - { - keyword_ok = (curr_token == Keyword.OPEN_BRACKET); - } - else if (i == 1) - { - keyword_ok = (curr_token == Keyword.PCB_SCOPE); - scanner.yybegin(SpecctraFileScanner.NAME); // to overread the name of the pcb for i = 2 - } - if (!keyword_ok) - { - System.out.println("DsnFile.read: specctra dsn file format expected"); - return ReadResult.ERROR; - } - } - ReadScopeParameter read_scope_par = - new ReadScopeParameter(scanner, p_board_handling, p_observers, p_item_id_no_generator, p_test_level); - boolean read_ok = Keyword.PCB_SCOPE.read_scope(read_scope_par); - ReadResult result; - if (read_ok) - { - result = ReadResult.OK; - if (read_scope_par.autoroute_settings == null) - { - // look for power planes with incorrect layer type and adjust autoroute parameters - adjust_plane_autoroute_settings(p_board_handling); - } - } - else if (!read_scope_par.board_outline_ok) - { - result = ReadResult.OUTLINE_MISSING; - } - else - { - result = ReadResult.ERROR; - } - //tests.Validate.check("after reading dsn", read_scope_par.board_handling.get_routing_board()); - return result; - } - - /** - * Sets contains_plane to true for nets with a conduction_area covering a - * large part of a signal layer, if that layer does not contain any traces - * This is useful in case the layer type was not set correctly to plane in the dsn-file. - * Returns true, if something was changed. - */ - private static boolean adjust_plane_autoroute_settings(interactive.IBoardHandling p_board_handling) - { - BasicBoard routing_board = p_board_handling.get_routing_board(); - board.LayerStructure board_layer_structure = routing_board.layer_structure; - if (board_layer_structure.arr.length <= 2) - { - return false; - } - for (board.Layer curr_layer : board_layer_structure.arr) - { - if (!curr_layer.is_signal) - { - return false; - } - } - boolean[] layer_contains_wires_arr = new boolean[board_layer_structure.arr.length]; - boolean[] changed_layer_arr = new boolean[board_layer_structure.arr.length]; - for (int i = 0; i < layer_contains_wires_arr.length; ++i) - { - layer_contains_wires_arr[i] = false; - changed_layer_arr[i] = false; - } - java.util.Collection conduction_area_list = new java.util.LinkedList(); - java.util.Collection item_list = routing_board.get_items(); - for (board.Item curr_item : item_list) - { - if (curr_item instanceof board.Trace) - { - int curr_layer = ((board.Trace) curr_item).get_layer(); - layer_contains_wires_arr[curr_layer] = true; - } - else if (curr_item instanceof board.ConductionArea) - { - conduction_area_list.add((board.ConductionArea) curr_item); - } - } - boolean nothing_changed = true; - - board.BoardOutline board_outline = routing_board.get_outline(); - double board_area = 0; - for (int i = 0; i < board_outline.shape_count(); ++i) - { - geometry.planar.TileShape[] curr_piece_arr = board_outline.get_shape(i).split_to_convex(); - if (curr_piece_arr != null) - { - for (geometry.planar.TileShape curr_piece : curr_piece_arr) - { - board_area += curr_piece.area(); - } - } - } - for (board.ConductionArea curr_conduction_area : conduction_area_list) - { - int layer_no = curr_conduction_area.get_layer(); - if (layer_contains_wires_arr[layer_no]) - { - continue; - } - board.Layer curr_layer = routing_board.layer_structure.arr[layer_no]; - if (!curr_layer.is_signal || layer_no == 0 || layer_no == board_layer_structure.arr.length - 1) - { - continue; - } - geometry.planar.TileShape[] convex_pieces = curr_conduction_area.get_area().split_to_convex(); - double curr_area = 0; - for (geometry.planar.TileShape curr_piece : convex_pieces) - { - curr_area += curr_piece.area(); - } - if (curr_area < 0.5 * board_area) - { - // skip conduction areas not covering most of the board - continue; - } - - for (int i = 0; i < curr_conduction_area.net_count(); ++i) - { - rules.Net curr_net = routing_board.rules.nets.get(curr_conduction_area.get_net_no(i)); - curr_net.set_contains_plane(true); - nothing_changed = false; - } - - changed_layer_arr[layer_no] = true; - if (curr_conduction_area.get_fixed_state().ordinal() < board.FixedState.USER_FIXED.ordinal()) - { - curr_conduction_area.set_fixed_state(board.FixedState.USER_FIXED); - } - } - if (nothing_changed) - { - return false; - } - // Adjust the layer prefered directions in the autoroute settings. - // and deactivate the changed layers. - interactive.AutorouteSettings autoroute_settings = p_board_handling.get_settings().autoroute_settings; - int layer_count = routing_board.get_layer_count(); - boolean curr_preferred_direction_is_horizontal = - autoroute_settings.get_preferred_direction_is_horizontal(0); - for (int i = 0; i < layer_count; ++i) - { - if (changed_layer_arr[i]) - { - autoroute_settings.set_layer_active(i, false); - } - else if (autoroute_settings.get_layer_active(i)) - { - autoroute_settings.set_preferred_direction_is_horizontal(i, curr_preferred_direction_is_horizontal); - curr_preferred_direction_is_horizontal = !curr_preferred_direction_is_horizontal; - } - } - return true; - } - - /** - * Writes p_board to a text file in the Specctra dsn format. - * Returns false, if the write failed. - * If p_compat_mode is true, only standard speecctra dsn scopes are written, so that any - * host system with an specctra interface can read them. - */ - public static boolean write(interactive.BoardHandling p_board_handling, java.io.OutputStream p_file, String p_design_name, boolean p_compat_mode) - { - //tests.Validate.check("before writing dsn", p_board); - IndentFileWriter output_file = new IndentFileWriter(p_file); - if (output_file == null) - { - System.out.println("unable to write dsn file"); - return false; - } - - try - { - write_pcb_scope(p_board_handling, output_file, p_design_name, p_compat_mode); - } - catch (java.io.IOException e) - { - System.out.println("unable to write dsn file"); - return false; - } - try - { - output_file.close(); - } - catch (java.io.IOException e) - { - System.out.println("unable to close dsn file"); - return false; - } - return true; - } - - private static void write_pcb_scope(interactive.BoardHandling p_board_handling, IndentFileWriter p_file, String p_design_name, boolean p_compat_mode) - throws java.io.IOException - { - BasicBoard routing_board = p_board_handling.get_routing_board(); - WriteScopeParameter write_scope_parameter = - new WriteScopeParameter(routing_board, p_board_handling.settings.autoroute_settings, p_file, - routing_board.communication.specctra_parser_info.string_quote, - routing_board.communication.coordinate_transform, p_compat_mode); - - p_file.start_scope(); - p_file.write("PCB "); - write_scope_parameter.identifier_type.write(p_design_name, p_file); - Parser.write_scope(write_scope_parameter.file, - write_scope_parameter.board.communication.specctra_parser_info, write_scope_parameter.identifier_type, false); - Resolution.write_scope(p_file, routing_board.communication); - Structure.write_scope(write_scope_parameter); - Placement.write_scope(write_scope_parameter); - Library.write_scope(write_scope_parameter); - PartLibrary.write_scope(write_scope_parameter); - Network.write_scope(write_scope_parameter); - Wiring.write_scope(write_scope_parameter); - p_file.end_scope(); - } - - static boolean read_on_off_scope(Scanner p_scanner) - { - try - { - Object next_token = p_scanner.next_token(); - boolean result = false; - if (next_token == Keyword.ON) - { - result = true; - } - else if (next_token != Keyword.OFF) - { - System.out.println("DsnFile.read_boolean: Keyword.OFF expected"); - } - ScopeKeyword.skip_scope(p_scanner); - return result; - } - catch (java.io.IOException e) - { - System.out.println("DsnFile.read_boolean: IO error scanning file"); - return false; - } - } - - static int read_integer_scope(Scanner p_scanner) - { - try - { - int value; - Object next_token = p_scanner.next_token(); - if (next_token instanceof Integer) - { - value = ((Integer) next_token).intValue(); - } - else - { - System.out.println("DsnFile.read_integer_scope: number expected"); - return 0; - } - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("DsnFile.read_integer_scope: closing bracket expected"); - return 0; - } - return value; - } - catch (java.io.IOException e) - { - System.out.println("DsnFile.read_integer_scope: IO error scanning file"); - return 0; - } - } - - static double read_float_scope(Scanner p_scanner) - { - try - { - double value; - Object next_token = p_scanner.next_token(); - if (next_token instanceof Double) - { - value = ((Double) next_token).doubleValue(); - } - else if (next_token instanceof Integer) - { - value = ((Integer) next_token).intValue(); - } - else - { - System.out.println("DsnFile.read_float_scope: number expected"); - return 0; - } - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("DsnFile.read_float_scope: closing bracket expected"); - return 0; - } - return value; - } - catch (java.io.IOException e) - { - System.out.println("DsnFile.read_float_scope: IO error scanning file"); - return 0; - } - } - - public static String read_string_scope(Scanner p_scanner) - { - try - { - p_scanner.yybegin(SpecctraFileScanner.NAME); - Object next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("DsnFile:read_string_scope: String expected"); - return null; - } - String result = (String) next_token; - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("DsnFile.read_string_scope: closing bracket expected"); - } - return result; - } - catch (java.io.IOException e) - { - System.out.println("DsnFile.read_string_scope: IO error scanning file"); - return null; - } - } - - public static java.util.Collection read_string_list_scope(Scanner p_scanner) - { - java.util.Collection result = new java.util.LinkedList(); - try - { - for (;;) - { - p_scanner.yybegin(SpecctraFileScanner.NAME); - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - if (!(next_token instanceof String)) - { - System.out.println("DsnFileread_string_list_scope: string expected"); - return null; - } - result.add((String) next_token); - } - } - catch (java.io.IOException e) - { - System.out.println("DsnFile.read_string_list_scope: IO error scanning file"); - } - return result; - } - static final String CLASS_CLEARANCE_SEPARATOR = "-"; -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Keyword.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Keyword.java deleted file mode 100644 index 52da218..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Keyword.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Keyword.java - * - * Created on 8. Mai 2004, 10:23 - */ -package designformats.specctra; - -/** - * Enumeration class for keywords of the specctra dsn file format - * - * @author alfons - */ -public class Keyword -{ - - /** - * The only instances of the internal classes: - * - * ScopeKeywords with an inividual read_scope method are defined in an extra class, - */ - public static final Keyword ABSOLUTE = new Keyword("absolute"); - public static final Keyword ACTIVE = new Keyword("active"); - public static final Keyword AGAINST_PREFERRED_DIRECTION_TRACE_COSTS = new Keyword("against_preferred_direction_trace_costs"); - public static final Keyword ATTACH = new Keyword("attach"); - public static final Keyword AUTOROUTE = new Keyword("autoroute"); - public static final Keyword AUTOROUTE_SETTINGS = new Keyword("autoroute_settings"); - public static final Keyword BACK = new Keyword("back"); - public static final Keyword BOUNDARY = new Keyword("boundary"); - public static final Keyword CIRCUIT = new Keyword("circuit"); - public static final Keyword CIRCLE = new Keyword("circle"); - public static final Keyword CLASS = new Keyword("class"); - public static final Keyword CLASS_CLASS = new Keyword("class_class"); - public static final Keyword CLASSES = new Keyword("classes"); - public static final ScopeKeyword COMPONENT_SCOPE = new Component(); - public static final Keyword CONSTANT = new Keyword("constant"); - public static final Keyword CONTROL = new Keyword("control"); - public static final Keyword CLEARANCE = new Keyword("clearance"); - public static final Keyword CLEARANCE_CLASS = new Keyword("clearance_class"); - public static final Keyword CLOSED_BRACKET = new Keyword(")"); - public static final Keyword FANOUT = new Keyword("fanout"); - public static final Keyword FLIP_STYLE = new Keyword("flip_style"); - public static final Keyword FIX = new Keyword("fix"); - public static final Keyword FORTYFIVE_DEGREE = new Keyword("fortyfive_degree"); - public static final Keyword FROMTO = new Keyword("fromto"); - public static final Keyword FRONT = new Keyword("front"); - public static final Keyword GENERATED_BY_FREEROUTE = new Keyword("generated_by_freeroute"); - public static final Keyword HORIZONTAL = new Keyword("horizontal"); - public static final Keyword HOST_CAD = new Keyword("host_cad"); - public static final Keyword HOST_VERSION = new Keyword("host_version"); - public static final Keyword IMAGE = new Keyword("image"); - public static final Keyword KEEPOUT = new Keyword("keepout"); - public static final Keyword LAYER = new Keyword("layer"); - public static final Keyword LAYER_RULE = new Keyword("layer_rule"); - public static final Keyword LENGTH = new Keyword("length"); - public static final ScopeKeyword LIBRARY_SCOPE = new Library(); - public static final Keyword LOCK_TYPE = new Keyword("lock_type"); - public static final Keyword LOGICAL_PART = new Keyword("logical_part"); - public static final Keyword LOGICAL_PART_MAPPING = new Keyword("logical_part_mapping"); - public static final Keyword NET = new Keyword("net"); - public static final Keyword NETWORK_OUT = new Keyword("network_out"); - public static final ScopeKeyword NETWORK_SCOPE = new Network(); - public static final Keyword NINETY_DEGREE = new Keyword("ninety_degree"); - public static final Keyword NONE = new Keyword("none"); - public static final Keyword NORMAL = new Keyword("normal"); - public static final Keyword OFF = new Keyword("off"); - public static final Keyword ON = new Keyword("on"); - public static final Keyword OPEN_BRACKET = new Keyword("("); - public static final Keyword ORDER = new Keyword("order"); - public static final Keyword OUTLINE = new Keyword("outline"); - public static final Keyword PADSTACK = new Keyword("padstack"); - public static final ScopeKeyword PART_LIBRARY_SCOPE = new PartLibrary(); - public static final ScopeKeyword PARSER_SCOPE = new Parser(); - public static final ScopeKeyword PCB_SCOPE = new ScopeKeyword("pcb"); - public static final Keyword PIN = new Keyword("pin"); - public static final Keyword PINS = new Keyword("pins"); - public static final Keyword PLACE = new Keyword("place"); - public static final ScopeKeyword PLACE_CONTROL = new PlaceControl(); - public static final Keyword PLACE_KEEPOUT = new Keyword("place_keepout"); - public static final ScopeKeyword PLACEMENT_SCOPE = new Placement(); - public static final ScopeKeyword PLANE_SCOPE = new Plane(); - public static final Keyword PLANE_VIA_COSTS = new Keyword("plane_via_costs"); - public static final Keyword PREFERRED_DIRECTION = new Keyword("preferred_direction"); - public static final Keyword PREFERRED_DIRECTION_TRACE_COSTS = new Keyword("preferred_direction_trace_costs"); - public static final Keyword SNAP_ANGLE = new Keyword("snap_angle"); - public static final Keyword POLYGON = new Keyword("polygon"); - public static final Keyword POLYGON_PATH = new Keyword("polygon_path"); - public static final Keyword POLYLINE_PATH = new Keyword("polyline_path"); - public static final Keyword POSITION = new Keyword("position"); - public static final Keyword POSTROUTE = new Keyword("postroute"); - public static final Keyword POWER = new Keyword("power"); - public static final Keyword PULL_TIGHT = new Keyword("pull_tight"); - public static final Keyword RECTANGLE = new Keyword("rectangle"); - public static final Keyword RESOLUTION_SCOPE = new Resolution(); - public static final Keyword ROTATE = new Keyword("rotate"); - public static final Keyword ROTATE_FIRST = new Keyword("rotate_first"); - public static final Keyword ROUTES = new Keyword("routes"); - public static final Keyword RULE = new Keyword("rule"); - public static final Keyword RULES = new Keyword("rules"); - public static final Keyword SESSION = new Keyword("session"); - public static final Keyword SHAPE = new Keyword("shape"); - public static final Keyword SHOVE_FIXED = new Keyword("shove_fixed"); - public static final Keyword SIDE = new Keyword("side"); - public static final Keyword SIGNAL = new Keyword("signal"); - public static final Keyword SPARE = new Keyword("spare"); - public static final Keyword START_PASS_NO = new Keyword("start_pass_no"); - public static final Keyword START_RIPUP_COSTS = new Keyword("start_ripup_costs"); - public static final Keyword STRING_QUOTE = new Keyword("string_quote"); - public static final ScopeKeyword STRUCTURE_SCOPE = new Structure(); - public static final Keyword TYPE = new Keyword("type"); - public static final Keyword USE_LAYER = new Keyword("use_layer"); - public static final Keyword USE_NET = new Keyword("use_net"); - public static final Keyword USE_VIA = new Keyword("use_via"); - public static final Keyword VERTICAL = new Keyword("vertical"); - public static final Keyword VIA = new Keyword("via"); - public static final Keyword VIAS = new Keyword("vias"); - public static final Keyword VIA_AT_SMD = new Keyword("via_at_smd"); - public static final Keyword VIA_COSTS = new Keyword("via_costs"); - public static final Keyword VIA_KEEPOUT = new Keyword("via_keepout"); - public static final Keyword VIA_RULE = new Keyword("via_rule"); - public static final Keyword WIDTH = new Keyword("width"); - public static final Keyword WINDOW = new Keyword("window"); - public static final Keyword WIRE = new Keyword("wire"); - public static final ScopeKeyword WIRING_SCOPE = new Wiring(); - public static final Keyword WRITE_RESOLUTION = new Keyword("write_resolution"); - - /** - * Returns the name string of this Keyword. - * The name is used for debugging purposes. - */ - public String get_name() - { - return name; - } - private final String name; - - /** prevents creating more instances */ - protected Keyword(String p_name) - { - name = p_name; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Layer.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Layer.java deleted file mode 100644 index 45658f2..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Layer.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Layer.java - * - * Created on 15. Mai 2004, 08:29 - */ - -package designformats.specctra; - -import java.util.Collection; -import java.util.LinkedList; - - -/** - * Describes a layer in a Specctra dsn file. - * - * @author alfons - */ -public class Layer -{ - /** all layers of the board */ - public static final Layer PCB = new Layer("pcb", -1, false); - /** the signal layers */ - public static final Layer SIGNAL = new Layer("signal", -1, true); - - /** - * Creates a new instance of Layer. - * p_no is the physical layer number starting with 0 at the component side - * and ending at the solder side. - * If p_is_signal, the layer is a signal layer, otherwise it is a powerground layer. - * For Layer objects describing more than 1 layer the number is -1. - * p_net_names is a list of nets for this layer, if the layer is a power plane. - */ - public Layer(String p_name, int p_no, boolean p_is_signal, Collection p_net_names) - { - name = p_name; - no = p_no; - is_signal = p_is_signal; - net_names = p_net_names; - } - - /** - * Creates a new instance of Layer. - * p_no is the physical layer number starting with 0 at the component side - * and ending at the solder side. - * If p_is_signal, the layer is a signal layer, otherwise it is a powerground layer. - * For Layer objects describing more than 1 layer the number is -1. - */ - public Layer(String p_name, int p_no, boolean p_is_signal) - { - name = p_name; - no = p_no; - is_signal = p_is_signal; - net_names = new LinkedList(); - } - - /** - * Writes a layer scope in the stucture scope. - */ - public static void write_scope(WriteScopeParameter p_par, int p_layer_no, - boolean p_write_rule) throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("layer "); - board.Layer board_layer = p_par.board.layer_structure.arr[p_layer_no]; - p_par.identifier_type.write(board_layer.name, p_par.file); - p_par.file.new_line(); - p_par.file.write("(type "); - if (board_layer.is_signal) - { - p_par.file.write("signal)"); - } - else - { - p_par.file.write("power)"); - } - if (p_write_rule) - { - Rule.write_default_rule(p_par, p_layer_no); - } - p_par.file.end_scope(); - } - public final String name; - public final int no; - public final boolean is_signal; - public final java.util.Collection net_names; -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/LayerStructure.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/LayerStructure.java deleted file mode 100644 index 202bb81..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/LayerStructure.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * LayerStructure.java - * - * Created on 16. Mai 2004, 08:08 - */ -package designformats.specctra; - -import java.util.Collection; -import java.util.Iterator; - -/** - * Describes a layer structure read from a dsn file. - * - * @author alfons - */ -public class LayerStructure -{ - - /** Creates a new instance of LayerStructure from a list of layers*/ - public LayerStructure(Collection p_layer_list) - { - arr = new Layer[p_layer_list.size()]; - Iterator it = p_layer_list.iterator(); - for (int i = 0; i < arr.length; ++i) - { - arr[i] = it.next(); - } - } - - /** - * Creates a dsn-LayerStructure from a board LayerStructure. - */ - public LayerStructure(board.LayerStructure p_board_layer_structure) - { - arr = new Layer[p_board_layer_structure.arr.length]; - for (int i = 0; i < arr.length; ++i) - { - board.Layer board_layer = p_board_layer_structure.arr[i]; - arr[i] = new Layer(board_layer.name, i, board_layer.is_signal); - } - } - - /** - * returns the number of the layer with the name p_name, - * -1, if no layer with name p_name exists. - */ - public int get_no(String p_name) - { - for (int i = 0; i < arr.length; ++i) - { - if (p_name.equals(arr[i].name)) - { - return i; - } - } - // check for special layers of the Electra autorouter used for the outline - if (p_name.contains("Top")) - { - return 0; - } - if (p_name.contains("Bottom")) - { - return arr.length - 1; - } - return -1; - } - - public int signal_layer_count() - { - int result = 0; - for (Layer curr_layer : arr) - { - if (curr_layer.is_signal) - { - ++result; - } - } - return result; - } - - /** - * Returns, if the net with name p_net_name contains a powwer plane. - */ - public boolean contains_plane(String p_net_name) - { - - for (Layer curr_layer : arr) - { - if (!curr_layer.is_signal) - { - if (curr_layer.net_names.contains(p_net_name)) - { - return true; - } - } - } - return false; - } - - public final Layer[] arr; -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Library.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Library.java deleted file mode 100644 index 5ad97c5..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Library.java +++ /dev/null @@ -1,446 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Library.java - * - * Created on 21. Mai 2004, 08:09 - */ - -package designformats.specctra; - -import geometry.planar.IntVector; -import geometry.planar.Vector; -import geometry.planar.PolygonShape; -import geometry.planar.Simplex; - -import java.util.Collection; -import java.util.Iterator; -import java.util.LinkedList; - - -/** - * Class for reading and writing library scopes from dsn-files. - * - * @author Alfons Wirtz - */ -public class Library extends ScopeKeyword -{ - - /** Creates a new instance of Library */ - public Library() - { - super("library"); - } - - public boolean read_scope(ReadScopeParameter p_par) - { - board.RoutingBoard board = p_par.board_handling.get_routing_board(); - board.library.padstacks = new library.Padstacks(p_par.board_handling.get_routing_board().layer_structure); - Collection package_list = new LinkedList(); - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_par.scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Library.read_scope: IO error scanning file"); - System.out.println(e); - return false; - } - if (next_token == null) - { - System.out.println("Library.read_scope: unexpected end of file"); - return false; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == OPEN_BRACKET) - { - if (next_token == Keyword.PADSTACK) - { - if (!read_padstack_scope(p_par.scanner, p_par.layer_structure, - p_par.coordinate_transform, board.library.padstacks)) - { - return false; - } - } - else if (next_token == Keyword.IMAGE) - { - Package curr_package = Package.read_scope(p_par.scanner, p_par.layer_structure); - if (curr_package == null) - { - return false; - } - package_list.add(curr_package); - } - else - { - skip_scope(p_par.scanner); - } - } - } - - // Set the via padstacks. - if (p_par.via_padstack_names != null) - { - library.Padstack[] via_padstacks = new library.Padstack[p_par.via_padstack_names.size()]; - Iterator it = p_par.via_padstack_names.iterator(); - int found_padstack_count = 0; - for (int i = 0; i < via_padstacks.length; ++i) - { - String curr_padstack_name = it.next(); - library.Padstack curr_padstack = board.library.padstacks.get(curr_padstack_name); - if (curr_padstack != null) - { - via_padstacks[found_padstack_count] = curr_padstack; - ++found_padstack_count; - } - else - { - System.out.print("Library.read_scope: via padstack with name "); - System.out.print(curr_padstack_name); - System.out.println(" not found"); - } - } - if (found_padstack_count != via_padstacks.length) - { - // Some via padstacks were not found in the padstacks scope of the dsn-file. - library.Padstack[] corrected_padstacks = new library.Padstack[found_padstack_count]; - System.arraycopy(via_padstacks, 0, corrected_padstacks, 0, found_padstack_count); - via_padstacks = corrected_padstacks; - } - board.library.set_via_padstacks(via_padstacks); - } - - // Create the library packages on the board - board.library.packages = new library.Packages(board.library.padstacks); - Iterator it = package_list.iterator(); - while (it.hasNext()) - { - Package curr_package = it.next(); - library.Package.Pin[] pin_arr = new library.Package.Pin[curr_package.pin_info_arr.length]; - for (int i = 0; i < pin_arr.length; ++i) - { - Package.PinInfo pin_info = curr_package.pin_info_arr[i]; - int rel_x = (int) Math.round(p_par.coordinate_transform.dsn_to_board(pin_info.rel_coor[0])); - int rel_y = (int) Math.round(p_par.coordinate_transform.dsn_to_board(pin_info.rel_coor[1])); - Vector rel_coor = new IntVector(rel_x, rel_y); - library.Padstack board_padstack = board.library.padstacks.get(pin_info.padstack_name); - if (board_padstack == null) - { - System.out.println("Library.read_scope: board padstack not found"); - return false; - } - pin_arr[i] = new library.Package.Pin(pin_info.pin_name, board_padstack.no, rel_coor, pin_info.rotation); - } - geometry.planar.Shape[] outline_arr = new geometry.planar.Shape[curr_package.outline.size()]; - - Iterator it3 = curr_package.outline.iterator(); - for (int i = 0; i < outline_arr.length; ++i) - { - Shape curr_shape = it3.next(); - if (curr_shape != null) - { - outline_arr[i] = curr_shape.transform_to_board_rel(p_par.coordinate_transform); - } - else - { - System.out.println("Library.read_scope: outline shape is null"); - } - } - generate_missing_keepout_names("keepout_", curr_package.keepouts); - generate_missing_keepout_names("via_keepout_", curr_package.via_keepouts); - generate_missing_keepout_names("place_keepout_", curr_package.place_keepouts); - library.Package.Keepout [] keepout_arr = new library.Package.Keepout [curr_package.keepouts.size()]; - Iterator it2 = curr_package.keepouts.iterator(); - for (int i = 0; i < keepout_arr.length; ++i) - { - Shape.ReadAreaScopeResult curr_keepout = it2.next(); - Layer curr_layer = curr_keepout.shape_list.iterator().next().layer; - geometry.planar.Area curr_area = Shape.transform_area_to_board_rel(curr_keepout.shape_list, p_par.coordinate_transform); - keepout_arr[i] = new library.Package.Keepout(curr_keepout.area_name, curr_area, curr_layer.no); - } - library.Package.Keepout [] via_keepout_arr = new library.Package.Keepout [curr_package.via_keepouts.size()]; - it2 = curr_package.via_keepouts.iterator(); - for (int i = 0; i < via_keepout_arr.length; ++i) - { - Shape.ReadAreaScopeResult curr_keepout = it2.next(); - Layer curr_layer = (curr_keepout.shape_list.iterator().next()).layer; - geometry.planar.Area curr_area = Shape.transform_area_to_board_rel(curr_keepout.shape_list, p_par.coordinate_transform); - via_keepout_arr[i] = new library.Package.Keepout(curr_keepout.area_name, curr_area, curr_layer.no); - } - library.Package.Keepout [] place_keepout_arr = new library.Package.Keepout [curr_package.place_keepouts.size()]; - it2 = curr_package.place_keepouts.iterator(); - for (int i = 0; i < place_keepout_arr.length; ++i) - { - Shape.ReadAreaScopeResult curr_keepout = it2.next(); - Layer curr_layer = (curr_keepout.shape_list.iterator().next()).layer; - geometry.planar.Area curr_area = Shape.transform_area_to_board_rel(curr_keepout.shape_list, p_par.coordinate_transform); - place_keepout_arr[i] = new library.Package.Keepout(curr_keepout.area_name, curr_area, curr_layer.no); - } - board.library.packages.add(curr_package.name, pin_arr, outline_arr, - keepout_arr, via_keepout_arr, place_keepout_arr, curr_package.is_front); - } - return true; - } - - public static void write_scope(WriteScopeParameter p_par) throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("library"); - for (int i = 1; i <= p_par.board.library.packages.count(); ++i) - { - Package.write_scope(p_par, p_par.board.library.packages.get(i)); - } - for (int i = 1; i <= p_par.board.library.padstacks.count(); ++i) - { - write_padstack_scope(p_par, p_par.board.library.padstacks.get(i)); - } - p_par.file.end_scope(); - } - - public static void write_padstack_scope(WriteScopeParameter p_par, library.Padstack p_padstack) throws java.io.IOException - { - // search the layer range of the padstack - int first_layer_no = 0; - while (first_layer_no < p_par.board.get_layer_count()) - { - if (p_padstack.get_shape(first_layer_no) != null) - { - break; - } - ++first_layer_no; - } - int last_layer_no = p_par.board.get_layer_count() - 1; - while (last_layer_no >= 0 ) - { - if (p_padstack.get_shape(last_layer_no) != null) - { - break; - } - --last_layer_no; - } - if (first_layer_no >= p_par.board.get_layer_count() || last_layer_no < 0) - { - System.out.println("Library.write_padstack_scope: padstack shape not found"); - return; - } - - p_par.file.start_scope(); - p_par.file.write("padstack "); - p_par.identifier_type.write(p_padstack.name, p_par.file); - for (int i = first_layer_no; i <= last_layer_no; ++i) - { - geometry.planar.Shape curr_board_shape = p_padstack.get_shape(i); - if (curr_board_shape == null) - { - continue; - } - board.Layer board_layer = p_par.board.layer_structure.arr[i]; - Layer curr_layer = new Layer(board_layer.name, i, board_layer.is_signal); - Shape curr_shape = p_par.coordinate_transform.board_to_dsn_rel(curr_board_shape, curr_layer); - p_par.file.start_scope(); - p_par.file.write("shape"); - curr_shape.write_scope(p_par.file, p_par.identifier_type); - p_par.file.end_scope(); - } - if (!p_padstack.attach_allowed) - { - p_par.file.new_line(); - p_par.file.write("(attach off)"); - } - if (p_padstack.placed_absolute) - { - p_par.file.new_line(); - p_par.file.write("(absolute on)"); - } - p_par.file.end_scope(); - } - - static boolean read_padstack_scope(Scanner p_scanner, LayerStructure p_layer_structure, - CoordinateTransform p_coordinate_transform, library.Padstacks p_board_padstacks) - { - String padstack_name = null; - boolean is_drilllable = true; - boolean placed_absolute = false; - Collection shape_list = new LinkedList(); - try - { - Object next_token = p_scanner.next_token(); - if (next_token instanceof String) - { - padstack_name = (String) next_token; - } - else - { - System.out.println("Library.read_padstack_scope: unexpected padstack identifier"); - return false; - } - - while (next_token != Keyword.CLOSED_BRACKET) - { - Object prev_token = next_token; - next_token = p_scanner.next_token(); - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.SHAPE) - { - Shape curr_shape = Shape.read_scope(p_scanner, p_layer_structure); - if (curr_shape != null) - { - shape_list.add(curr_shape); - } - // overread the closing bracket and unknown scopes. - Object curr_next_token = p_scanner.next_token(); - while (curr_next_token == Keyword.OPEN_BRACKET) - { - ScopeKeyword.skip_scope(p_scanner); - curr_next_token = p_scanner.next_token(); - } - if (curr_next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Library.read_padstack_scope: closing bracket expected"); - return false; - } - } - else if (next_token == Keyword.ATTACH) - { - is_drilllable = DsnFile.read_on_off_scope(p_scanner); - } - else if (next_token == Keyword.ABSOLUTE) - { - placed_absolute = DsnFile.read_on_off_scope(p_scanner); - } - else - { - ScopeKeyword.skip_scope(p_scanner); - } - } - - } - } - catch (java.io.IOException e) - { - System.out.println("Library.read_padstack_scope: IO error scanning file"); - System.out.println(e); - return false; - } - if (p_board_padstacks.get(padstack_name) != null) - { - // Padstack exists already - return true; - } - if (shape_list.isEmpty()) - { - System.out.print("Library.read_padstack_scope: shape not found for padstack with name "); - System.out.println(padstack_name); - return true; - } - geometry.planar.ConvexShape[] padstack_shapes = new geometry.planar.ConvexShape[p_layer_structure.arr.length]; - Iterator it = shape_list.iterator(); - while (it.hasNext()) - { - Shape pad_shape = it.next(); - geometry.planar.Shape curr_shape = pad_shape.transform_to_board_rel(p_coordinate_transform); - geometry.planar.ConvexShape convex_shape; - if (curr_shape instanceof geometry.planar.ConvexShape) - { - convex_shape = (geometry.planar.ConvexShape) curr_shape; - } - else - { - if (curr_shape instanceof PolygonShape) - { - curr_shape = ((PolygonShape)curr_shape).convex_hull(); - } - geometry.planar.TileShape[] convex_shapes = curr_shape.split_to_convex(); - if (convex_shapes.length != 1) - { - System.out.println("Library.read_padstack_scope: convex shape expected"); - } - convex_shape = convex_shapes[0]; - if (convex_shape instanceof Simplex) - { - convex_shape = ((Simplex) convex_shape).simplify(); - } - } - geometry.planar.ConvexShape padstack_shape = convex_shape; - if (padstack_shape != null) - { - if (padstack_shape.dimension() < 2) - { - System.out.print("Library.read_padstack_scope: shape is not an area "); - // enllarge the shape a little bit, so that it is an area - padstack_shape = padstack_shape.offset(1); - if (padstack_shape.dimension() < 2) - { - padstack_shape = null; - } - } - } - - if (pad_shape.layer == Layer.PCB || pad_shape.layer == Layer.SIGNAL) - { - for (int i = 0; i < padstack_shapes.length; ++i) - { - padstack_shapes[i] = padstack_shape; - } - } - else - { - int shape_layer = p_layer_structure.get_no(pad_shape.layer.name); - if (shape_layer < 0 || shape_layer >= padstack_shapes.length) - { - System.out.println("Library.read_padstack_scope: layer number found"); - return false; - } - padstack_shapes[shape_layer] = padstack_shape; - } - } - p_board_padstacks.add(padstack_name, padstack_shapes, is_drilllable, placed_absolute); - return true; - } - - private void generate_missing_keepout_names(String p_keepout_type, Collection p_keepout_list) - { - boolean all_names_existing = true; - for (Shape.ReadAreaScopeResult curr_keepout : p_keepout_list) - { - if (curr_keepout.area_name == null) - { - all_names_existing = false; - break; - } - } - if (all_names_existing) - { - return; - } - // generate names - Integer curr_name_index = 1; - for (Shape.ReadAreaScopeResult curr_keepout : p_keepout_list) - { - curr_keepout.area_name = p_keepout_type + curr_name_index.toString(); - ++curr_name_index; - } - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Net.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Net.java deleted file mode 100644 index 8ea45af..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Net.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Net.java - * - * Created on 19. Mai 2004, 08:58 - */ - -package designformats.specctra; - -import java.util.Collection; -import java.util.Set; -import java.util.TreeSet; -import java.util.Iterator; - -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - - -/** - * Class for reading and writing net scopes from dsn-files. - * - * @author alfons - */ -public class Net -{ - - /** Creates a new instance of Net */ - public Net(Id p_net_id) - { - id = p_net_id; - } - - public static void write_scope(WriteScopeParameter p_par, rules.Net p_net, Collection p_pin_list) throws java.io.IOException - { - p_par.file.start_scope(); - write_net_id(p_net, p_par.file, p_par.identifier_type); - // write the pins scope - p_par.file.start_scope(); - p_par.file.write("pins"); - Iterator it = p_pin_list.iterator(); - while (it.hasNext()) - { - board.Pin curr_pin = it.next(); - if (curr_pin.contains_net(p_net.net_number)) - { - write_pin(p_par, curr_pin); - } - } - p_par.file.end_scope(); - p_par.file.end_scope(); - } - - public static void write_net_id( rules.Net p_net, IndentFileWriter p_file, IdentifierType p_identifier_type) throws java.io.IOException - { - p_file.write("net "); - p_identifier_type.write(p_net.name, p_file); - p_file.write(" "); - Integer subnet_number = p_net.subnet_number; - p_file.write(subnet_number.toString()); - } - - public static void write_pin(WriteScopeParameter p_par, board.Pin p_pin) throws java.io.IOException - { - board.Component curr_component = p_par.board.components.get(p_pin.get_component_no()); - if (curr_component == null) - { - System.out.println("Net.write_scope: component not found"); - return; - } - library.Package.Pin lib_pin = curr_component.get_package().get_pin(p_pin.get_index_in_package()); - if (lib_pin == null) - { - System.out.println("Net.write_scope: pin number out of range"); - return; - } - p_par.file.new_line(); - p_par.identifier_type.write(curr_component.name, p_par.file); - p_par.file.write("-"); - p_par.identifier_type.write(lib_pin.name, p_par.file); - - } - - public void set_pins(Collection p_pin_list) - { - pin_list = new TreeSet(); - for (Pin curr_pin : p_pin_list) - { - pin_list.add(curr_pin); - } - } - - public Set get_pins() - { - return pin_list; - } - - public final Id id; - - /** List of elements of type Pin. */ - private Set pin_list = null; - - public static class Id implements Comparable - { - public Id(String p_name, int p_subnet_number) - { - name = p_name; - subnet_number = p_subnet_number; - } - - public int compareTo(Id p_other) - { - int result = this.name.compareTo(p_other.name); - if (result == 0) - { - result = this.subnet_number - p_other.subnet_number; - } - return result; - } - - public final String name; - public final int subnet_number; - } - - - /** - * Sorted tuple of component name and pin name. - */ - public static class Pin implements Comparable - { - public Pin(String p_component_name, String p_pin_name) - { - component_name = p_component_name; - pin_name = p_pin_name; - } - - public int compareTo(Pin p_other) - { - int result = this.component_name.compareTo(p_other.component_name); - if (result == 0) - { - result = this.pin_name.compareTo(p_other.pin_name); - } - return result; - } - - public final String component_name; - public final String pin_name; - } -} \ No newline at end of file diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/NetClass.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/NetClass.java deleted file mode 100644 index 2f58819..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/NetClass.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * NetClass.java - * - * Created on 13. April 2005, 06:55 - */ - -package designformats.specctra; - -import java.util.Collection; -import java.util.LinkedList; - -/** - * Contains the information of a Specctra Class scope. - * - * @author alfons - */ -public class NetClass -{ - - public static NetClass read_scope(Scanner p_scanner) - { - - try - { - // read the class name - p_scanner.yybegin(SpecctraFileScanner.NAME); - Object next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("NetClass.read_scope: String expected"); - return null; - } - String class_name = (String) next_token; - Collection net_list = new LinkedList(); - boolean rules_missing = false; - // read the nets belonging to the class - for (;;) - { - p_scanner.yybegin(SpecctraFileScanner.NAME); - next_token = p_scanner.next_token(); - if (next_token == Keyword.OPEN_BRACKET) - { - break; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - rules_missing = true; - break; - } - if (!(next_token instanceof String)) - { - System.out.println("NetClass.read_scope: String expected"); - return null; - } - net_list.add((String) next_token); - } - Collection rules = new LinkedList(); - Collection layer_rules = new LinkedList(); - Collection use_via = new LinkedList(); - Collection use_layer = new LinkedList(); - String via_rule = null; - String trace_clearance_class = null; - boolean pull_tight = true; - boolean shove_fixed = false; - double min_trace_length = 0; - double max_trace_length = 0; - if (!rules_missing) - { - Object prev_token = next_token; - for (;;) - { - next_token = p_scanner.next_token(); - if (next_token == null) - { - System.out.println("NetClass.read_scope: unexpected end of file"); - return null; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.RULE) - { - rules.addAll(Rule.read_scope(p_scanner)); - } - else if (next_token == Keyword.LAYER_RULE) - { - layer_rules.add(Rule.read_layer_rule_scope(p_scanner)); - } - else if (next_token == Keyword.VIA_RULE) - { - via_rule = DsnFile.read_string_scope(p_scanner); - } - else if (next_token == Keyword.CIRCUIT) - { - Circuit.ReadScopeResult curr_rule = Circuit.read_scope(p_scanner); - if (curr_rule != null) - { - max_trace_length = curr_rule.max_length; - min_trace_length = curr_rule.min_length; - use_via.addAll(curr_rule.use_via); - use_layer.addAll(curr_rule.use_layer); - } - } - else if (next_token == Keyword.CLEARANCE_CLASS) - { - trace_clearance_class = DsnFile.read_string_scope(p_scanner); - if (trace_clearance_class == null) - { - return null; - } - } - else if (next_token == Keyword.SHOVE_FIXED) - { - shove_fixed = DsnFile.read_on_off_scope(p_scanner); - } - else if (next_token == Keyword.PULL_TIGHT) - { - pull_tight = DsnFile.read_on_off_scope(p_scanner); - } - else - { - ScopeKeyword.skip_scope(p_scanner); - } - } - prev_token = next_token; - } - } - return new NetClass(class_name, trace_clearance_class, net_list, rules, layer_rules, - use_via, use_layer, via_rule, shove_fixed, pull_tight, min_trace_length, max_trace_length); - } - catch (java.io.IOException e) - { - System.out.println("NetClass.read_scope: IO error while scanning file"); - return null; - } - } - - public static ClassClass read_class_class_scope(Scanner p_scanner) - { - try - { - Collection classes = new LinkedList(); - Collection rules = new LinkedList(); - Collection layer_rules = new LinkedList(); - Object prev_token = null; - for (;;) - { - Object next_token = p_scanner.next_token(); - if (next_token == null) - { - System.out.println("ClassClass.read_scope: unexpected end of file"); - return null; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.CLASSES) - { - classes.addAll(DsnFile.read_string_list_scope(p_scanner)); - } - else if (next_token == Keyword.RULE) - { - rules.addAll(Rule.read_scope(p_scanner)); - } - else if (next_token == Keyword.LAYER_RULE) - { - layer_rules.add(Rule.read_layer_rule_scope(p_scanner)); - } - } - prev_token = next_token; - } - return new ClassClass(classes, rules, layer_rules); - } - catch (java.io.IOException e) - { - System.out.println("NetClass.read_scope: IO error while scanning file"); - return null; - } - } - - /** Creates a new instance of NetClass */ - public NetClass(String p_name, String p_trace_clearance_class, Collection p_net_list, - Collection p_rules, Collection p_layer_rules, Collection p_use_via, - Collection p_use_layer, String p_via_rule, boolean p_shove_fixed, boolean p_pull_tight, - double p_min_trace_length, double p_max_trace_length) - { - name = p_name; - trace_clearance_class = p_trace_clearance_class; - net_list = p_net_list; - rules = p_rules; - layer_rules = p_layer_rules; - use_via = p_use_via; - use_layer = p_use_layer; - via_rule = p_via_rule; - shove_fixed = p_shove_fixed; - pull_tight = p_pull_tight; - min_trace_length = p_min_trace_length; - max_trace_length = p_max_trace_length; - } - - public final String name; - public final String trace_clearance_class; - public final Collection net_list; - public final Collection rules; - public final Collection layer_rules; - public final Collection use_via; - public final Collection use_layer; - public final String via_rule; - public final boolean shove_fixed; - public final boolean pull_tight; - public final double min_trace_length; - public final double max_trace_length; - - public static class ClassClass - { - public ClassClass( Collection p_class_names, Collection p_rules, - Collection p_layer_rules) - { - class_names = p_class_names; - rules = p_rules; - layer_rules = p_layer_rules; - } - public final Collection class_names; - public final Collection rules; - public final Collection layer_rules; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/NetList.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/NetList.java deleted file mode 100644 index 7da2471..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/NetList.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * NetList.java - * - * Created on 19. Mai 2004, 09:05 - */ - -package designformats.specctra; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Map; -import java.util.TreeMap; -import java.util.Set; - -/** - * Describes a list of nets sorted by its names. - * The net number is generated internally. - * - * @author alfons - */ -public class NetList -{ - - /** - * Returns true, if the netlist contains a net with the input name. - */ - public boolean contains(Net.Id p_net_id) - { - return nets.containsKey(p_net_id); - } - - /** - * Adds a new net mit the input name to the net list. - * Returns null, if a net with p_name already exists in the net list. - * In this case no new net is added. - */ - public Net add_net(Net.Id p_net_id) - { - Net result; - if (nets.containsKey(p_net_id)) - { - result = null; - } - else - { - result = new Net(p_net_id); - nets.put(p_net_id, result); - } - return result; - } - - /** - * Returns the net with the input name, or null, - * if the netlist does not contain a net with the input name. - */ - public Net get_net(Net.Id p_net_id) - { - Object value = nets.get(p_net_id); - return ((Net) value); - } - - /** - * Returns all nets in this net list containing the input pin. - */ - public Collection get_nets(String p_component_name, String p_pin_name) - { - Collection result = new java.util.LinkedList(); - Net.Pin search_pin = new Net.Pin(p_component_name, p_pin_name); - Collection net_list = nets.values(); - Iterator it = net_list.iterator(); - while (it.hasNext()) - { - Net curr_net = it.next(); - Set net_pins = curr_net.get_pins(); - if (net_pins != null && net_pins.contains(search_pin)) - { - result.add(curr_net); - } - } - return result; - } - - /** The entries of this map are of type Net, the keys are the net_ids. */ - private final Map nets = new TreeMap(); - -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Network.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Network.java deleted file mode 100644 index 042c6b1..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Network.java +++ /dev/null @@ -1,1536 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Network.java - * - * Created on 22. Mai 2004, 07:44 - */ -package designformats.specctra; - -import geometry.planar.IntPoint; -import geometry.planar.Point; -import geometry.planar.Vector; - -import java.util.Collection; -import java.util.LinkedList; -import java.util.Set; -import java.util.Iterator; - -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - -import rules.BoardRules; -import rules.DefaultItemClearanceClasses.ItemClass; -import board.RoutingBoard; - -/** - * Class for reading and writing net network from dsn-files. - * - * @author Alfons Wirtz - */ -public class Network extends ScopeKeyword -{ - - /** Creates a new instance of Network */ - public Network() - { - super("network"); - } - - public boolean read_scope(ReadScopeParameter p_par) - { - Collection classes = new LinkedList(); - Collection class_class_list = new LinkedList(); - Collection via_infos = new LinkedList(); - Collection> via_rules = new LinkedList>(); - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_par.scanner.next_token(); - } catch (java.io.IOException e) - { - System.out.println("Network.read_scope: IO error scanning file"); - System.out.println(e); - return false; - } - if (next_token == null) - { - System.out.println("Network.read_scope: unexpected end of file"); - return false; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == OPEN_BRACKET) - { - if (next_token == Keyword.NET) - { - read_net_scope(p_par.scanner, p_par.netlist, p_par.board_handling.get_routing_board(), - p_par.coordinate_transform, p_par.layer_structure, p_par.board_handling.get_locale()); - } - else if (next_token == Keyword.VIA) - { - rules.ViaInfo curr_via_info = read_via_info(p_par.scanner, p_par.board_handling.get_routing_board()); - if (curr_via_info == null) - { - return false; - } - via_infos.add(curr_via_info); - } - else if (next_token == Keyword.VIA_RULE) - { - Collection curr_via_rule = read_via_rule(p_par.scanner, p_par.board_handling.get_routing_board()); - if (curr_via_rule == null) - { - return false; - } - via_rules.add(curr_via_rule); - } - else if (next_token == Keyword.CLASS) - { - NetClass curr_class = NetClass.read_scope(p_par.scanner); - if (curr_class == null) - { - return false; - } - classes.add(curr_class); - } - else if (next_token == Keyword.CLASS_CLASS) - { - NetClass.ClassClass curr_class_class = NetClass.read_class_class_scope(p_par.scanner); - if (curr_class_class == null) - { - return false; - } - class_class_list.add(curr_class_class); - } - else - { - skip_scope(p_par.scanner); - } - } - } - insert_via_infos(via_infos, p_par.board_handling.get_routing_board(), p_par.via_at_smd_allowed); - insert_via_rules(via_rules, p_par.board_handling.get_routing_board()); - insert_net_classes(classes, p_par); - insert_class_pairs(class_class_list, p_par); - insert_compoments(p_par); - insert_logical_parts(p_par); - return true; - } - - public static void write_scope(WriteScopeParameter p_par) throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("network"); - Collection board_pins = p_par.board.get_pins(); - for (int i = 1; i <= p_par.board.rules.nets.max_net_no(); ++i) - { - Net.write_scope(p_par, p_par.board.rules.nets.get(i), board_pins); - } - write_via_infos(p_par.board.rules, p_par.file, p_par.identifier_type); - write_via_rules(p_par.board.rules, p_par.file, p_par.identifier_type); - write_net_classes(p_par); - p_par.file.end_scope(); - } - - public static void write_via_infos(rules.BoardRules p_rules, IndentFileWriter p_file, IdentifierType p_identifier_type) - throws java.io.IOException - { - for (int i = 0; i < p_rules.via_infos.count(); ++i) - { - rules.ViaInfo curr_via = p_rules.via_infos.get(i); - p_file.start_scope(); - p_file.write("via "); - p_file.new_line(); - p_identifier_type.write(curr_via.get_name(), p_file); - p_file.write(" "); - p_identifier_type.write(curr_via.get_padstack().name, p_file); - p_file.write(" "); - p_identifier_type.write(p_rules.clearance_matrix.get_name(curr_via.get_clearance_class()), p_file); - if (curr_via.attach_smd_allowed()) - { - p_file.write(" attach"); - } - p_file.end_scope(); - } - } - - public static void write_via_rules(rules.BoardRules p_rules, IndentFileWriter p_file, IdentifierType p_identifier_type) - throws java.io.IOException - { - for (rules.ViaRule curr_rule : p_rules.via_rules) - { - p_file.start_scope(); - p_file.write("via_rule"); - p_file.new_line(); - p_identifier_type.write(curr_rule.name, p_file); - for (int i = 0; i < curr_rule.via_count(); ++i) - { - p_file.write(" "); - p_identifier_type.write(curr_rule.get_via(i).get_name(), p_file); - } - p_file.end_scope(); - } - } - - public static void write_net_classes(WriteScopeParameter p_par) - throws java.io.IOException - { - for (int i = 0; i < p_par.board.rules.net_classes.count(); ++i) - { - write_net_class(p_par.board.rules.net_classes.get(i), p_par); - } - } - - public static void write_net_class(rules.NetClass p_net_class, WriteScopeParameter p_par) - throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("class "); - p_par.identifier_type.write(p_net_class.get_name(), p_par.file); - final int nets_per_row = 8; - int net_counter = 0; - for (int i = 1; i <= p_par.board.rules.nets.max_net_no(); ++i) - { - if (p_par.board.rules.nets.get(i).get_class() == p_net_class) - { - if (net_counter % nets_per_row == 0) - { - p_par.file.new_line(); - } - else - { - p_par.file.write(" "); - } - p_par.identifier_type.write(p_par.board.rules.nets.get(i).name, p_par.file); - ++net_counter; - } - } - - // write the trace clearance class - Rule.write_item_clearance_class(p_par.board.rules.clearance_matrix.get_name(p_net_class.get_trace_clearance_class()), - p_par.file, p_par.identifier_type); - - // write the via rule - p_par.file.new_line(); - p_par.file.write("(via_rule "); - p_par.file.write(p_net_class.get_via_rule().name); - p_par.file.write(")"); - - // write the rules, if they are different from the default rule. - Rule.write_scope(p_net_class, p_par); - - write_circuit(p_net_class, p_par); - - if (!p_net_class.get_pull_tight()) - { - p_par.file.new_line(); - p_par.file.write("(pull_tight off)"); - } - - if (p_net_class.is_shove_fixed()) - { - p_par.file.new_line(); - p_par.file.write("(shove_fixed on)"); - } - - p_par.file.end_scope(); - } - - private static void write_circuit(rules.NetClass p_net_class, WriteScopeParameter p_par) - throws java.io.IOException - { - double min_trace_length = p_net_class.get_minimum_trace_length(); - double max_trace_length = p_net_class.get_maximum_trace_length(); - p_par.file.start_scope(); - p_par.file.write("circuit "); - p_par.file.new_line(); - p_par.file.write("(use_layer"); - int layer_count = p_net_class.layer_count(); - for (int i = 0; i < layer_count; ++i) - { - if (p_net_class.is_active_routing_layer(i)) - { - p_par.file.write(" "); - p_par.file.write(p_par.board.layer_structure.arr[i].name); - } - } - p_par.file.write(")"); - if (min_trace_length > 0 || max_trace_length > 0) - { - p_par.file.new_line(); - p_par.file.write("(length "); - Double transformed_max_length; - if (max_trace_length <= 0) - { - transformed_max_length = (double) -1; - } - else - { - transformed_max_length = p_par.coordinate_transform.board_to_dsn(max_trace_length); - } - p_par.file.write(transformed_max_length.toString()); - p_par.file.write(" "); - Double transformed_min_length; - if (min_trace_length <= 0) - { - transformed_min_length = (double) 0; - } - else - { - transformed_min_length = p_par.coordinate_transform.board_to_dsn(min_trace_length); - } - p_par.file.write(transformed_min_length.toString()); - p_par.file.write(")"); - } - p_par.file.end_scope(); - } - - private boolean read_net_scope(Scanner p_scanner, NetList p_net_list, RoutingBoard p_board, - CoordinateTransform p_coordinate_transform, LayerStructure p_layer_structure, java.util.Locale p_locale) - { - // read the net name - Object next_token; - try - { - next_token = p_scanner.next_token(); - } catch (java.io.IOException e) - { - System.out.println("Network.read_net_scope: IO error while scanning file"); - return false; - } - if (!(next_token instanceof String)) - { - System.out.println("Network.read_net_scope: String expected"); - return false; - } - String net_name = (String) next_token; - int subnet_number = 1; - try - { - next_token = p_scanner.next_token(); - } catch (java.io.IOException e) - { - System.out.println("Network.read_net_scope: IO error while scanning file"); - return false; - } - boolean scope_is_empty = (next_token == CLOSED_BRACKET); - if (next_token instanceof Integer) - { - subnet_number = ((Integer) next_token).intValue(); - } - boolean pin_order_found = false; - Collection pin_list = new LinkedList(); - Collection net_rules = new LinkedList(); - Collection> subnet_pin_lists = new LinkedList>(); - if (!scope_is_empty) - { - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_scanner.next_token(); - } catch (java.io.IOException e) - { - System.out.println("Network.read_net_scope: IO error scanning file"); - return false; - } - if (next_token == null) - { - System.out.println("Network.read_net_scope: unexpected end of file"); - return false; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == OPEN_BRACKET) - { - if (next_token == Keyword.PINS) - { - if (!read_net_pins(p_scanner, pin_list)) - { - return false; - } - } - else if (next_token == Keyword.ORDER) - { - pin_order_found = true; - if (!read_net_pins(p_scanner, pin_list)) - { - return false; - } - } - else if (next_token == Keyword.FROMTO) - { - Set curr_subnet_pin_list = new java.util.TreeSet(); - if (!read_net_pins(p_scanner, curr_subnet_pin_list)) - { - return false; - } - subnet_pin_lists.add(curr_subnet_pin_list); - } - else if (next_token == Keyword.RULE) - { - net_rules.addAll(Rule.read_scope(p_scanner)); - } - else if (next_token == Keyword.LAYER_RULE) - { - System.out.println("Netwark.read_net_scope: layer_rule not yet implemented"); - skip_scope(p_scanner); - } - else - { - skip_scope(p_scanner); - } - } - } - } - if (subnet_pin_lists.isEmpty()) - { - if (pin_order_found) - { - subnet_pin_lists = create_ordered_subnets(pin_list); - } - else - { - subnet_pin_lists.add(pin_list); - } - } - for (Collection curr_pin_list : subnet_pin_lists) - { - Net.Id net_id = new Net.Id(net_name, subnet_number); - if (!p_net_list.contains(net_id)) - { - Net new_net = p_net_list.add_net(net_id); - boolean contains_plane = p_layer_structure.contains_plane(net_name); - if (new_net != null) - { - p_board.rules.nets.add(new_net.id.name, new_net.id.subnet_number, contains_plane); - } - } - Net curr_subnet = p_net_list.get_net(net_id); - if (curr_subnet == null) - { - System.out.println("Network.read_net_scope: net not found in netlist"); - return false; - } - curr_subnet.set_pins(curr_pin_list); - if (!net_rules.isEmpty()) - { - // Evaluate the net rules. - rules.Net board_net = p_board.rules.nets.get(curr_subnet.id.name, curr_subnet.id.subnet_number); - if (board_net == null) - { - System.out.println("Network.read_net_scope: board net not found"); - return false; - } - Iterator it = net_rules.iterator(); - while (it.hasNext()) - { - Rule curr_ob = it.next(); - if (curr_ob instanceof Rule.WidthRule) - { - rules.NetClass default_net_rule = p_board.rules.get_default_net_class(); - double wire_width = ((Rule.WidthRule) curr_ob).value; - int trace_halfwidth = (int) Math.round(p_coordinate_transform.dsn_to_board(wire_width) / 2); - rules.NetClass net_rule = - p_board.rules.net_classes.find(trace_halfwidth, default_net_rule.get_trace_clearance_class(), - default_net_rule.get_via_rule()); - if (net_rule == null) - { - // create a new net rule - net_rule = p_board.rules.get_new_net_class(p_locale); - } - net_rule.set_trace_half_width(trace_halfwidth); - board_net.set_class(net_rule); - } - else - { - System.out.println("Network.read_net_scope: Rule not yet implemented"); - } - } - } - ++subnet_number; - } - return true; - } - - /** - * Creates a sequence of subnets with 2 pins from p_pin_list - */ - private static Collection> create_ordered_subnets(Collection p_pin_list) - { - Collection> result = new LinkedList>(); - if (p_pin_list.isEmpty()) - { - return result; - } - - Iterator it = p_pin_list.iterator(); - Net.Pin prev_pin = it.next(); - while (it.hasNext()) - { - Net.Pin next_pin = it.next(); - Set curr_subnet_pin_list = new java.util.TreeSet(); - curr_subnet_pin_list.add(prev_pin); - curr_subnet_pin_list.add(next_pin); - result.add(curr_subnet_pin_list); - prev_pin = next_pin; - } - return result; - } - - private static boolean read_net_pins(Scanner p_scanner, Collection p_pin_list) - { - Object next_token; - for (;;) - { - try - { - p_scanner.yybegin(SpecctraFileScanner.COMPONENT_NAME); - next_token = p_scanner.next_token(); - } catch (java.io.IOException e) - { - System.out.println("Network.read_net_pins: IO error while scanning file"); - return false; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - if (!(next_token instanceof String)) - { - System.out.println("Network.read_net_pins: String expected"); - return false; - } - String component_name = (String) next_token; - try - { - p_scanner.yybegin(SpecctraFileScanner.SPEC_CHAR); - next_token = p_scanner.next_token(); // overread the hyphen - p_scanner.yybegin(SpecctraFileScanner.NAME); - next_token = p_scanner.next_token(); - } catch (java.io.IOException e) - { - System.out.println("Network.read_net_pins: IO error while scanning file"); - return false; - } - if (!(next_token instanceof String)) - { - System.out.println("Network.read_net_pins: String expected"); - return false; - } - String pin_name = (String) next_token; - Net.Pin curr_entry = new Net.Pin(component_name, pin_name); - p_pin_list.add(curr_entry); - } - return true; - } - - static rules.ViaInfo read_via_info(Scanner p_scanner, board.BasicBoard p_board) - { - try - { - p_scanner.yybegin(SpecctraFileScanner.NAME); - Object next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Network.read_via_info: string expected"); - return null; - } - String name = (String) next_token; - p_scanner.yybegin(SpecctraFileScanner.NAME); - next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Network.read_via_info: string expected"); - return null; - } - String padstack_name = (String) next_token; - library.Padstack via_padstack = p_board.library.get_via_padstack(padstack_name); - if (via_padstack == null) - { - // The padstack may not yet be inserted into the list of via padstacks - via_padstack = p_board.library.padstacks.get(padstack_name); - if (via_padstack == null) - { - System.out.println("Network.read_via_info: padstack not found"); - return null; - } - p_board.library.add_via_padstack(via_padstack); - } - p_scanner.yybegin(SpecctraFileScanner.NAME); - next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Network.read_via_info: string expected"); - return null; - } - int clearance_class = p_board.rules.clearance_matrix.get_no((String) next_token); - if (clearance_class < 0) - { - // Clearance class not stored, because it is identical to the default clearance class. - clearance_class = BoardRules.default_clearance_class(); - } - boolean attach_allowed = false; - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - if (next_token != Keyword.ATTACH) - { - System.out.println("Network.read_via_info: Keyword.ATTACH expected"); - return null; - } - attach_allowed = true; - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Network.read_via_info: closing bracket expected"); - return null; - } - } - return new rules.ViaInfo(name, via_padstack, clearance_class, attach_allowed, p_board.rules); - } catch (java.io.IOException e) - { - System.out.println("Network.read_via_info: IO error while scanning file"); - return null; - } - } - - static Collection read_via_rule(Scanner p_scanner, board.BasicBoard p_board) - { - try - { - Collection result = new LinkedList(); - for (;;) - { - p_scanner.yybegin(SpecctraFileScanner.NAME); - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - if (!(next_token instanceof String)) - { - System.out.println("Network.read_via_rule: string expected"); - return null; - } - result.add((String) next_token); - } - return result; - } catch (java.io.IOException e) - { - System.out.println("Network.read_via_rule: IO error while scanning file"); - return null; - } - } - - private static void insert_via_infos(Collection p_via_infos, RoutingBoard p_board, boolean p_attach_allowed) - { - if (p_via_infos.size() > 0) - { - for (rules.ViaInfo curr_info : p_via_infos) - { - p_board.rules.via_infos.add(curr_info); - } - } - else // no via infos found, create default via infos from the via padstacks. - { - create_default_via_infos(p_board, p_board.rules.get_default_net_class(), p_attach_allowed); - } - } - - private static void create_default_via_infos(board.BasicBoard p_board, rules.NetClass p_net_class, boolean p_attach_allowed) - { - int cl_class = p_net_class.default_item_clearance_classes.get(rules.DefaultItemClearanceClasses.ItemClass.VIA); - boolean is_default_class = (p_net_class == p_board.rules.get_default_net_class()); - for (int i = 0; i < p_board.library.via_padstack_count(); ++i) - { - library.Padstack curr_padstack = p_board.library.get_via_padstack(i); - boolean attach_allowed = p_attach_allowed && curr_padstack.attach_allowed; - String via_name; - if (is_default_class) - { - via_name = curr_padstack.name; - } - else - { - via_name = curr_padstack.name + DsnFile.CLASS_CLEARANCE_SEPARATOR + p_net_class.get_name(); - } - rules.ViaInfo found_via_info = - new rules.ViaInfo(via_name, curr_padstack, cl_class, attach_allowed, p_board.rules); - p_board.rules.via_infos.add(found_via_info); - } - } - - private static void insert_via_rules(Collection> p_via_rules, board.BasicBoard p_board) - { - boolean rule_found = false; - for (Collection curr_list : p_via_rules) - { - if (curr_list.size() < 2) - { - continue; - } - if (add_via_rule(curr_list, p_board)) - { - rule_found = true; - } - } - if (!rule_found) - { - p_board.rules.create_default_via_rule(p_board.rules.get_default_net_class(), "default"); - } - for (int i = 0; i < p_board.rules.net_classes.count(); ++i) - { - p_board.rules.net_classes.get(i).set_via_rule(p_board.rules.get_default_via_rule()); - } - } - - /** - * Inserts a via rule into the board. - * Replaces an already existing via rule with the same - */ - static boolean add_via_rule(Collection p_name_list, board.BasicBoard p_board) - { - Iterator it = p_name_list.iterator(); - String rule_name = it.next(); - rules.ViaRule existing_rule = p_board.rules.get_via_rule(rule_name); - rules.ViaRule curr_rule = new rules.ViaRule(rule_name); - boolean rule_ok = true; - while (it.hasNext()) - { - rules.ViaInfo curr_via = p_board.rules.via_infos.get(it.next()); - if (curr_via != null) - { - curr_rule.append_via(curr_via); - } - else - { - System.out.println("Network.insert_via_rules: via_info not found"); - rule_ok = false; - } - } - if (rule_ok) - { - if (existing_rule != null) - { - // Replace already existing rule. - p_board.rules.via_rules.remove(existing_rule); - } - p_board.rules.via_rules.add(curr_rule); - } - return rule_ok; - } - - private static void insert_net_classes(Collection p_net_classes, ReadScopeParameter p_par) - { - board.BasicBoard routing_board = p_par.board_handling.get_routing_board(); - for (NetClass curr_class : p_net_classes) - { - insert_net_class(curr_class, p_par.layer_structure, routing_board, p_par.coordinate_transform, p_par.via_at_smd_allowed); - } - } - - static void insert_net_class(NetClass p_class, LayerStructure p_layer_structure, board.BasicBoard p_board, CoordinateTransform p_coordinate_transform, - boolean p_via_at_smd_allowed) - { - rules.NetClass board_net_class = p_board.rules.append_net_class(p_class.name); - if (p_class.trace_clearance_class != null) - { - int trace_clearance_class = p_board.rules.clearance_matrix.get_no(p_class.trace_clearance_class); - if (trace_clearance_class >= 0) - { - board_net_class.set_trace_clearance_class(trace_clearance_class); - } - else - { - System.out.println("Network.insert_net_class: clearance class not found"); - } - } - if (p_class.via_rule != null) - { - rules.ViaRule via_rule = p_board.rules.get_via_rule(p_class.via_rule); - if (via_rule != null) - { - board_net_class.set_via_rule(via_rule); - } - else - { - System.out.println("Network.insert_net_class: via rule not found"); - } - } - if (p_class.max_trace_length > 0) - { - board_net_class.set_maximum_trace_length(p_coordinate_transform.dsn_to_board(p_class.max_trace_length)); - } - if (p_class.min_trace_length > 0) - { - board_net_class.set_minimum_trace_length(p_coordinate_transform.dsn_to_board(p_class.min_trace_length)); - } - for (String curr_net_name : p_class.net_list) - { - Collection curr_net_list = p_board.rules.nets.get(curr_net_name); - for (rules.Net curr_net : curr_net_list) - { - curr_net.set_class(board_net_class); - } - } - - // read the trace width and clearance rules. - - boolean clearance_rule_found = false; - - for (Rule curr_rule : p_class.rules) - { - if (curr_rule instanceof Rule.WidthRule) - { - int trace_halfwidth = (int) Math.round(p_coordinate_transform.dsn_to_board(((Rule.WidthRule) curr_rule).value / 2)); - board_net_class.set_trace_half_width(trace_halfwidth); - } - else if (curr_rule instanceof Rule.ClearanceRule) - { - add_clearance_rule(p_board.rules.clearance_matrix, board_net_class, - (Rule.ClearanceRule) curr_rule, -1, p_coordinate_transform); - clearance_rule_found = true; - } - else - { - - System.out.println("Network.insert_net_class: rule type not yet implemented"); - } - } - - // read the layer dependent rules. - - for (Rule.LayerRule curr_layer_rule : p_class.layer_rules) - { - for (String curr_layer_name : curr_layer_rule.layer_names) - { - int layer_no = p_board.layer_structure.get_no(curr_layer_name); - if (layer_no < 0) - { - System.out.println("Network.insert_net_class: layer not found"); - continue; - } - for (Rule curr_rule : curr_layer_rule.rules) - { - if (curr_rule instanceof Rule.WidthRule) - { - int trace_halfwidth = (int) Math.round(p_coordinate_transform.dsn_to_board(((Rule.WidthRule) curr_rule).value / 2)); - board_net_class.set_trace_half_width(layer_no, trace_halfwidth); - } - else if (curr_rule instanceof Rule.ClearanceRule) - { - add_clearance_rule(p_board.rules.clearance_matrix, board_net_class, (Rule.ClearanceRule) curr_rule, layer_no, p_coordinate_transform); - clearance_rule_found = true; - } - else - { - System.out.println("Network.insert_net_class: layer rule type not yet implemented"); - } - } - } - } - - board_net_class.set_pull_tight(p_class.pull_tight); - board_net_class.set_shove_fixed(p_class.shove_fixed); - boolean via_infos_created = false; - - if (clearance_rule_found && board_net_class != p_board.rules.get_default_net_class()) - { - create_default_via_infos(p_board, board_net_class, p_via_at_smd_allowed); - via_infos_created = true; - } - - if (!p_class.use_via.isEmpty()) - { - create_via_rule(p_class.use_via, board_net_class, p_board, p_via_at_smd_allowed); - } - else if (via_infos_created) - { - p_board.rules.create_default_via_rule(board_net_class, board_net_class.get_name()); - } - if (!p_class.use_layer.isEmpty()) - { - create_active_trace_layers(p_class.use_layer, p_layer_structure, board_net_class); - } - } - - static private void insert_class_pairs(Collection p_class_classes, ReadScopeParameter p_par) - { - for (NetClass.ClassClass curr_class_class : p_class_classes) - { - java.util.Iterator it1 = curr_class_class.class_names.iterator(); - board.BasicBoard routing_board = p_par.board_handling.get_routing_board(); - while (it1.hasNext()) - { - String first_name = it1.next(); - rules.NetClass first_class = routing_board.rules.net_classes.get(first_name); - if (first_class == null) - { - System.out.println("Network.insert_class_pairs: first class not found"); - } - else - { - java.util.Iterator it2 = it1; - while (it2.hasNext()) - { - String second_name = it2.next(); - rules.NetClass second_class = routing_board.rules.net_classes.get(second_name); - if (second_class == null) - { - System.out.println("Network.insert_class_pairs: second class not found"); - } - else - { - insert_class_pair_info(curr_class_class, first_class, second_class, routing_board, - p_par.coordinate_transform); - } - } - } - } - } - } - - static private void insert_class_pair_info(NetClass.ClassClass p_class_class, rules.NetClass p_first_class, rules.NetClass p_second_class, - board.BasicBoard p_board, CoordinateTransform p_coordinate_transform) - { - for (Rule curr_rule : p_class_class.rules) - { - if (curr_rule instanceof Rule.ClearanceRule) - { - Rule.ClearanceRule curr_clearance_rule = (Rule.ClearanceRule) curr_rule; - add_mixed_clearance_rule(p_board.rules.clearance_matrix, p_first_class, p_second_class, - curr_clearance_rule, -1, p_coordinate_transform); - } - else - { - System.out.println("Network.insert_class_pair_info: unexpected rule"); - } - } - for (Rule.LayerRule curr_layer_rule : p_class_class.layer_rules) - { - for (String curr_layer_name : curr_layer_rule.layer_names) - { - int layer_no = p_board.layer_structure.get_no(curr_layer_name); - if (layer_no < 0) - { - System.out.println("Network.insert_class_pair_info: layer not found"); - continue; - } - for (Rule curr_rule : curr_layer_rule.rules) - { - if (curr_rule instanceof Rule.ClearanceRule) - { - add_mixed_clearance_rule(p_board.rules.clearance_matrix, - p_first_class, p_second_class, (Rule.ClearanceRule) curr_rule, - layer_no, p_coordinate_transform); - } - else - { - System.out.println("Network.insert_class_pair_info: unexpected layer rule type"); - } - } - } - } - } - - static private void add_mixed_clearance_rule(rules.ClearanceMatrix p_clearance_matrix, rules.NetClass p_first_class, - rules.NetClass p_second_class, Rule.ClearanceRule p_clearance_rule, int p_layer_no, - CoordinateTransform p_coordinate_transform) - { - int curr_clearance = (int) Math.round(p_coordinate_transform.dsn_to_board(p_clearance_rule.value)); - final String first_class_name = p_first_class.get_name(); - int first_class_no = p_clearance_matrix.get_no(first_class_name); - if (first_class_no < 0) - { - p_clearance_matrix.append_class(first_class_name); - first_class_no = p_clearance_matrix.get_no(first_class_name); - } - final String second_class_name = p_second_class.get_name(); - int second_class_no = p_clearance_matrix.get_no(second_class_name); - if (second_class_no < 0) - { - p_clearance_matrix.append_class(second_class_name); - second_class_no = p_clearance_matrix.get_no(second_class_name); - } - if (p_clearance_rule.clearance_class_pairs.isEmpty()) - { - if (p_layer_no < 0) - { - p_clearance_matrix.set_value(first_class_no, second_class_no, curr_clearance); - p_clearance_matrix.set_value(second_class_no, first_class_no, curr_clearance); - } - else - { - p_clearance_matrix.set_value(first_class_no, second_class_no, p_layer_no, curr_clearance); - p_clearance_matrix.set_value(second_class_no, first_class_no, p_layer_no, curr_clearance); - } - } - else - { - Iterator it = p_clearance_rule.clearance_class_pairs.iterator(); - while (it.hasNext()) - { - String curr_string = it.next(); - String[] curr_pair = curr_string.split("_"); - if (curr_pair.length != 2) - { - continue; - } - - int curr_first_class_no; - int curr_second_class_no; - for (int i = 0; i < 2; ++i) - { - if (i == 0) - { - curr_first_class_no = get_clearance_class(p_clearance_matrix, p_first_class, curr_pair[0]); - curr_second_class_no = get_clearance_class(p_clearance_matrix, p_second_class, curr_pair[1]); - } - else - { - curr_first_class_no = get_clearance_class(p_clearance_matrix, p_second_class, curr_pair[0]); - curr_second_class_no = get_clearance_class(p_clearance_matrix, p_first_class, curr_pair[1]); - } - if (p_layer_no < 0) - { - p_clearance_matrix.set_value(curr_first_class_no, curr_second_class_no, curr_clearance); - p_clearance_matrix.set_value(curr_second_class_no, curr_first_class_no, curr_clearance); - } - else - { - p_clearance_matrix.set_value(curr_first_class_no, curr_second_class_no, p_layer_no, curr_clearance); - p_clearance_matrix.set_value(curr_second_class_no, curr_first_class_no, p_layer_no, curr_clearance); - } - } - } - } - } - - static private void create_default_clearance_classes(rules.NetClass p_net_class, - rules.ClearanceMatrix p_clearance_matrix) - { - get_clearance_class(p_clearance_matrix, p_net_class, "via"); - get_clearance_class(p_clearance_matrix, p_net_class, "smd"); - get_clearance_class(p_clearance_matrix, p_net_class, "pin"); - get_clearance_class(p_clearance_matrix, p_net_class, "area"); - } - - private static void create_via_rule(Collection p_use_via, rules.NetClass p_net_class, board.BasicBoard p_board, boolean p_attach_allowed) - { - rules.ViaRule new_via_rule = new rules.ViaRule(p_net_class.get_name()); - int default_via_cl_class = p_net_class.default_item_clearance_classes.get(rules.DefaultItemClearanceClasses.ItemClass.VIA); - for (String curr_via_name : p_use_via) - { - for (int i = 0; i < p_board.rules.via_infos.count(); ++i) - { - rules.ViaInfo curr_via_info = p_board.rules.via_infos.get(i); - if (curr_via_info.get_clearance_class() == default_via_cl_class) - { - if (curr_via_info.get_padstack().name.equals(curr_via_name)) - { - new_via_rule.append_via(curr_via_info); - } - } - } - } - p_board.rules.via_rules.add(new_via_rule); - p_net_class.set_via_rule(new_via_rule); - } - - private static void create_active_trace_layers(Collection p_use_layer, LayerStructure p_layer_structure, rules.NetClass p_net_class) - { - for (int i = 0; i < p_layer_structure.arr.length; ++i) - { - p_net_class.set_active_routing_layer(i, false); - } - for (String cur_layer_name : p_use_layer) - { - int curr_no = p_layer_structure.get_no(cur_layer_name); - p_net_class.set_active_routing_layer(curr_no, true); - } - // currently all inactive layers have tracewidth 0. - for (int i = 0; i < p_layer_structure.arr.length; ++i) - { - if (!p_net_class.is_active_routing_layer(i)) - { - p_net_class.set_trace_half_width(i, 0); - } - } - } - - private static void add_clearance_rule(rules.ClearanceMatrix p_clearance_matrix, rules.NetClass p_net_class, - Rule.ClearanceRule p_rule, int p_layer_no, CoordinateTransform p_coordinate_transform) - { - int curr_clearance = (int) Math.round(p_coordinate_transform.dsn_to_board(p_rule.value)); - final String class_name = p_net_class.get_name(); - int class_no = p_clearance_matrix.get_no(class_name); - if (class_no < 0) - { - // class not yet existing, create a new class - p_clearance_matrix.append_class(class_name); - class_no = p_clearance_matrix.get_no(class_name); - // set the clearance values of the new class to the maximum of curr_clearance and the - // the existing values. - for (int i = 1; i < p_clearance_matrix.get_class_count(); ++i) - { - for (int j = 0; j < p_clearance_matrix.get_layer_count(); ++j) - { - int curr_value = Math.max(p_clearance_matrix.value(class_no, i, j), curr_clearance); - p_clearance_matrix.set_value(class_no, i, j, curr_value); - p_clearance_matrix.set_value(i, class_no, j, curr_value); - } - } - p_net_class.default_item_clearance_classes.set_all(class_no); - } - p_net_class.set_trace_clearance_class(class_no); - if (p_rule.clearance_class_pairs.isEmpty()) - { - if (p_layer_no < 0) - { - p_clearance_matrix.set_value(class_no, class_no, curr_clearance); - } - else - { - p_clearance_matrix.set_value(class_no, class_no, p_layer_no, curr_clearance); - } - return; - } - if (Structure.contains_wire_clearance_pair(p_rule.clearance_class_pairs)) - { - create_default_clearance_classes(p_net_class, p_clearance_matrix); - } - Iterator it = p_rule.clearance_class_pairs.iterator(); - while (it.hasNext()) - { - String curr_string = it.next(); - String[] curr_pair = curr_string.split("_"); - if (curr_pair.length != 2) - { - continue; - } - - int first_class_no = get_clearance_class(p_clearance_matrix, p_net_class, curr_pair[0]); - int second_class_no = get_clearance_class(p_clearance_matrix, p_net_class, curr_pair[1]); - - if (p_layer_no < 0) - { - p_clearance_matrix.set_value(first_class_no, second_class_no, curr_clearance); - p_clearance_matrix.set_value(second_class_no, first_class_no, curr_clearance); - } - else - { - p_clearance_matrix.set_value(first_class_no, second_class_no, p_layer_no, curr_clearance); - p_clearance_matrix.set_value(second_class_no, first_class_no, p_layer_no, curr_clearance); - } - } - } - - /** - * Gets the number of the clearance class with name combined of p_net_class_name and p_item_class_name. - * Creates a new class, if that class is not yet existing. - */ - static private int get_clearance_class(rules.ClearanceMatrix p_clearance_matrix, - rules.NetClass p_net_class, String p_item_class_name) - { - String net_class_name = p_net_class.get_name(); - String new_class_name = net_class_name; - if (!p_item_class_name.equals("wire")) - { - new_class_name = new_class_name + DsnFile.CLASS_CLEARANCE_SEPARATOR + p_item_class_name; - } - int found_class_no = p_clearance_matrix.get_no(new_class_name); - if (found_class_no >= 0) - { - return found_class_no; - } - p_clearance_matrix.append_class(new_class_name); - int result = p_clearance_matrix.get_no(new_class_name); - int net_class_no = p_clearance_matrix.get_no(net_class_name); - if (net_class_no < 0 || result < 0) - { - System.out.println("Network.get_clearance_class: clearance class not found"); - return result; - } - // initalise the clearance values of p_new_class_name from p_net_class_name - for (int i = 1; i < p_clearance_matrix.get_class_count(); ++i) - { - - for (int j = 0; j < p_clearance_matrix.get_layer_count(); ++j) - { - int curr_value = p_clearance_matrix.value(net_class_no, i, j); - p_clearance_matrix.set_value(result, i, j, curr_value); - p_clearance_matrix.set_value(i, result, j, curr_value); - } - } - if (p_item_class_name.equals("via")) - { - p_net_class.default_item_clearance_classes.set(ItemClass.VIA, result); - } - else if (p_item_class_name.equals("pin")) - { - p_net_class.default_item_clearance_classes.set(ItemClass.PIN, result); - } - else if (p_item_class_name.equals("smd")) - { - p_net_class.default_item_clearance_classes.set(ItemClass.SMD, result); - } - else if (p_item_class_name.equals("area")) - { - p_net_class.default_item_clearance_classes.set(ItemClass.AREA, result); - } - return result; - } - - private static void insert_compoments(ReadScopeParameter p_par) - { - Iterator it = p_par.placement_list.iterator(); - while (it.hasNext()) - { - ComponentPlacement next_lib_component = it.next(); - Iterator it2 = next_lib_component.locations.iterator(); - while (it2.hasNext()) - { - ComponentPlacement.ComponentLocation next_component = it2.next(); - insert_component(next_component, next_lib_component.lib_name, p_par); - } - - } - } - - /** - * Create the part library on the board. Can be called after the components are inserted. - * Returns false, if an error occured. - */ - private static boolean insert_logical_parts(ReadScopeParameter p_par) - { - board.BasicBoard routing_board = p_par.board_handling.get_routing_board(); - for (PartLibrary.LogicalPart next_part : p_par.logical_parts) - { - library.Package lib_package = search_lib_package(next_part.name, p_par.logical_part_mappings, routing_board); - if (lib_package == null) - { - return false; - } - library.LogicalPart.PartPin[] board_part_pins = - new library.LogicalPart.PartPin[next_part.part_pins.size()]; - int curr_index = 0; - for (PartLibrary.PartPin curr_part_pin : next_part.part_pins) - { - int pin_no = lib_package.get_pin_no(curr_part_pin.pin_name); - if (pin_no < 0) - { - System.out.println("Network.insert_logical_parts: package pin not found"); - return false; - } - board_part_pins[curr_index] = - new library.LogicalPart.PartPin(pin_no, curr_part_pin.pin_name, - curr_part_pin.gate_name, curr_part_pin.gate_swap_code, - curr_part_pin.gate_pin_name, curr_part_pin.gate_pin_swap_code); - ++curr_index; - } - routing_board.library.logical_parts.add(next_part.name, board_part_pins); - } - - for (PartLibrary.LogicalPartMapping next_mapping : p_par.logical_part_mappings) - { - library.LogicalPart curr_logical_part = routing_board.library.logical_parts.get(next_mapping.name); - { - if (curr_logical_part == null) - { - System.out.println("Network.insert_logical_parts: logical part not found"); - } - } - for (String curr_cmp_name : next_mapping.components) - { - board.Component curr_component = routing_board.components.get(curr_cmp_name); - if (curr_component != null) - { - curr_component.set_logical_part(curr_logical_part); - } - else - { - System.out.println("Network.insert_logical_parts: board component not found"); - } - } - } - return true; - } - - /** - * Calculates the library package belonging to the logical part with name p_part_name. - * Returns null, if the package was not found. - */ - private static library.Package search_lib_package(String p_part_name, - java.util.Collection p_logical_part_mappings, board.BasicBoard p_board) - { - for (PartLibrary.LogicalPartMapping curr_mapping : p_logical_part_mappings) - { - if (curr_mapping.name.equals(p_part_name)) - { - if (curr_mapping.components.isEmpty()) - { - System.out.println("Network.search_lib_package: component list empty"); - return null; - } - String component_name = curr_mapping.components.first(); - if (component_name == null) - { - System.out.println("Network.search_lib_package: component list empty"); - return null; - } - board.Component curr_component = p_board.components.get(component_name); - if (curr_component == null) - { - System.out.println("Network.search_lib_package: component not found"); - return null; - } - return curr_component.get_package(); - } - } - System.out.print("Network.search_lib_package: library package "); - System.out.print(p_part_name); - System.out.println(" not found"); - return null; - } - - /** - * Inserts all board components belonging to the input library component. - */ - private static void insert_component(ComponentPlacement.ComponentLocation p_location, String p_lib_key, - ReadScopeParameter p_par) - { - board.RoutingBoard routing_board = p_par.board_handling.get_routing_board(); - library.Package curr_front_package = routing_board.library.packages.get(p_lib_key, true); - library.Package curr_back_package = routing_board.library.packages.get(p_lib_key, false); - if (curr_front_package == null || curr_back_package == null) - { - System.out.println("Network.insert_component: component package not found"); - return; - } - - IntPoint component_location; - if (p_location.coor != null) - { - component_location = p_par.coordinate_transform.dsn_to_board(p_location.coor).round(); - } - else - { - component_location = null; - } - double rotation_in_degree = p_location.rotation; - - board.Component new_component = routing_board.components.add(p_location.name, component_location, - rotation_in_degree, p_location.is_front, curr_front_package, curr_back_package, p_location.position_fixed); - - if (component_location == null) - { - return; // component is not yet placed. - } - Vector component_translation = component_location.difference_by(Point.ZERO); - board.FixedState fixed_state; - if (p_location.position_fixed) - { - fixed_state = board.FixedState.SYSTEM_FIXED; - } - else - { - fixed_state = board.FixedState.UNFIXED; - } - library.Package curr_package = new_component.get_package(); - for (int i = 0; i < curr_package.pin_count(); ++i) - { - library.Package.Pin curr_pin = curr_package.get_pin(i); - library.Padstack curr_padstack = routing_board.library.padstacks.get(curr_pin.padstack_no); - if (curr_padstack == null) - { - System.out.println("Network.insert_component: pin padstack not found"); - return; - } - Collection pin_nets = p_par.netlist.get_nets(p_location.name, curr_pin.name); - Collection net_numbers = new LinkedList(); - for (Net curr_pin_net : pin_nets) - { - rules.Net curr_board_net = routing_board.rules.nets.get(curr_pin_net.id.name, curr_pin_net.id.subnet_number); - if (curr_board_net == null) - { - System.out.println("Network.insert_component: board net not found"); - - } - else - { - net_numbers.add(curr_board_net.net_number); - } - } - int[] net_no_arr = new int[net_numbers.size()]; - int net_index = 0; - for (Integer curr_net_no : net_numbers) - { - net_no_arr[net_index] = curr_net_no; - ++net_index; - } - rules.NetClass net_class; - rules.Net board_net; - if (net_no_arr.length > 0) - { - board_net = routing_board.rules.nets.get(net_no_arr[0]); - } - else - { - board_net = null; - } - if (board_net != null) - { - net_class = board_net.get_class(); - } - else - { - net_class = routing_board.rules.get_default_net_class(); - } - int clearance_class = -1; - ComponentPlacement.ItemClearanceInfo pin_info = p_location.pin_infos.get(curr_pin.name); - if (pin_info != null) - { - clearance_class = routing_board.rules.clearance_matrix.get_no(pin_info.clearance_class); - } - if (clearance_class < 0) - { - if (curr_padstack.from_layer() == curr_padstack.to_layer()) - { - clearance_class = net_class.default_item_clearance_classes.get(rules.DefaultItemClearanceClasses.ItemClass.SMD); - } - else - { - clearance_class = net_class.default_item_clearance_classes.get(rules.DefaultItemClearanceClasses.ItemClass.PIN); - } - } - routing_board.insert_pin(new_component.no, i, net_no_arr, clearance_class, fixed_state); - } - - // insert the keepouts belonging to the package (k = 1 for via keepouts) - for (int k = 0; k <= 2; ++k) - { - library.Package.Keepout[] keepout_arr; - java.util.Map curr_keepout_infos; - if (k == 0) - { - keepout_arr = curr_package.keepout_arr; - curr_keepout_infos = p_location.keepout_infos; - } - else if (k == 1) - { - keepout_arr = curr_package.via_keepout_arr; - curr_keepout_infos = p_location.via_keepout_infos; - } - else - { - keepout_arr = curr_package.place_keepout_arr; - curr_keepout_infos = p_location.place_keepout_infos; - } - for (int i = 0; i < keepout_arr.length; ++i) - { - library.Package.Keepout curr_keepout = keepout_arr[i]; - int layer = curr_keepout.layer; - if (layer >= routing_board.get_layer_count()) - { - System.out.println("Network.insert_component: keepout layer is to big"); - continue; - } - if (layer >= 0 && !p_location.is_front) - { - layer = routing_board.get_layer_count() - curr_keepout.layer - 1; - } - int clearance_class = - routing_board.rules.get_default_net_class().default_item_clearance_classes.get(rules.DefaultItemClearanceClasses.ItemClass.AREA); - ComponentPlacement.ItemClearanceInfo keepout_info = curr_keepout_infos.get(curr_keepout.name); - if (keepout_info != null) - { - int curr_clearance_class = routing_board.rules.clearance_matrix.get_no(keepout_info.clearance_class); - if (curr_clearance_class > 0) - { - clearance_class = curr_clearance_class; - } - } - if (layer >= 0) - { - if (k == 0) - { - routing_board.insert_obstacle(curr_keepout.area, layer, component_translation, - rotation_in_degree, !p_location.is_front, clearance_class, new_component.no, - curr_keepout.name, fixed_state); - } - else if (k == 1) - { - routing_board.insert_via_obstacle(curr_keepout.area, layer, component_translation, - rotation_in_degree, !p_location.is_front, clearance_class, new_component.no, - curr_keepout.name, fixed_state); - } - else - { - routing_board.insert_component_obstacle(curr_keepout.area, layer, component_translation, - rotation_in_degree, !p_location.is_front, clearance_class, new_component.no, - curr_keepout.name, fixed_state); - } - } - else - { - // insert the obstacle on all signal layers - for (int j = 0; j < routing_board.layer_structure.arr.length; ++j) - { - if (routing_board.layer_structure.arr[j].is_signal) - { - if (k == 0) - { - routing_board.insert_obstacle(curr_keepout.area, j, component_translation, - rotation_in_degree, !p_location.is_front, clearance_class, new_component.no, - curr_keepout.name, fixed_state); - } - else if (k == 1) - { - routing_board.insert_via_obstacle(curr_keepout.area, j, component_translation, - rotation_in_degree, !p_location.is_front, clearance_class, new_component.no, - curr_keepout.name, fixed_state); - } - else - { - routing_board.insert_component_obstacle(curr_keepout.area, j, component_translation, - rotation_in_degree, !p_location.is_front, clearance_class, new_component.no, - curr_keepout.name, fixed_state); - } - } - } - } - } - } - // insert the outline as component keepout - for (int i = 0; i < curr_package.outline.length; ++i) - { - - routing_board.insert_component_outline(curr_package.outline[i], p_location.is_front, component_translation, - rotation_in_degree, new_component.no, fixed_state); - } - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Package.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Package.java deleted file mode 100644 index 6347cac..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Package.java +++ /dev/null @@ -1,504 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Package.java - * - * Created on 21. Mai 2004, 09:31 - */ - -package designformats.specctra; - -import java.util.Collection; -import java.util.Iterator; -import java.util.LinkedList; - -import board.Item; - -/** - * Class for reading and writing package scopes from dsn-files. - * - * @author alfons - */ -public class Package -{ - - /** Creates a new instance of Package */ - public Package(String p_name, PinInfo[] p_pin_info_arr, Collection p_outline, Collection p_keepouts, - Collection p_via_keepouts, Collection p_place_keepouts, boolean p_is_front) - { - name = p_name; - pin_info_arr = p_pin_info_arr; - outline = p_outline; - keepouts = p_keepouts; - via_keepouts = p_via_keepouts; - place_keepouts = p_place_keepouts; - is_front = p_is_front; - } - - public static Package read_scope(Scanner p_scanner, LayerStructure p_layer_structure) - { - try - { - boolean is_front = true; - Collection outline = new LinkedList(); - Collection keepouts = new LinkedList(); - Collection via_keepouts = new LinkedList(); - Collection place_keepouts = new LinkedList(); - Object next_token = p_scanner.next_token(); - if ( !(next_token instanceof String)) - { - System.out.println("Package.read_scope: String expected"); - return null; - } - String package_name = (String) next_token; - Collection pin_info_list = new LinkedList(); - for (;;) - { - Object prev_token = next_token; - next_token = p_scanner.next_token(); - - if (next_token == null) - { - System.out.println("Package.read_scope: unexpected end of file"); - return null; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.PIN) - { - PinInfo next_pin = read_pin_info(p_scanner); - if (next_pin == null) - { - return null; - } - pin_info_list.add(next_pin); - } - else if (next_token == Keyword.SIDE) - { - is_front = read_placement_side(p_scanner); - } - else if (next_token == Keyword.OUTLINE) - { - Shape curr_shape = Shape.read_scope(p_scanner, p_layer_structure); - if (curr_shape != null) - { - outline.add(curr_shape); - } - // overread closing bracket - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Package.read_scope: closed bracket expected"); - return null; - } - } - else if (next_token == Keyword.KEEPOUT) - { - Shape.ReadAreaScopeResult keepout_area = Shape.read_area_scope(p_scanner, p_layer_structure, false); - if (keepout_area != null) - { - keepouts.add(keepout_area); - } - } - else if (next_token == Keyword.VIA_KEEPOUT) - { - Shape.ReadAreaScopeResult keepout_area = Shape.read_area_scope(p_scanner, p_layer_structure, false); - if (keepout_area != null) - { - via_keepouts.add(keepout_area); - } - } - else if (next_token == Keyword.PLACE_KEEPOUT) - { - Shape.ReadAreaScopeResult keepout_area = Shape.read_area_scope(p_scanner, p_layer_structure, false); - if (keepout_area != null) - { - place_keepouts.add(keepout_area); - } - } - else - { - ScopeKeyword.skip_scope(p_scanner); - } - } - } - PinInfo [] pin_info_arr = new PinInfo[pin_info_list.size()]; - Iterator it = pin_info_list.iterator(); - for (int i = 0; i < pin_info_arr.length; ++i) - { - pin_info_arr[i] = it.next(); - } - return new Package(package_name, pin_info_arr, outline, keepouts, via_keepouts, place_keepouts, is_front); - } - catch (java.io.IOException e) - { - System.out.println("Package.read_scope: IO error scanning file"); - System.out.println(e); - return null; - } - } - - public static void write_scope(WriteScopeParameter p_par, library.Package p_package) throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("image "); - p_par.identifier_type.write(p_package.name, p_par.file); - // write the placement side of the package - p_par.file.new_line(); - p_par.file.write("(side "); - if (p_package.is_front) - { - p_par.file.write("front)"); - } - else - { - p_par.file.write("back)"); - } - // write the pins of the package - for (int i = 0; i < p_package.pin_count(); ++i) - { - library.Package.Pin curr_pin = p_package.get_pin(i); - p_par.file.new_line(); - p_par.file.write("(pin "); - library.Padstack curr_padstack = p_par.board.library.padstacks.get(curr_pin.padstack_no); - p_par.identifier_type.write(curr_padstack.name, p_par.file); - p_par.file.write(" "); - p_par.identifier_type.write(curr_pin.name, p_par.file); - double [] rel_coor = p_par.coordinate_transform.board_to_dsn(curr_pin.relative_location); - for(int j = 0; j < rel_coor.length; ++j) - { - p_par.file.write(" "); - p_par.file.write((new Double(rel_coor[j])).toString()); - } - int rotation = (int) Math.round(curr_pin.rotation_in_degree); - if (rotation != 0) - { - p_par.file.write("(rotate "); - p_par.file.write((new Integer(rotation)).toString()); - p_par.file.write(")"); - } - p_par.file.write(")"); - } - // write the keepouts belonging to the package. - for (int i = 0; i < p_package.keepout_arr.length; ++i) - { - write_package_keepout(p_package.keepout_arr[i], p_par, false); - } - for (int i = 0; i < p_package.via_keepout_arr.length; ++i) - { - write_package_keepout(p_package.via_keepout_arr[i], p_par, true); - } - // write the package outline. - for (int i = 0; i < p_package.outline.length; ++i) - { - p_par.file.start_scope(); - p_par.file.write("outline"); - Shape curr_outline = p_par.coordinate_transform.board_to_dsn_rel(p_package.outline[i], Layer.SIGNAL); - curr_outline.write_scope(p_par.file, p_par.identifier_type); - p_par.file.end_scope(); - } - p_par.file.end_scope(); - } - - private static void write_package_keepout(library.Package.Keepout p_keepout, WriteScopeParameter p_par, - boolean p_is_via_keepout) throws java.io.IOException - { - Layer keepout_layer; - if (p_keepout.layer >= 0) - { - board.Layer board_layer = p_par.board.layer_structure.arr[p_keepout.layer]; - keepout_layer = new Layer(board_layer.name, p_keepout.layer, board_layer.is_signal); - } - else - { - keepout_layer = Layer.SIGNAL; - } - geometry.planar.Shape boundary_shape; - geometry.planar.Shape [] holes; - if (p_keepout.area instanceof geometry.planar.Shape) - { - boundary_shape = (geometry.planar.Shape) p_keepout.area ; - holes = new geometry.planar.Shape [0]; - } - else - { - boundary_shape = p_keepout.area .get_border(); - holes = p_keepout.area .get_holes(); - } - p_par.file.start_scope(); - if (p_is_via_keepout) - { - p_par.file.write("via_keepout"); - } - else - { - p_par.file.write("keepout"); - } - Shape dsn_shape = p_par.coordinate_transform.board_to_dsn(boundary_shape, keepout_layer); - if (dsn_shape != null) - { - dsn_shape.write_scope(p_par.file, p_par.identifier_type); - } - for (int j = 0; j < holes.length; ++j) - { - Shape dsn_hole = p_par.coordinate_transform.board_to_dsn(holes[j], keepout_layer); - dsn_hole.write_hole_scope(p_par.file, p_par.identifier_type); - } - p_par.file.end_scope(); - } - - /** Reads the information of a single pin in a package. */ - private static PinInfo read_pin_info(Scanner p_scanner) - { - try - { - // Read the padstack name. - p_scanner.yybegin(SpecctraFileScanner.NAME); - String padstack_name = null; - Object next_token = p_scanner.next_token(); - if ( next_token instanceof String) - { - padstack_name = (String) next_token; - } - else if ( next_token instanceof Integer) - { - padstack_name = ((Integer) next_token).toString(); - } - else - { - System.out.println("Package.read_pin_info: String or Integer expected"); - return null; - } - double rotation = 0; - - p_scanner.yybegin(SpecctraFileScanner.NAME); // to be able to handle pin names starting with a digit. - next_token = p_scanner.next_token(); - if (next_token == Keyword.OPEN_BRACKET) - { - // read the padstack rotation - next_token = p_scanner.next_token(); - if (next_token == Keyword.ROTATE) - { - rotation = read_rotation(p_scanner); - } - else - { - ScopeKeyword.skip_scope(p_scanner); - } - p_scanner.yybegin(SpecctraFileScanner.NAME); - next_token = p_scanner.next_token(); - } - // Read the pin name. - String pin_name = null; - if ( next_token instanceof String) - { - pin_name = (String) next_token; - } - else if ( next_token instanceof Integer) - { - pin_name = ((Integer) next_token).toString(); - } - else - { - System.out.println("Package.read_pin_info: String or Integer expected"); - return null; - } - - double [] pin_coor = new double [2]; - for (int i = 0; i < 2; ++i) - { - next_token = p_scanner.next_token(); - if (next_token instanceof Double) - { - pin_coor[i] = ((Double) next_token).doubleValue(); - } - else if (next_token instanceof Integer) - { - pin_coor[i] = ((Integer) next_token).intValue(); - } - else - { - System.out.println("Package.read_pin_info: number expected"); - return null; - } - } - // Handle scopes at the end of the pin scope. - for (;;) - { - Object prev_token = next_token; - next_token = p_scanner.next_token(); - - if (next_token == null) - { - System.out.println("Package.read_pin_info: unexpected end of file"); - return null; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.ROTATE) - { - rotation = read_rotation(p_scanner); - } - else - { - ScopeKeyword.skip_scope(p_scanner); - } - } - } - return new PinInfo(padstack_name, pin_name, pin_coor, rotation); - } - catch (java.io.IOException e) - { - System.out.println("Package.read_pin_info: IO error while scanning file"); - return null; - } - } - - private static double read_rotation(Scanner p_scanner) - { - double result = 0; - try - { - Object next_token = p_scanner.next_token(); - if (next_token instanceof Integer) - { - result = ((Integer)next_token).intValue(); - } - else if (next_token instanceof Double) - { - result = ((Double)next_token).doubleValue(); - } - else - { - System.out.println("Package.read_rotation: number expected"); - } - // Overread The closing bracket. - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Package.read_rotation: closing bracket expected"); - } - } - catch (java.io.IOException e) - { - System.out.println("Package.read_rotation: IO error while scanning file"); - } - return result; - } - - /** - * Writes the placements of p_package to a Specctra dsn-file. - */ - public static void write_placement_scope(WriteScopeParameter p_par, library.Package p_package) - throws java.io.IOException - { - Collection board_items = p_par.board.get_items(); - boolean component_found = false; - for (int i = 1; i <= p_par.board.components.count(); ++i) - { - board.Component curr_component = p_par.board.components.get(i); - if (curr_component.get_package() == p_package) - { - // check, if not all items of the component are deleted - boolean undeleted_item_found = false; - Iterator it = board_items.iterator(); - while (it.hasNext()) - { - Item curr_item = it.next(); - if (curr_item.get_component_no() == curr_component.no) - { - undeleted_item_found = true; - break; - } - } - if (undeleted_item_found || !curr_component.is_placed()) - { - if (!component_found) - { - // write the scope header - p_par.file.start_scope(); - p_par.file.write("component "); - p_par.identifier_type.write(p_package.name, p_par.file); - component_found = true; - } - Component.write_scope(p_par, curr_component); - } - } - } - if (component_found) - { - p_par.file.end_scope(); - } - } - - private static boolean read_placement_side(Scanner p_scanner) throws java.io.IOException - { - Object next_token = p_scanner.next_token(); - boolean result = (next_token != Keyword.BACK); - - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Package.read_placement_side: closing bracket expected"); - } - return result; - } - - - public final String name; - /** List of objects of type PinInfo. */ - public final PinInfo[] pin_info_arr; - /** The outline of the package. */ - public final Collection outline; - /** Collection of keepoouts belonging to this package */ - public final Collection keepouts; - /** Collection of via keepoouts belonging to this package */ - public final Collection via_keepouts; - /** Collection of place keepoouts belonging to this package */ - public final Collection place_keepouts; - /** If false, the package is placed on the back side of the board */ - public final boolean is_front; - - - /** Describes the Iinformation of a pin in a package. */ - static public class PinInfo - { - PinInfo(String p_padstack_name, String p_pin_name, double [] p_rel_coor, double p_rotation) - { - padstack_name = p_padstack_name; - pin_name = p_pin_name; - rel_coor = p_rel_coor; - rotation = p_rotation; - } - /** Phe name of the pastack of this pin. */ - public final String padstack_name; - /** Phe name of this pin. */ - public final String pin_name; - /** The x- and y-coordinates relative to the package location. */ - public final double [] rel_coor; - /** The rotation of the pin relative to the package. */ - public final double rotation; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Parser.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Parser.java deleted file mode 100644 index dffc2dc..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Parser.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Parser.java - * - * Created on 24. Januar 2005, 08:29 - */ -package designformats.specctra; - -import board.Communication.SpecctraParserInfo; - -/** - * Class for reading and writing parser scopes from dsn-files. - * - * @author Alfons Wirtz - */ -public class Parser extends ScopeKeyword -{ - - /** Creates a new instance of Parser */ - public Parser() - { - super("parser"); - } - - public boolean read_scope(ReadScopeParameter p_par) - { - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_par.scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Parser.read_scope: IO error scanning file"); - return false; - } - if (next_token == null) - { - System.out.println("Parser.read_scope: unexpected end of file"); - return false; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - boolean read_ok = true; - if (prev_token == OPEN_BRACKET) - { - if (next_token == Keyword.STRING_QUOTE) - { - String quote_char = read_quote_char(p_par.scanner); - if (quote_char == null) - { - return false; - } - p_par.string_quote = quote_char; - } - else if (next_token == Keyword.HOST_CAD) - { - p_par.host_cad = DsnFile.read_string_scope(p_par.scanner); - } - else if (next_token == Keyword.HOST_VERSION) - { - p_par.host_version = DsnFile.read_string_scope(p_par.scanner); - } - else if (next_token == Keyword.CONSTANT) - { - String[] curr_constant = read_constant(p_par); - if (curr_constant != null) - { - p_par.constants.add(curr_constant); - } - } - else if (next_token == Keyword.WRITE_RESOLUTION) - { - p_par.write_resolution = read_write_solution(p_par); - } - else if (next_token == Keyword.GENERATED_BY_FREEROUTE) - { - p_par.dsn_file_generated_by_host = false; - // skip the closing bracket - skip_scope(p_par.scanner); - } - else - { - skip_scope(p_par.scanner); - } - } - if (!read_ok) - { - return false; - } - } - return true; - } - - private static SpecctraParserInfo.WriteResolution read_write_solution(ReadScopeParameter p_par) - { - try - { - Object next_token = p_par.scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Parser.read_write_solution: string expected"); - return null; - } - String resolution_string = (String) next_token; - next_token = p_par.scanner.next_token(); - if (!(next_token instanceof Integer)) - { - System.out.println("Parser.read_write_solution: integer expected expected"); - return null; - } - int resolution_value = (Integer) next_token; - next_token = p_par.scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Parser.read_write_solution: closing_bracket expected"); - return null; - } - return new SpecctraParserInfo.WriteResolution(resolution_string, resolution_value); - } - catch (java.io.IOException e) - { - System.out.println("Parser.read_write_solution: IO error scanning file"); - return null; - } - } - - private static String[] read_constant(ReadScopeParameter p_par) - { - try - { - String[] result = new String[2]; - p_par.scanner.yybegin(SpecctraFileScanner.NAME); - Object next_token = p_par.scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Parser.read_constant: string expected"); - return null; - } - result[0] = (String) next_token; - p_par.scanner.yybegin(SpecctraFileScanner.NAME); - next_token = p_par.scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Parser.read_constant: string expected"); - return null; - } - result[1] = (String) next_token; - next_token = p_par.scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Parser.read_constant: closing_bracket expected"); - return null; - } - return result; - } - catch (java.io.IOException e) - { - System.out.println("Parser.read_constant: IO error scanning file"); - return null; - } - } - - /** - * p_reduced is true if the scope is written to a session file. - */ - public static void write_scope(datastructures.IndentFileWriter p_file, SpecctraParserInfo p_parser_info, - datastructures.IdentifierType p_identifier_type, boolean p_reduced) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("parser"); - if (!p_reduced) - { - p_file.new_line(); - p_file.write("(string_quote "); - p_file.write(p_parser_info.string_quote); - p_file.write(")"); - p_file.new_line(); - p_file.write("(space_in_quoted_tokens on)"); - } - if (p_parser_info.host_cad != null) - { - p_file.new_line(); - p_file.write("(host_cad "); - p_identifier_type.write(p_parser_info.host_cad, p_file); - p_file.write(")"); - } - if (p_parser_info.host_version != null) - { - p_file.new_line(); - p_file.write("(host_version "); - p_identifier_type.write(p_parser_info.host_version, p_file); - p_file.write(")"); - } - if (p_parser_info.constants != null) - { - for (String[] curr_constant : p_parser_info.constants) - { - p_file.new_line(); - p_file.write("(constant "); - for (int i = 0; i < curr_constant.length; ++i) - { - p_identifier_type.write(curr_constant[i], p_file); - p_file.write(" "); - } - p_file.write(")"); - } - } - if (p_parser_info.write_resolution != null) - { - p_file.new_line(); - p_file.write("(write_resolution "); - p_file.write(p_parser_info.write_resolution.char_name.substring(0, 1)); - p_file.write(" "); - Integer positive_int = p_parser_info.write_resolution.positive_int; - p_file.write(positive_int.toString()); - p_file.write(")"); - } - if (!p_reduced) - { - p_file.new_line(); - p_file.write("(generated_by_freeroute)"); - } - p_file.end_scope(); - } - - private static String read_quote_char(Scanner p_scanner) - { - try - { - Object next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Parser.read_quote_char: string expected"); - return null; - } - String result = (String) next_token; - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Parser.read_quote_char: closing bracket expected"); - return null; - } - return result; - } - catch (java.io.IOException e) - { - System.out.println("Parser.read_quote_char: IO error scanning file"); - return null; - } - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/PartLibrary.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/PartLibrary.java deleted file mode 100644 index c0ebb4f..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/PartLibrary.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * PartLibrary.java - * - * Created on 23. Maerz 2005, 08:36 - */ - -package designformats.specctra; - -/** - * - * @author Alfons Wirtz - */ -public class PartLibrary extends ScopeKeyword -{ - - /** Creates a new instance of PartLibrary */ - public PartLibrary() - { - super("part_library"); - } - - public boolean read_scope(ReadScopeParameter p_par) - { - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_par.scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("PartLibrary.read_scope: IO error scanning file"); - System.out.println(e); - return false; - } - if (next_token == null) - { - System.out.println("PartLibrary.read_scope: unexpected end of file"); - return false; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == OPEN_BRACKET) - { - if (next_token == Keyword.LOGICAL_PART_MAPPING) - { - LogicalPartMapping next_mapping = read_logical_part_mapping(p_par.scanner); - if (next_mapping == null) - { - return false; - } - p_par.logical_part_mappings.add(next_mapping); - } - else if (next_token == Keyword.LOGICAL_PART) - { - LogicalPart next_part = read_logical_part(p_par.scanner); - if (next_part == null) - { - return false; - } - p_par.logical_parts.add(next_part); - } - else - { - skip_scope(p_par.scanner); - } - } - } - return true; - } - - public static void write_scope(WriteScopeParameter p_par) throws java.io.IOException - { - library.LogicalParts logical_parts = p_par.board.library.logical_parts; - if (logical_parts.count() <= 0) - { - return; - } - p_par.file.start_scope(); - p_par.file.write("part_library"); - - // write the logical part mappings - - for (int i = 1; i <= logical_parts.count(); ++i) - { - library.LogicalPart curr_part = logical_parts.get(i); - p_par.file.start_scope(); - p_par.file.write("logical_part_mapping "); - p_par.identifier_type.write(curr_part.name, p_par.file); - p_par.file.new_line(); - p_par.file.write("(comp"); - for (int j = 1; j <= p_par.board.components.count(); ++j) - { - board.Component curr_compomnent = p_par.board.components.get(j); - if (curr_compomnent.get_logical_part() == curr_part) - { - p_par.file.write(" "); - p_par.file.write(curr_compomnent.name); - } - } - p_par.file.write(")"); - p_par.file.end_scope(); - } - - // write the logical parts. - - for (int i = 1; i <= logical_parts.count(); ++i) - { - library.LogicalPart curr_part = logical_parts.get(i); - - p_par.file.start_scope(); - p_par.file.write("logical_part "); - p_par.identifier_type.write(curr_part.name, p_par.file); - p_par.file.new_line(); - for (int j = 0; j < curr_part.pin_count(); ++j) - { - p_par.file.new_line(); - library.LogicalPart.PartPin curr_pin = curr_part.get_pin(j); - p_par.file.write("(pin "); - p_par.identifier_type.write(curr_pin.pin_name, p_par.file); - p_par.file.write(" 0 "); - p_par.identifier_type.write(curr_pin.gate_name, p_par.file); - p_par.file.write(" "); - Integer gate_swap_code = curr_pin.gate_swap_code; - p_par.file.write(gate_swap_code.toString()); - p_par.file.write(" "); - p_par.identifier_type.write(curr_pin.gate_pin_name, p_par.file); - p_par.file.write(" "); - Integer gate_pin_swap_code = curr_pin.gate_pin_swap_code; - p_par.file.write(gate_pin_swap_code.toString()); - p_par.file.write(")"); - } - p_par.file.end_scope(); - } - p_par.file.end_scope(); - } - - /** - * Reads the component list of a logical part mapping. - * Returns null, if an error occured. - */ - private LogicalPartMapping read_logical_part_mapping(Scanner p_scanner) - { - try - { - Object next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("PartLibrary.read_logical_part_mapping: string expected"); - return null; - } - String name = (String) next_token; - next_token = p_scanner.next_token(); - if (next_token != Keyword.OPEN_BRACKET) - { - System.out.println("PartLibrary.read_logical_part_mapping: open bracket expected"); - return null; - } - next_token = p_scanner.next_token(); - if (next_token != Keyword.COMPONENT_SCOPE) - { - System.out.println("PartLibrary.read_logical_part_mapping: Keyword.COMPONENT_SCOPE expected"); - return null; - } - java.util.SortedSet result = new java.util.TreeSet(); - for(;;) - { - p_scanner.yybegin(SpecctraFileScanner.NAME); - next_token = p_scanner.next_token(); - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - if (!(next_token instanceof String)) - { - System.out.println("PartLibrary.read_logical_part_mapping: string expected"); - return null; - } - result.add((String) next_token); - } - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("PartLibrary.read_logical_part_mapping: closing bracket expected"); - return null; - } - return new LogicalPartMapping(name, result); - } - catch (java.io.IOException e) - { - System.out.println("PartLibrary.read_logical_part_mapping: IO error scanning file"); - return null; - } - } - - private LogicalPart read_logical_part(Scanner p_scanner) - { - java.util.Collection part_pins = new java.util.LinkedList(); - Object next_token = null; - try - { - next_token = p_scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("PartLibrary.read_logical_part: IO error scanning file"); - return null; - } - if (!(next_token instanceof String)) - { - System.out.println("PartLibrary.read_logical_part: string expected"); - return null; - } - String part_name = (String) next_token; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("PartLibrary.read_logical_part: IO error scanning file"); - return null; - } - if (next_token == null) - { - System.out.println("PartLibrary.read_logical_part: unexpected end of file"); - return null; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - boolean read_ok = true; - if (prev_token == OPEN_BRACKET) - { - if (next_token == Keyword.PIN) - { - PartPin curr_part_pin = read_part_pin(p_scanner); - if (curr_part_pin == null) - { - return null; - } - part_pins.add(curr_part_pin); - } - else - { - skip_scope(p_scanner); - } - } - if (!read_ok) - { - return null; - } - } - return new LogicalPart(part_name, part_pins); - } - - private PartPin read_part_pin(Scanner p_scanner) - { - try - { - p_scanner.yybegin(SpecctraFileScanner.NAME); - Object next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("PartLibrary.read_part_pin: string expected"); - return null; - } - String pin_name = (String) next_token; - next_token = p_scanner.next_token(); - if (!(next_token instanceof Integer)) - { - System.out.println("PartLibrary.read_part_pin: integer expected"); - return null; - } - p_scanner.yybegin(SpecctraFileScanner.NAME); - next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("PartLibrary.read_part_pin: string expected"); - return null; - } - String gate_name = (String) next_token; - next_token = p_scanner.next_token(); - if (!(next_token instanceof Integer)) - { - System.out.println("PartLibrary.read_part_pin: integer expected"); - return null; - } - int gate_swap_code = (Integer) next_token; - p_scanner.yybegin(SpecctraFileScanner.NAME); - next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("PartLibrary.read_part_pin: string expected"); - return null; - } - String gate_pin_name = (String) next_token; - next_token = p_scanner.next_token(); - if (!(next_token instanceof Integer)) - { - System.out.println("PartLibrary.read_part_pin: integer expected"); - return null; - } - int gate_pin_swap_code = (Integer) next_token; - // overread subgates - for (;;) - { - next_token = p_scanner.next_token(); - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - } - return new PartPin(pin_name, gate_name, gate_swap_code, gate_pin_name, gate_pin_swap_code); - } - catch (java.io.IOException e) - { - System.out.println("PartLibrary.read_part_pin: IO error scanning file"); - return null; - } - } - - public static class LogicalPartMapping - { - private LogicalPartMapping(String p_name, java.util.SortedSet p_components) - { - name = p_name; - components = p_components; - } - /** The name of the maopping. */ - public final String name; - - /** The conponents belonging to the mapping. */ - public final java.util.SortedSet components; - } - - public static class PartPin - { - private PartPin(String p_pin_name, String p_gate_name, int p_gate_swap_code, - String p_gate_pin_name, int p_gate_pin_swap_code) - { - pin_name = p_pin_name; - gate_name = p_gate_name; - gate_swap_code = p_gate_swap_code; - gate_pin_name = p_gate_pin_name; - gate_pin_swap_code = p_gate_pin_swap_code; - } - - public final String pin_name; - public final String gate_name; - public final int gate_swap_code; - public final String gate_pin_name; - public final int gate_pin_swap_code; - } - - public static class LogicalPart - { - private LogicalPart(String p_name, java.util.Collection p_part_pins) - { - name = p_name; - part_pins = p_part_pins; - } - /** The name of the maopping. */ - public final String name; - - /** The pins of this logical part */ - public final java.util.Collection part_pins; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Path.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Path.java deleted file mode 100644 index 2cad403..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Path.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Path.java - * - * Created on 30. Juni 2004, 09:28 - */ - -package designformats.specctra; - -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - -/** - * Class for writing path scopes from dsn-files. - * - * @author alfons - */ -public abstract class Path extends Shape -{ - - /** Creates a new instance of Path */ - Path(Layer p_layer, double p_width, double[] p_coordinate_arr) - { - super (p_layer); - width = p_width; - coordinate_arr = p_coordinate_arr; - } - - /** - * Writes this path as a scope to an output dsn-file. - */ - public abstract void write_scope(IndentFileWriter p_file, IdentifierType p_identifier) throws java.io.IOException; - - public final double width; - public final double [] coordinate_arr; -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/PlaceControl.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/PlaceControl.java deleted file mode 100644 index e71ab91..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/PlaceControl.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * PlaceControl.java - * - * Created on 25. November 2004, 13:21 - */ - -package designformats.specctra; - -/** - * Class for reading place_control scopes from dsn-files. - * - * @author Alfons Wirtz - */ -public class PlaceControl extends ScopeKeyword -{ - - /** Creates a new instance of PlaceControl */ - public PlaceControl() - { - super("place_control"); - } - - /** Reads the flip_style */ - public boolean read_scope(ReadScopeParameter p_par) - { - boolean flip_style_rotate_first = false; - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_par.scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("PlaceControl.read_scope: IO error scanning file"); - return false; - } - if (next_token == null) - { - System.out.println("PlaceControl.read_scope: unexpected end of file"); - return false; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == OPEN_BRACKET) - { - if (next_token == Keyword.FLIP_STYLE) - { - flip_style_rotate_first = read_flip_style_rotate_first(p_par.scanner); - } - } - } - if (flip_style_rotate_first) - { - p_par.board_handling.get_routing_board().components.set_flip_style_rotate_first(true); - } - return true; - } - - /** - * Returns true, if rotate_first is read, else false. - */ - static boolean read_flip_style_rotate_first(Scanner p_scanner) - { - try - { - boolean result = false; - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.ROTATE_FIRST) - { - if (next_token == Keyword.ROTATE_FIRST) - { - result = true; - } - } - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Structure.read_flip_style: closing bracket expected"); - return false; - } - return result; - } - catch (java.io.IOException e) - { - System.out.println("Structure.read_flip_style: IO error scanning file"); - return false; - } - } - -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Placement.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Placement.java deleted file mode 100644 index d03f9cd..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Placement.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Placement.java - * - * Created on 5. Juli 2004, 08:53 - */ - -package designformats.specctra; - -/** - * Class for writing placement scopes from dsn-files. - * - * @author Alfons Wirtz - */ -public class Placement extends ScopeKeyword -{ - - /** Creates a new instance of Placemet */ - public Placement() - { - super("placement"); - } - - public static void write_scope(WriteScopeParameter p_par) throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("placement"); - if (p_par.board.components.get_flip_style_rotate_first()) - { - p_par.file.new_line(); - p_par.file.write("(place_control (flip_style rotate_first))"); - } - for (int i = 1; i <= p_par.board.library.packages.count(); ++i) - { - Package.write_placement_scope(p_par, p_par.board.library.packages.get(i)); - } - p_par.file.end_scope(); - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Plane.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Plane.java deleted file mode 100644 index f58fab0..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Plane.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Plane.java - * - * Created on 19. Mai 2004, 08:39 - */ - -package designformats.specctra; - - - -/** - * Class for reading and writing plane scopes from dsn-files. - * - * @author alfons - */ -public class Plane extends ScopeKeyword -{ - - /** Creates a new instance of Plane */ - public Plane() - { - super("plane"); - } - - public boolean read_scope(ReadScopeParameter p_par) - { - // read the net name - String net_name = null; - boolean skip_window_scopes = p_par.host_cad != null && p_par.host_cad.equalsIgnoreCase("allegro"); - // Cadence Allegro cutouts the pins on power planes, which leads to performance problems - // when dividing a conduction area into convex pieces. - Shape.ReadAreaScopeResult conduction_area = null; - try - { - Object next_token = p_par.scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Plane.read_scope: String expected"); - return false; - } - net_name = (String) next_token; - conduction_area = Shape.read_area_scope(p_par.scanner, p_par.layer_structure, skip_window_scopes); - } - catch (java.io.IOException e) - { - System.out.println("Plane.read_scope: IO error scanning file"); - System.out.println(e); - return false; - } - ReadScopeParameter.PlaneInfo plane_info = new ReadScopeParameter.PlaneInfo(conduction_area, net_name); - p_par.plane_list.add(plane_info); - return true; - } - - public static void write_scope(WriteScopeParameter p_par, board.ConductionArea p_conduction) throws java.io.IOException - { - int net_count = p_conduction.net_count(); - if (net_count <= 0 || net_count > 1) - { - System.out.println("Plane.write_scope: unexpected net count"); - return; - } - String net_name = p_par.board.rules.nets.get(p_conduction.get_net_no(0)).name; - geometry.planar.Area curr_area = p_conduction.get_area(); - int layer_no = p_conduction.get_layer(); - board.Layer board_layer = p_par.board.layer_structure.arr[ layer_no]; - Layer plane_layer = new Layer(board_layer.name, layer_no, board_layer.is_signal); - geometry.planar.Shape boundary_shape; - geometry.planar.Shape [] holes; - if (curr_area instanceof geometry.planar.Shape) - { - boundary_shape = (geometry.planar.Shape) curr_area; - holes = new geometry.planar.Shape [0]; - } - else - { - boundary_shape = curr_area.get_border(); - holes = curr_area.get_holes(); - } - p_par.file.start_scope(); - p_par.file.write("plane "); - p_par.identifier_type.write(net_name, p_par.file); - Shape dsn_shape = p_par.coordinate_transform.board_to_dsn(boundary_shape, plane_layer); - if (dsn_shape != null) - { - dsn_shape.write_scope(p_par.file, p_par.identifier_type); - } - for (int i = 0; i < holes.length; ++i) - { - Shape dsn_hole = p_par.coordinate_transform.board_to_dsn(holes[i], plane_layer); - dsn_hole.write_hole_scope(p_par.file, p_par.identifier_type); - } - p_par.file.end_scope(); - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Polygon.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Polygon.java deleted file mode 100644 index 3231e54..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Polygon.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Polygon.java - * - * Created on 15. Mai 2004, 08:39 - */ - -package designformats.specctra; -import geometry.planar.IntPoint; -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - -/** - * Describes a polygon in a Specctra dsn file. - * - * @author alfons - */ -public class Polygon extends Shape -{ - /** - * Creates a new instance of Polygon - * p_coor is an array of dimension of dimension 2 * point_count and contains x0, y0, x1, y1, ... - * If the polygon is used as rectangle, - */ - public Polygon(Layer p_layer, double[] p_coor) - { - super(p_layer); - coor = p_coor; - } - - public geometry.planar.Shape transform_to_board(CoordinateTransform p_coordinate_transform) - { - IntPoint [] corner_arr = new IntPoint[coor.length / 2]; - double [] curr_point = new double [2]; - for (int i = 0; i < corner_arr.length; ++i) - { - curr_point[0] = coor[2 * i]; - curr_point[1] = coor[2 * i + 1]; - corner_arr[i] = p_coordinate_transform.dsn_to_board(curr_point).round(); - } - return new geometry.planar.PolygonShape(corner_arr); - } - - public geometry.planar.Shape transform_to_board_rel(CoordinateTransform p_coordinate_transform) - { - if (coor.length < 2) - { - return geometry.planar.Simplex.EMPTY; - } - IntPoint [] corner_arr = new IntPoint[coor.length / 2]; - for (int i = 0; i < corner_arr.length; ++i) - { - int curr_x = (int) Math.round(p_coordinate_transform.dsn_to_board(coor[2 * i])); - int curr_y = (int) Math.round(p_coordinate_transform.dsn_to_board(coor[2 * i + 1])); - corner_arr[i] = new IntPoint(curr_x, curr_y); - } - return new geometry.planar.PolygonShape(corner_arr); - } - - public Rectangle bounding_box() - { - double[] bounds = new double[4]; - bounds[0] = Integer.MAX_VALUE; - bounds[1] = Integer.MAX_VALUE; - bounds[2] = Integer.MIN_VALUE; - bounds[3] = Integer.MIN_VALUE; - for (int i = 0; i < coor.length; ++i) - { - if (i % 2 == 0) - { - // x coordinate - bounds[0] = Math.min(bounds[0], coor[i]); - bounds[2] = Math.max(bounds[2], coor[i]); - } - else - { - // x coordinate - bounds[1] = Math.min(bounds[1], coor[i]); - bounds[3] = Math.max(bounds[3], coor[i]); - } - } - return new Rectangle(layer, bounds); - } - - /** - * Writes this polygon as a scope to an output dsn-file. - */ - public void write_scope(IndentFileWriter p_file, IdentifierType p_identifier_type) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("polygon "); - p_identifier_type.write(this.layer.name, p_file); - p_file.write(" "); - p_file.write((new Integer(0)).toString()); - int corner_count = coor.length/ 2; - for (int i = 0; i < corner_count; ++i) - { - p_file.new_line(); - p_file.write(new Double(coor[2 * i]).toString()); - p_file.write(" "); - p_file.write(new Double(coor[2 * i + 1]).toString()); - } - p_file.end_scope(); - } - - public void write_scope_int(IndentFileWriter p_file, IdentifierType p_identifier_type) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("polygon "); - p_identifier_type.write(this.layer.name, p_file); - p_file.write(" "); - p_file.write((new Integer(0)).toString()); - int corner_count = coor.length/ 2; - for (int i = 0; i < corner_count; ++i) - { - p_file.new_line(); - Integer curr_coor = (int) Math.round(coor[2* i ]); - p_file.write(curr_coor.toString()); - p_file.write(" "); - curr_coor = (int) Math.round(coor[2* i + 1]); - p_file.write(curr_coor.toString()); - } - p_file.end_scope(); - } - - public final double [] coor; -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/PolygonPath.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/PolygonPath.java deleted file mode 100644 index 298b013..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/PolygonPath.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Path.java - * - * Created on 24. Mai 2004, 08:10 - */ - -package designformats.specctra; - -import geometry.planar.FloatPoint; -import geometry.planar.IntPoint; -import geometry.planar.IntOctagon; -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - - -/** - * Class for reading and writing path scopes consisting of a polygon from dsn-files. - * - * @author Alfons Wirtz - */ -public class PolygonPath extends Path -{ - - /** Creates a new instance of PolygonPath */ - public PolygonPath(Layer p_layer, double p_width, double[] p_coordinate_arr) - { - super(p_layer, p_width, p_coordinate_arr); - } - - - /** - * Writes this path as a scope to an output dsn-file. - */ - public void write_scope(IndentFileWriter p_file, IdentifierType p_identifier_type) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("path "); - p_identifier_type.write(this.layer.name, p_file); - p_file.write(" "); - p_file.write((new Double(this.width)).toString()); - int corner_count = coordinate_arr.length/ 2; - for (int i = 0; i < corner_count; ++i) - { - p_file.new_line(); - p_file.write(new Double(coordinate_arr[2 * i]).toString()); - p_file.write(" "); - p_file.write(new Double(coordinate_arr[2 * i + 1]).toString()); - } - p_file.end_scope(); - } - - public void write_scope_int(IndentFileWriter p_file, IdentifierType p_identifier_type) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("path "); - p_identifier_type.write(this.layer.name, p_file); - p_file.write(" "); - p_file.write((new Double(this.width)).toString()); - int corner_count = coordinate_arr.length/ 2; - for (int i = 0; i < corner_count; ++i) - { - p_file.new_line(); - Integer curr_coor = (int) Math.round(coordinate_arr[2* i ]); - p_file.write(curr_coor.toString()); - p_file.write(" "); - curr_coor = (int) Math.round(coordinate_arr[2* i + 1]); - p_file.write(curr_coor.toString()); - } - p_file.end_scope(); - } - - public geometry.planar.Shape transform_to_board(CoordinateTransform p_coordinate_transform) - { - FloatPoint [] corner_arr = new FloatPoint[this.coordinate_arr.length / 2]; - double [] curr_point = new double [2]; - for (int i = 0; i < corner_arr.length; ++i) - { - curr_point[0] = this.coordinate_arr[2 * i]; - curr_point[1] = this.coordinate_arr[2 * i + 1]; - corner_arr[i] = p_coordinate_transform.dsn_to_board(curr_point); - } - double offset = p_coordinate_transform.dsn_to_board(this.width) / 2; - if (corner_arr.length <= 2) - { - IntOctagon bounding_oct = FloatPoint.bounding_octagon(corner_arr); - return bounding_oct.enlarge(offset); - } - IntPoint [] rounded_corner_arr = new IntPoint[corner_arr.length]; - for (int i = 0; i < corner_arr.length; ++i) - { - rounded_corner_arr[i] = corner_arr[i].round(); - } - geometry.planar.Shape result = new geometry.planar.PolygonShape(rounded_corner_arr); - if (offset > 0) - { - result = result.bounding_tile().enlarge(offset); - } - return result; - } - - public geometry.planar.Shape transform_to_board_rel(CoordinateTransform p_coordinate_transform) - { - FloatPoint [] corner_arr = new FloatPoint[this.coordinate_arr.length / 2]; - double [] curr_point = new double [2]; - for (int i = 0; i < corner_arr.length; ++i) - { - curr_point[0] = this.coordinate_arr[2 * i]; - curr_point[1] = this.coordinate_arr[2 * i + 1]; - corner_arr[i] = p_coordinate_transform.dsn_to_board_rel(curr_point); - } - double offset = p_coordinate_transform.dsn_to_board(this.width) / 2; - if (corner_arr.length <= 2) - { - IntOctagon bounding_oct = FloatPoint.bounding_octagon(corner_arr); - return bounding_oct.enlarge(offset); - } - IntPoint [] rounded_corner_arr = new IntPoint[corner_arr.length]; - for (int i = 0; i < corner_arr.length; ++i) - { - rounded_corner_arr[i] = corner_arr[i].round(); - } - geometry.planar.Shape result = new geometry.planar.PolygonShape(rounded_corner_arr); - if (offset > 0) - { - result = result.bounding_tile().enlarge(offset); - } - return result; - } - - public Rectangle bounding_box() - { - double offset = this.width/2; - double[] bounds = new double[4]; - bounds[0] = Integer.MAX_VALUE; - bounds[1] = Integer.MAX_VALUE; - bounds[2] = Integer.MIN_VALUE; - bounds[3] = Integer.MIN_VALUE; - for (int i = 0; i < coordinate_arr.length; ++i) - { - if (i % 2 == 0) - { - // x coordinate - bounds[0] = Math.min(bounds[0], coordinate_arr[i] - offset); - bounds[2] = Math.max(bounds[2], coordinate_arr[i]) + offset; - } - else - { - // x coordinate - bounds[1] = Math.min(bounds[1], coordinate_arr[i] - offset); - bounds[3] = Math.max(bounds[3], coordinate_arr[i] + offset); - } - } - return new Rectangle(layer, bounds); - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/PolylinePath.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/PolylinePath.java deleted file mode 100644 index 2add800..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/PolylinePath.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * PolylinePath.java - * - * Created on 30. Juni 2004, 08:24 - */ - -package designformats.specctra; - -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - - -/** - * Describes a path defined by a sequence of lines (instead of a sequence of corners. - * - * @author alfons - */ -public class PolylinePath extends Path -{ - - /** Creates a new instance of PolylinePath */ - public PolylinePath(Layer p_layer, double p_width, double[] p_corner_arr) - { - super(p_layer, p_width, p_corner_arr); - } - - /** - * Writes this path as a scope to an output dsn-file. - */ - public void write_scope(IndentFileWriter p_file, IdentifierType p_identifier) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("polyline_path "); - p_identifier.write(this.layer.name, p_file); - p_file.write(" "); - p_file.write((new Double(this.width)).toString()); - int line_count = coordinate_arr.length/ 4; - for (int i = 0; i < line_count; ++i) - { - p_file.new_line(); - for (int j = 0; j < 4; ++j) - { - p_file.write(new Double(coordinate_arr[4 * i + j]).toString()); - p_file.write(" "); - } - } - p_file.end_scope(); - } - - public void write_scope_int(IndentFileWriter p_file, IdentifierType p_identifier) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("polyline_path "); - p_identifier.write(this.layer.name, p_file); - p_file.write(" "); - p_file.write((new Double(this.width)).toString()); - int line_count = coordinate_arr.length/ 4; - for (int i = 0; i < line_count; ++i) - { - p_file.new_line(); - for (int j = 0; j < 4; ++j) - { - Integer curr_coor = (int) Math.round(coordinate_arr[4 * i + j]); - p_file.write(curr_coor.toString()); - p_file.write(" "); - } - } - p_file.end_scope(); - } - - public geometry.planar.Shape transform_to_board_rel(CoordinateTransform p_coordinate_transform) - { - System.out.println("PolylinePath.transform_to_board_rel not implemented"); - return null; - } - - public geometry.planar.Shape transform_to_board(CoordinateTransform p_coordinate_transform) - { - System.out.println("PolylinePath.transform_to_board_rel not implemented"); - return null; - } - - - public Rectangle bounding_box() - { - System.out.println("PolylinePath.boundingbox not implemented"); - return null; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/ReadScopeParameter.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/ReadScopeParameter.java deleted file mode 100644 index 0e6d14c..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/ReadScopeParameter.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * ReadScopeParameter.java - * - * Created on 21. Juni 2004, 08:28 - */ - -package designformats.specctra; - -import java.util.Collection; -import java.util.LinkedList; - -/** - * Default parameter type used while reading a Specctra dsn-file. - * - * @author alfons - */ -public class ReadScopeParameter -{ - - /** Creates a new instance of ReadScopeParameter */ - ReadScopeParameter(Scanner p_scanner, interactive.IBoardHandling p_board_handling, - board.BoardObservers p_observers, - datastructures.IdNoGenerator p_item_id_no_generator,board.TestLevel p_test_level) - { - scanner = p_scanner; - board_handling = p_board_handling; - observers = p_observers; - item_id_no_generator = p_item_id_no_generator; - test_level = p_test_level; - } - - final Scanner scanner; - final interactive.IBoardHandling board_handling; - final NetList netlist = new NetList(); - - final board.BoardObservers observers; - final datastructures.IdNoGenerator item_id_no_generator; - final board.TestLevel test_level; - - /** Collection of elements of class PlaneInfo. - * The plane cannot be inserted directly into the boards, because the layers may not be read completely. - */ - final Collection plane_list = new LinkedList(); - - /** - * Component placement information. - * It is filled while reading the placement scope and can be - * evaluated after reading the library and network scope. - */ - final Collection placement_list = new LinkedList(); - - - /** - * The names of the via padstacks filled while reading the structure scope - * and evaluated after reading the library scope. - */ - Collection via_padstack_names = null; - - boolean via_at_smd_allowed = false; - board.AngleRestriction snap_angle = board.AngleRestriction.FORTYFIVE_DEGREE; - - /** The logical parts are used for pin and gate swaw */ - java.util.Collection logical_part_mappings - = new java.util.LinkedList(); - java.util.Collection logical_parts = new java.util.LinkedList(); - - /** The following objects are from the parser scope. */ - String string_quote = "\""; - String host_cad = null; - String host_version = null; - - boolean dsn_file_generated_by_host = true; - - boolean board_outline_ok = true; - - final Collection constants = new LinkedList(); - board.Communication.SpecctraParserInfo.WriteResolution write_resolution = null; - - - /** The following objects will be initialised when the structure scope is read. */ - CoordinateTransform coordinate_transform = null; - LayerStructure layer_structure = null; - interactive.AutorouteSettings autoroute_settings = null; - - board.Unit unit = board.Unit.MIL; - int resolution = 100; // default resulution - - /** Information for inserting a plane */ - static class PlaneInfo - { - PlaneInfo(Shape.ReadAreaScopeResult p_area, String p_net_name) - { - area = p_area; - net_name = p_net_name; - } - - final Shape.ReadAreaScopeResult area; - final String net_name; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Rectangle.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Rectangle.java deleted file mode 100644 index 474d4c5..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Rectangle.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Rectangle.java - * - * Created on 15. Mai 2004, 08:39 - */ - -package designformats.specctra; - -import geometry.planar.FloatPoint; -import geometry.planar.IntBox; -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - -/** - * Describes a rectangle in a Specctra dsn file. - * - * @author alfons - */ -public class Rectangle extends Shape -{ - /** - * Creates a new instance of Rectangle - * p_coor is an array of dimension 4 and contains the rectangle coordinates - * in the following order: lower left x, lower left y, upper right x, uppper right y. - */ - public Rectangle(Layer p_layer, double[] p_coor) - { - super(p_layer); - coor = p_coor; - } - - public Rectangle bounding_box() - { - return this; - } - - /** - * Creates the smallest rectangle containing this rectangle and p_other - */ - public Rectangle union (Rectangle p_other) - { - double[] result_coor = new double[4]; - result_coor[0] = Math.min(this.coor[0], p_other.coor[0]); - result_coor[1] = Math.min(this.coor[1], p_other.coor[1]); - result_coor[2] = Math.max(this.coor[2], p_other.coor[2]); - result_coor[3] = Math.max(this.coor[3], p_other.coor[3]); - return new Rectangle(this.layer, result_coor); - } - - public geometry.planar.Shape transform_to_board_rel(CoordinateTransform p_coordinate_transform) - { - int box_coor[] = new int[4]; - for (int i = 0; i < 4; ++i) - { - box_coor[i] = (int) Math.round(p_coordinate_transform.dsn_to_board(this.coor[i])); - } - - IntBox result; - if (box_coor[1] <= box_coor[3]) - { - // box_coor describe lower left and upper right corner - result = new IntBox(box_coor[0], box_coor[1], box_coor[2], box_coor[3]); - } - else - { - // box_coor describe upper left and lower right corner - result = new IntBox(box_coor[0], box_coor[3], box_coor[2], box_coor[1]); - } - return result; - } - - public geometry.planar.Shape transform_to_board(CoordinateTransform p_coordinate_transform) - { - double [] curr_point = new double [2]; - curr_point[0] = Math.min(coor[0], coor[2]); - curr_point[1] = Math.min(coor[1], coor[3]); - FloatPoint lower_left = p_coordinate_transform.dsn_to_board(curr_point); - curr_point[0] = Math.max(coor[0], coor[2]); - curr_point[1] = Math.max(coor[1], coor[3]); - FloatPoint upper_right= p_coordinate_transform.dsn_to_board(curr_point); - return new IntBox(lower_left.round(), upper_right.round()); - } - - /** - * Writes this rectangle as a scope to an output dsn-file. - */ - public void write_scope(IndentFileWriter p_file, IdentifierType p_identifier) throws java.io.IOException - { - p_file.new_line(); - p_file.write("(rect "); - p_identifier.write(this.layer.name, p_file); - for (int i = 0; i < coor.length; ++i) - { - p_file.write(" "); - p_file.write(new Double(coor[i]).toString()); - } - p_file.write(")"); - } - - public void write_scope_int(IndentFileWriter p_file, IdentifierType p_identifier) throws java.io.IOException - { - p_file.new_line(); - p_file.write("(rect "); - p_identifier.write(this.layer.name, p_file); - for (int i = 0; i < coor.length; ++i) - { - p_file.write(" "); - Integer curr_coor = (int) Math.round(coor[i]); - p_file.write(curr_coor.toString()); - } - p_file.write(")"); - } - - public final double [] coor; -} \ No newline at end of file diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Resolution.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Resolution.java deleted file mode 100644 index 833c84a..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Resolution.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Resolution.java - * - * Created on 30. Oktober 2004, 08:00 - */ - -package designformats.specctra; - -/** - * Class for reading resolution scopes from dsn-files. - * - * @author alfons - */ -public class Resolution extends ScopeKeyword -{ - - /** Creates a new instance of Resolution */ - public Resolution() - { - super("resolution"); - } - - public boolean read_scope(ReadScopeParameter p_par) - { - try - { - // read the unit - Object next_token = p_par.scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Resolution.read_scope: string expected"); - return false; - } - p_par.unit = board.Unit.from_string((String) next_token); - if (p_par.unit == null) - { - System.out.println("Resolution.read_scope: unit mil, inch or mm expected"); - return false; - } - // read the scale factor - next_token = p_par.scanner.next_token(); - if (!(next_token instanceof Integer)) - { - System.out.println("Resolution.read_scope: integer expected"); - return false; - } - p_par.resolution = ((Integer)next_token).intValue(); - // overread the closing bracket - next_token = p_par.scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Resolution.read_scope: closing bracket expected"); - return false; - } - return true; - } - catch (java.io.IOException e) - { - System.out.println("Resolution.read_scope: IO error scanning file"); - return false; - } - } - - public static void write_scope(datastructures.IndentFileWriter p_file, board.Communication p_board_communication) throws java.io.IOException - { - p_file.new_line(); - p_file.write("(resolution "); - p_file.write(p_board_communication.unit.toString()); - p_file.write(" "); - p_file.write((new Integer(p_board_communication.resolution)).toString()); - p_file.write(")"); - } - -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Rule.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Rule.java deleted file mode 100644 index 0b90f3f..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Rule.java +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Rule.java - * - * Created on 1. Juni 2004, 09:27 - */ - -package designformats.specctra; - -import java.util.Collection; -import java.util.LinkedList; - - -/** - * Class for reading and writing rule scopes from dsn-files. - * - * @author Alfons Wirtz - */ -public abstract class Rule -{ - /** - * Returns a collection of objects of class Rule. - */ - public static Collection read_scope( Scanner p_scanner) - { - Collection result = new LinkedList(); - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Rule.read_scope: IO error scanning file"); - System.out.println(e); - return null; - } - if (next_token == null) - { - System.out.println("Rule.read_scope: unexpected end of file"); - return null; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == Keyword.OPEN_BRACKET) - { - Rule curr_rule = null; - if (next_token == Keyword.WIDTH) - { - curr_rule = read_width_rule(p_scanner); - } - else if (next_token == Keyword.CLEARANCE) - { - curr_rule = read_clearance_rule(p_scanner); - } - else - { - ScopeKeyword.skip_scope(p_scanner); - } - if (curr_rule != null) - { - result.add(curr_rule); - } - - } - } - return result; - } - - /** - * Reads a LayerRule from dsn-file. - */ - public static LayerRule read_layer_rule_scope( Scanner p_scanner) - { - try - { - Collection layer_names = new LinkedList(); - Collection rule_list = new LinkedList(); - for (;;) - { - p_scanner.yybegin(SpecctraFileScanner.LAYER_NAME); - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.OPEN_BRACKET) - { - break; - } - if (!(next_token instanceof String)) - { - - System.out.println("Rule.read_layer_rule_scope: string expected"); - return null; - } - layer_names.add((String) next_token); - } - for (;;) - { - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - if (next_token != Keyword.RULE) - { - - System.out.println("Rule.read_layer_rule_scope: rule expected"); - return null; - } - rule_list.addAll(read_scope(p_scanner)); - } - return new LayerRule(layer_names, rule_list); - } - catch (java.io.IOException e) - { - System.out.println("Rule.read_layer_rule_scope: IO error scanning file"); - return null; - } - } - - public static WidthRule read_width_rule(Scanner p_scanner) - { - try - { - double value; - Object next_token = p_scanner.next_token(); - if (next_token instanceof Double) - { - value = ((Double) next_token).doubleValue(); - } - else if (next_token instanceof Integer) - { - value = ((Integer) next_token).intValue(); - } - else - { - System.out.println("Rule.read_width_rule: number expected"); - return null; - } - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Rule.read_width_rule: closing bracket expected"); - return null; - } - return new WidthRule(value); - } - catch (java.io.IOException e) - { - System.out.println("Rule.read_width_rule: IO error scanning file"); - return null; - } - } - - public static void write_scope(rules.NetClass p_net_class, WriteScopeParameter p_par) throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("rule"); - - // write the trace width - int default_trace_half_width = p_net_class.get_trace_half_width(0); - double trace_width = 2 * p_par.coordinate_transform.board_to_dsn(default_trace_half_width); - p_par.file.new_line(); - p_par.file.write("(width "); - p_par.file.write((new Double(trace_width)).toString()); - p_par.file.write(")"); - p_par.file.end_scope(); - for (int i = 1; i < p_par.board.layer_structure.arr.length; ++i) - { - if (p_net_class.get_trace_half_width(i) != default_trace_half_width) - { - write_layer_rule(p_net_class, i, p_par); - } - } - } - - private static void write_layer_rule(rules.NetClass p_net_class, int p_layer_no, WriteScopeParameter p_par) throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("layer_rule "); - - board.Layer curr_board_layer = p_par.board.layer_structure.arr[p_layer_no]; - - p_par.file.write(curr_board_layer.name); - p_par.file.start_scope(); - p_par.file.write("rule "); - - int curr_trace_half_width = p_net_class.get_trace_half_width(p_layer_no); - - // write the trace width - double trace_width = 2 * p_par.coordinate_transform.board_to_dsn(curr_trace_half_width); - p_par.file.new_line(); - p_par.file.write("(width "); - p_par.file.write((new Double(trace_width)).toString()); - p_par.file.write(") "); - p_par.file.end_scope(); - p_par.file.end_scope(); - } - - /** - * Writes the default rule as a scope to an output dsn-file. - */ - public static void write_default_rule(WriteScopeParameter p_par, int p_layer) throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("rule"); - // write the trace width - double trace_width = 2 * p_par.coordinate_transform.board_to_dsn(p_par.board.rules.get_default_net_class().get_trace_half_width(0)); - p_par.file.new_line(); - p_par.file.write("(width "); - p_par.file.write((new Double(trace_width)).toString()); - p_par.file.write(")"); - // write the default clearance rule - int default_cl_no = rules.BoardRules.default_clearance_class(); - int default_board_clearance = p_par.board.rules.clearance_matrix.value(default_cl_no, default_cl_no, p_layer); - double default_clearance = p_par.coordinate_transform.board_to_dsn(default_board_clearance); - p_par.file.new_line(); - p_par.file.write("(clear "); - p_par.file.write((new Double(default_clearance)).toString()); - p_par.file.write(")"); - // write the Smd_to_turn_gap - Double smd_to_turn_dist = p_par.coordinate_transform.board_to_dsn(p_par.board.rules.get_pin_edge_to_turn_dist()); - p_par.file.new_line(); - p_par.file.write("(clear "); - p_par.file.write(smd_to_turn_dist.toString()); - p_par.file.write(" (type smd_to_turn_gap))"); - int cl_count = p_par.board.rules.clearance_matrix.get_class_count(); - for (int i = 1; i <= cl_count; ++i) - { - write_clearance_rules(p_par, p_layer, i, cl_count, default_board_clearance); - } - p_par.file.end_scope(); - } - - /** - * Write the clearance rules, which are different from the default clearance. - */ - private static void write_clearance_rules(WriteScopeParameter p_par, - int p_layer, int p_cl_class, int p_max_cl_class, int p_default_clearance) throws java.io.IOException - { - rules.ClearanceMatrix cl_matrix = p_par.board.rules.clearance_matrix; - for (int i = p_cl_class; i < p_max_cl_class; ++i) - { - int curr_board_clearance = cl_matrix.value(p_cl_class, i, p_layer); - if (curr_board_clearance == p_default_clearance) - { - continue; - } - double curr_clearance = p_par.coordinate_transform.board_to_dsn(curr_board_clearance); - p_par.file.new_line(); - p_par.file.write("(clear "); - p_par.file.write((new Double(curr_clearance)).toString()); - p_par.file.write(" (type "); - p_par.identifier_type.write(cl_matrix.get_name(p_cl_class), p_par.file); - p_par.file.write("_"); - p_par.identifier_type.write(cl_matrix.get_name(i), p_par.file); - p_par.file.write("))"); - } - } - - public static ClearanceRule read_clearance_rule(Scanner p_scanner) - { - try - { - double value; - Object next_token = p_scanner.next_token(); - if (next_token instanceof Double) - { - value = ((Double) next_token).doubleValue(); - } - else if (next_token instanceof Integer) - { - value = ((Integer) next_token).intValue(); - } - else - { - System.out.println("Rule.read_clearance_rule: number expected"); - return null; - } - Collection class_pairs = new LinkedList (); - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - if (next_token != Keyword.OPEN_BRACKET) - { - System.out.println("Rule.read_clearance_rule: ( expected"); - return null; - } - next_token = p_scanner.next_token(); - if (next_token != Keyword.TYPE) - { - System.out.println("Rule.read_clearance_rule: type expected"); - return null; - } - for (;;) - { - p_scanner.yybegin(SpecctraFileScanner.IGNORE_QUOTE); - next_token = p_scanner.next_token(); - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - if (!(next_token instanceof String)) - { - System.out.println("Rule.read_clearance_rule: string expected"); - return null; - } - class_pairs.add((String)next_token); - } - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Rule.read_clearance_rule: closing bracket expected"); - return null; - } - } - return new ClearanceRule(value, class_pairs); - } - catch (java.io.IOException e) - { - System.out.println("Rule.read_clearance_rule: IO error scanning file"); - return null; - } - - } - - static public void write_item_clearance_class( String p_name, datastructures.IndentFileWriter p_file, - datastructures.IdentifierType p_identifier_type) throws java.io.IOException - { - p_file.new_line(); - p_file.write("(clearance_class "); - p_identifier_type.write(p_name, p_file); - p_file.write(")"); - } - - public static class WidthRule extends Rule - { - public WidthRule(double p_value) - { - value = p_value; - } - final double value; - } - - public static class ClearanceRule extends Rule - { - public ClearanceRule(double p_value, Collection p_class_pairs) - { - value = p_value; - clearance_class_pairs = p_class_pairs; - } - final double value; - final Collection clearance_class_pairs; - } - - public static class LayerRule - { - LayerRule(Collection p_layer_names, Collection p_rules) - { - layer_names = p_layer_names; - rules = p_rules; - } - final Collection layer_names; - final Collection rules; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/RulesFile.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/RulesFile.java deleted file mode 100644 index 23dc7d6..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/RulesFile.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * RulesFile.java - * - * Created on 18. Juli 2005, 07:07 - * - */ - -package designformats.specctra; - -import datastructures.IndentFileWriter; - -import board.BasicBoard; - -/** - * File for saving the board rules, so that they can be restored after the Board - * is creates anew from the host system. - * - * @author Alfons Wirtz - */ -public class RulesFile -{ - - public static void write(interactive.BoardHandling p_board_handling, java.io.OutputStream p_output_stream, String p_design_name) - { - IndentFileWriter output_file = new IndentFileWriter(p_output_stream); - BasicBoard routing_board = p_board_handling.get_routing_board(); - WriteScopeParameter write_scope_parameter = - new WriteScopeParameter(routing_board, p_board_handling.settings.autoroute_settings, - output_file, routing_board.communication.specctra_parser_info.string_quote, - routing_board.communication.coordinate_transform, false); - try - { - write_rules(write_scope_parameter, p_design_name); - } - catch (java.io.IOException e) - { - System.out.println("unable to write rules to file"); - } - try - { - output_file.close(); - } - catch (java.io.IOException e) - { - System.out.println("unable to close rules file"); - } - } - - public static boolean read(java.io.InputStream p_input_stream, String p_design_name, - interactive.BoardHandling p_board_handling) - { - BasicBoard routing_board = p_board_handling.get_routing_board(); - Scanner scanner = new SpecctraFileScanner(p_input_stream); - try - { - Object curr_token = scanner.next_token(); - if (curr_token != Keyword.OPEN_BRACKET) - { - System.out.println("RulesFile.read: open bracket expected"); - return false; - } - curr_token = scanner.next_token(); - if (curr_token != Keyword.RULES) - { - System.out.println("RulesFile.read: keyword rules expected"); - return false; - } - curr_token = scanner.next_token(); - if (curr_token != Keyword.PCB_SCOPE) - { - System.out.println("RulesFile.read: keyword pcb expected"); - return false; - } - scanner.yybegin(SpecctraFileScanner.NAME); - curr_token = scanner.next_token(); - if (!(curr_token instanceof String) || !((String) curr_token).equals(p_design_name)) - { - System.out.println("RulesFile.read: design_name not matching"); - return false; - } - } - catch (java.io.IOException e) - { - System.out.println("RulesFile.read: IO error scanning file"); - return false; - } - LayerStructure layer_structure = new LayerStructure(routing_board.layer_structure); - CoordinateTransform coordinate_transform = routing_board.communication.coordinate_transform; - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("RulesFile.read: IO error scanning file"); - return false; - } - if (next_token == null) - { - System.out.println("Structure.read_scope: unexpected end of file"); - return false; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - boolean read_ok = true; - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.RULE) - { - add_rules(Rule.read_scope(scanner), routing_board, null); - } - else if (next_token == Keyword.LAYER) - { - add_layer_rules(scanner, routing_board); - } - else if (next_token == Keyword.PADSTACK) - { - Library.read_padstack_scope(scanner, layer_structure, coordinate_transform, routing_board.library.padstacks); - } - else if (next_token == Keyword.VIA) - { - read_via_info(scanner, routing_board); - } - else if (next_token == Keyword.VIA_RULE) - { - read_via_rule(scanner, routing_board); - } - else if (next_token == Keyword.CLASS) - { - read_net_class(scanner, layer_structure, routing_board); - } - else if (next_token == Keyword.SNAP_ANGLE) - { - - board.AngleRestriction snap_angle = Structure.read_snap_angle(scanner); - if (snap_angle != null) - { - routing_board.rules.set_trace_angle_restriction(snap_angle); - } - } - else if (next_token == Keyword.AUTOROUTE_SETTINGS) - { - interactive.AutorouteSettings autoroute_settings - = AutorouteSettings.read_scope(scanner, layer_structure); - if (autoroute_settings != null) - { - p_board_handling.settings.autoroute_settings = autoroute_settings; - } - } - else - { - ScopeKeyword.skip_scope(scanner); - } - } - if (!read_ok) - { - return false; - } - } - return true; - } - - private static void write_rules( WriteScopeParameter p_par, String p_design_name) throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("rules PCB "); - p_par.file.write(p_design_name); - Structure.write_snap_angle(p_par.file, p_par.board.rules.get_trace_angle_restriction()); - AutorouteSettings.write_scope(p_par.file, p_par.autoroute_settings, - p_par.board.layer_structure, p_par.identifier_type); - // write the default rule using 0 as default layer. - Rule.write_default_rule(p_par, 0); - // write the via padstacks - for (int i = 1; i <= p_par.board.library.padstacks.count(); ++i) - { - library.Padstack curr_padstack = p_par.board.library.padstacks.get(i); - if (p_par.board.library.get_via_padstack(curr_padstack.name )!= null) - { - Library.write_padstack_scope(p_par, curr_padstack); - } - } - Network.write_via_infos(p_par.board.rules, p_par.file, p_par.identifier_type); - Network.write_via_rules(p_par.board.rules, p_par.file, p_par.identifier_type); - Network.write_net_classes(p_par); - p_par.file.end_scope(); - } - - private static void add_rules(java.util.Collection p_rules, BasicBoard p_board, String p_layer_name) - { - int layer_no = -1; - if (p_layer_name != null) - { - layer_no = p_board.layer_structure.get_no(p_layer_name); - if (layer_no < 0) - { - System.out.println("RulesFile.add_rules: layer not found"); - } - } - CoordinateTransform coordinate_transform = p_board.communication.coordinate_transform; - String string_quote = p_board.communication.specctra_parser_info.string_quote; - for (Rule curr_rule : p_rules) - { - if (curr_rule instanceof Rule.WidthRule) - { - double wire_width = ((Rule.WidthRule)curr_rule).value; - int trace_halfwidth = (int) Math.round(coordinate_transform.dsn_to_board(wire_width) / 2); - if (layer_no < 0) - { - p_board.rules.set_default_trace_half_widths(trace_halfwidth); - } - else - { - p_board.rules.set_default_trace_half_width(layer_no, trace_halfwidth); - } - } - else if (curr_rule instanceof Rule.ClearanceRule) - { - Structure.set_clearance_rule(( Rule.ClearanceRule)curr_rule, layer_no, coordinate_transform, p_board.rules, string_quote); - } - } - } - - private static boolean add_layer_rules(Scanner p_scanner, BasicBoard p_board) - { - try - { - Object next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("RulesFile.add_layer_rules: String expected"); - return false; - } - String layer_string = (String) next_token; - next_token = p_scanner.next_token(); - while (next_token != Keyword.CLOSED_BRACKET) - { - if (next_token != Keyword.OPEN_BRACKET) - { - System.out.println("RulesFile.add_layer_rules: ( expected"); - return false; - } - next_token = p_scanner.next_token(); - if (next_token == Keyword.RULE) - { - java.util.Collection curr_rules = Rule.read_scope(p_scanner); - add_rules(curr_rules, p_board, layer_string); - } - else - { - ScopeKeyword.skip_scope(p_scanner); - } - next_token = p_scanner.next_token(); - } - return true; - } - catch (java.io.IOException e) - { - System.out.println("RulesFile.add_layer_rules: IO error scanning file"); - return false; - } - } - private static boolean read_via_info(Scanner p_scanner, BasicBoard p_board) - { - rules.ViaInfo curr_via_info = Network.read_via_info(p_scanner, p_board); - if (curr_via_info == null) - { - return false; - } - rules.ViaInfo existing_via = p_board.rules.via_infos.get(curr_via_info.get_name()); - if (existing_via != null) - { - // replace existing via info - p_board.rules.via_infos.remove(existing_via); - } - p_board.rules.via_infos.add(curr_via_info); - return true; - } - - private static boolean read_via_rule(Scanner p_scanner, BasicBoard p_board) - { - java.util.Collection via_rule = Network.read_via_rule(p_scanner, p_board); - if (via_rule == null) - { - return false; - } - Network.add_via_rule(via_rule, p_board); - return true; - } - - private static boolean read_net_class(Scanner p_scanner, LayerStructure p_layer_structure, BasicBoard p_board) - { - NetClass curr_class = NetClass.read_scope(p_scanner); - if (curr_class == null) - { - return false; - } - Network.insert_net_class(curr_class, p_layer_structure, p_board, p_board.communication.coordinate_transform, false); - return true; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Scanner.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Scanner.java deleted file mode 100644 index 70c924b..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Scanner.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Scanner.java - * - * Created on 4. Juli 2004, 19:13 - */ - -package designformats.specctra; - -/** - * Interface for scanner generated by jflex. - * - * @author alfons - */ -public interface Scanner -{ - /** - * Reads the next token from the input file. - */ - Object next_token() throws java.io.IOException; - - /** - * Starts a new state. - */ - void yybegin(int p_new_state); -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/ScopeKeyword.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/ScopeKeyword.java deleted file mode 100644 index f64b2bf..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/ScopeKeyword.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * ScopeKeyword.java - * - * Created on 12. Mai 2004, 08:47 - */ - -package designformats.specctra; - -/** - * - * @author alfons - */ - -/** Keywords defining a scope object*/ -public class ScopeKeyword extends Keyword -{ - public ScopeKeyword(String p_name) - { - super(p_name); - } - - /** - * Scips the current scope while reading a dsn file. - * Returns false, if no legal scope was found. - */ - public static boolean skip_scope(Scanner p_scanner) - { - int open_bracked_count = 1; - while (open_bracked_count > 0) - { - p_scanner.yybegin(SpecctraFileScanner.NAME); - Object curr_token = null; - try - { - curr_token = p_scanner.next_token(); - } - catch (Exception e) - { - System.out.println("ScopeKeyword.skip_scope: Error while scanning file"); - System.out.println(e); - return false; - } - if (curr_token == null) - { - return false; // end of file - } - if (curr_token == Keyword.OPEN_BRACKET) - { - ++open_bracked_count; - } - else if (curr_token == Keyword.CLOSED_BRACKET) - { - --open_bracked_count; - } - } - return true; - } - - /** - * Reads the next scope of this keyword from dsn file. - */ - public boolean read_scope(ReadScopeParameter p_par) - { - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_par.scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("ScopeKeyword.read_scope: IO error scanning file"); - System.out.println(e); - return false; - } - if (next_token == null) - { - // end of file - return true; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - - if (prev_token == OPEN_BRACKET) - { - ScopeKeyword next_scope; - // a new scope is expected - if (next_token instanceof ScopeKeyword) - { - next_scope = (ScopeKeyword) next_token; - if (!next_scope.read_scope(p_par)) - { - return false; - } - - } - else - { - // skip unknown scope - skip_scope(p_par.scanner); - } - - } - } - return true; - } -} - diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SessionFile.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SessionFile.java deleted file mode 100644 index cc739b2..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SessionFile.java +++ /dev/null @@ -1,522 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * SessionFile.java - * - * Created on 29. Oktober 2004, 08:01 - */ - -package designformats.specctra; - -import java.util.Collection; -import java.util.Iterator; - -import geometry.planar.FloatPoint; -import geometry.planar.Point; - -import board.BasicBoard; -import board.PolylineTrace; -import board.Via; -import board.ConductionArea; -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - -/** - * Methods to handle a Specctra session file. - * - * @author alfons - */ -public class SessionFile -{ - /** - * Creates a Specctra session file to update the host system from the RoutingBooard - */ - public static boolean write( BasicBoard p_board, java.io.OutputStream p_output_stream, String p_design_name) - { - if (p_output_stream == null) - { - return false; - } - IndentFileWriter output_file = null; - try - { - output_file = new IndentFileWriter(p_output_stream); - } - catch (Exception e) - { - System.out.println("unable to create session file"); - return false; - } - String session_name = p_design_name.replace(".dsn", ".ses"); - try - { - String [] reserved_chars = {"(", ")", " ", "-"}; - IdentifierType identifier_type = new IdentifierType(reserved_chars, p_board.communication.specctra_parser_info.string_quote); - write_session_scope(p_board, identifier_type, output_file, session_name, p_design_name); - } - catch (java.io.IOException e) - { - System.out.println("unable to write session file"); - return false; - } - try - { - output_file.close(); - } - catch (java.io.IOException e) - { - System.out.println("unable to close session file"); - return false; - } - return true; - } - - private static void write_session_scope(BasicBoard p_board, IdentifierType p_identifier_type, - IndentFileWriter p_file, String p_session_name, String p_design_name) throws java.io.IOException - { - double scale_factor = p_board.communication.coordinate_transform.dsn_to_board(1)/p_board.communication.resolution; - CoordinateTransform coordinate_transform = new CoordinateTransform(scale_factor, 0, 0); - p_file.start_scope(); - p_file.write("session "); - p_identifier_type.write(p_session_name, p_file); - p_file.new_line(); - p_file.write("(base_design "); - p_identifier_type.write(p_design_name, p_file); - p_file.write(")"); - write_placement(p_board, p_identifier_type, coordinate_transform, p_file); - write_was_is(p_board, p_identifier_type, p_file); - write_routes(p_board, p_identifier_type, coordinate_transform, p_file); - p_file.end_scope(); - } - - public static void write_placement(BasicBoard p_board, IdentifierType p_identifier_type, - CoordinateTransform p_coordinate_transform, IndentFileWriter p_file) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("placement"); - Resolution.write_scope(p_file, p_board.communication); - - for (int i = 1; i <= p_board.library.packages.count(); ++i) - { - write_components(p_board, p_identifier_type, p_coordinate_transform, p_file, p_board.library.packages.get(i)); - } - p_file.end_scope(); - } - - /** - * Writes all components with the package p_package to the session file. - */ - public static void write_components(BasicBoard p_board, IdentifierType p_identifier_type, CoordinateTransform p_coordinate_transform, - IndentFileWriter p_file, library.Package p_package) throws java.io.IOException - { - Collection board_items = p_board.get_items(); - boolean component_found = false; - for (int i = 1; i <= p_board.components.count(); ++i) - { - board.Component curr_component = p_board.components.get(i); - if (curr_component.get_package() == p_package) - { - // check, if not all items of the component are deleted - boolean undeleted_item_found = false; - Iterator it = board_items.iterator(); - while (it.hasNext()) - { - board.Item curr_item = it.next(); - if (curr_item.get_component_no() == curr_component.no) - { - undeleted_item_found = true; - break; - } - } - if (undeleted_item_found) - { - if (!component_found) - { - // write the scope header - p_file.start_scope(); - p_file.write("component "); - p_identifier_type.write(p_package.name, p_file); - component_found = true; - } - write_component(p_board, p_identifier_type, p_coordinate_transform, p_file, curr_component); - } - } - } - if (component_found) - { - p_file.end_scope(); - } - } - - public static void write_component(BasicBoard p_board, IdentifierType p_identifier_type, CoordinateTransform p_coordinate_transform, - IndentFileWriter p_file, board.Component p_component) throws java.io.IOException - { - p_file.new_line(); - p_file.write("(place "); - p_identifier_type.write(p_component.name, p_file); - double[] location = p_coordinate_transform.board_to_dsn(p_component.get_location().to_float()); - Integer x_coor = (int) Math.round(location[0]); - Integer y_coor = (int) Math.round(location[1]); - p_file.write(" "); - p_file.write(x_coor.toString()); - p_file.write(" "); - p_file.write(y_coor.toString()); - if (p_component.placed_on_front()) - { - p_file.write(" front "); - } - else - { - p_file.write(" back "); - } - int rotation = (int) Math.round(p_component.get_rotation_in_degree()); - p_file.write((new Integer(rotation).toString())); - if (p_component.position_fixed) - { - p_file.new_line(); - p_file.write(" (lock_type position)"); - } - p_file.write(")"); - } - - public static void write_was_is(BasicBoard p_board, IdentifierType p_identifier_type, - IndentFileWriter p_file) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("was_is"); - Collection board_pins = p_board.get_pins(); - for (board.Pin curr_pin : board_pins) - { - board.Pin swapped_with = curr_pin.get_changed_to(); - if (curr_pin.get_changed_to() != curr_pin) - { - p_file.new_line(); - p_file.write("(pins "); - board.Component curr_cmp = p_board.components.get(curr_pin.get_component_no()); - if (curr_cmp != null) - { - p_identifier_type.write(curr_cmp.name, p_file); - p_file.write("-"); - library.Package.Pin package_pin = curr_cmp.get_package().get_pin(curr_pin.get_index_in_package()); - p_identifier_type.write(package_pin.name, p_file); - } - else - { - System.out.println("SessionFile.write_was_is: component not found"); - } - p_file.write(" "); - board.Component swap_cmp = p_board.components.get(swapped_with.get_component_no()); - if (swap_cmp != null) - { - p_identifier_type.write(swap_cmp.name, p_file); - p_file.write("-"); - library.Package.Pin package_pin = swap_cmp.get_package().get_pin(swapped_with.get_index_in_package()); - p_identifier_type.write(package_pin.name, p_file); - } - else - { - System.out.println("SessionFile.write_was_is: component not found"); - } - p_file.write(")"); - } - } - p_file.end_scope(); - } - - private static void write_routes(BasicBoard p_board, IdentifierType p_identifier_type, CoordinateTransform p_coordinate_transform, - IndentFileWriter p_file) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("routes "); - Resolution.write_scope(p_file, p_board.communication); - Parser.write_scope(p_file,p_board.communication.specctra_parser_info, p_identifier_type, true); - write_library(p_board, p_identifier_type, p_coordinate_transform, p_file); - write_network(p_board, p_identifier_type, p_coordinate_transform, p_file); - p_file.end_scope(); - } - - private static void write_library(BasicBoard p_board, IdentifierType p_identifier_type, CoordinateTransform p_coordinate_transform, - IndentFileWriter p_file) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("library_out "); - for (int i = 0; i < p_board.library.via_padstack_count(); ++i) - { - write_padstack(p_board.library.get_via_padstack(i), p_board, p_identifier_type, p_coordinate_transform, p_file); - } - p_file.end_scope(); - } - - private static void write_padstack(library.Padstack p_padstack, BasicBoard p_board, IdentifierType p_identifier_type, - CoordinateTransform p_coordinate_transform, IndentFileWriter p_file) - throws java.io.IOException - { - // search the layer range of the padstack - int first_layer_no = 0; - while (first_layer_no < p_board.get_layer_count()) - { - if (p_padstack.get_shape(first_layer_no) != null) - { - break; - } - ++first_layer_no; - } - int last_layer_no = p_board.get_layer_count() - 1; - while (last_layer_no >= 0 ) - { - if (p_padstack.get_shape(last_layer_no) != null) - { - break; - } - --last_layer_no; - } - if (first_layer_no >= p_board.get_layer_count() || last_layer_no < 0) - { - System.out.println("SessionFile.write_padstack: padstack shape not found"); - return; - } - - p_file.start_scope(); - p_file.write("padstack "); - p_identifier_type.write(p_padstack.name, p_file); - for (int i = first_layer_no; i <= last_layer_no; ++i) - { - geometry.planar.Shape curr_board_shape = p_padstack.get_shape(i); - if (curr_board_shape == null) - { - continue; - } - board.Layer board_layer = p_board.layer_structure.arr[i]; - Layer curr_layer = new Layer(board_layer.name, i, board_layer.is_signal); - Shape curr_shape = p_coordinate_transform.board_to_dsn_rel(curr_board_shape, curr_layer); - p_file.start_scope(); - p_file.write("shape"); - curr_shape.write_scope_int(p_file, p_identifier_type); - p_file.end_scope(); - } - if (!p_padstack.attach_allowed) - { - p_file.new_line(); - p_file.write("(attach off)"); - } - p_file.end_scope(); - } - - - - private static void write_network(BasicBoard p_board, IdentifierType p_identifier_type, CoordinateTransform p_coordinate_transform, - IndentFileWriter p_file) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("network_out "); - for (int i = 1; i <= p_board.rules.nets.max_net_no(); ++i) - { - write_net(i, p_board, p_identifier_type, p_coordinate_transform, p_file); - } - p_file.end_scope(); - } - - private static void write_net(int p_net_no, BasicBoard p_board, IdentifierType p_identifier_type, CoordinateTransform p_coordinate_transform, - IndentFileWriter p_file) throws java.io.IOException - { - Collection net_items = p_board.get_connectable_items(p_net_no); - boolean header_written = false; - Iterator it = net_items.iterator(); - while (it.hasNext()) - { - board.Item curr_item = it.next(); - if (curr_item.get_fixed_state() == board.FixedState.SYSTEM_FIXED) - { - continue; - } - boolean is_wire = curr_item instanceof PolylineTrace; - boolean is_via = curr_item instanceof Via; - boolean is_conduction_area = curr_item instanceof ConductionArea - && p_board.layer_structure.arr [curr_item.first_layer()].is_signal; - if (!header_written && (is_wire || is_via || is_conduction_area)) - { - p_file.start_scope(); - p_file.write("net "); - rules.Net curr_net = p_board.rules.nets.get(p_net_no); - if (curr_net == null) - { - System.out.println("SessionFile.write_net: net not found"); - } - else - { - p_identifier_type.write(curr_net.name, p_file); - } - header_written = true; - } - if (is_wire) - { - write_wire((PolylineTrace)curr_item, p_board, p_identifier_type, p_coordinate_transform, p_file); - } - else if (is_via) - { - write_via((Via) curr_item, p_board, p_identifier_type, p_coordinate_transform, p_file); - } - else if (is_conduction_area) - { - write_conduction_area( (ConductionArea) curr_item, p_board, p_identifier_type, - p_coordinate_transform, p_file); - } - } - if (header_written) - { - p_file.end_scope(); - } - } - - private static void write_wire(PolylineTrace p_wire, BasicBoard p_board, IdentifierType p_identifier_type, - CoordinateTransform p_coordinate_transform, IndentFileWriter p_file) throws java.io.IOException - { - int layer_no = p_wire.get_layer(); - board.Layer board_layer = p_board.layer_structure.arr[layer_no]; - int wire_width = (int) Math.round(p_coordinate_transform.board_to_dsn(2 * p_wire.get_half_width())); - p_file.start_scope(); - p_file.write("wire"); - Point[] corner_arr = p_wire.polyline().corner_arr(); - int [] coors = new int [2 * corner_arr.length]; - int corner_index = 0; - int [] prev_coors = null; - for (int i = 0; i < corner_arr.length; ++i) - { - double[] curr_float_coors = p_coordinate_transform.board_to_dsn(corner_arr[i].to_float()); - int [] curr_coors = new int[2]; - curr_coors[0] = (int) Math.round(curr_float_coors[0]); - curr_coors[1] = (int) Math.round(curr_float_coors[1]); - if (i == 0 || ( curr_coors[0] != prev_coors[0] || curr_coors[1] != prev_coors[1])) - { - coors[corner_index] = curr_coors[0]; - ++corner_index; - coors[corner_index] = curr_coors[1]; - ++corner_index; - prev_coors = curr_coors; - - } - } - if (corner_index < coors.length) - { - int [] adjusted_coors = new int[corner_index]; - for (int i = 0; i < adjusted_coors.length; ++i) - { - adjusted_coors[i] = coors[i]; - } - coors = adjusted_coors; - } - write_path(board_layer.name, wire_width, coors, p_identifier_type, p_file); - write_fixed_state(p_file, p_wire.get_fixed_state()); - p_file.end_scope(); - } - - private static void write_via(Via p_via, BasicBoard p_board, IdentifierType p_identifier_type, - CoordinateTransform p_coordinate_transform, IndentFileWriter p_file) throws java.io.IOException - { - library.Padstack via_padstack = p_via.get_padstack(); - FloatPoint via_location = p_via.get_center().to_float(); - p_file.start_scope(); - p_file.write("via "); - p_identifier_type.write(via_padstack.name, p_file); - p_file.write(" "); - double[] location = p_coordinate_transform.board_to_dsn(via_location); - Integer x_coor = (int) Math.round(location[0]); - p_file.write(x_coor.toString()); - p_file.write(" "); - Integer y_coor = (int) Math.round(location[1]); - p_file.write(y_coor.toString()); - write_fixed_state(p_file, p_via.get_fixed_state()); - p_file.end_scope(); - } - - static private void write_fixed_state(IndentFileWriter p_file, board.FixedState p_fixed_state) throws java.io.IOException - { - if (p_fixed_state.ordinal() <= board.FixedState.SHOVE_FIXED.ordinal()) - { - return; - } - p_file.new_line(); - p_file.write("(type "); - if (p_fixed_state == board.FixedState.SYSTEM_FIXED) - { - p_file.write("fix)"); - } - else - { - p_file.write("protect)"); - } - } - - private static void write_path(String p_layer_name, int p_width, int[] p_coors, IdentifierType p_identifier_type, - IndentFileWriter p_file) - throws java.io.IOException - { - p_file.start_scope(); - p_file.write("path "); - p_identifier_type.write(p_layer_name, p_file); - p_file.write(" "); - p_file.write((new Integer(p_width)).toString()); - int corner_count = p_coors.length/ 2; - for (int i = 0; i < corner_count; ++i) - { - p_file.new_line(); - p_file.write(new Integer(p_coors[2 * i]).toString()); - p_file.write(" "); - p_file.write(new Integer(p_coors[2 * i + 1]).toString()); - } - p_file.end_scope(); - } - - private static void write_conduction_area( ConductionArea p_conduction_area, BasicBoard p_board, - IdentifierType p_identifier_type, CoordinateTransform p_coordinate_transform, - IndentFileWriter p_file) throws java.io.IOException - { - int net_count = p_conduction_area.net_count(); - if (net_count <= 0 || net_count > 1) - { - System.out.println("SessionFile.write_conduction_area: unexpected net count"); - return; - } - geometry.planar.Area curr_area = p_conduction_area.get_area(); - int layer_no = p_conduction_area.get_layer(); - board.Layer board_layer = p_board.layer_structure.arr[ layer_no]; - Layer conduction_layer = new Layer(board_layer.name, layer_no, board_layer.is_signal); - geometry.planar.Shape boundary_shape; - geometry.planar.Shape [] holes; - if (curr_area instanceof geometry.planar.Shape) - { - boundary_shape = (geometry.planar.Shape) curr_area; - holes = new geometry.planar.Shape [0]; - } - else - { - boundary_shape = curr_area.get_border(); - holes = curr_area.get_holes(); - } - p_file.start_scope(); - p_file.write("wire "); - Shape dsn_shape = p_coordinate_transform.board_to_dsn(boundary_shape, conduction_layer); - if (dsn_shape != null) - { - dsn_shape.write_scope_int(p_file, p_identifier_type); - } - for (int i = 0; i < holes.length; ++i) - { - Shape dsn_hole = p_coordinate_transform.board_to_dsn(holes[i], conduction_layer); - dsn_hole.write_hole_scope(p_file, p_identifier_type); - } - p_file.end_scope(); - } -} \ No newline at end of file diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SessionToEagle.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SessionToEagle.java deleted file mode 100644 index d1180ad..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SessionToEagle.java +++ /dev/null @@ -1,738 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * SessionToEagle.java - * - * Created on 8. Dezember 2004, 07:42 - */ - -package designformats.specctra; - - -/** - * Transformes a Specctra session file into an Eagle script file. - * - * @author Alfons Wirtz - */ -public class SessionToEagle extends javax.swing.JFrame -{ - - public static boolean get_instance(java.io.InputStream p_session, java.io.OutputStream p_output_stream, - board.BasicBoard p_board) - { - if (p_output_stream == null) - { - return false; - } - - // create a scanner for reading the session_file. - - Scanner scanner = new SpecctraFileScanner(p_session); - - // create a file_writer for the eagle script file. - java.io.OutputStreamWriter file_writer = new java.io.OutputStreamWriter(p_output_stream); - - boolean result = true; - - double board_scale_factor = p_board.communication.coordinate_transform.board_to_dsn(1); - SessionToEagle new_instance = new SessionToEagle(scanner, file_writer, p_board, - p_board.communication.unit, p_board.communication.resolution, board_scale_factor); - - try - { - result = new_instance.process_session_scope(); - } - catch (java.io.IOException e) - { - System.out.println("unable to process session scope"); - result = false; - } - - // close files - try - { - p_session.close(); - file_writer.close(); - } - catch (java.io.IOException e) - { - System.out.println("unable to close files"); - } - return result; - } - - SessionToEagle(Scanner p_scanner, java.io.OutputStreamWriter p_out_file, board.BasicBoard p_board, - board.Unit p_unit, double p_session_file_scale_dominator, double p_board_scale_factor) - { - scanner = p_scanner; - out_file = p_out_file; - board = p_board; - this.specctra_layer_structure = new LayerStructure(p_board.layer_structure); - unit = p_unit; - session_file_scale_denominator = p_session_file_scale_dominator; - board_scale_factor = p_board_scale_factor; - } - - /** - * Processes the outmost scope of the session file. - * Returns false, if an error occured. - */ - private boolean process_session_scope() throws java.io.IOException - { - - // read the first line of the session file - Object next_token = null; - for (int i = 0; i < 3; ++i) - { - next_token = this.scanner.next_token(); - boolean keyword_ok = true; - if (i == 0) - { - keyword_ok = (next_token == Keyword.OPEN_BRACKET); - } - else if (i == 1) - { - keyword_ok = (next_token == Keyword.SESSION); - this.scanner.yybegin(SpecctraFileScanner.NAME); // to overread the name of the pcb for i = 2 - } - if (!keyword_ok) - { - System.out.println("SessionToEagle.process_session_scope specctra session file format expected"); - return false; - } - } - - // Write the header of the eagle script file. - - this.out_file.write("GRID "); - this.out_file.write(this.unit.toString()); - this.out_file.write("\n"); - this.out_file.write("SET WIRE_BEND 2\n"); - this.out_file.write("SET OPTIMIZING OFF\n"); - - // Activate all layers in Eagle. - - for (int i = 0; i < this.board.layer_structure.arr.length; ++i) - { - this.out_file.write("LAYER " + this.get_eagle_layer_string(i) + ";\n"); - } - - this.out_file.write("LAYER 17;\n"); - this.out_file.write("LAYER 18;\n"); - this.out_file.write("LAYER 19;\n"); - this.out_file.write("LAYER 20;\n"); - this.out_file.write("LAYER 23;\n"); - this.out_file.write("LAYER 24;\n"); - - // Generate Code to remove the complete route. - // Write a bounding rectangle with GROUP (Min_X-1 Min_Y-1) (Max_X+1 Max_Y+1); - - geometry.planar.IntBox board_bounding_box = this.board.get_bounding_box(); - - Float min_x = (float) this.board_scale_factor * (board_bounding_box.ll.x - 1); - Float min_y = (float) this.board_scale_factor * (board_bounding_box.ll.y - 1); - Float max_x = (float) this.board_scale_factor * (board_bounding_box.ur.x + 1); - Float max_y = (float) this.board_scale_factor * (board_bounding_box.ur.y + 1); - - this.out_file.write("GROUP ("); - this.out_file.write(min_x.toString()); - this.out_file.write(" "); - this.out_file.write(min_y.toString()); - this.out_file.write(") ("); - this.out_file.write(max_x.toString()); - this.out_file.write(" "); - this.out_file.write(max_y.toString()); - this.out_file.write(");\n"); - this.out_file.write("RIPUP;\n"); - - // read the direct subscopes of the session scope - for (;;) - { - Object prev_token = next_token; - next_token = this.scanner.next_token(); - if (next_token == null) - { - // end of file - return true; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.ROUTES) - { - if (!process_routes_scope()) - { - return false; - } - } - else if (next_token == Keyword.PLACEMENT_SCOPE) - { - if (!process_placement_scope()) - { - return false; - } - } - else - { - // overread all scopes except the routes scope for the time being - ScopeKeyword.skip_scope(this.scanner); - } - } - } - // Wird nur einmal am Ende benoetigt! - this.out_file.write("RATSNEST\n"); - return true; - } - - private boolean process_placement_scope() throws java.io.IOException - { - // read the component scopes - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - next_token = this.scanner.next_token(); - if (next_token == null) - { - // unexpected end of file - return false; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - - if (prev_token == Keyword.OPEN_BRACKET) - { - - if (next_token == Keyword.COMPONENT_SCOPE) - { - if (!process_component_placement()) - { - return false; - } - } - else - { - // skip unknown scope - ScopeKeyword.skip_scope(this.scanner); - } - - } - } - process_swapped_pins(); - return true; - } - - private boolean process_component_placement() throws java.io.IOException - { - ComponentPlacement component_placement = Component.read_scope(this.scanner); - if (component_placement == null) - { - return false; - } - for (ComponentPlacement.ComponentLocation curr_location : component_placement.locations) - { - this.out_file.write("ROTATE ="); - Integer rotation = (int) Math.round(curr_location.rotation); - String rotation_string; - if (curr_location.is_front) - { - rotation_string = "R" + rotation.toString(); - } - else - { - rotation_string = "MR" + rotation.toString(); - } - this.out_file.write(rotation_string); - this.out_file.write(" '"); - this.out_file.write(curr_location.name); - this.out_file.write("';\n"); - this.out_file.write("move '"); - this.out_file.write(curr_location.name); - this.out_file.write("' ("); - Double x_coor = curr_location.coor[0] / this.session_file_scale_denominator; - this.out_file.write(x_coor.toString()); - this.out_file.write(" "); - Double y_coor = curr_location.coor[1] / this.session_file_scale_denominator; - this.out_file.write(y_coor.toString()); - this.out_file.write(");\n"); - } - return true; - } - - private boolean process_routes_scope() throws java.io.IOException - { - // read the direct subscopes of the routes scope - boolean result = true; - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - next_token = this.scanner.next_token(); - if (next_token == null) - { - // unexpected end of file - return false; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - - if (prev_token == Keyword.OPEN_BRACKET) - { - - if (next_token == Keyword.NETWORK_OUT) - { - result = process_network_scope(); - } - else - { - // skip unknown scope - ScopeKeyword.skip_scope(this.scanner); - } - - } - } - return result; - } - - private boolean process_network_scope() throws java.io.IOException - { - boolean result = true; - Object next_token = null; - // read the net scopes - for (;;) - { - Object prev_token = next_token; - next_token = this.scanner.next_token(); - if (next_token == null) - { - // unexpected end of file - return false; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - - if (prev_token == Keyword.OPEN_BRACKET) - { - - if (next_token == Keyword.NET) - { - result = process_net_scope(); - } - else - { - // skip unknown scope - ScopeKeyword.skip_scope(this.scanner); - } - - } - } - return result; - } - - private boolean process_net_scope() throws java.io.IOException - { - // read the net name - Object next_token = this.scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("SessionToEagle.processnet_scope: String expected"); - return false; - } - String net_name = (String) next_token; - - // Hier alle nicht gefixten Traces und Vias des Netz mit Namen net_name - // in der Eagle Datenhaltung loeschen. - - // read the wires and vias of this net - for (;;) - { - Object prev_token = next_token; - next_token = this.scanner.next_token(); - if (next_token == null) - { - // end of file - return true; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.WIRE) - { - if (!process_wire_scope(net_name)) - { - return false; - } - } - else if (next_token == Keyword.VIA) - { - if (!process_via_scope(net_name)) - { - return false; - } - } - else - { - ScopeKeyword.skip_scope(this.scanner); - } - } - } - return true; - } - - private boolean process_wire_scope(String p_net_name) throws java.io.IOException - { - PolygonPath wire_path = null; - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - next_token = this.scanner.next_token(); - if (next_token == null) - { - System.out.println("SessionToEagle.process_wire_scope: unexpected end of file"); - return false; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.POLYGON_PATH) - { - wire_path = Shape.read_polygon_path_scope(this.scanner, this.specctra_layer_structure); - } - else - { - ScopeKeyword.skip_scope(this.scanner); - } - } - } - if (wire_path == null) - { - // conduction areas are skipped - return true; - } - - this.out_file.write("CHANGE LAYER "); - - this.out_file.write(wire_path.layer.name); - this.out_file.write(";\n"); - - //WIRE ['signal_name'] [width] [ROUND | FLAT] [curve | @radius] - - this.out_file.write("WIRE '"); - - this.out_file.write(p_net_name); - this.out_file.write("' "); - Double wire_width = wire_path.width / this.session_file_scale_denominator; - this.out_file.write(wire_width.toString()); - this.out_file.write(" ("); - for (int i = 0; i < wire_path.coordinate_arr.length; ++i) - { - Double wire_coor = wire_path.coordinate_arr[i] / this.session_file_scale_denominator; - this.out_file.write(wire_coor.toString()); - if (i % 2 == 0) - { - this.out_file.write(" "); - } - else - { - if (i == wire_path.coordinate_arr.length - 1) - { - this.out_file.write(")"); - } - else - { - this.out_file.write(") ("); - } - } - } - this.out_file.write(";\n"); - - return true; - } - - private boolean process_via_scope(String p_net_name) throws java.io.IOException - { - // read the padstack name - Object next_token = this.scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("SessionToEagle.process_via_scope: padstack name expected"); - return false; - } - String padstack_name = (String) next_token; - // read the location - double []location = new double [2]; - for (int i = 0; i < 2; ++i) - { - next_token = this.scanner.next_token(); - if (next_token instanceof Double) - { - location[i] = ((Double) next_token).doubleValue(); - } - else if (next_token instanceof Integer) - { - location[i] = ((Integer) next_token).intValue(); - } - else - { - System.out.println("SessionToEagle.process_via_scope: number expected"); - return false; - } - } - next_token = this.scanner.next_token(); - while (next_token == Keyword.OPEN_BRACKET) - { - // skip unknown scopes - ScopeKeyword.skip_scope(this.scanner); - next_token = this.scanner.next_token(); - } - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("SessionToEagle.process_via_scope: closing bracket expected"); - return false; - } - - if (padstack_name == null) - { - System.out.println("SessionToEagle.process_via_scope: padstack_name missing"); - return false; - } - - library.Padstack via_padstack = this.board.library.padstacks.get(padstack_name); - - if (via_padstack == null) - { - System.out.println("SessionToEagle.process_via_scope: via padstack not found"); - return false; - } - - geometry.planar.ConvexShape via_shape = via_padstack.get_shape(via_padstack.from_layer()); - - Double via_diameter = via_shape.max_width() * this.board_scale_factor; - - // The Padstack name is of the form Name$drill_diameter$from_layer-to_layer - - String [] name_parts = via_padstack.name.split("\\$", 3); - - // example CHANGE DRILL 0.2 - - this.out_file.write("CHANGE DRILL "); - if (name_parts.length > 1) - { - this.out_file.write(name_parts[1]); - } - else - { - // create a default drill, because it is needed in Eagle - this.out_file.write("0.1"); - } - this.out_file.write(";\n"); - - - //VIA ['signal_name'] [diameter] [shape] [layers] [flags] - // Via Net2 0.6 round 1-4 (20.0, 222.0); - this.out_file.write("VIA '"); - - this.out_file.write(p_net_name); - this.out_file.write("' "); - - //Durchmesser aus Padstack - this.out_file.write(via_diameter.toString()); - - //Shape lesen und einsetzen Square / Round / Octagon - if (via_shape instanceof geometry.planar.Circle) - { - this.out_file.write(" round "); - } - else if (via_shape instanceof geometry.planar.IntOctagon) - { - this.out_file.write(" octagon "); - } - else - { - this.out_file.write(" square "); - } - this.out_file.write(get_eagle_layer_string(via_padstack.from_layer())); - this.out_file.write("-"); - this.out_file.write(get_eagle_layer_string(via_padstack.to_layer())); - this.out_file.write(" ("); - Double x_coor = location[0] / this.session_file_scale_denominator; - this.out_file.write(x_coor.toString()); - this.out_file.write(" "); - Double y_coor = location[1] / this.session_file_scale_denominator; - this.out_file.write(y_coor.toString()); - this.out_file.write(");\n"); - - return true; - } - - private String get_eagle_layer_string(int p_layer_no) - { - if (p_layer_no < 0 || p_layer_no >= specctra_layer_structure.arr.length) - { - return "0"; - } - String [] name_pieces = this.specctra_layer_structure.arr[p_layer_no].name.split("#", 2); - return name_pieces[0]; - } - - private boolean process_swapped_pins() throws java.io.IOException - { - for (int i = 1; i <= this.board.components.count(); ++i) - { - if (!process_swapped_pins(i)) - { - return false; - } - } - return true; - } - - private boolean process_swapped_pins(int p_component_no) throws java.io.IOException - { - java.util.Collection component_pins = this.board.get_component_pins(p_component_no); - boolean component_has_swapped_pins = false; - for (board.Pin curr_pin : component_pins) - { - if (curr_pin.get_changed_to() != curr_pin) - { - component_has_swapped_pins = true; - break; - } - } - if (!component_has_swapped_pins) - { - return true; - } - PinInfo[] pin_info_arr = new PinInfo[component_pins.size()]; - int i = 0; - for (board.Pin curr_pin : component_pins) - { - pin_info_arr[i] = new PinInfo(curr_pin); - ++i; - } - for (i = 0; i < pin_info_arr.length; ++i) - { - PinInfo curr_pin_info = pin_info_arr[i]; - if (curr_pin_info.curr_changed_to != curr_pin_info.pin.get_changed_to()) - { - PinInfo other_pin_info = null; - for (int j = i + 1; j < pin_info_arr.length; ++j) - { - if (pin_info_arr[j].pin.get_changed_to() == curr_pin_info.pin) - { - other_pin_info = pin_info_arr[j]; - } - } - if (other_pin_info == null) - { - System.out.println("SessuinToEagle.process_swapped_pins: other_pin_info not found"); - return false; - } - write_pin_swap(curr_pin_info.pin, other_pin_info.pin); - curr_pin_info.curr_changed_to = other_pin_info.pin; - other_pin_info.curr_changed_to = curr_pin_info.pin; - } - } - return true; - } - - private void write_pin_swap( board.Pin p_pin_1, board.Pin p_pin_2) throws java.io.IOException - { - int layer_no = Math.max(p_pin_1.first_layer(), p_pin_2.first_layer()); - String layer_name = board.layer_structure.arr[layer_no].name; - - this.out_file.write("CHANGE LAYER "); - this.out_file.write(layer_name); - this.out_file.write(";\n"); - - double [] location_1 = - this.board.communication.coordinate_transform.board_to_dsn(p_pin_1.get_center().to_float()); - double [] location_2 = - this.board.communication.coordinate_transform.board_to_dsn(p_pin_2.get_center().to_float()); - - this.out_file.write("PINSWAP "); - this.out_file.write(" ("); - Double curr_coor = location_1[0]; - this.out_file.write(curr_coor.toString()); - this.out_file.write(" "); - curr_coor = location_1[1]; - this.out_file.write(curr_coor.toString()); - this.out_file.write(") ("); - curr_coor = location_2[0]; - this.out_file.write(curr_coor.toString()); - this.out_file.write(" "); - curr_coor = location_2[1]; - this.out_file.write(curr_coor.toString()); - this.out_file.write(");\n"); - } - - - - /** The function for scanning the session file */ - private final Scanner scanner; - - /** The generated Eagle script file. */ - private final java.io.OutputStreamWriter out_file; - - /** Some information is read from the board, because it is not contained in the speccctra session file. */ - private final board.BasicBoard board; - - /** The layer structure in specctra format */ - private final LayerStructure specctra_layer_structure; - - private final board.Unit unit; - - /** The scale factor for transforming coordinates from the session file to Eagle */ - private final double session_file_scale_denominator; - - /** The scale factor for transforming coordinates from the board to Eagle */ - private final double board_scale_factor; - - private static class PinInfo - { - PinInfo(board.Pin p_pin) - { - pin = p_pin; - curr_changed_to = p_pin; - } - final board.Pin pin; - board.Pin curr_changed_to; - } -} - diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Shape.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Shape.java deleted file mode 100644 index e1da944..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Shape.java +++ /dev/null @@ -1,831 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Shape.java - * - * Created on 16. Mai 2004, 11:09 - */ -package designformats.specctra; - -import java.util.Collection; -import java.util.Iterator; -import java.util.LinkedList; - -import geometry.planar.PolylineShape; -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - -/** - * Describes a shape in a Specctra dsn file. - * - * @author alfons - */ -public abstract class Shape -{ - - /** - * Writes a shape scope to a Specctra dsn file. - */ - public abstract void write_scope(IndentFileWriter p_file, IdentifierType p_identifier) throws java.io.IOException; - - /** - * Writes a shape scope to a Specctra session file. - * In a session file all coordinates must be integer. - */ - public abstract void write_scope_int(IndentFileWriter p_file, IdentifierType p_identifier) throws java.io.IOException; - - /** - * Reads shape scope from a Specctra dsn file. - * If p_layer_structure == null, only Layer.PCB and Layer.Signal are expected, no induvidual layers. - */ - public static final Shape read_scope(Scanner p_scanner, LayerStructure p_layer_structure) - { - Shape result = null; - try - { - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.OPEN_BRACKET) - { - // overread the open bracket - next_token = p_scanner.next_token(); - } - - if (next_token == Keyword.RECTANGLE) - { - - result = Shape.read_rectangle_scope(p_scanner, p_layer_structure); - } - else if (next_token == Keyword.POLYGON) - { - - result = Shape.read_polygon_scope(p_scanner, p_layer_structure); - } - else if (next_token == Keyword.CIRCLE) - { - - result = Shape.read_circle_scope(p_scanner, p_layer_structure); - } - else if (next_token == Keyword.POLYGON_PATH) - { - result = Shape.read_polygon_path_scope(p_scanner, p_layer_structure); - } - else - { - // not a shape scope, skip it. - ScopeKeyword.skip_scope(p_scanner); - } - } - catch (java.io.IOException e) - { - System.out.println("Shape.read_scope: IO error scanning file"); - System.out.println(e); - return result; - } - return result; - } - - /** - * Reads an object of type PolylinePath from the dsn-file. - */ - public static PolylinePath read_polyline_path_scope(Scanner p_scanner, LayerStructure p_layer_structure) - { - try - { - Layer layer = null; - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.PCB_SCOPE) - { - layer = Layer.PCB; - } - else if (next_token == Keyword.SIGNAL) - { - layer = Layer.SIGNAL; - } - else - { - if (p_layer_structure == null) - { - System.out.println("PolylinePath.read_scope: only layer types pcb or signal expected"); - return null; - } - if (!(next_token instanceof String)) - { - System.out.println("PolylinePath.read_scope: layer name string expected"); - return null; - } - int layer_no = p_layer_structure.get_no((String) next_token); - if (layer_no < 0 || layer_no >= p_layer_structure.arr.length) - { - System.out.print("Shape.read_polyline_path_scope: layer name "); - System.out.print((String) next_token); - System.out.println(" not found in layer structure "); - return null; - } - layer = p_layer_structure.arr[layer_no]; - } - Collection corner_list = new LinkedList(); - - // read the width and the corners of the path - for (;;) - { - next_token = p_scanner.next_token(); - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - corner_list.add(next_token); - } - if (corner_list.size() < 5) - { - System.out.println("PolylinePath.read_scope: to few numbers in scope"); - return null; - } - Iterator it = corner_list.iterator(); - double width = 0; - Object next_object = it.next(); - if (next_object instanceof Double) - { - width = ((Double) next_object).doubleValue(); - } - else if (next_object instanceof Integer) - { - width = ((Integer) next_object).intValue(); - } - else - { - System.out.println("PolylinePath.read_scope: number expected"); - return null; - } - double[] corner_arr = new double[corner_list.size() - 1]; - for (int i = 0; i < corner_arr.length; ++i) - { - next_object = it.next(); - if (next_object instanceof Double) - { - corner_arr[i] = ((Double) next_object).doubleValue(); - } - else if (next_object instanceof Integer) - { - corner_arr[i] = ((Integer) next_object).intValue(); - } - else - { - System.out.println("Shape.read_polygon_path_scope: number expected"); - return null; - } - - } - return new PolylinePath(layer, width, corner_arr); - } - catch (java.io.IOException e) - { - System.out.println("PolylinePath.read_scope: IO error scanning file"); - System.out.println(e); - return null; - } - } - - /** - * Reads a shape , which may contain holes from a specctra dsn-file. - * The first shape in the shape_list of the result is the border of the area. - * The other shapes in the shape_list are holes (windows). - */ - public static final ReadAreaScopeResult read_area_scope(Scanner p_scanner, - LayerStructure p_layer_structure, boolean p_skip_window_scopes) - { - Collection shape_list = new LinkedList(); - String clearance_class_name = null; - String area_name = null; - boolean result_ok = true; - Object next_token = null; - try - { - next_token = p_scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Shape.read_area_scope: IO error scanning file"); - return null; - } - if (next_token instanceof String) - { - String curr_name = (String) next_token; - if (!curr_name.isEmpty()) - { - area_name = curr_name; - } - } - Shape curr_shape = Shape.read_scope(p_scanner, p_layer_structure); - if (curr_shape == null) - { - result_ok = false; - } - shape_list.add(curr_shape); - next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Shape.read_area_scope: IO error scanning file"); - return null; - } - if (next_token == null) - { - System.out.println("Shape.read_area_scope: unexpected end of file"); - return null; - } - if (next_token == Keyword.CLOSED_BRACKET) - { - // end of scope - break; - } - - if (prev_token == Keyword.OPEN_BRACKET) - { - // a new scope is expected - if (next_token == Keyword.WINDOW && !p_skip_window_scopes) - { - Shape hole_shape = Shape.read_scope(p_scanner, p_layer_structure); - shape_list.add(hole_shape); - // overread closing bracket - try - { - next_token = p_scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Shape.read_area_scope: IO error scanning file"); - return null; - } - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Shape.read_area_scope: closed bracket expected"); - return null; - } - - } - else if (next_token == Keyword.CLEARANCE_CLASS) - { - clearance_class_name = DsnFile.read_string_scope(p_scanner); - } - else - { - // skip unknown scope - ScopeKeyword.skip_scope(p_scanner); - } - } - } - if (!result_ok) - { - return null; - } - return new ReadAreaScopeResult(area_name, shape_list, clearance_class_name); - } - - /** - * Reads a rectangle scope from a Specctra dsn file. - * If p_layer_structure == null, only Layer.PCB and Layer.Signal are expected, no induvidual layers. - */ - public static Rectangle read_rectangle_scope(Scanner p_scanner, LayerStructure p_layer_structure) - { - try - { - Layer rect_layer = null; - double rect_coor[] = new double[4]; - - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.PCB_SCOPE) - { - rect_layer = Layer.PCB; - } - else if (next_token == Keyword.SIGNAL) - { - rect_layer = Layer.SIGNAL; - } - else if (p_layer_structure != null) - { - if (!(next_token instanceof String)) - { - System.out.println("Shape.read_rectangle_scope: layer name string expected"); - return null; - } - String layer_name = (String) next_token; - int layer_no = p_layer_structure.get_no(layer_name); - if (layer_no < 0 || layer_no >= p_layer_structure.arr.length) - { - System.out.println("Shape.read_rectangle_scope: layer name " + layer_name + - " not found in layer structure "); - } - else - { - rect_layer = p_layer_structure.arr[layer_no]; - } - } - else - { - rect_layer = Layer.SIGNAL; - } - // fill the the rectangle - for (int i = 0; i < 4; ++i) - { - next_token = p_scanner.next_token(); - if (next_token instanceof Double) - { - rect_coor[i] = ((Double) next_token).doubleValue(); - } - else if (next_token instanceof Integer) - { - rect_coor[i] = ((Integer) next_token).intValue(); - } - else - { - System.out.println("Shape.read_rectangle_scope: number expected"); - return null; - } - } - // overread the closing bracket - - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Shape.read_rectangle_scope ) expected"); - return null; - } - if (rect_layer == null) - { - return null; - } - return new Rectangle(rect_layer, rect_coor); - } - catch (java.io.IOException e) - { - System.out.println("Shape.read_rectangle_scope: IO error scanning file"); - System.out.println(e); - return null; - } - } - - /** - * Reads a closed polygon scope from a Specctra dsn file. - * If p_layer_structure == null, only Layer.PCB and Layer.Signal are expected, no induvidual layers. - */ - public static Polygon read_polygon_scope(Scanner p_scanner, LayerStructure p_layer_structure) - { - try - { - Layer polygon_layer = null; - boolean layer_ok = true; - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.PCB_SCOPE) - { - polygon_layer = Layer.PCB; - } - else if (next_token == Keyword.SIGNAL) - { - polygon_layer = Layer.SIGNAL; - } - else - { - if (p_layer_structure == null) - { - System.out.println("Shape.read_polygon_scope: only layer types pcb or signal expected"); - return null; - } - if (!(next_token instanceof String)) - { - System.out.println("Shape.read_polygon_scope: layer name string expected"); - return null; - } - int layer_no = p_layer_structure.get_no((String) next_token); - if (layer_no < 0 || layer_no >= p_layer_structure.arr.length) - { - System.out.print("Shape.read_polygon_scope: layer name "); - System.out.print((String) next_token); - System.out.println(" not found in layer structure "); - layer_ok = false; - } - else - { - polygon_layer = p_layer_structure.arr[layer_no]; - } - } - - // overread the aperture width - next_token = p_scanner.next_token(); - - Collection coor_list = new LinkedList(); - - // read the coordinates of the polygon - for (;;) - { - next_token = p_scanner.next_token(); - if (next_token == null) - { - System.out.println("Shape.read_polygon_scope: unexpected end of file"); - return null; - } - if (next_token == Keyword.OPEN_BRACKET) - { - // unknown scope - ScopeKeyword.skip_scope(p_scanner); - next_token = p_scanner.next_token(); - } - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - coor_list.add(next_token); - } - if (!layer_ok) - { - return null; - } - double[] coor_arr = new double[coor_list.size()]; - Iterator it = coor_list.iterator(); - for (int i = 0; i < coor_arr.length; ++i) - { - Object next_object = it.next(); - if (next_object instanceof Double) - { - coor_arr[i] = ((Double) next_object).doubleValue(); - } - else if (next_object instanceof Integer) - { - coor_arr[i] = ((Integer) next_object).intValue(); - } - else - { - System.out.println("Shape.read_polygon_scope: number expected"); - return null; - } - - } - return new Polygon(polygon_layer, coor_arr); - } - catch (java.io.IOException e) - { - System.out.println("Rectangle.read_scope: IO error scanning file"); - System.out.println(e); - return null; - } - } - - /** - * Reads a circle scope from a Specctra dsn file. - */ - public static Circle read_circle_scope(Scanner p_scanner, LayerStructure p_layer_structure) - { - try - { - Layer circle_layer = null; - boolean layer_ok = true; - double circle_coor[] = new double[3]; - - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.PCB_SCOPE) - { - circle_layer = Layer.PCB; - } - else if (next_token == Keyword.SIGNAL) - { - circle_layer = Layer.SIGNAL; - } - else - { - if (p_layer_structure == null) - { - System.out.println("Shape.read_circle_scope: p_layer_structure != null expected"); - return null; - } - if (!(next_token instanceof String)) - { - System.out.println("Shape.read_circle_scope: string for layer_name expected"); - return null; - } - int layer_no = p_layer_structure.get_no((String) next_token); - if (layer_no < 0 || layer_no >= p_layer_structure.arr.length) - { - System.out.print("Shape.read_circle_scope: layer with name "); - System.out.print((String) next_token); - System.out.println(" not found in layer stracture "); - layer_ok = false; - } - else - { - circle_layer = p_layer_structure.arr[layer_no]; - } - } - // fill the the the coordinates - int curr_index = 0; - for (;;) - { - next_token = p_scanner.next_token(); - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - if (curr_index > 2) - { - System.out.println("Shape.read_circle_scope: closed bracket expected"); - return null; - } - if (next_token instanceof Double) - { - circle_coor[curr_index] = ((Double) next_token).doubleValue(); - } - else if (next_token instanceof Integer) - { - circle_coor[curr_index] = ((Integer) next_token).intValue(); - } - else - { - System.out.println("Shape.read_circle_scope: number expected"); - return null; - } - ++curr_index; - } - if (!layer_ok) - { - return null; - } - return new Circle(circle_layer, circle_coor); - } - catch (java.io.IOException e) - { - System.out.println("Shape.read_rectangle_scope: IO error scanning file"); - System.out.println(e); - return null; - } - } - - /** - * Reads an object of type Path from the dsn-file. - */ - public static PolygonPath read_polygon_path_scope(Scanner p_scanner, LayerStructure p_layer_structure) - { - try - { - Layer layer = null; - boolean layer_ok = true; - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.PCB_SCOPE) - { - layer = Layer.PCB; - } - else if (next_token == Keyword.SIGNAL) - { - layer = Layer.SIGNAL; - } - else - { - if (p_layer_structure == null) - { - System.out.println("Shape.read_polygon_path_scope: only layer types pcb or signal expected"); - return null; - } - if (!(next_token instanceof String)) - { - System.out.println("Path.read_scope: layer name string expected"); - return null; - } - int layer_no = p_layer_structure.get_no((String) next_token); - if (layer_no < 0 || layer_no >= p_layer_structure.arr.length) - { - System.out.print("Shape.read_polygon_path_scope: layer with name "); - System.out.print((String) next_token); - System.out.println(" not found in layer structure "); - layer_ok = false; - } - else - { - layer = p_layer_structure.arr[layer_no]; - } - } - Collection corner_list = new LinkedList(); - - // read the width and the corners of the path - for (;;) - { - next_token = p_scanner.next_token(); - if (next_token == Keyword.OPEN_BRACKET) - { - // unknown scope - ScopeKeyword.skip_scope(p_scanner); - next_token = p_scanner.next_token(); - } - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - corner_list.add(next_token); - } - if (corner_list.size() < 5) - { - System.out.println("Shape.read_polygon_path_scope: to few numbers in scope"); - return null; - } - if (!layer_ok) - { - return null; - } - Iterator it = corner_list.iterator(); - double width = 0; - Object next_object = it.next(); - if (next_object instanceof Double) - { - width = ((Double) next_object).doubleValue(); - } - else if (next_object instanceof Integer) - { - width = ((Integer) next_object).intValue(); - } - else - { - System.out.println("Shape.read_polygon_path_scope: number expected"); - return null; - } - double[] coordinate_arr = new double[corner_list.size() - 1]; - for (int i = 0; i < coordinate_arr.length; ++i) - { - next_object = it.next(); - if (next_object instanceof Double) - { - coordinate_arr[i] = ((Double) next_object).doubleValue(); - } - else if (next_object instanceof Integer) - { - coordinate_arr[i] = ((Integer) next_object).intValue(); - } - else - { - System.out.println("Shape.read_polygon_path_scope: number expected"); - return null; - } - - } - return new PolygonPath(layer, width, coordinate_arr); - } - catch (java.io.IOException e) - { - System.out.println("Shape.read_polygon_path_scope: IO error scanning file"); - System.out.println(e); - return null; - } - } - - /** - * Transforms a shape with holes to the board coordinate system. - * The first shape in the Collection p_area is the border, - * the other shapes are holes of the area. - */ - public static geometry.planar.Area transform_area_to_board(Collection p_area, CoordinateTransform p_coordinate_transform) - { - int hole_count = p_area.size() - 1; - if (hole_count <= -1) - { - System.out.println("Shape.transform_area_to_board: p_area.size() > 0 expected"); - return null; - } - Iterator it = p_area.iterator(); - Shape boundary = it.next(); - geometry.planar.Shape boundary_shape = boundary.transform_to_board(p_coordinate_transform); - geometry.planar.Area result; - if (hole_count == 0) - { - result = boundary_shape; - } - else - { - // Area with holes - if (!(boundary_shape instanceof geometry.planar.PolylineShape)) - { - System.out.println("Shape.transform_area_to_board: PolylineShape expected"); - return null; - } - PolylineShape border = (PolylineShape) boundary_shape; - PolylineShape[] holes = new PolylineShape[hole_count]; - for (int i = 0; i < holes.length; ++i) - { - geometry.planar.Shape hole_shape = it.next().transform_to_board(p_coordinate_transform); - if (!(hole_shape instanceof PolylineShape)) - { - System.out.println("Shape.transform_area_to_board: PolylineShape expected"); - return null; - } - holes[i] = (PolylineShape) hole_shape; - } - result = new geometry.planar.PolylineArea(border, holes); - } - return result; - } - - /** - * Transforms the relative coordinates of a shape with holes to the board coordinate system. - * The first shape in the Collection p_area is the border, - * the other shapes are holes of the area. - */ - public static geometry.planar.Area transform_area_to_board_rel(Collection p_area, CoordinateTransform p_coordinate_transform) - { - int hole_count = p_area.size() - 1; - if (hole_count <= -1) - { - System.out.println("Shape.transform_area_to_board_rel: p_area.size() > 0 expected"); - return null; - } - Iterator it = p_area.iterator(); - Shape boundary = it.next(); - geometry.planar.Shape boundary_shape = boundary.transform_to_board_rel(p_coordinate_transform); - geometry.planar.Area result; - if (hole_count == 0) - { - result = boundary_shape; - } - else - { - // Area with holes - if (!(boundary_shape instanceof geometry.planar.PolylineShape)) - { - System.out.println("Shape.transform_area_to_board_rel: PolylineShape expected"); - return null; - } - PolylineShape border = (PolylineShape) boundary_shape; - PolylineShape[] holes = new PolylineShape[hole_count]; - for (int i = 0; i < holes.length; ++i) - { - geometry.planar.Shape hole_shape = it.next().transform_to_board_rel(p_coordinate_transform); - if (!(hole_shape instanceof PolylineShape)) - { - System.out.println("Shape.transform_area_to_board: PolylineShape expected"); - return null; - } - holes[i] = (PolylineShape) hole_shape; - } - result = new geometry.planar.PolylineArea(border, holes); - } - return result; - } - - public void write_hole_scope(IndentFileWriter p_file, IdentifierType p_identifier_type) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("window"); - this.write_scope(p_file, p_identifier_type); - p_file.end_scope(); - } - - /** - * Transforms a specctra dsn shape to a geometry.planar.Shape. - */ - public abstract geometry.planar.Shape transform_to_board(CoordinateTransform p_coordinate_transform); - - /** - * Returns the smallest axis parallel rectangle containing this shape. - */ - public abstract Rectangle bounding_box(); - - /** - * Transforms the relative (vector) coordinates of a specctra dsn shape to a geometry.planar.Shape. - */ - public abstract geometry.planar.Shape transform_to_board_rel(CoordinateTransform p_coordinate_transform); - - protected Shape(Layer p_layer) - { - layer = p_layer; - } - public final Layer layer; - - /** - * Contains the result of the function read_area_scope. - * area_name or clearance_class_name may be null, which means they are not provided. - */ - static class ReadAreaScopeResult - { - - private ReadAreaScopeResult(String p_area_name, Collection p_shape_list, String p_clearance_class_name) - { - area_name = p_area_name; - shape_list = p_shape_list; - clearance_class_name = p_clearance_class_name; - } - String area_name; // may be generated later on, if area_name is null. - final Collection shape_list; - final String clearance_class_name; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SpecctraFileDescription.flex b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SpecctraFileDescription.flex deleted file mode 100644 index af7eedc..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SpecctraFileDescription.flex +++ /dev/null @@ -1,311 +0,0 @@ -package designformats.specctra; -@SuppressWarnings("all") -%% - -%class SpecctraFileScanner -%implements Scanner -%unicode -%ignorecase -%function next_token -%type Object -/* %debug */ - -%{ - StringBuffer string = new StringBuffer(); -%} - -LineTerminator = \r|\n|\r\n -InputCharacter = [^\r\n] -WhiteSpace = {LineTerminator} | [ \t\f] - -/* comments */ -Comment = {TraditionalComment} | {EndOfLineComment} - -TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" -EndOfLineComment = "#" {InputCharacter}* {LineTerminator} - -Letter=[A-Za-z] -Digit=[0-9] - -/* Character used for quoting string */ -QuoteChar1 = \" -QuoteChar2 = ' - -SpecCharASCII = _|\.|\/|\\|:|#|\$|&|>|<|,|;|=|@|\[|\]||\~|\*|\?|\!|\%|\^ - -SpecCharANSI1 = €|‚|ƒ|„|…|†|‡|ˆ|‰|Š|‹|Œ|Ž|‘|’|“|”|•|–|—|˜|™|š|›|œ|ž|Ÿ -SpecCharANSI2 = [¡-ÿ] -SpecCharANSI = {SpecCharANSI1}|{SpecCharANSI2} - - -SpecChar1 = {SpecCharASCII}|{SpecCharANSI} - -SpecChar2 = {SpecChar1}|-|\+ - -SpecChar3 = {SpecChar2}|{QuoteChar1}|{QuoteChar2} - -SpecChar4 = {SpecChar1}|\+ - -SpecChar5 = {SpecChar4}|{QuoteChar1}|{QuoteChar2} - - -DecIntegerLiteral = ([+-]? (0 | [1-9][0-9]*)) - -Mantissa = ([+-]? [0-9]+ ("." [0-9]+)?) - -Exponent = ([Ee] {DecIntegerLiteral}) - -DecFloatLiteral = {Mantissa} {Exponent}? - -Identifier = ({Letter}|{SpecChar1})({Letter}|{Digit}|{SpecChar3})* - -NameIdentifier = ({Letter}|{Digit}|{SpecChar2})({Letter}|{Digit}|{SpecChar3})* - -IdentifierIgnoringQuotes = ({Letter}|{Digit}|{SpecChar3})* - -/* to divide the component name from the pin name with the character "-" */ -ComponentIdentifier = ({Letter}|{Digit}|{SpecChar4})({Letter}|{Digit}|{SpecChar5})* - -/* States used for qouting strings */ -%state STRING1 -%state STRING2 - -/* The state NAME is used if the next token has to be interpreted as string, even if it is a number */ -%state NAME - -/* The state LAYER_NAME is used if the next token has to be interpreted as a layer name */ -%state LAYER_NAME - -/* To divide a component name from the pin name with the charracter "-" */ -%state COMPONENT_NAME - -/* Returns the next character */ -%state SPEC_CHAR - -/* Reads the next identifier while handling the quote characters as normal characters */ -%state IGNORE_QUOTE - -%% - - - { - /* keywords */ - "absolute" { return Keyword.ABSOLUTE; } - "active" { return Keyword.ACTIVE; } - "against_preferred_direction_trace_costs" { return Keyword.AGAINST_PREFERRED_DIRECTION_TRACE_COSTS; } - "against_prefered_direction_trace_costs" { return Keyword.AGAINST_PREFERRED_DIRECTION_TRACE_COSTS; } - "attach" { return Keyword.ATTACH; } - "autoroute" { return Keyword.AUTOROUTE; } - "autoroute_settings" { return Keyword.AUTOROUTE_SETTINGS; } - "back" { return Keyword.BACK; } - "boundary" { return Keyword.BOUNDARY; } - "circ" { yybegin(LAYER_NAME); return Keyword.CIRCLE; } - "circle" { yybegin(LAYER_NAME); return Keyword.CIRCLE; } - "circuit" { return Keyword.CIRCUIT; } - "class" { yybegin(NAME); return Keyword.CLASS; } - "class_class" { return Keyword.CLASS_CLASS; } - "classes" { return Keyword.CLASSES; } - "clear" { return Keyword.CLEARANCE; } - "clearance" { return Keyword.CLEARANCE; } - "clearance_class" { yybegin(NAME); return Keyword.CLEARANCE_CLASS; } - "comp" { yybegin(NAME); return Keyword.COMPONENT_SCOPE; } - "component" { yybegin(NAME); return Keyword.COMPONENT_SCOPE; } - "constant" { return Keyword.CONSTANT; } - "control" { return Keyword.CONTROL; } - "fanout" { return Keyword.FANOUT; } - "fix" { return Keyword.FIX; } - "fortyfive_degree" { return Keyword.FORTYFIVE_DEGREE; } - "flip_style" { return Keyword.FLIP_STYLE; } - "fromto" { return Keyword.FROMTO; } - "front" { return Keyword.FRONT; } - "generated_by_freeroute" {return Keyword.GENERATED_BY_FREEROUTE; } - "horizontal" { return Keyword.HORIZONTAL; } - "image" { yybegin(NAME); return Keyword.IMAGE; } - "host_cad" { yybegin(NAME); return Keyword.HOST_CAD; } - "host_version" { yybegin(NAME); return Keyword.HOST_VERSION; } - "keepout" { yybegin(NAME); return Keyword.KEEPOUT; } - "layer" { yybegin(NAME); return Keyword.LAYER; } - "layer_rule" { yybegin(NAME); return Keyword.LAYER_RULE; } - "length" { return Keyword.LENGTH; } - "library" { return Keyword.LIBRARY_SCOPE; } - "lock_type" { return Keyword.LOCK_TYPE; } - "logical_part" { yybegin(NAME); return Keyword.LOGICAL_PART; } - "logical_part_mapping" { yybegin(NAME); return Keyword.LOGICAL_PART_MAPPING; } - "net" { yybegin(NAME); return Keyword.NET; } - "network" { return Keyword.NETWORK_SCOPE; } - "network_out" { return Keyword.NETWORK_OUT; } - "ninety_degree" { return Keyword.NINETY_DEGREE; } - "none" { return Keyword.NONE; } - "normal" { return Keyword.NORMAL; } - "off" { return Keyword.OFF; } - "on" { return Keyword.ON; } - "order" { return Keyword.ORDER; } - "outline" { return Keyword.OUTLINE; } - "padstack" { yybegin(NAME); return Keyword.PADSTACK; } - "parser" { return Keyword.PARSER_SCOPE; } - "part_library" { return Keyword.PART_LIBRARY_SCOPE; } - "path" { yybegin(LAYER_NAME); return Keyword.POLYGON_PATH; } - "pcb" { return Keyword.PCB_SCOPE; } - "pin" { return Keyword.PIN; } - "pins" { return Keyword.PINS; } - "place" { yybegin(NAME); return Keyword.PLACE; } - "place_control" { return Keyword.PLACE_CONTROL; } - "place_keepout" { yybegin(NAME); return Keyword.PLACE_KEEPOUT; } - "placement" { return Keyword.PLACEMENT_SCOPE; } - "plane" { yybegin(NAME); return Keyword.PLANE_SCOPE; } - "plane_via_costs" { return Keyword.PLANE_VIA_COSTS; } - "poly" { yybegin(LAYER_NAME); return Keyword.POLYGON; } - "polygon" { yybegin(LAYER_NAME); return Keyword.POLYGON; } - "polyline_path" { yybegin(LAYER_NAME); return Keyword.POLYLINE_PATH; } - "position" { return Keyword.POSITION; } - "postroute" { return Keyword.POSTROUTE; } - "power" { return Keyword.POWER; } - "preferred_direction" { return Keyword.PREFERRED_DIRECTION; } - "prefered_direction" { return Keyword.PREFERRED_DIRECTION; } - "preferred_direction_trace_costs" { return Keyword.PREFERRED_DIRECTION_TRACE_COSTS; } - "prefered_direction_trace_costs" { return Keyword.PREFERRED_DIRECTION_TRACE_COSTS; } - "pull_tight" { return Keyword.PULL_TIGHT; } - "rect" { yybegin(LAYER_NAME); return Keyword.RECTANGLE; } - "rectangle" { yybegin(LAYER_NAME); return Keyword.RECTANGLE; } - "resolution" { return Keyword.RESOLUTION_SCOPE; } - "rotate" { return Keyword.ROTATE; } - "rotate_first" { return Keyword.ROTATE_FIRST; } - "routes" { return Keyword.ROUTES; } - "rule" { return Keyword.RULE; } - "rules" { return Keyword.RULES; } - "session" { return Keyword.SESSION; } - "shape" { return Keyword.SHAPE; } - "shove_fixed" { return Keyword.SHOVE_FIXED; } - "side" { return Keyword.SIDE; } - "signal" { return Keyword.SIGNAL; } - "snap_angle" { return Keyword.SNAP_ANGLE; } - "spare" { return Keyword.SPARE; } - "start_pass_no" { return Keyword.START_PASS_NO; } - "start_ripup_costs" { return Keyword.START_RIPUP_COSTS; } - "string_quote" { yybegin(IGNORE_QUOTE); return Keyword.STRING_QUOTE; } - "structure" { return Keyword.STRUCTURE_SCOPE; } - "type" { return Keyword.TYPE; } - "use_layer" { yybegin(NAME); return Keyword.USE_LAYER; } - "use_net" { yybegin(NAME); return Keyword.USE_NET; } - "use_via" { yybegin(NAME); return Keyword.USE_VIA; } - "vertical" { return Keyword.VERTICAL; } - "via" { yybegin(NAME); return Keyword.VIA; } - "vias" { return Keyword.VIAS; } - "via_at_smd" { return Keyword.VIA_AT_SMD; } - "via_costs" { return Keyword.VIA_COSTS; } - "via_keepout" { yybegin(NAME); return Keyword.VIA_KEEPOUT; } - "via_rule" { return Keyword.VIA_RULE; } - "width" { return Keyword.WIDTH; } - "window" { return Keyword.WINDOW; } - "wire" { yybegin(NAME); return Keyword.WIRE; } - "wire_keepout" { return Keyword.KEEPOUT; } - "wiring" { return Keyword.WIRING_SCOPE; } - "write_resolution" { return Keyword.WRITE_RESOLUTION; } - "(" { return Keyword.OPEN_BRACKET; } - ")" { return Keyword.CLOSED_BRACKET; } - - /* identifiers */ - {Identifier} { return yytext(); } - - /* Characters for quoting strings */ - {QuoteChar1} { string.setLength(0); yybegin(STRING1); } - {QuoteChar2} { string.setLength(0); yybegin(STRING2); } - - /* literals */ - {DecIntegerLiteral} { return new Integer(yytext()); } - {DecFloatLiteral} { return new Double(yytext()); } - - /* comments */ - {Comment} { /* ignore */ } - - /* whitespace */ - {WhiteSpace} { /* ignore */ } -} - -/* Strings quoted with " */ - { - [^\"\\]+ { string.append( yytext() ); } - \\ { string.append('\\'); } - \" { yybegin(YYINITIAL); return string.toString(); } -} - -/* Strings quotet with ' */ - { - [^\'\\]+ { string.append( yytext() ); } - \\ { string.append('\\'); } - ' { yybegin(YYINITIAL); return string.toString(); } -} - - - { - /* keywords */ - "(" { yybegin(YYINITIAL); return Keyword.OPEN_BRACKET;} - ")" { yybegin(YYINITIAL); return Keyword.CLOSED_BRACKET;} - - /* identifiers */ - {NameIdentifier} { yybegin(YYINITIAL); return yytext(); } - - - /* Characters for quoting strings */ - {QuoteChar1} { string.setLength(0); yybegin(STRING1); } - {QuoteChar2} { string.setLength(0); yybegin(STRING2); } - - /* whitespace */ - {WhiteSpace} { /* ignore */ } -} - -/* Reads the next identifier while handling the quote characters as normal characters */ - { - /* keywords */ - "(" { yybegin(YYINITIAL); return Keyword.OPEN_BRACKET;} - ")" { yybegin(YYINITIAL); return Keyword.CLOSED_BRACKET;} - - /* identifiers */ - {IdentifierIgnoringQuotes} { yybegin(YYINITIAL); return yytext(); } - {WhiteSpace} { /* ignore */ } -} - - - { - /* keywords */ - "pcb" { yybegin(YYINITIAL); return Keyword.PCB_SCOPE; } - "signal" { yybegin(YYINITIAL); return Keyword.SIGNAL; } - "(" { yybegin(YYINITIAL); return Keyword.OPEN_BRACKET;} - ")" { yybegin(YYINITIAL); return Keyword.CLOSED_BRACKET;} - - /* identifiers */ - {NameIdentifier} { yybegin(YYINITIAL); return yytext(); } - - /* Characters for quoting strings */ - {QuoteChar1} { string.setLength(0); yybegin(STRING1); } - {QuoteChar2} { string.setLength(0); yybegin(STRING2); } - - /* whitespace */ - {WhiteSpace} { /* ignore */ } -} - -/* to divide a component name from the pin name with the charracter "-" */ - { - /* keywords */ - "(" { yybegin(YYINITIAL); return Keyword.OPEN_BRACKET;} - ")" { yybegin(YYINITIAL); return Keyword.CLOSED_BRACKET;} - - /* identifiers */ - {ComponentIdentifier} { yybegin(YYINITIAL); return yytext(); } - - - /* Characters for quoting strings */ - {QuoteChar1} { string.setLength(0); yybegin(STRING1); } - {QuoteChar2} { string.setLength(0); yybegin(STRING2); } - - /* whitespace */ - {WhiteSpace} { /* ignore */ } -} - - { - {SpecChar2} {return yytext();} -} - -/* error fallback */ -.|\n { throw new Error("Illegal character <"+ - yytext()+">"); } diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SpecctraFileScanner.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SpecctraFileScanner.java deleted file mode 100644 index 32df1f0..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SpecctraFileScanner.java +++ /dev/null @@ -1,1459 +0,0 @@ -/* The following code was generated by JFlex 1.4.1 on 16.10.08 09:27 */ - -package designformats.specctra; -@SuppressWarnings("all") - -/** - * This class is a scanner generated by - * JFlex 1.4.1 - * on 16.10.08 09:27 from the specification file - * C:/Users/Public/Documents/router/sources/designformats/specctra/SpecctraFileDescription.flex - */ -class SpecctraFileScanner implements Scanner { - - /** This character denotes the end of file */ - public static final int YYEOF = -1; - - /** initial size of the lookahead buffer */ - private static final int ZZ_BUFFERSIZE = 16384; - - /** lexical states */ - public static final int COMPONENT_NAME = 5; - public static final int IGNORE_QUOTE = 7; - public static final int YYINITIAL = 0; - public static final int SPEC_CHAR = 6; - public static final int LAYER_NAME = 4; - public static final int STRING2 = 2; - public static final int STRING1 = 1; - public static final int NAME = 3; - - /** - * Translates characters to character classes - */ - private static final String ZZ_CMAP_PACKED = - "\11\0\1\3\1\2\1\0\1\3\1\1\21\0\1\16\1\3\1\16"+ - "\1\11\1\6\1\16\1\16\1\16\1\12\1\53\1\54\1\5\1\20"+ - "\1\16\1\17\1\14\1\4\1\21\11\10\1\16\1\16\1\16\1\16"+ - "\1\16\1\16\1\16\1\23\1\24\1\32\1\42\1\22\1\41\1\35"+ - "\1\43\1\33\1\7\1\44\1\27\1\46\1\36\1\26\1\37\1\52"+ - "\1\40\1\25\1\31\1\30\1\34\1\51\1\47\1\45\1\50\1\16"+ - "\1\15\1\16\1\16\1\13\1\0\1\23\1\24\1\32\1\42\1\22"+ - "\1\41\1\35\1\43\1\33\1\7\1\44\1\27\1\46\1\36\1\26"+ - "\1\37\1\52\1\40\1\25\1\31\1\30\1\34\1\51\1\47\1\45"+ - "\1\50\3\0\1\16\42\0\136\16\1\16\122\0\2\16\14\0\2\16"+ - "\26\0\1\16\4\0\2\16\22\0\2\16\u0133\0\1\16\25\0\1\16"+ - "\u1d36\0\1\16\1\16\3\0\1\16\1\16\1\16\1\0\1\16\1\16"+ - "\1\16\1\0\1\16\1\16\1\16\3\0\1\16\11\0\1\16\10\0"+ - "\1\16\1\16\161\0\1\16\165\0\1\16\udedd\0"; - - /** - * Translates characters to character classes - */ - private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); - - /** - * Translates DFA states to action switch labels. - */ - private static final int [] ZZ_ACTION = zzUnpackAction(); - - private static final String ZZ_ACTION_PACKED_0 = - "\7\0\1\1\1\2\2\3\3\4\1\5\1\6\1\7"+ - "\1\2\1\5\22\4\1\10\1\11\1\12\1\13\1\14"+ - "\1\12\1\1\1\15\1\16\3\1\2\4\3\0\1\17"+ - "\16\4\1\20\45\4\2\1\1\0\1\4\2\17\1\0"+ - "\1\17\22\4\1\21\16\4\1\22\1\4\1\23\13\4"+ - "\1\24\1\25\11\4\1\26\10\4\1\1\1\27\1\0"+ - "\6\4\1\30\6\4\1\31\14\4\1\32\2\4\1\33"+ - "\2\4\1\34\3\4\1\35\2\4\1\36\2\4\1\37"+ - "\5\4\1\40\4\4\1\41\2\4\1\42\2\4\1\43"+ - "\11\4\1\44\3\4\1\1\14\4\1\45\1\46\2\4"+ - "\1\47\1\4\1\50\11\4\1\51\1\52\2\4\1\53"+ - "\20\4\1\54\1\55\1\56\6\4\1\57\3\4\1\60"+ - "\7\4\1\61\1\4\1\1\2\4\1\62\1\63\6\4"+ - "\1\64\3\4\1\65\15\4\1\34\10\4\1\66\1\4"+ - "\1\67\15\4\1\70\1\71\1\72\2\4\1\73\4\4"+ - "\1\74\1\4\1\75\1\4\1\76\4\4\1\77\6\4"+ - "\1\100\3\4\1\101\1\4\1\102\1\103\1\4\1\104"+ - "\3\4\1\105\1\106\6\4\1\107\6\4\1\40\17\4"+ - "\1\110\2\4\1\111\2\4\1\112\12\4\1\113\3\4"+ - "\1\114\2\4\1\115\5\4\1\116\1\4\1\117\14\4"+ - "\1\120\4\4\1\121\3\4\1\122\4\4\1\123\1\4"+ - "\1\124\1\33\1\51\2\4\1\125\5\4\1\126\3\4"+ - "\1\127\4\4\1\42\14\4\1\130\1\4\1\131\3\4"+ - "\1\132\11\4\1\133\1\4\1\134\2\4\1\135\1\4"+ - "\1\136\7\4\1\137\2\4\1\140\1\141\1\4\1\142"+ - "\20\4\1\143\1\144\3\4\1\145\5\4\1\146\1\4"+ - "\1\147\1\150\3\4\1\151\4\4\1\152\1\153\1\154"+ - "\1\155\23\4\1\156\1\4\1\157\11\4\1\160\1\161"+ - "\2\4\1\162\3\4\1\163\3\4\1\164\5\4\1\165"+ - "\6\4\1\166\20\4\1\167\7\4\1\170"; - - private static int [] zzUnpackAction() { - int [] result = new int[712]; - int offset = 0; - offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackAction(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do result[j++] = value; while (--count > 0); - } - return j; - } - - - /** - * Translates a state to a row index in the transition table - */ - private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); - - private static final String ZZ_ROWMAP_PACKED_0 = - "\0\0\0\55\0\132\0\207\0\264\0\341\0\u010e\0\u013b"+ - "\0\u0168\0\u0195\0\u0168\0\u01c2\0\u01ef\0\u021c\0\u0249\0\u0168"+ - "\0\u0168\0\u0276\0\u02a3\0\u02d0\0\u02fd\0\u032a\0\u0357\0\u0384"+ - "\0\u03b1\0\u03de\0\u040b\0\u0438\0\u0465\0\u0492\0\u04bf\0\u04ec"+ - "\0\u0519\0\u0546\0\u0573\0\u05a0\0\u05cd\0\u0168\0\u0168\0\u05fa"+ - "\0\u0168\0\u0168\0\u0627\0\u0654\0\u0168\0\u0168\0\u0681\0\u06ae"+ - "\0\u06db\0\u0168\0\u0708\0\u0735\0\u0762\0\u078f\0\u02a3\0\u07bc"+ - "\0\u07e9\0\u0816\0\u0843\0\u0870\0\u089d\0\u08ca\0\u08f7\0\u0924"+ - "\0\u0951\0\u097e\0\u09ab\0\u09d8\0\u0a05\0\u01ef\0\u0a32\0\u0a5f"+ - "\0\u0a8c\0\u0ab9\0\u0ae6\0\u0b13\0\u0b40\0\u0b6d\0\u0b9a\0\u0bc7"+ - "\0\u0bf4\0\u0c21\0\u0c4e\0\u0c7b\0\u0ca8\0\u0cd5\0\u0d02\0\u0d2f"+ - "\0\u0d5c\0\u0d89\0\u0db6\0\u0de3\0\u0e10\0\u0e3d\0\u0e6a\0\u0e97"+ - "\0\u0ec4\0\u0ef1\0\u0f1e\0\u0f4b\0\u0f78\0\u0fa5\0\u0fd2\0\u0fff"+ - "\0\u102c\0\u1059\0\u1086\0\u10b3\0\u10e0\0\u110d\0\u113a\0\u1167"+ - "\0\u1194\0\u11c1\0\u0168\0\u11ee\0\u121b\0\u1248\0\u1275\0\u12a2"+ - "\0\u12cf\0\u12fc\0\u1329\0\u1356\0\u1383\0\u13b0\0\u13dd\0\u140a"+ - "\0\u1437\0\u1464\0\u1491\0\u14be\0\u14eb\0\u01ef\0\u1518\0\u1545"+ - "\0\u1572\0\u159f\0\u15cc\0\u15f9\0\u1626\0\u1653\0\u1680\0\u16ad"+ - "\0\u16da\0\u1707\0\u1734\0\u1761\0\u178e\0\u17bb\0\u17e8\0\u1815"+ - "\0\u1842\0\u186f\0\u189c\0\u18c9\0\u18f6\0\u1923\0\u1950\0\u197d"+ - "\0\u19aa\0\u19d7\0\u01ef\0\u1a04\0\u1a31\0\u1a5e\0\u1a8b\0\u1ab8"+ - "\0\u1ae5\0\u1b12\0\u1b3f\0\u1b6c\0\u1b99\0\u01ef\0\u1bc6\0\u1bf3"+ - "\0\u1c20\0\u1c4d\0\u1c7a\0\u1ca7\0\u1cd4\0\u1d01\0\u1d2e\0\u0654"+ - "\0\u1d5b\0\u1d88\0\u1db5\0\u1de2\0\u1e0f\0\u1e3c\0\u1e69\0\u01ef"+ - "\0\u1e96\0\u1ec3\0\u1ef0\0\u1f1d\0\u1f4a\0\u1f77\0\u01ef\0\u1fa4"+ - "\0\u1fd1\0\u1ffe\0\u202b\0\u2058\0\u2085\0\u20b2\0\u20df\0\u210c"+ - "\0\u2139\0\u2166\0\u2193\0\u01ef\0\u21c0\0\u21ed\0\u221a\0\u2247"+ - "\0\u2274\0\u22a1\0\u22ce\0\u22fb\0\u2328\0\u01ef\0\u2355\0\u2382"+ - "\0\u01ef\0\u23af\0\u23dc\0\u01ef\0\u2409\0\u2436\0\u2463\0\u2490"+ - "\0\u24bd\0\u24ea\0\u2517\0\u2544\0\u2571\0\u259e\0\u01ef\0\u25cb"+ - "\0\u25f8\0\u2625\0\u2652\0\u267f\0\u26ac\0\u26d9\0\u2706\0\u2733"+ - "\0\u2760\0\u278d\0\u27ba\0\u27e7\0\u2814\0\u2841\0\u286e\0\u289b"+ - "\0\u28c8\0\u28f5\0\u2922\0\u294f\0\u297c\0\u29a9\0\u29d6\0\u2a03"+ - "\0\u2a30\0\u2a5d\0\u2a8a\0\u2ab7\0\u2ae4\0\u2b11\0\u2b3e\0\u01ef"+ - "\0\u01ef\0\u2b6b\0\u2b98\0\u01ef\0\u2bc5\0\u2bf2\0\u2c1f\0\u2c4c"+ - "\0\u2c79\0\u2ca6\0\u2cd3\0\u2d00\0\u2d2d\0\u2d5a\0\u2d87\0\u2db4"+ - "\0\u2de1\0\u2e0e\0\u2e3b\0\u01ef\0\u2e68\0\u2e95\0\u2ec2\0\u2eef"+ - "\0\u2f1c\0\u2f49\0\u2f76\0\u2fa3\0\u2fd0\0\u2ffd\0\u302a\0\u3057"+ - "\0\u3084\0\u30b1\0\u30de\0\u310b\0\u01ef\0\u3138\0\u3165\0\u3192"+ - "\0\u31bf\0\u31ec\0\u3219\0\u3246\0\u3273\0\u01ef\0\u32a0\0\u32cd"+ - "\0\u32fa\0\u01ef\0\u3327\0\u3354\0\u3381\0\u33ae\0\u33db\0\u3408"+ - "\0\u3435\0\u01ef\0\u3462\0\u348f\0\u34bc\0\u34e9\0\u01ef\0\u01ef"+ - "\0\u3516\0\u3543\0\u3570\0\u359d\0\u35ca\0\u35f7\0\u01ef\0\u3624"+ - "\0\u3651\0\u367e\0\u01ef\0\u36ab\0\u36d8\0\u3705\0\u3732\0\u375f"+ - "\0\u378c\0\u37b9\0\u37e6\0\u3813\0\u3840\0\u386d\0\u389a\0\u38c7"+ - "\0\u01ef\0\u38f4\0\u3921\0\u394e\0\u397b\0\u39a8\0\u39d5\0\u3a02"+ - "\0\u3a2f\0\u01ef\0\u3a5c\0\u01ef\0\u3a89\0\u3ab6\0\u3ae3\0\u3b10"+ - "\0\u3b3d\0\u3b6a\0\u3b97\0\u3bc4\0\u3bf1\0\u3c1e\0\u3c4b\0\u3c78"+ - "\0\u3ca5\0\u01ef\0\u3cd2\0\u01ef\0\u3cff\0\u3d2c\0\u01ef\0\u3d59"+ - "\0\u3d86\0\u3db3\0\u3de0\0\u01ef\0\u3e0d\0\u01ef\0\u3e3a\0\u0654"+ - "\0\u3e67\0\u3e94\0\u3ec1\0\u3eee\0\u01ef\0\u3f1b\0\u3f48\0\u3f75"+ - "\0\u3fa2\0\u3fcf\0\u3ffc\0\u01ef\0\u4029\0\u4056\0\u4083\0\u01ef"+ - "\0\u40b0\0\u01ef\0\u01ef\0\u40dd\0\u01ef\0\u410a\0\u4137\0\u4164"+ - "\0\u01ef\0\u01ef\0\u4191\0\u41be\0\u41eb\0\u4218\0\u4245\0\u4272"+ - "\0\u429f\0\u42cc\0\u42f9\0\u4326\0\u4353\0\u4380\0\u43ad\0\u01ef"+ - "\0\u43da\0\u4407\0\u4434\0\u4461\0\u448e\0\u44bb\0\u44e8\0\u4515"+ - "\0\u4542\0\u456f\0\u459c\0\u45c9\0\u45f6\0\u4623\0\u4650\0\u01ef"+ - "\0\u467d\0\u46aa\0\u01ef\0\u46d7\0\u4704\0\u01ef\0\u4731\0\u475e"+ - "\0\u478b\0\u47b8\0\u47e5\0\u4812\0\u483f\0\u486c\0\u4899\0\u48c6"+ - "\0\u01ef\0\u48f3\0\u4920\0\u494d\0\u01ef\0\u497a\0\u49a7\0\u01ef"+ - "\0\u49d4\0\u4a01\0\u4a2e\0\u4a5b\0\u4a88\0\u01ef\0\u4ab5\0\u01ef"+ - "\0\u4ae2\0\u4b0f\0\u4b3c\0\u4b69\0\u4b96\0\u4bc3\0\u4bf0\0\u4c1d"+ - "\0\u4c4a\0\u4c77\0\u4ca4\0\u4cd1\0\u01ef\0\u4cfe\0\u4d2b\0\u4d58"+ - "\0\u4d85\0\u4db2\0\u4ddf\0\u4e0c\0\u4e39\0\u01ef\0\u4e66\0\u4e93"+ - "\0\u4ec0\0\u4eed\0\u01ef\0\u4f1a\0\u01ef\0\u01ef\0\u4f47\0\u4f74"+ - "\0\u4fa1\0\u01ef\0\u4fce\0\u4ffb\0\u5028\0\u5055\0\u5082\0\u01ef"+ - "\0\u50af\0\u50dc\0\u5109\0\u01ef\0\u5136\0\u5163\0\u5190\0\u51bd"+ - "\0\u01ef\0\u51ea\0\u5217\0\u5244\0\u5271\0\u529e\0\u52cb\0\u52f8"+ - "\0\u5325\0\u5352\0\u537f\0\u53ac\0\u53d9\0\u01ef\0\u5406\0\u01ef"+ - "\0\u5433\0\u5460\0\u548d\0\u01ef\0\u54ba\0\u54e7\0\u5514\0\u5541"+ - "\0\u556e\0\u559b\0\u55c8\0\u55f5\0\u5622\0\u01ef\0\u564f\0\u01ef"+ - "\0\u567c\0\u56a9\0\u01ef\0\u56d6\0\u01ef\0\u5703\0\u5730\0\u575d"+ - "\0\u578a\0\u57b7\0\u57e4\0\u5811\0\u01ef\0\u583e\0\u586b\0\u01ef"+ - "\0\u01ef\0\u5898\0\u01ef\0\u58c5\0\u58f2\0\u591f\0\u594c\0\u5979"+ - "\0\u59a6\0\u59d3\0\u5a00\0\u5a2d\0\u5a5a\0\u5a87\0\u5ab4\0\u5ae1"+ - "\0\u5b0e\0\u5b3b\0\u5b68\0\u01ef\0\u5b95\0\u5bc2\0\u5bef\0\u5c1c"+ - "\0\u01ef\0\u5c49\0\u5c76\0\u5ca3\0\u5cd0\0\u5cfd\0\u01ef\0\u5d2a"+ - "\0\u01ef\0\u01ef\0\u5d57\0\u5d84\0\u5db1\0\u01ef\0\u5dde\0\u5e0b"+ - "\0\u5e38\0\u5e65\0\u01ef\0\u01ef\0\u01ef\0\u01ef\0\u5e92\0\u5ebf"+ - "\0\u5eec\0\u5f19\0\u5f46\0\u5f73\0\u5fa0\0\u5fcd\0\u5ffa\0\u6027"+ - "\0\u6054\0\u6081\0\u60ae\0\u60db\0\u6108\0\u6135\0\u6162\0\u618f"+ - "\0\u61bc\0\u01ef\0\u61e9\0\u01ef\0\u6216\0\u6243\0\u6270\0\u629d"+ - "\0\u62ca\0\u62f7\0\u6324\0\u6351\0\u637e\0\u01ef\0\u01ef\0\u63ab"+ - "\0\u63d8\0\u01ef\0\u6405\0\u6432\0\u645f\0\u01ef\0\u648c\0\u64b9"+ - "\0\u64e6\0\u6513\0\u6540\0\u656d\0\u659a\0\u65c7\0\u65f4\0\u01ef"+ - "\0\u6621\0\u664e\0\u667b\0\u66a8\0\u66d5\0\u6702\0\u01ef\0\u672f"+ - "\0\u675c\0\u6789\0\u67b6\0\u67e3\0\u6810\0\u683d\0\u686a\0\u6897"+ - "\0\u68c4\0\u68f1\0\u691e\0\u694b\0\u6978\0\u69a5\0\u69d2\0\u01ef"+ - "\0\u69ff\0\u6a2c\0\u6a59\0\u6a86\0\u6ab3\0\u6ae0\0\u6b0d\0\u01ef"; - - private static int [] zzUnpackRowMap() { - int [] result = new int[712]; - int offset = 0; - offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackRowMap(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int high = packed.charAt(i++) << 16; - result[j++] = high | packed.charAt(i++); - } - return j; - } - - /** - * The transition table of the DFA - */ - private static final int [] ZZ_TRANS = zzUnpackTrans(); - - private static final String ZZ_TRANS_PACKED_0 = - "\1\11\1\12\2\13\1\14\1\15\1\16\1\15\1\17"+ - "\1\20\1\21\4\15\2\22\1\23\1\15\1\24\1\25"+ - "\1\26\1\27\1\30\1\31\1\32\1\33\1\34\1\35"+ - "\1\36\1\37\1\40\1\41\1\42\1\15\1\43\1\44"+ - "\4\15\1\45\1\15\1\46\1\47\11\50\1\51\3\50"+ - "\1\52\37\50\12\53\1\51\2\53\1\52\37\53\1\11"+ - "\1\12\2\13\5\54\1\20\1\21\40\54\1\55\1\56"+ - "\1\11\1\12\2\13\5\54\1\20\1\21\12\54\1\57"+ - "\11\54\1\60\13\54\1\55\1\56\1\11\1\12\2\13"+ - "\5\61\1\20\1\21\4\61\1\11\33\61\1\55\1\56"+ - "\4\11\3\62\4\11\6\62\35\11\1\12\2\13\47\54"+ - "\1\55\1\56\57\0\1\13\56\0\1\15\1\63\45\15"+ - "\6\0\47\15\2\0\1\64\1\12\1\13\1\64\47\16"+ - "\2\64\10\0\1\17\3\0\1\65\4\0\1\17\1\66"+ - "\42\0\1\17\10\0\1\23\43\0\1\67\3\0\1\65"+ - "\4\0\1\67\1\66\36\0\20\15\1\70\3\15\1\71"+ - "\1\72\1\73\2\15\1\74\15\15\6\0\17\15\1\75"+ - "\2\15\1\76\24\15\6\0\16\15\1\77\6\15\1\100"+ - "\1\15\1\101\2\15\1\102\1\103\3\15\1\104\7\15"+ - "\6\0\24\15\1\105\5\15\1\106\1\15\1\107\1\110"+ - "\11\15\6\0\16\15\1\111\1\112\2\15\1\113\4\15"+ - "\1\114\17\15\6\0\21\15\1\115\25\15\6\0\41\15"+ - "\1\116\5\15\6\0\22\15\1\117\1\120\3\15\1\121"+ - "\17\15\6\0\42\15\1\122\4\15\6\0\16\15\1\123"+ - "\10\15\1\124\17\15\6\0\16\15\1\125\30\15\6\0"+ - "\16\15\1\126\3\15\1\127\4\15\1\130\17\15\6\0"+ - "\17\15\1\131\2\15\1\132\1\133\1\134\1\15\1\135"+ - "\1\136\4\15\1\137\12\15\6\0\16\15\1\140\3\15"+ - "\1\141\1\15\1\142\22\15\6\0\17\15\1\143\2\15"+ - "\1\144\1\145\3\15\1\146\4\15\1\147\12\15\6\0"+ - "\22\15\1\150\24\15\6\0\16\15\1\151\30\15\6\0"+ - "\27\15\1\152\4\15\1\153\12\15\2\0\11\50\1\0"+ - "\3\50\1\0\37\50\12\53\1\0\2\53\1\0\37\53"+ - "\4\0\47\54\6\0\27\54\1\154\17\54\6\0\26\54"+ - "\1\155\20\54\6\0\13\61\1\0\33\61\2\0\4\156"+ - "\1\157\1\15\45\157\2\156\1\64\1\12\1\13\52\64"+ - "\10\0\1\160\10\0\1\160\43\0\1\161\6\0\2\162"+ - "\1\163\37\0\21\15\1\164\25\15\6\0\25\15\1\165"+ - "\21\15\6\0\25\15\1\166\21\15\6\0\25\15\1\167"+ - "\21\15\6\0\17\15\1\170\27\15\6\0\26\15\1\171"+ - "\20\15\6\0\24\15\1\172\22\15\6\0\21\15\1\173"+ - "\25\15\6\0\17\15\1\174\14\15\1\175\12\15\6\0"+ - "\31\15\1\176\4\15\1\177\10\15\6\0\17\15\1\200"+ - "\27\15\6\0\17\15\1\201\27\15\6\0\17\15\1\202"+ - "\2\15\1\203\24\15\6\0\25\15\1\204\21\15\6\0"+ - "\36\15\1\205\10\15\6\0\35\15\1\206\11\15\6\0"+ - "\32\15\1\207\14\15\6\0\41\15\1\210\5\15\6\0"+ - "\26\15\1\211\2\15\1\212\15\15\6\0\20\15\1\213"+ - "\26\15\6\0\16\15\1\214\30\15\6\0\33\15\1\215"+ - "\13\15\6\0\32\15\1\216\7\15\1\217\4\15\6\0"+ - "\16\15\1\220\1\221\27\15\6\0\34\15\1\222\12\15"+ - "\6\0\17\15\1\223\27\15\6\0\34\15\1\224\12\15"+ - "\6\0\17\15\1\225\27\15\6\0\32\15\1\226\14\15"+ - "\6\0\25\15\1\227\21\15\6\0\32\15\1\230\1\15"+ - "\1\231\12\15\6\0\32\15\1\232\14\15\6\0\25\15"+ - "\1\233\6\15\1\234\1\15\1\235\10\15\6\0\21\15"+ - "\1\236\1\15\1\237\21\15\1\240\1\15\6\0\17\15"+ - "\1\241\27\15\6\0\23\15\1\242\23\15\6\0\20\15"+ - "\1\243\26\15\6\0\32\15\1\244\14\15\6\0\16\15"+ - "\1\245\30\15\6\0\21\15\1\246\4\15\1\247\20\15"+ - "\6\0\24\15\1\250\1\251\21\15\6\0\23\15\1\252"+ - "\23\15\6\0\32\15\1\253\14\15\6\0\34\15\1\254"+ - "\12\15\6\0\27\15\1\255\17\15\6\0\43\15\1\256"+ - "\3\15\6\0\22\15\1\257\24\15\6\0\21\15\1\260"+ - "\12\15\1\261\12\15\6\0\16\15\1\262\30\15\6\0"+ - "\32\15\1\263\1\15\1\264\1\15\1\265\10\15\6\0"+ - "\27\15\1\266\17\15\6\0\31\54\1\267\15\54\6\0"+ - "\20\54\1\270\26\54\2\0\5\156\1\271\53\156\1\157"+ - "\1\272\45\157\2\156\10\0\1\160\10\0\1\160\1\66"+ - "\42\0\1\161\10\0\1\161\43\0\1\161\10\0\1\163"+ - "\37\0\22\15\1\273\24\15\6\0\22\15\1\274\24\15"+ - "\6\0\17\15\1\275\27\15\6\0\27\15\1\276\17\15"+ - "\6\0\27\15\1\277\17\15\6\0\40\15\1\300\6\15"+ - "\6\0\32\15\1\301\14\15\6\0\21\15\1\302\25\15"+ - "\6\0\34\15\1\303\12\15\6\0\24\15\1\304\2\15"+ - "\1\305\17\15\6\0\32\15\1\306\14\15\6\0\16\15"+ - "\1\307\30\15\6\0\33\15\1\310\13\15\6\0\34\15"+ - "\1\311\12\15\6\0\33\15\1\312\13\15\6\0\30\15"+ - "\1\313\16\15\6\0\23\15\1\314\23\15\6\0\16\15"+ - "\1\315\30\15\6\0\31\15\1\316\15\15\6\0\16\15"+ - "\1\317\30\15\6\0\40\15\1\320\6\15\6\0\27\15"+ - "\1\321\17\15\6\0\34\15\1\322\12\15\6\0\7\15"+ - "\1\323\37\15\6\0\16\15\1\324\30\15\6\0\21\15"+ - "\1\325\3\15\1\326\21\15\6\0\33\15\1\327\13\15"+ - "\6\0\17\15\1\330\27\15\6\0\21\15\1\331\25\15"+ - "\6\0\26\15\1\332\20\15\6\0\31\15\1\333\15\15"+ - "\6\0\25\15\1\334\21\15\6\0\7\15\1\335\11\15"+ - "\1\336\25\15\6\0\16\15\1\337\30\15\6\0\45\15"+ - "\1\340\1\15\6\0\16\15\1\341\30\15\6\0\42\15"+ - "\1\342\4\15\6\0\16\15\1\343\30\15\6\0\37\15"+ - "\1\344\7\15\6\0\21\15\1\345\3\15\1\346\21\15"+ - "\6\0\21\15\1\347\25\15\6\0\25\15\1\350\1\15"+ - "\1\351\17\15\6\0\41\15\1\352\5\15\6\0\16\15"+ - "\1\353\30\15\6\0\26\15\1\354\3\15\1\355\14\15"+ - "\6\0\23\15\1\356\23\15\6\0\21\15\1\357\25\15"+ - "\6\0\35\15\1\360\11\15\6\0\22\15\1\361\24\15"+ - "\6\0\25\15\1\362\21\15\6\0\25\15\1\363\21\15"+ - "\6\0\17\15\1\364\27\15\6\0\16\15\1\365\30\15"+ - "\6\0\22\15\1\366\24\15\6\0\25\15\1\367\21\15"+ - "\6\0\33\15\1\370\13\15\6\0\32\15\1\371\7\15"+ - "\1\372\4\15\6\0\25\15\1\373\21\15\6\0\27\15"+ - "\1\374\17\15\6\0\33\15\1\375\13\15\6\0\36\15"+ - "\1\376\10\15\6\0\16\15\1\377\10\15\1\u0100\17\15"+ - "\6\0\25\15\1\u0101\21\15\6\0\25\15\1\u0102\21\15"+ - "\6\0\32\54\1\u0103\14\54\2\0\4\156\1\13\1\271"+ - "\53\156\1\15\1\272\45\157\2\156\4\0\23\15\1\u0104"+ - "\23\15\6\0\34\15\1\u0105\12\15\6\0\26\15\1\u0106"+ - "\20\15\6\0\30\15\1\u0107\16\15\6\0\32\15\1\u0108"+ - "\14\15\6\0\36\15\1\u0109\10\15\6\0\27\15\1\u010a"+ - "\17\15\6\0\25\15\1\u010b\21\15\6\0\26\15\1\u010c"+ - "\20\15\6\0\32\15\1\u010d\14\15\6\0\17\15\1\u010e"+ - "\27\15\6\0\7\15\1\u010f\37\15\6\0\16\15\1\u0110"+ - "\30\15\6\0\16\15\1\u0111\30\15\6\0\16\15\1\u0112"+ - "\30\15\6\0\27\15\1\u0113\17\15\6\0\34\15\1\u0114"+ - "\12\15\6\0\25\15\1\u0115\21\15\6\0\34\15\1\u0116"+ - "\12\15\6\0\7\15\1\u0117\37\15\6\0\26\15\1\u0118"+ - "\20\15\6\0\17\15\1\u0119\27\15\6\0\23\15\1\u011a"+ - "\4\15\1\u011b\1\15\1\u011c\14\15\6\0\25\15\1\u011d"+ - "\21\15\6\0\34\15\1\u011e\12\15\6\0\22\15\1\u011f"+ - "\24\15\6\0\34\15\1\u0120\12\15\6\0\21\15\1\u0121"+ - "\25\15\6\0\23\15\1\u0122\1\u0123\22\15\6\0\16\15"+ - "\1\u0124\30\15\6\0\27\15\1\u0125\17\15\6\0\17\15"+ - "\1\u0126\6\15\1\u0127\5\15\1\u0128\3\15\1\u0129\6\15"+ - "\6\0\34\15\1\u012a\12\15\6\0\22\15\1\u012b\24\15"+ - "\6\0\17\15\1\u012c\27\15\6\0\25\15\1\u012d\21\15"+ - "\6\0\16\15\1\u012e\30\15\6\0\7\15\1\u012f\37\15"+ - "\6\0\25\15\1\u0130\21\15\6\0\34\15\1\u0131\12\15"+ - "\6\0\25\15\1\u0132\21\15\6\0\23\15\1\u0133\5\15"+ - "\1\u0134\15\15\6\0\34\15\1\u0135\12\15\6\0\16\15"+ - "\1\u0136\30\15\6\0\16\15\1\u0137\30\15\6\0\7\15"+ - "\1\u0138\37\15\6\0\16\15\1\u0139\30\15\6\0\23\15"+ - "\1\u013a\23\15\6\0\17\15\1\u013b\27\15\6\0\16\15"+ - "\1\u013c\30\15\6\0\25\15\1\u013d\21\15\6\0\21\15"+ - "\1\u013e\25\15\6\0\24\15\1\u013f\22\15\6\0\41\15"+ - "\1\u0140\5\15\6\0\7\15\1\u0141\37\15\6\0\25\15"+ - "\1\u0142\21\15\6\0\25\15\1\u0143\21\15\6\0\7\15"+ - "\1\u0144\37\15\6\0\44\15\1\u0145\2\15\6\0\22\15"+ - "\1\u0146\24\15\6\0\22\15\1\u0147\24\15\6\0\7\15"+ - "\1\u0148\37\15\6\0\32\15\1\u0149\14\15\6\0\37\15"+ - "\1\u014a\7\15\6\0\16\15\1\u014b\30\15\6\0\17\54"+ - "\1\u014c\27\54\6\0\24\15\1\u014d\22\15\6\0\22\15"+ - "\1\u014e\24\15\6\0\37\15\1\u014f\7\15\6\0\16\15"+ - "\1\u0150\30\15\6\0\21\15\1\u0151\25\15\6\0\17\15"+ - "\1\u0152\27\15\6\0\22\15\1\u0153\24\15\6\0\7\15"+ - "\1\u0154\37\15\6\0\25\15\1\u0155\21\15\6\0\31\15"+ - "\1\u0156\15\15\6\0\23\15\1\u0157\23\15\6\0\17\15"+ - "\1\u0158\27\15\6\0\7\15\1\u0159\37\15\6\0\32\15"+ - "\1\u015a\14\15\6\0\37\15\1\u015b\7\15\6\0\7\15"+ - "\1\u015c\37\15\6\0\25\15\1\u015d\21\15\6\0\17\15"+ - "\1\u015e\27\15\6\0\34\15\1\u015f\12\15\6\0\17\15"+ - "\1\u0160\27\15\6\0\27\15\1\u0161\17\15\6\0\16\15"+ - "\1\u0162\30\15\6\0\17\15\1\u0163\27\15\6\0\22\15"+ - "\1\u0164\24\15\6\0\32\15\1\u0165\14\15\6\0\17\15"+ - "\1\u0166\27\15\6\0\7\15\1\u0167\6\15\1\u0168\30\15"+ - "\6\0\16\15\1\u0169\30\15\6\0\27\15\1\u016a\17\15"+ - "\6\0\26\15\1\u016b\20\15\6\0\25\15\1\u016c\21\15"+ - "\6\0\22\15\1\u016d\24\15\6\0\24\15\1\u016e\22\15"+ - "\6\0\16\15\1\u016f\30\15\6\0\17\15\1\u0170\27\15"+ - "\6\0\34\15\1\u0171\12\15\6\0\23\15\1\u0172\23\15"+ - "\6\0\41\15\1\u0173\5\15\6\0\34\15\1\u0174\12\15"+ - "\6\0\23\15\1\u0175\23\15\6\0\17\15\1\u0176\27\15"+ - "\6\0\22\15\1\u0177\24\15\6\0\27\15\1\u0178\17\15"+ - "\6\0\27\15\1\u0179\17\15\6\0\22\15\1\u017a\24\15"+ - "\6\0\7\15\1\u017b\32\15\1\u017c\4\15\6\0\7\15"+ - "\1\u017d\37\15\6\0\25\15\1\u017e\21\15\6\0\34\15"+ - "\1\u017f\12\15\6\0\24\15\1\u0180\22\15\6\0\32\15"+ - "\1\u0181\14\15\6\0\21\15\1\u0182\25\15\6\0\16\15"+ - "\1\u0183\30\15\6\0\25\15\1\u0184\21\15\6\0\35\15"+ - "\1\u0185\11\15\6\0\21\15\1\u0186\25\15\6\0\22\15"+ - "\1\u0187\24\15\6\0\26\15\1\u0188\1\15\1\u0189\16\15"+ - "\6\0\22\15\1\u018a\24\15\6\0\24\15\1\u018b\22\15"+ - "\6\0\45\15\1\u018c\1\15\6\0\40\15\1\u018d\6\15"+ - "\6\0\31\15\1\u018e\15\15\6\0\7\15\1\u018f\37\15"+ - "\6\0\23\54\1\u0190\23\54\6\0\25\15\1\u0191\21\15"+ - "\6\0\24\15\1\u0192\22\15\6\0\25\15\1\u0193\21\15"+ - "\6\0\34\15\1\u0194\12\15\6\0\32\15\1\u0195\14\15"+ - "\6\0\33\15\1\u0196\1\u0197\12\15\6\0\24\15\1\u0198"+ - "\22\15\6\0\7\15\1\u0199\37\15\6\0\32\15\1\u019a"+ - "\14\15\6\0\35\15\1\u019b\11\15\6\0\16\15\1\u019c"+ - "\30\15\6\0\34\15\1\u019d\12\15\6\0\41\15\1\u019e"+ - "\5\15\6\0\23\15\1\u019f\23\15\6\0\41\15\1\u01a0"+ - "\5\15\6\0\41\15\1\u01a1\5\15\6\0\17\15\1\u01a2"+ - "\27\15\6\0\25\15\1\u01a3\21\15\6\0\32\15\1\u01a4"+ - "\14\15\6\0\23\15\1\u01a5\23\15\6\0\16\15\1\u01a6"+ - "\30\15\6\0\32\15\1\u01a7\14\15\6\0\26\15\1\u01a8"+ - "\20\15\6\0\21\15\1\u01a9\25\15\6\0\25\15\1\u01aa"+ - "\21\15\6\0\17\15\1\u01ab\27\15\6\0\7\15\1\u01ac"+ - "\37\15\6\0\21\15\1\u01ad\25\15\6\0\23\15\1\u01ae"+ - "\23\15\6\0\16\15\1\u01af\30\15\6\0\25\15\1\u01b0"+ - "\21\15\6\0\40\15\1\u01b1\6\15\6\0\7\15\1\u01b2"+ - "\37\15\6\0\27\15\1\u01b3\17\15\6\0\26\15\1\u01b4"+ - "\20\15\6\0\24\15\1\u01b5\22\15\6\0\22\15\1\u01b6"+ - "\24\15\6\0\32\15\1\u01b7\14\15\6\0\32\15\1\u01b8"+ - "\14\15\6\0\26\15\1\u01b9\11\15\1\u01ba\6\15\6\0"+ - "\16\15\1\u01bb\30\15\6\0\30\15\1\u01bc\16\15\6\0"+ - "\27\15\1\u01bd\17\15\6\0\16\15\1\u01be\15\15\1\u01bf"+ - "\12\15\6\0\25\15\1\u01c0\21\15\6\0\31\15\1\u01c1"+ - "\15\15\6\0\7\15\1\u01c2\37\15\6\0\27\15\1\u01c3"+ - "\17\15\6\0\25\15\1\u01c4\21\15\6\0\17\15\1\u01c5"+ - "\27\15\6\0\16\15\1\u01c6\30\15\6\0\32\15\1\u01c7"+ - "\14\15\6\0\25\15\1\u01c8\21\15\6\0\16\15\1\u01c9"+ - "\30\15\6\0\34\15\1\u01ca\12\15\6\0\16\15\1\u01cb"+ - "\30\15\6\0\25\15\1\u01cc\21\15\6\0\7\15\1\u01cd"+ - "\37\15\6\0\41\15\1\u01ce\5\15\6\0\17\15\1\u01cf"+ - "\27\15\6\0\27\15\1\u01d0\17\15\6\0\34\15\1\u01d1"+ - "\12\15\6\0\46\15\1\u01d2\6\0\31\15\1\u01d3\15\15"+ - "\6\0\27\15\1\u01d4\17\15\6\0\24\15\1\u01d5\22\15"+ - "\6\0\33\15\1\u01d6\13\15\6\0\7\15\1\u01d7\37\15"+ - "\6\0\16\15\1\u01d8\30\15\6\0\25\15\1\u01d9\21\15"+ - "\6\0\32\15\1\u01da\14\15\6\0\26\15\1\u01db\20\15"+ - "\6\0\23\15\1\u01dc\23\15\6\0\23\15\1\u01dd\23\15"+ - "\6\0\21\15\1\u01de\25\15\6\0\25\15\1\u01df\21\15"+ - "\6\0\16\15\1\u01e0\30\15\6\0\33\15\1\u01e1\13\15"+ - "\6\0\16\15\1\u01e2\30\15\6\0\7\15\1\u01e3\37\15"+ - "\6\0\36\15\1\u01e4\10\15\6\0\20\15\1\u01e5\26\15"+ - "\6\0\40\15\1\u01e6\6\15\6\0\25\15\1\u01e7\21\15"+ - "\6\0\32\15\1\u01e8\14\15\6\0\16\15\1\u01e9\30\15"+ - "\6\0\22\15\1\u01ea\24\15\6\0\16\15\1\u01eb\30\15"+ - "\6\0\32\15\1\u01ec\14\15\6\0\27\15\1\u01ed\17\15"+ - "\6\0\31\15\1\u01ee\15\15\6\0\36\15\1\u01ef\10\15"+ - "\6\0\16\15\1\u01be\30\15\6\0\27\15\1\u01f0\17\15"+ - "\6\0\23\15\1\u01f1\23\15\6\0\35\15\1\u01f2\11\15"+ - "\6\0\30\15\1\u01f3\16\15\6\0\41\15\1\u01f4\5\15"+ - "\6\0\36\15\1\u01f5\10\15\6\0\34\15\1\u01f6\12\15"+ - "\6\0\25\15\1\u01f7\21\15\6\0\16\15\1\u01f8\30\15"+ - "\6\0\16\15\1\u01f9\30\15\6\0\16\15\1\u01fa\30\15"+ - "\6\0\33\15\1\u01fb\13\15\6\0\21\15\1\u01fc\25\15"+ - "\6\0\33\15\1\u01fd\13\15\6\0\16\15\1\u01fe\30\15"+ - "\6\0\24\15\1\u01ff\22\15\6\0\23\15\1\u0200\23\15"+ - "\6\0\43\15\1\u0201\3\15\6\0\23\15\1\u0202\23\15"+ - "\6\0\16\15\1\u0203\30\15\6\0\33\15\1\u0204\13\15"+ - "\6\0\34\15\1\u0205\12\15\6\0\25\15\1\u0206\21\15"+ - "\6\0\16\15\1\u0207\30\15\6\0\17\15\1\u0208\27\15"+ - "\6\0\42\15\1\u0209\4\15\6\0\21\15\1\u020a\25\15"+ - "\6\0\22\15\1\u020b\24\15\6\0\36\15\1\u020c\10\15"+ - "\6\0\22\15\1\u020d\24\15\6\0\16\15\1\u020e\30\15"+ - "\6\0\34\15\1\u020f\12\15\6\0\16\15\1\u0210\30\15"+ - "\6\0\7\15\1\u0211\37\15\6\0\32\15\1\u0212\14\15"+ - "\6\0\16\15\1\u0213\30\15\6\0\25\15\1\u0214\21\15"+ - "\6\0\17\15\1\u0215\27\15\6\0\37\15\1\u0216\7\15"+ - "\6\0\7\15\1\u0217\37\15\6\0\22\15\1\u0218\24\15"+ - "\6\0\16\15\1\u0219\30\15\6\0\27\15\1\u021a\17\15"+ - "\6\0\16\15\1\u021b\30\15\6\0\23\15\1\u021c\23\15"+ - "\6\0\21\15\1\u021d\25\15\6\0\17\15\1\u021e\27\15"+ - "\6\0\33\15\1\u021f\13\15\6\0\21\15\1\u0220\25\15"+ - "\6\0\7\15\1\u0221\37\15\6\0\34\15\1\u0222\12\15"+ - "\6\0\21\15\1\u0223\25\15\6\0\24\15\1\u0224\22\15"+ - "\6\0\22\15\1\u0225\24\15\6\0\16\15\1\u0226\30\15"+ - "\6\0\16\15\1\u0227\30\15\6\0\16\15\1\u0228\30\15"+ - "\6\0\17\15\1\u0229\27\15\6\0\7\15\1\u022a\37\15"+ - "\6\0\21\15\1\u022b\25\15\6\0\36\15\1\u022c\10\15"+ - "\6\0\24\15\1\u022d\22\15\6\0\7\15\1\u022e\37\15"+ - "\6\0\24\15\1\u022f\22\15\6\0\31\15\1\u0230\15\15"+ - "\6\0\17\15\1\u0231\27\15\6\0\33\15\1\u0232\13\15"+ - "\6\0\25\15\1\u0233\21\15\6\0\33\15\1\u0234\13\15"+ - "\6\0\7\15\1\u0235\37\15\6\0\25\15\1\u0236\21\15"+ - "\6\0\36\15\1\u0237\10\15\6\0\32\15\1\u0238\14\15"+ - "\6\0\34\15\1\u0239\12\15\6\0\7\15\1\u023a\37\15"+ - "\6\0\16\15\1\u023b\30\15\6\0\27\15\1\u023c\17\15"+ - "\6\0\23\15\1\u023d\23\15\6\0\22\15\1\u023e\24\15"+ - "\6\0\22\15\1\u023f\24\15\6\0\21\15\1\u0240\25\15"+ - "\6\0\16\15\1\u0241\30\15\6\0\7\15\1\u0242\37\15"+ - "\6\0\33\15\1\u0243\13\15\6\0\25\15\1\u0244\21\15"+ - "\6\0\36\15\1\u0245\10\15\6\0\34\15\1\u0246\12\15"+ - "\6\0\26\15\1\u0247\20\15\6\0\21\15\1\u0248\25\15"+ - "\6\0\25\15\1\u0249\21\15\6\0\20\15\1\u024a\26\15"+ - "\6\0\25\15\1\u024b\21\15\6\0\34\15\1\u024c\12\15"+ - "\6\0\34\15\1\u024d\12\15\6\0\17\15\1\u024e\27\15"+ - "\6\0\34\15\1\u024f\12\15\6\0\22\15\1\u0250\24\15"+ - "\6\0\26\15\1\u0251\20\15\6\0\27\15\1\u0252\17\15"+ - "\6\0\21\15\1\u0253\25\15\6\0\36\15\1\u0254\10\15"+ - "\6\0\22\15\1\u0255\24\15\6\0\24\15\1\u0256\22\15"+ - "\6\0\23\15\1\u0257\23\15\6\0\16\15\1\u0258\30\15"+ - "\6\0\35\15\1\u0259\11\15\6\0\32\15\1\u025a\14\15"+ - "\6\0\7\15\1\u025b\37\15\6\0\16\15\1\u025c\30\15"+ - "\6\0\25\15\1\u025d\21\15\6\0\23\15\1\u025e\23\15"+ - "\6\0\41\15\1\u025f\5\15\6\0\16\15\1\u0260\30\15"+ - "\6\0\41\15\1\u0261\5\15\6\0\25\15\1\u0262\21\15"+ - "\6\0\22\15\1\u0263\24\15\6\0\24\15\1\u0264\22\15"+ - "\6\0\22\15\1\u0265\24\15\6\0\34\15\1\u0266\12\15"+ - "\6\0\25\15\1\u0267\21\15\6\0\16\15\1\u0268\30\15"+ - "\6\0\32\15\1\u0269\14\15\6\0\25\15\1\u026a\21\15"+ - "\6\0\24\15\1\u026b\22\15\6\0\25\15\1\u026c\21\15"+ - "\6\0\16\15\1\u026d\30\15\6\0\22\15\1\u026e\24\15"+ - "\6\0\26\15\1\u026f\20\15\6\0\7\15\1\u0270\37\15"+ - "\6\0\17\15\1\u0271\27\15\6\0\7\15\1\u0272\37\15"+ - "\6\0\16\15\1\u0273\30\15\6\0\37\15\1\u0274\7\15"+ - "\6\0\23\15\1\u0275\23\15\6\0\25\15\1\u0276\21\15"+ - "\6\0\21\15\1\u0277\25\15\6\0\16\15\1\u0278\30\15"+ - "\6\0\31\15\1\u0279\15\15\6\0\25\15\1\u027a\21\15"+ - "\6\0\25\15\1\u027b\21\15\6\0\34\15\1\u027c\12\15"+ - "\6\0\22\15\1\u027d\24\15\6\0\42\15\1\u027e\4\15"+ - "\6\0\21\15\1\u027f\25\15\6\0\35\15\1\u0280\11\15"+ - "\6\0\25\15\1\u0281\21\15\6\0\26\15\1\u0282\20\15"+ - "\6\0\34\15\1\u0283\12\15\6\0\27\15\1\u0284\17\15"+ - "\6\0\27\15\1\u0285\17\15\6\0\16\15\1\u0286\15\15"+ - "\1\u0287\12\15\6\0\21\15\1\u0288\25\15\6\0\17\15"+ - "\1\u0289\27\15\6\0\21\15\1\u028a\25\15\6\0\34\15"+ - "\1\u028b\12\15\6\0\21\15\1\u028c\25\15\6\0\25\15"+ - "\1\u028d\21\15\6\0\16\15\1\u028e\30\15\6\0\22\15"+ - "\1\u028f\24\15\6\0\32\15\1\u0290\14\15\6\0\36\15"+ - "\1\u0291\10\15\6\0\16\15\1\u0286\30\15\6\0\25\15"+ - "\1\u0292\21\15\6\0\33\15\1\u0293\13\15\6\0\16\15"+ - "\1\u0294\30\15\6\0\27\15\1\u0295\17\15\6\0\16\15"+ - "\1\u0296\30\15\6\0\32\15\1\u0297\14\15\6\0\31\15"+ - "\1\u0298\15\15\6\0\7\15\1\u0299\37\15\6\0\21\15"+ - "\1\u029a\25\15\6\0\33\15\1\u029b\13\15\6\0\16\15"+ - "\1\u029c\30\15\6\0\22\15\1\u029d\24\15\6\0\21\15"+ - "\1\u029e\25\15\6\0\36\15\1\u029f\10\15\6\0\27\15"+ - "\1\u02a0\17\15\6\0\34\15\1\u02a1\12\15\6\0\32\15"+ - "\1\u02a2\14\15\6\0\27\15\1\u02a3\17\15\6\0\32\15"+ - "\1\u02a4\14\15\6\0\22\15\1\u02a5\24\15\6\0\7\15"+ - "\1\u02a6\37\15\6\0\34\15\1\u02a7\12\15\6\0\31\15"+ - "\1\u02a8\15\15\6\0\24\15\1\u02a9\22\15\6\0\25\15"+ - "\1\u02aa\21\15\6\0\16\15\1\u02ab\30\15\6\0\25\15"+ - "\1\u02ac\21\15\6\0\34\15\1\u02ad\12\15\6\0\26\15"+ - "\1\u02ae\20\15\6\0\16\15\1\u02af\30\15\6\0\17\15"+ - "\1\u02b0\27\15\6\0\25\15\1\u02b1\21\15\6\0\26\15"+ - "\1\u02b2\20\15\6\0\27\15\1\u02b3\17\15\6\0\16\15"+ - "\1\u02b4\30\15\6\0\22\15\1\u02b5\24\15\6\0\7\15"+ - "\1\u02b6\37\15\6\0\32\15\1\u02b7\14\15\6\0\26\15"+ - "\1\u02b8\20\15\6\0\7\15\1\u02b9\37\15\6\0\22\15"+ - "\1\u02ba\24\15\6\0\25\15\1\u02bb\21\15\6\0\21\15"+ - "\1\u02bc\25\15\6\0\34\15\1\u02bd\12\15\6\0\25\15"+ - "\1\u02be\21\15\6\0\17\15\1\u02bf\27\15\6\0\21\15"+ - "\1\u02c0\25\15\6\0\26\15\1\u02c1\20\15\6\0\16\15"+ - "\1\u02c2\30\15\6\0\7\15\1\u02c3\37\15\6\0\26\15"+ - "\1\u02c4\20\15\6\0\22\15\1\u02c5\24\15\6\0\21\15"+ - "\1\u02c6\25\15\6\0\25\15\1\u02c7\21\15\6\0\21\15"+ - "\1\u02c8\25\15\2\0"; - - private static int [] zzUnpackTrans() { - int [] result = new int[27450]; - int offset = 0; - offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackTrans(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - value--; - do result[j++] = value; while (--count > 0); - } - return j; - } - - - /* error codes */ - private static final int ZZ_UNKNOWN_ERROR = 0; - private static final int ZZ_NO_MATCH = 1; - private static final int ZZ_PUSHBACK_2BIG = 2; - - /* error messages for the codes above */ - private static final String ZZ_ERROR_MSG[] = { - "Unkown internal scanner error", - "Error: could not match input", - "Error: pushback value was too large" - }; - - /** - * ZZ_ATTRIBUTE[aState] contains the attributes of state aState - */ - private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); - - private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\7\0\1\1\1\11\1\1\1\11\4\1\2\11\24\1"+ - "\2\11\1\1\2\11\2\1\2\11\3\1\1\11\1\1"+ - "\3\0\67\1\1\0\3\1\1\0\1\11\105\1\1\0"+ - "\u020f\1"; - - private static int [] zzUnpackAttribute() { - int [] result = new int[712]; - int offset = 0; - offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackAttribute(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do result[j++] = value; while (--count > 0); - } - return j; - } - - /** the input device */ - private java.io.Reader zzReader; - - /** the current state of the DFA */ - private int zzState; - - /** the current lexical state */ - private int zzLexicalState = YYINITIAL; - - /** this buffer contains the current text to be matched and is - the source of the yytext() string */ - private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; - - /** the textposition at the last accepting state */ - private int zzMarkedPos; - - /** the textposition at the last state to be included in yytext */ - private int zzPushbackPos; - - /** the current text position in the buffer */ - private int zzCurrentPos; - - /** startRead marks the beginning of the yytext() string in the buffer */ - private int zzStartRead; - - /** endRead marks the last character in the buffer, that has been read - from input */ - private int zzEndRead; - - /** number of newlines encountered up to the start of the matched text */ - private int yyline; - - /** the number of characters up to the start of the matched text */ - private int yychar; - - /** - * the number of characters from the last newline up to the start of the - * matched text - */ - private int yycolumn; - - /** - * zzAtBOL == true <=> the scanner is currently at the beginning of a line - */ - private boolean zzAtBOL = true; - - /** zzAtEOF == true <=> the scanner is at the EOF */ - private boolean zzAtEOF; - - /* user code: */ - StringBuffer string = new StringBuffer(); - - - /** - * Creates a new scanner - * There is also a java.io.InputStream version of this constructor. - * - * @param in the java.io.Reader to read input from. - */ - SpecctraFileScanner(java.io.Reader in) { - this.zzReader = in; - } - - /** - * Creates a new scanner. - * There is also java.io.Reader version of this constructor. - * - * @param in the java.io.Inputstream to read input from. - */ - SpecctraFileScanner(java.io.InputStream in) { - this(new java.io.InputStreamReader(in)); - } - - /** - * Unpacks the compressed character translation table. - * - * @param packed the packed character translation table - * @return the unpacked character translation table - */ - private static char [] zzUnpackCMap(String packed) { - char [] map = new char[0x10000]; - int i = 0; /* index in packed string */ - int j = 0; /* index in unpacked array */ - while (i < 274) { - int count = packed.charAt(i++); - char value = packed.charAt(i++); - do map[j++] = value; while (--count > 0); - } - return map; - } - - - /** - * Refills the input buffer. - * - * @return false, iff there was new input. - * - * @exception java.io.IOException if any I/O-Error occurs - */ - private boolean zzRefill() throws java.io.IOException { - - /* first: make room (if you can) */ - if (zzStartRead > 0) { - System.arraycopy(zzBuffer, zzStartRead, - zzBuffer, 0, - zzEndRead-zzStartRead); - - /* translate stored positions */ - zzEndRead-= zzStartRead; - zzCurrentPos-= zzStartRead; - zzMarkedPos-= zzStartRead; - zzPushbackPos-= zzStartRead; - zzStartRead = 0; - } - - /* is the buffer big enough? */ - if (zzCurrentPos >= zzBuffer.length) { - /* if not: blow it up */ - char newBuffer[] = new char[zzCurrentPos*2]; - System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); - zzBuffer = newBuffer; - } - - /* finally: fill the buffer with new input */ - int numRead = zzReader.read(zzBuffer, zzEndRead, - zzBuffer.length-zzEndRead); - - if (numRead < 0) { - return true; - } - else { - zzEndRead+= numRead; - return false; - } - } - - - /** - * Closes the input stream. - */ - public final void yyclose() throws java.io.IOException { - zzAtEOF = true; /* indicate end of file */ - zzEndRead = zzStartRead; /* invalidate buffer */ - - if (zzReader != null) - zzReader.close(); - } - - - /** - * Resets the scanner to read from a new input stream. - * Does not close the old reader. - * - * All internal variables are reset, the old input stream - * cannot be reused (internal buffer is discarded and lost). - * Lexical state is set to ZZ_INITIAL. - * - * @param reader the new input stream - */ - public final void yyreset(java.io.Reader reader) { - zzReader = reader; - zzAtBOL = true; - zzAtEOF = false; - zzEndRead = zzStartRead = 0; - zzCurrentPos = zzMarkedPos = zzPushbackPos = 0; - yyline = yychar = yycolumn = 0; - zzLexicalState = YYINITIAL; - } - - - /** - * Returns the current lexical state. - */ - public final int yystate() { - return zzLexicalState; - } - - - /** - * Enters a new lexical state - * - * @param newState the new lexical state - */ - public final void yybegin(int newState) { - zzLexicalState = newState; - } - - - /** - * Returns the text matched by the current regular expression. - */ - public final String yytext() { - return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); - } - - - /** - * Returns the character at position pos from the - * matched text. - * - * It is equivalent to yytext().charAt(pos), but faster - * - * @param pos the position of the character to fetch. - * A value from 0 to yylength()-1. - * - * @return the character at position pos - */ - public final char yycharat(int pos) { - return zzBuffer[zzStartRead+pos]; - } - - - /** - * Returns the length of the matched text region. - */ - public final int yylength() { - return zzMarkedPos-zzStartRead; - } - - - /** - * Reports an error that occured while scanning. - * - * In a wellformed scanner (no or only correct usage of - * yypushback(int) and a match-all fallback rule) this method - * will only be called with things that "Can't Possibly Happen". - * If this method is called, something is seriously wrong - * (e.g. a JFlex bug producing a faulty scanner etc.). - * - * Usual syntax/scanner level error handling should be done - * in error fallback rules. - * - * @param errorCode the code of the errormessage to display - */ - private void zzScanError(int errorCode) { - String message; - try { - message = ZZ_ERROR_MSG[errorCode]; - } - catch (ArrayIndexOutOfBoundsException e) { - message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; - } - - throw new Error(message); - } - - - /** - * Pushes the specified amount of characters back into the input stream. - * - * They will be read again by then next call of the scanning method - * - * @param number the number of characters to be read again. - * This number must not be greater than yylength()! - */ - public void yypushback(int number) { - if ( number > yylength() ) - zzScanError(ZZ_PUSHBACK_2BIG); - - zzMarkedPos -= number; - } - - - /** - * Resumes scanning until the next regular expression is matched, - * the end of input is encountered or an I/O-Error occurs. - * - * @return the next token - * @exception java.io.IOException if any I/O-Error occurs - */ - public Object next_token() throws java.io.IOException { - int zzInput; - int zzAction; - - // cached fields: - int zzCurrentPosL; - int zzMarkedPosL; - int zzEndReadL = zzEndRead; - char [] zzBufferL = zzBuffer; - char [] zzCMapL = ZZ_CMAP; - - int [] zzTransL = ZZ_TRANS; - int [] zzRowMapL = ZZ_ROWMAP; - int [] zzAttrL = ZZ_ATTRIBUTE; - - while (true) { - zzMarkedPosL = zzMarkedPos; - - zzAction = -1; - - zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; - - zzState = zzLexicalState; - - - zzForAction: { - while (true) { - - if (zzCurrentPosL < zzEndReadL) - zzInput = zzBufferL[zzCurrentPosL++]; - else if (zzAtEOF) { - zzInput = YYEOF; - break zzForAction; - } - else { - // store back cached positions - zzCurrentPos = zzCurrentPosL; - zzMarkedPos = zzMarkedPosL; - boolean eof = zzRefill(); - // get translated positions and possibly new buffer - zzCurrentPosL = zzCurrentPos; - zzMarkedPosL = zzMarkedPos; - zzBufferL = zzBuffer; - zzEndReadL = zzEndRead; - if (eof) { - zzInput = YYEOF; - break zzForAction; - } - else { - zzInput = zzBufferL[zzCurrentPosL++]; - } - } - int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; - if (zzNext == -1) break zzForAction; - zzState = zzNext; - - int zzAttributes = zzAttrL[zzState]; - if ( (zzAttributes & 1) == 1 ) { - zzAction = zzState; - zzMarkedPosL = zzCurrentPosL; - if ( (zzAttributes & 8) == 8 ) break zzForAction; - } - - } - } - - // store back cached position - zzMarkedPos = zzMarkedPosL; - - switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 18: - { yybegin(NAME); return Keyword.VIA; - } - case 121: break; - case 24: - { return Keyword.BACK; - } - case 122: break; - case 31: - { yybegin(LAYER_NAME); return Keyword.POLYGON_PATH; - } - case 123: break; - case 71: - { return Keyword.NETWORK_SCOPE; - } - case 124: break; - case 56: - { return Keyword.ROUTES; - } - case 125: break; - case 93: - { return Keyword.FLIP_STYLE; - } - case 126: break; - case 108: - { return Keyword.PLACE_CONTROL; - } - case 127: break; - case 32: - { yybegin(LAYER_NAME); return Keyword.POLYGON; - } - case 128: break; - case 78: - { yybegin(NAME); return Keyword.PADSTACK; - } - case 129: break; - case 110: - { yybegin(NAME); return Keyword.CLEARANCE_CLASS; - } - case 130: break; - case 115: - { return Keyword.AUTOROUTE_SETTINGS; - } - case 131: break; - case 13: - { yybegin(YYINITIAL); return Keyword.OPEN_BRACKET; - } - case 132: break; - case 105: - { return Keyword.START_PASS_NO; - } - case 133: break; - case 23: - { yybegin(YYINITIAL); return Keyword.PCB_SCOPE; - } - case 134: break; - case 34: - { yybegin(LAYER_NAME); return Keyword.RECTANGLE; - } - case 135: break; - case 82: - { return Keyword.STRUCTURE_SCOPE; - } - case 136: break; - case 27: - { yybegin(NAME); return Keyword.COMPONENT_SCOPE; - } - case 137: break; - case 43: - { yybegin(NAME); return Keyword.IMAGE; - } - case 138: break; - case 112: - { return Keyword.FORTYFIVE_DEGREE; - } - case 139: break; - case 60: - { return Keyword.WINDOW; - } - case 140: break; - case 76: - { return Keyword.VERTICAL; - } - case 141: break; - case 20: - { return Keyword.PCB_SCOPE; - } - case 142: break; - case 37: - { return Keyword.SPARE; - } - case 143: break; - case 21: - { return Keyword.PIN; - } - case 144: break; - case 35: - { return Keyword.RULE; - } - case 145: break; - case 29: - { return Keyword.VIAS; - } - case 146: break; - case 16: - { return Keyword.ON; - } - case 147: break; - case 63: - { return Keyword.SESSION; - } - case 148: break; - case 74: - { return Keyword.BOUNDARY; - } - case 149: break; - case 88: - { return Keyword.SNAP_ANGLE; - } - case 150: break; - case 113: - { return Keyword.WRITE_RESOLUTION; - } - case 151: break; - case 54: - { return Keyword.NORMAL; - } - case 152: break; - case 8: - { return Keyword.OPEN_BRACKET; - } - case 153: break; - case 22: - { return Keyword.FIX; - } - case 154: break; - case 89: - { yybegin(NAME); return Keyword.LAYER_RULE; - } - case 155: break; - case 86: - { return Keyword.POSTROUTE; - } - case 156: break; - case 14: - { yybegin(YYINITIAL); return Keyword.CLOSED_BRACKET; - } - case 157: break; - case 9: - { return Keyword.CLOSED_BRACKET; - } - case 158: break; - case 90: - { return Keyword.VIA_AT_SMD; - } - case 159: break; - case 28: - { yybegin(LAYER_NAME); return Keyword.CIRCLE; - } - case 160: break; - case 50: - { return Keyword.ATTACH; - } - case 161: break; - case 92: - { return Keyword.RESOLUTION_SCOPE; - } - case 162: break; - case 77: - { return Keyword.VIA_RULE; - } - case 163: break; - case 70: - { return Keyword.CIRCUIT; - } - case 164: break; - case 87: - { return Keyword.PLACEMENT_SCOPE; - } - case 165: break; - case 36: - { yybegin(NAME); return Keyword.WIRE; - } - case 166: break; - case 116: - { return Keyword.PREFERRED_DIRECTION; - } - case 167: break; - case 40: - { yybegin(NAME); return Keyword.LAYER; - } - case 168: break; - case 69: - { return Keyword.CLASSES; - } - case 169: break; - case 61: - { return Keyword.WIRING_SCOPE; - } - case 170: break; - case 103: - { yybegin(NAME); return Keyword.HOST_VERSION; - } - case 171: break; - case 4: - { return yytext(); - } - case 172: break; - case 73: - { return Keyword.ABSOLUTE; - } - case 173: break; - case 58: - { return Keyword.FANOUT; - } - case 174: break; - case 79: - { return Keyword.POSITION; - } - case 175: break; - case 47: - { return Keyword.RULES; - } - case 176: break; - case 57: - { return Keyword.ROTATE; - } - case 177: break; - case 7: - { string.setLength(0); yybegin(STRING2); - } - case 178: break; - case 84: - { yybegin(NAME); return Keyword.USE_LAYER; - } - case 179: break; - case 80: - { yybegin(NAME); return Keyword.HOST_CAD; - } - case 180: break; - case 64: - { return Keyword.OUTLINE; - } - case 181: break; - case 45: - { yybegin(NAME); return Keyword.PLACE; - } - case 182: break; - case 6: - { string.setLength(0); yybegin(STRING1); - } - case 183: break; - case 99: - { yybegin(IGNORE_QUOTE); return Keyword.STRING_QUOTE; - } - case 184: break; - case 39: - { return Keyword.ORDER; - } - case 185: break; - case 17: - { return Keyword.OFF; - } - case 186: break; - case 81: - { return Keyword.AUTOROUTE; - } - case 187: break; - case 52: - { return Keyword.SIGNAL; - } - case 188: break; - case 107: - { yybegin(LAYER_NAME); return Keyword.POLYLINE_PATH; - } - case 189: break; - case 68: - { return Keyword.CONTROL; - } - case 190: break; - case 46: - { yybegin(NAME); return Keyword.PLANE_SCOPE; - } - case 191: break; - case 1: - { yybegin(YYINITIAL); return yytext(); - } - case 192: break; - case 100: - { yybegin(NAME); return Keyword.LOGICAL_PART; - } - case 193: break; - case 83: - { return Keyword.LOCK_TYPE; - } - case 194: break; - case 109: - { yybegin(NAME); return Keyword.PLACE_KEEPOUT; - } - case 195: break; - case 49: - { return Keyword.WIDTH; - } - case 196: break; - case 106: - { return Keyword.NINETY_DEGREE; - } - case 197: break; - case 67: - { yybegin(NAME); return Keyword.USE_NET; - } - case 198: break; - case 118: - { return Keyword.GENERATED_BY_FREEROUTE; - } - case 199: break; - case 101: - { return Keyword.PART_LIBRARY_SCOPE; - } - case 200: break; - case 85: - { return Keyword.VIA_COSTS; - } - case 201: break; - case 102: - { return Keyword.ROTATE_FIRST; - } - case 202: break; - case 75: - { return Keyword.CONSTANT; - } - case 203: break; - case 12: - { string.append('\\'); - } - case 204: break; - case 15: - { return new Double(yytext()); - } - case 205: break; - case 42: - { yybegin(NAME); return Keyword.CLASS; - } - case 206: break; - case 91: - { return Keyword.PULL_TIGHT; - } - case 207: break; - case 30: - { return Keyword.NONE; - } - case 208: break; - case 120: - { return Keyword.AGAINST_PREFERRED_DIRECTION_TRACE_COSTS; - } - case 209: break; - case 114: - { return Keyword.START_RIPUP_COSTS; - } - case 210: break; - case 53: - { return Keyword.LENGTH; - } - case 211: break; - case 38: - { return Keyword.SHAPE; - } - case 212: break; - case 59: - { return Keyword.FROMTO; - } - case 213: break; - case 44: - { return Keyword.POWER; - } - case 214: break; - case 94: - { return Keyword.HORIZONTAL; - } - case 215: break; - case 26: - { return Keyword.TYPE; - } - case 216: break; - case 51: - { return Keyword.ACTIVE; - } - case 217: break; - case 48: - { return Keyword.FRONT; - } - case 218: break; - case 11: - { yybegin(YYINITIAL); return string.toString(); - } - case 219: break; - case 19: - { yybegin(NAME); return Keyword.NET; - } - case 220: break; - case 96: - { return Keyword.CLASS_CLASS; - } - case 221: break; - case 66: - { yybegin(NAME); return Keyword.USE_VIA; - } - case 222: break; - case 65: - { return Keyword.LIBRARY_SCOPE; - } - case 223: break; - case 3: - { /* ignore */ - } - case 224: break; - case 117: - { yybegin(NAME); return Keyword.LOGICAL_PART_MAPPING; - } - case 225: break; - case 111: - { return Keyword.PLANE_VIA_COSTS; - } - case 226: break; - case 72: - { yybegin(NAME); return Keyword.KEEPOUT; - } - case 227: break; - case 98: - { return Keyword.NETWORK_OUT; - } - case 228: break; - case 55: - { return Keyword.PARSER_SCOPE; - } - case 229: break; - case 10: - { string.append( yytext() ); - } - case 230: break; - case 2: - { throw new Error("Illegal character <"+ - yytext()+">"); - } - case 231: break; - case 95: - { return Keyword.SHOVE_FIXED; - } - case 232: break; - case 104: - { return Keyword.KEEPOUT; - } - case 233: break; - case 33: - { return Keyword.PINS; - } - case 234: break; - case 119: - { return Keyword.PREFERRED_DIRECTION_TRACE_COSTS; - } - case 235: break; - case 5: - { return new Integer(yytext()); - } - case 236: break; - case 25: - { return Keyword.SIDE; - } - case 237: break; - case 41: - { return Keyword.CLEARANCE; - } - case 238: break; - case 97: - { yybegin(NAME); return Keyword.VIA_KEEPOUT; - } - case 239: break; - case 62: - { yybegin(YYINITIAL); return Keyword.SIGNAL; - } - case 240: break; - default: - if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { - zzAtEOF = true; - return null; - } - else { - zzScanError(ZZ_NO_MATCH); - } - } - } - } - - -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SpecctraFileScanner.java~ b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SpecctraFileScanner.java~ deleted file mode 100644 index 32df1f0..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/SpecctraFileScanner.java~ +++ /dev/null @@ -1,1459 +0,0 @@ -/* The following code was generated by JFlex 1.4.1 on 16.10.08 09:27 */ - -package designformats.specctra; -@SuppressWarnings("all") - -/** - * This class is a scanner generated by - * JFlex 1.4.1 - * on 16.10.08 09:27 from the specification file - * C:/Users/Public/Documents/router/sources/designformats/specctra/SpecctraFileDescription.flex - */ -class SpecctraFileScanner implements Scanner { - - /** This character denotes the end of file */ - public static final int YYEOF = -1; - - /** initial size of the lookahead buffer */ - private static final int ZZ_BUFFERSIZE = 16384; - - /** lexical states */ - public static final int COMPONENT_NAME = 5; - public static final int IGNORE_QUOTE = 7; - public static final int YYINITIAL = 0; - public static final int SPEC_CHAR = 6; - public static final int LAYER_NAME = 4; - public static final int STRING2 = 2; - public static final int STRING1 = 1; - public static final int NAME = 3; - - /** - * Translates characters to character classes - */ - private static final String ZZ_CMAP_PACKED = - "\11\0\1\3\1\2\1\0\1\3\1\1\21\0\1\16\1\3\1\16"+ - "\1\11\1\6\1\16\1\16\1\16\1\12\1\53\1\54\1\5\1\20"+ - "\1\16\1\17\1\14\1\4\1\21\11\10\1\16\1\16\1\16\1\16"+ - "\1\16\1\16\1\16\1\23\1\24\1\32\1\42\1\22\1\41\1\35"+ - "\1\43\1\33\1\7\1\44\1\27\1\46\1\36\1\26\1\37\1\52"+ - "\1\40\1\25\1\31\1\30\1\34\1\51\1\47\1\45\1\50\1\16"+ - "\1\15\1\16\1\16\1\13\1\0\1\23\1\24\1\32\1\42\1\22"+ - "\1\41\1\35\1\43\1\33\1\7\1\44\1\27\1\46\1\36\1\26"+ - "\1\37\1\52\1\40\1\25\1\31\1\30\1\34\1\51\1\47\1\45"+ - "\1\50\3\0\1\16\42\0\136\16\1\16\122\0\2\16\14\0\2\16"+ - "\26\0\1\16\4\0\2\16\22\0\2\16\u0133\0\1\16\25\0\1\16"+ - "\u1d36\0\1\16\1\16\3\0\1\16\1\16\1\16\1\0\1\16\1\16"+ - "\1\16\1\0\1\16\1\16\1\16\3\0\1\16\11\0\1\16\10\0"+ - "\1\16\1\16\161\0\1\16\165\0\1\16\udedd\0"; - - /** - * Translates characters to character classes - */ - private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); - - /** - * Translates DFA states to action switch labels. - */ - private static final int [] ZZ_ACTION = zzUnpackAction(); - - private static final String ZZ_ACTION_PACKED_0 = - "\7\0\1\1\1\2\2\3\3\4\1\5\1\6\1\7"+ - "\1\2\1\5\22\4\1\10\1\11\1\12\1\13\1\14"+ - "\1\12\1\1\1\15\1\16\3\1\2\4\3\0\1\17"+ - "\16\4\1\20\45\4\2\1\1\0\1\4\2\17\1\0"+ - "\1\17\22\4\1\21\16\4\1\22\1\4\1\23\13\4"+ - "\1\24\1\25\11\4\1\26\10\4\1\1\1\27\1\0"+ - "\6\4\1\30\6\4\1\31\14\4\1\32\2\4\1\33"+ - "\2\4\1\34\3\4\1\35\2\4\1\36\2\4\1\37"+ - "\5\4\1\40\4\4\1\41\2\4\1\42\2\4\1\43"+ - "\11\4\1\44\3\4\1\1\14\4\1\45\1\46\2\4"+ - "\1\47\1\4\1\50\11\4\1\51\1\52\2\4\1\53"+ - "\20\4\1\54\1\55\1\56\6\4\1\57\3\4\1\60"+ - "\7\4\1\61\1\4\1\1\2\4\1\62\1\63\6\4"+ - "\1\64\3\4\1\65\15\4\1\34\10\4\1\66\1\4"+ - "\1\67\15\4\1\70\1\71\1\72\2\4\1\73\4\4"+ - "\1\74\1\4\1\75\1\4\1\76\4\4\1\77\6\4"+ - "\1\100\3\4\1\101\1\4\1\102\1\103\1\4\1\104"+ - "\3\4\1\105\1\106\6\4\1\107\6\4\1\40\17\4"+ - "\1\110\2\4\1\111\2\4\1\112\12\4\1\113\3\4"+ - "\1\114\2\4\1\115\5\4\1\116\1\4\1\117\14\4"+ - "\1\120\4\4\1\121\3\4\1\122\4\4\1\123\1\4"+ - "\1\124\1\33\1\51\2\4\1\125\5\4\1\126\3\4"+ - "\1\127\4\4\1\42\14\4\1\130\1\4\1\131\3\4"+ - "\1\132\11\4\1\133\1\4\1\134\2\4\1\135\1\4"+ - "\1\136\7\4\1\137\2\4\1\140\1\141\1\4\1\142"+ - "\20\4\1\143\1\144\3\4\1\145\5\4\1\146\1\4"+ - "\1\147\1\150\3\4\1\151\4\4\1\152\1\153\1\154"+ - "\1\155\23\4\1\156\1\4\1\157\11\4\1\160\1\161"+ - "\2\4\1\162\3\4\1\163\3\4\1\164\5\4\1\165"+ - "\6\4\1\166\20\4\1\167\7\4\1\170"; - - private static int [] zzUnpackAction() { - int [] result = new int[712]; - int offset = 0; - offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackAction(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do result[j++] = value; while (--count > 0); - } - return j; - } - - - /** - * Translates a state to a row index in the transition table - */ - private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); - - private static final String ZZ_ROWMAP_PACKED_0 = - "\0\0\0\55\0\132\0\207\0\264\0\341\0\u010e\0\u013b"+ - "\0\u0168\0\u0195\0\u0168\0\u01c2\0\u01ef\0\u021c\0\u0249\0\u0168"+ - "\0\u0168\0\u0276\0\u02a3\0\u02d0\0\u02fd\0\u032a\0\u0357\0\u0384"+ - "\0\u03b1\0\u03de\0\u040b\0\u0438\0\u0465\0\u0492\0\u04bf\0\u04ec"+ - "\0\u0519\0\u0546\0\u0573\0\u05a0\0\u05cd\0\u0168\0\u0168\0\u05fa"+ - "\0\u0168\0\u0168\0\u0627\0\u0654\0\u0168\0\u0168\0\u0681\0\u06ae"+ - "\0\u06db\0\u0168\0\u0708\0\u0735\0\u0762\0\u078f\0\u02a3\0\u07bc"+ - "\0\u07e9\0\u0816\0\u0843\0\u0870\0\u089d\0\u08ca\0\u08f7\0\u0924"+ - "\0\u0951\0\u097e\0\u09ab\0\u09d8\0\u0a05\0\u01ef\0\u0a32\0\u0a5f"+ - "\0\u0a8c\0\u0ab9\0\u0ae6\0\u0b13\0\u0b40\0\u0b6d\0\u0b9a\0\u0bc7"+ - "\0\u0bf4\0\u0c21\0\u0c4e\0\u0c7b\0\u0ca8\0\u0cd5\0\u0d02\0\u0d2f"+ - "\0\u0d5c\0\u0d89\0\u0db6\0\u0de3\0\u0e10\0\u0e3d\0\u0e6a\0\u0e97"+ - "\0\u0ec4\0\u0ef1\0\u0f1e\0\u0f4b\0\u0f78\0\u0fa5\0\u0fd2\0\u0fff"+ - "\0\u102c\0\u1059\0\u1086\0\u10b3\0\u10e0\0\u110d\0\u113a\0\u1167"+ - "\0\u1194\0\u11c1\0\u0168\0\u11ee\0\u121b\0\u1248\0\u1275\0\u12a2"+ - "\0\u12cf\0\u12fc\0\u1329\0\u1356\0\u1383\0\u13b0\0\u13dd\0\u140a"+ - "\0\u1437\0\u1464\0\u1491\0\u14be\0\u14eb\0\u01ef\0\u1518\0\u1545"+ - "\0\u1572\0\u159f\0\u15cc\0\u15f9\0\u1626\0\u1653\0\u1680\0\u16ad"+ - "\0\u16da\0\u1707\0\u1734\0\u1761\0\u178e\0\u17bb\0\u17e8\0\u1815"+ - "\0\u1842\0\u186f\0\u189c\0\u18c9\0\u18f6\0\u1923\0\u1950\0\u197d"+ - "\0\u19aa\0\u19d7\0\u01ef\0\u1a04\0\u1a31\0\u1a5e\0\u1a8b\0\u1ab8"+ - "\0\u1ae5\0\u1b12\0\u1b3f\0\u1b6c\0\u1b99\0\u01ef\0\u1bc6\0\u1bf3"+ - "\0\u1c20\0\u1c4d\0\u1c7a\0\u1ca7\0\u1cd4\0\u1d01\0\u1d2e\0\u0654"+ - "\0\u1d5b\0\u1d88\0\u1db5\0\u1de2\0\u1e0f\0\u1e3c\0\u1e69\0\u01ef"+ - "\0\u1e96\0\u1ec3\0\u1ef0\0\u1f1d\0\u1f4a\0\u1f77\0\u01ef\0\u1fa4"+ - "\0\u1fd1\0\u1ffe\0\u202b\0\u2058\0\u2085\0\u20b2\0\u20df\0\u210c"+ - "\0\u2139\0\u2166\0\u2193\0\u01ef\0\u21c0\0\u21ed\0\u221a\0\u2247"+ - "\0\u2274\0\u22a1\0\u22ce\0\u22fb\0\u2328\0\u01ef\0\u2355\0\u2382"+ - "\0\u01ef\0\u23af\0\u23dc\0\u01ef\0\u2409\0\u2436\0\u2463\0\u2490"+ - "\0\u24bd\0\u24ea\0\u2517\0\u2544\0\u2571\0\u259e\0\u01ef\0\u25cb"+ - "\0\u25f8\0\u2625\0\u2652\0\u267f\0\u26ac\0\u26d9\0\u2706\0\u2733"+ - "\0\u2760\0\u278d\0\u27ba\0\u27e7\0\u2814\0\u2841\0\u286e\0\u289b"+ - "\0\u28c8\0\u28f5\0\u2922\0\u294f\0\u297c\0\u29a9\0\u29d6\0\u2a03"+ - "\0\u2a30\0\u2a5d\0\u2a8a\0\u2ab7\0\u2ae4\0\u2b11\0\u2b3e\0\u01ef"+ - "\0\u01ef\0\u2b6b\0\u2b98\0\u01ef\0\u2bc5\0\u2bf2\0\u2c1f\0\u2c4c"+ - "\0\u2c79\0\u2ca6\0\u2cd3\0\u2d00\0\u2d2d\0\u2d5a\0\u2d87\0\u2db4"+ - "\0\u2de1\0\u2e0e\0\u2e3b\0\u01ef\0\u2e68\0\u2e95\0\u2ec2\0\u2eef"+ - "\0\u2f1c\0\u2f49\0\u2f76\0\u2fa3\0\u2fd0\0\u2ffd\0\u302a\0\u3057"+ - "\0\u3084\0\u30b1\0\u30de\0\u310b\0\u01ef\0\u3138\0\u3165\0\u3192"+ - "\0\u31bf\0\u31ec\0\u3219\0\u3246\0\u3273\0\u01ef\0\u32a0\0\u32cd"+ - "\0\u32fa\0\u01ef\0\u3327\0\u3354\0\u3381\0\u33ae\0\u33db\0\u3408"+ - "\0\u3435\0\u01ef\0\u3462\0\u348f\0\u34bc\0\u34e9\0\u01ef\0\u01ef"+ - "\0\u3516\0\u3543\0\u3570\0\u359d\0\u35ca\0\u35f7\0\u01ef\0\u3624"+ - "\0\u3651\0\u367e\0\u01ef\0\u36ab\0\u36d8\0\u3705\0\u3732\0\u375f"+ - "\0\u378c\0\u37b9\0\u37e6\0\u3813\0\u3840\0\u386d\0\u389a\0\u38c7"+ - "\0\u01ef\0\u38f4\0\u3921\0\u394e\0\u397b\0\u39a8\0\u39d5\0\u3a02"+ - "\0\u3a2f\0\u01ef\0\u3a5c\0\u01ef\0\u3a89\0\u3ab6\0\u3ae3\0\u3b10"+ - "\0\u3b3d\0\u3b6a\0\u3b97\0\u3bc4\0\u3bf1\0\u3c1e\0\u3c4b\0\u3c78"+ - "\0\u3ca5\0\u01ef\0\u3cd2\0\u01ef\0\u3cff\0\u3d2c\0\u01ef\0\u3d59"+ - "\0\u3d86\0\u3db3\0\u3de0\0\u01ef\0\u3e0d\0\u01ef\0\u3e3a\0\u0654"+ - "\0\u3e67\0\u3e94\0\u3ec1\0\u3eee\0\u01ef\0\u3f1b\0\u3f48\0\u3f75"+ - "\0\u3fa2\0\u3fcf\0\u3ffc\0\u01ef\0\u4029\0\u4056\0\u4083\0\u01ef"+ - "\0\u40b0\0\u01ef\0\u01ef\0\u40dd\0\u01ef\0\u410a\0\u4137\0\u4164"+ - "\0\u01ef\0\u01ef\0\u4191\0\u41be\0\u41eb\0\u4218\0\u4245\0\u4272"+ - "\0\u429f\0\u42cc\0\u42f9\0\u4326\0\u4353\0\u4380\0\u43ad\0\u01ef"+ - "\0\u43da\0\u4407\0\u4434\0\u4461\0\u448e\0\u44bb\0\u44e8\0\u4515"+ - "\0\u4542\0\u456f\0\u459c\0\u45c9\0\u45f6\0\u4623\0\u4650\0\u01ef"+ - "\0\u467d\0\u46aa\0\u01ef\0\u46d7\0\u4704\0\u01ef\0\u4731\0\u475e"+ - "\0\u478b\0\u47b8\0\u47e5\0\u4812\0\u483f\0\u486c\0\u4899\0\u48c6"+ - "\0\u01ef\0\u48f3\0\u4920\0\u494d\0\u01ef\0\u497a\0\u49a7\0\u01ef"+ - "\0\u49d4\0\u4a01\0\u4a2e\0\u4a5b\0\u4a88\0\u01ef\0\u4ab5\0\u01ef"+ - "\0\u4ae2\0\u4b0f\0\u4b3c\0\u4b69\0\u4b96\0\u4bc3\0\u4bf0\0\u4c1d"+ - "\0\u4c4a\0\u4c77\0\u4ca4\0\u4cd1\0\u01ef\0\u4cfe\0\u4d2b\0\u4d58"+ - "\0\u4d85\0\u4db2\0\u4ddf\0\u4e0c\0\u4e39\0\u01ef\0\u4e66\0\u4e93"+ - "\0\u4ec0\0\u4eed\0\u01ef\0\u4f1a\0\u01ef\0\u01ef\0\u4f47\0\u4f74"+ - "\0\u4fa1\0\u01ef\0\u4fce\0\u4ffb\0\u5028\0\u5055\0\u5082\0\u01ef"+ - "\0\u50af\0\u50dc\0\u5109\0\u01ef\0\u5136\0\u5163\0\u5190\0\u51bd"+ - "\0\u01ef\0\u51ea\0\u5217\0\u5244\0\u5271\0\u529e\0\u52cb\0\u52f8"+ - "\0\u5325\0\u5352\0\u537f\0\u53ac\0\u53d9\0\u01ef\0\u5406\0\u01ef"+ - "\0\u5433\0\u5460\0\u548d\0\u01ef\0\u54ba\0\u54e7\0\u5514\0\u5541"+ - "\0\u556e\0\u559b\0\u55c8\0\u55f5\0\u5622\0\u01ef\0\u564f\0\u01ef"+ - "\0\u567c\0\u56a9\0\u01ef\0\u56d6\0\u01ef\0\u5703\0\u5730\0\u575d"+ - "\0\u578a\0\u57b7\0\u57e4\0\u5811\0\u01ef\0\u583e\0\u586b\0\u01ef"+ - "\0\u01ef\0\u5898\0\u01ef\0\u58c5\0\u58f2\0\u591f\0\u594c\0\u5979"+ - "\0\u59a6\0\u59d3\0\u5a00\0\u5a2d\0\u5a5a\0\u5a87\0\u5ab4\0\u5ae1"+ - "\0\u5b0e\0\u5b3b\0\u5b68\0\u01ef\0\u5b95\0\u5bc2\0\u5bef\0\u5c1c"+ - "\0\u01ef\0\u5c49\0\u5c76\0\u5ca3\0\u5cd0\0\u5cfd\0\u01ef\0\u5d2a"+ - "\0\u01ef\0\u01ef\0\u5d57\0\u5d84\0\u5db1\0\u01ef\0\u5dde\0\u5e0b"+ - "\0\u5e38\0\u5e65\0\u01ef\0\u01ef\0\u01ef\0\u01ef\0\u5e92\0\u5ebf"+ - "\0\u5eec\0\u5f19\0\u5f46\0\u5f73\0\u5fa0\0\u5fcd\0\u5ffa\0\u6027"+ - "\0\u6054\0\u6081\0\u60ae\0\u60db\0\u6108\0\u6135\0\u6162\0\u618f"+ - "\0\u61bc\0\u01ef\0\u61e9\0\u01ef\0\u6216\0\u6243\0\u6270\0\u629d"+ - "\0\u62ca\0\u62f7\0\u6324\0\u6351\0\u637e\0\u01ef\0\u01ef\0\u63ab"+ - "\0\u63d8\0\u01ef\0\u6405\0\u6432\0\u645f\0\u01ef\0\u648c\0\u64b9"+ - "\0\u64e6\0\u6513\0\u6540\0\u656d\0\u659a\0\u65c7\0\u65f4\0\u01ef"+ - "\0\u6621\0\u664e\0\u667b\0\u66a8\0\u66d5\0\u6702\0\u01ef\0\u672f"+ - "\0\u675c\0\u6789\0\u67b6\0\u67e3\0\u6810\0\u683d\0\u686a\0\u6897"+ - "\0\u68c4\0\u68f1\0\u691e\0\u694b\0\u6978\0\u69a5\0\u69d2\0\u01ef"+ - "\0\u69ff\0\u6a2c\0\u6a59\0\u6a86\0\u6ab3\0\u6ae0\0\u6b0d\0\u01ef"; - - private static int [] zzUnpackRowMap() { - int [] result = new int[712]; - int offset = 0; - offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackRowMap(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int high = packed.charAt(i++) << 16; - result[j++] = high | packed.charAt(i++); - } - return j; - } - - /** - * The transition table of the DFA - */ - private static final int [] ZZ_TRANS = zzUnpackTrans(); - - private static final String ZZ_TRANS_PACKED_0 = - "\1\11\1\12\2\13\1\14\1\15\1\16\1\15\1\17"+ - "\1\20\1\21\4\15\2\22\1\23\1\15\1\24\1\25"+ - "\1\26\1\27\1\30\1\31\1\32\1\33\1\34\1\35"+ - "\1\36\1\37\1\40\1\41\1\42\1\15\1\43\1\44"+ - "\4\15\1\45\1\15\1\46\1\47\11\50\1\51\3\50"+ - "\1\52\37\50\12\53\1\51\2\53\1\52\37\53\1\11"+ - "\1\12\2\13\5\54\1\20\1\21\40\54\1\55\1\56"+ - "\1\11\1\12\2\13\5\54\1\20\1\21\12\54\1\57"+ - "\11\54\1\60\13\54\1\55\1\56\1\11\1\12\2\13"+ - "\5\61\1\20\1\21\4\61\1\11\33\61\1\55\1\56"+ - "\4\11\3\62\4\11\6\62\35\11\1\12\2\13\47\54"+ - "\1\55\1\56\57\0\1\13\56\0\1\15\1\63\45\15"+ - "\6\0\47\15\2\0\1\64\1\12\1\13\1\64\47\16"+ - "\2\64\10\0\1\17\3\0\1\65\4\0\1\17\1\66"+ - "\42\0\1\17\10\0\1\23\43\0\1\67\3\0\1\65"+ - "\4\0\1\67\1\66\36\0\20\15\1\70\3\15\1\71"+ - "\1\72\1\73\2\15\1\74\15\15\6\0\17\15\1\75"+ - "\2\15\1\76\24\15\6\0\16\15\1\77\6\15\1\100"+ - "\1\15\1\101\2\15\1\102\1\103\3\15\1\104\7\15"+ - "\6\0\24\15\1\105\5\15\1\106\1\15\1\107\1\110"+ - "\11\15\6\0\16\15\1\111\1\112\2\15\1\113\4\15"+ - "\1\114\17\15\6\0\21\15\1\115\25\15\6\0\41\15"+ - "\1\116\5\15\6\0\22\15\1\117\1\120\3\15\1\121"+ - "\17\15\6\0\42\15\1\122\4\15\6\0\16\15\1\123"+ - "\10\15\1\124\17\15\6\0\16\15\1\125\30\15\6\0"+ - "\16\15\1\126\3\15\1\127\4\15\1\130\17\15\6\0"+ - "\17\15\1\131\2\15\1\132\1\133\1\134\1\15\1\135"+ - "\1\136\4\15\1\137\12\15\6\0\16\15\1\140\3\15"+ - "\1\141\1\15\1\142\22\15\6\0\17\15\1\143\2\15"+ - "\1\144\1\145\3\15\1\146\4\15\1\147\12\15\6\0"+ - "\22\15\1\150\24\15\6\0\16\15\1\151\30\15\6\0"+ - "\27\15\1\152\4\15\1\153\12\15\2\0\11\50\1\0"+ - "\3\50\1\0\37\50\12\53\1\0\2\53\1\0\37\53"+ - "\4\0\47\54\6\0\27\54\1\154\17\54\6\0\26\54"+ - "\1\155\20\54\6\0\13\61\1\0\33\61\2\0\4\156"+ - "\1\157\1\15\45\157\2\156\1\64\1\12\1\13\52\64"+ - "\10\0\1\160\10\0\1\160\43\0\1\161\6\0\2\162"+ - "\1\163\37\0\21\15\1\164\25\15\6\0\25\15\1\165"+ - "\21\15\6\0\25\15\1\166\21\15\6\0\25\15\1\167"+ - "\21\15\6\0\17\15\1\170\27\15\6\0\26\15\1\171"+ - "\20\15\6\0\24\15\1\172\22\15\6\0\21\15\1\173"+ - "\25\15\6\0\17\15\1\174\14\15\1\175\12\15\6\0"+ - "\31\15\1\176\4\15\1\177\10\15\6\0\17\15\1\200"+ - "\27\15\6\0\17\15\1\201\27\15\6\0\17\15\1\202"+ - "\2\15\1\203\24\15\6\0\25\15\1\204\21\15\6\0"+ - "\36\15\1\205\10\15\6\0\35\15\1\206\11\15\6\0"+ - "\32\15\1\207\14\15\6\0\41\15\1\210\5\15\6\0"+ - "\26\15\1\211\2\15\1\212\15\15\6\0\20\15\1\213"+ - "\26\15\6\0\16\15\1\214\30\15\6\0\33\15\1\215"+ - "\13\15\6\0\32\15\1\216\7\15\1\217\4\15\6\0"+ - "\16\15\1\220\1\221\27\15\6\0\34\15\1\222\12\15"+ - "\6\0\17\15\1\223\27\15\6\0\34\15\1\224\12\15"+ - "\6\0\17\15\1\225\27\15\6\0\32\15\1\226\14\15"+ - "\6\0\25\15\1\227\21\15\6\0\32\15\1\230\1\15"+ - "\1\231\12\15\6\0\32\15\1\232\14\15\6\0\25\15"+ - "\1\233\6\15\1\234\1\15\1\235\10\15\6\0\21\15"+ - "\1\236\1\15\1\237\21\15\1\240\1\15\6\0\17\15"+ - "\1\241\27\15\6\0\23\15\1\242\23\15\6\0\20\15"+ - "\1\243\26\15\6\0\32\15\1\244\14\15\6\0\16\15"+ - "\1\245\30\15\6\0\21\15\1\246\4\15\1\247\20\15"+ - "\6\0\24\15\1\250\1\251\21\15\6\0\23\15\1\252"+ - "\23\15\6\0\32\15\1\253\14\15\6\0\34\15\1\254"+ - "\12\15\6\0\27\15\1\255\17\15\6\0\43\15\1\256"+ - "\3\15\6\0\22\15\1\257\24\15\6\0\21\15\1\260"+ - "\12\15\1\261\12\15\6\0\16\15\1\262\30\15\6\0"+ - "\32\15\1\263\1\15\1\264\1\15\1\265\10\15\6\0"+ - "\27\15\1\266\17\15\6\0\31\54\1\267\15\54\6\0"+ - "\20\54\1\270\26\54\2\0\5\156\1\271\53\156\1\157"+ - "\1\272\45\157\2\156\10\0\1\160\10\0\1\160\1\66"+ - "\42\0\1\161\10\0\1\161\43\0\1\161\10\0\1\163"+ - "\37\0\22\15\1\273\24\15\6\0\22\15\1\274\24\15"+ - "\6\0\17\15\1\275\27\15\6\0\27\15\1\276\17\15"+ - "\6\0\27\15\1\277\17\15\6\0\40\15\1\300\6\15"+ - "\6\0\32\15\1\301\14\15\6\0\21\15\1\302\25\15"+ - "\6\0\34\15\1\303\12\15\6\0\24\15\1\304\2\15"+ - "\1\305\17\15\6\0\32\15\1\306\14\15\6\0\16\15"+ - "\1\307\30\15\6\0\33\15\1\310\13\15\6\0\34\15"+ - "\1\311\12\15\6\0\33\15\1\312\13\15\6\0\30\15"+ - "\1\313\16\15\6\0\23\15\1\314\23\15\6\0\16\15"+ - "\1\315\30\15\6\0\31\15\1\316\15\15\6\0\16\15"+ - "\1\317\30\15\6\0\40\15\1\320\6\15\6\0\27\15"+ - "\1\321\17\15\6\0\34\15\1\322\12\15\6\0\7\15"+ - "\1\323\37\15\6\0\16\15\1\324\30\15\6\0\21\15"+ - "\1\325\3\15\1\326\21\15\6\0\33\15\1\327\13\15"+ - "\6\0\17\15\1\330\27\15\6\0\21\15\1\331\25\15"+ - "\6\0\26\15\1\332\20\15\6\0\31\15\1\333\15\15"+ - "\6\0\25\15\1\334\21\15\6\0\7\15\1\335\11\15"+ - "\1\336\25\15\6\0\16\15\1\337\30\15\6\0\45\15"+ - "\1\340\1\15\6\0\16\15\1\341\30\15\6\0\42\15"+ - "\1\342\4\15\6\0\16\15\1\343\30\15\6\0\37\15"+ - "\1\344\7\15\6\0\21\15\1\345\3\15\1\346\21\15"+ - "\6\0\21\15\1\347\25\15\6\0\25\15\1\350\1\15"+ - "\1\351\17\15\6\0\41\15\1\352\5\15\6\0\16\15"+ - "\1\353\30\15\6\0\26\15\1\354\3\15\1\355\14\15"+ - "\6\0\23\15\1\356\23\15\6\0\21\15\1\357\25\15"+ - "\6\0\35\15\1\360\11\15\6\0\22\15\1\361\24\15"+ - "\6\0\25\15\1\362\21\15\6\0\25\15\1\363\21\15"+ - "\6\0\17\15\1\364\27\15\6\0\16\15\1\365\30\15"+ - "\6\0\22\15\1\366\24\15\6\0\25\15\1\367\21\15"+ - "\6\0\33\15\1\370\13\15\6\0\32\15\1\371\7\15"+ - "\1\372\4\15\6\0\25\15\1\373\21\15\6\0\27\15"+ - "\1\374\17\15\6\0\33\15\1\375\13\15\6\0\36\15"+ - "\1\376\10\15\6\0\16\15\1\377\10\15\1\u0100\17\15"+ - "\6\0\25\15\1\u0101\21\15\6\0\25\15\1\u0102\21\15"+ - "\6\0\32\54\1\u0103\14\54\2\0\4\156\1\13\1\271"+ - "\53\156\1\15\1\272\45\157\2\156\4\0\23\15\1\u0104"+ - "\23\15\6\0\34\15\1\u0105\12\15\6\0\26\15\1\u0106"+ - "\20\15\6\0\30\15\1\u0107\16\15\6\0\32\15\1\u0108"+ - "\14\15\6\0\36\15\1\u0109\10\15\6\0\27\15\1\u010a"+ - "\17\15\6\0\25\15\1\u010b\21\15\6\0\26\15\1\u010c"+ - "\20\15\6\0\32\15\1\u010d\14\15\6\0\17\15\1\u010e"+ - "\27\15\6\0\7\15\1\u010f\37\15\6\0\16\15\1\u0110"+ - "\30\15\6\0\16\15\1\u0111\30\15\6\0\16\15\1\u0112"+ - "\30\15\6\0\27\15\1\u0113\17\15\6\0\34\15\1\u0114"+ - "\12\15\6\0\25\15\1\u0115\21\15\6\0\34\15\1\u0116"+ - "\12\15\6\0\7\15\1\u0117\37\15\6\0\26\15\1\u0118"+ - "\20\15\6\0\17\15\1\u0119\27\15\6\0\23\15\1\u011a"+ - "\4\15\1\u011b\1\15\1\u011c\14\15\6\0\25\15\1\u011d"+ - "\21\15\6\0\34\15\1\u011e\12\15\6\0\22\15\1\u011f"+ - "\24\15\6\0\34\15\1\u0120\12\15\6\0\21\15\1\u0121"+ - "\25\15\6\0\23\15\1\u0122\1\u0123\22\15\6\0\16\15"+ - "\1\u0124\30\15\6\0\27\15\1\u0125\17\15\6\0\17\15"+ - "\1\u0126\6\15\1\u0127\5\15\1\u0128\3\15\1\u0129\6\15"+ - "\6\0\34\15\1\u012a\12\15\6\0\22\15\1\u012b\24\15"+ - "\6\0\17\15\1\u012c\27\15\6\0\25\15\1\u012d\21\15"+ - "\6\0\16\15\1\u012e\30\15\6\0\7\15\1\u012f\37\15"+ - "\6\0\25\15\1\u0130\21\15\6\0\34\15\1\u0131\12\15"+ - "\6\0\25\15\1\u0132\21\15\6\0\23\15\1\u0133\5\15"+ - "\1\u0134\15\15\6\0\34\15\1\u0135\12\15\6\0\16\15"+ - "\1\u0136\30\15\6\0\16\15\1\u0137\30\15\6\0\7\15"+ - "\1\u0138\37\15\6\0\16\15\1\u0139\30\15\6\0\23\15"+ - "\1\u013a\23\15\6\0\17\15\1\u013b\27\15\6\0\16\15"+ - "\1\u013c\30\15\6\0\25\15\1\u013d\21\15\6\0\21\15"+ - "\1\u013e\25\15\6\0\24\15\1\u013f\22\15\6\0\41\15"+ - "\1\u0140\5\15\6\0\7\15\1\u0141\37\15\6\0\25\15"+ - "\1\u0142\21\15\6\0\25\15\1\u0143\21\15\6\0\7\15"+ - "\1\u0144\37\15\6\0\44\15\1\u0145\2\15\6\0\22\15"+ - "\1\u0146\24\15\6\0\22\15\1\u0147\24\15\6\0\7\15"+ - "\1\u0148\37\15\6\0\32\15\1\u0149\14\15\6\0\37\15"+ - "\1\u014a\7\15\6\0\16\15\1\u014b\30\15\6\0\17\54"+ - "\1\u014c\27\54\6\0\24\15\1\u014d\22\15\6\0\22\15"+ - "\1\u014e\24\15\6\0\37\15\1\u014f\7\15\6\0\16\15"+ - "\1\u0150\30\15\6\0\21\15\1\u0151\25\15\6\0\17\15"+ - "\1\u0152\27\15\6\0\22\15\1\u0153\24\15\6\0\7\15"+ - "\1\u0154\37\15\6\0\25\15\1\u0155\21\15\6\0\31\15"+ - "\1\u0156\15\15\6\0\23\15\1\u0157\23\15\6\0\17\15"+ - "\1\u0158\27\15\6\0\7\15\1\u0159\37\15\6\0\32\15"+ - "\1\u015a\14\15\6\0\37\15\1\u015b\7\15\6\0\7\15"+ - "\1\u015c\37\15\6\0\25\15\1\u015d\21\15\6\0\17\15"+ - "\1\u015e\27\15\6\0\34\15\1\u015f\12\15\6\0\17\15"+ - "\1\u0160\27\15\6\0\27\15\1\u0161\17\15\6\0\16\15"+ - "\1\u0162\30\15\6\0\17\15\1\u0163\27\15\6\0\22\15"+ - "\1\u0164\24\15\6\0\32\15\1\u0165\14\15\6\0\17\15"+ - "\1\u0166\27\15\6\0\7\15\1\u0167\6\15\1\u0168\30\15"+ - "\6\0\16\15\1\u0169\30\15\6\0\27\15\1\u016a\17\15"+ - "\6\0\26\15\1\u016b\20\15\6\0\25\15\1\u016c\21\15"+ - "\6\0\22\15\1\u016d\24\15\6\0\24\15\1\u016e\22\15"+ - "\6\0\16\15\1\u016f\30\15\6\0\17\15\1\u0170\27\15"+ - "\6\0\34\15\1\u0171\12\15\6\0\23\15\1\u0172\23\15"+ - "\6\0\41\15\1\u0173\5\15\6\0\34\15\1\u0174\12\15"+ - "\6\0\23\15\1\u0175\23\15\6\0\17\15\1\u0176\27\15"+ - "\6\0\22\15\1\u0177\24\15\6\0\27\15\1\u0178\17\15"+ - "\6\0\27\15\1\u0179\17\15\6\0\22\15\1\u017a\24\15"+ - "\6\0\7\15\1\u017b\32\15\1\u017c\4\15\6\0\7\15"+ - "\1\u017d\37\15\6\0\25\15\1\u017e\21\15\6\0\34\15"+ - "\1\u017f\12\15\6\0\24\15\1\u0180\22\15\6\0\32\15"+ - "\1\u0181\14\15\6\0\21\15\1\u0182\25\15\6\0\16\15"+ - "\1\u0183\30\15\6\0\25\15\1\u0184\21\15\6\0\35\15"+ - "\1\u0185\11\15\6\0\21\15\1\u0186\25\15\6\0\22\15"+ - "\1\u0187\24\15\6\0\26\15\1\u0188\1\15\1\u0189\16\15"+ - "\6\0\22\15\1\u018a\24\15\6\0\24\15\1\u018b\22\15"+ - "\6\0\45\15\1\u018c\1\15\6\0\40\15\1\u018d\6\15"+ - "\6\0\31\15\1\u018e\15\15\6\0\7\15\1\u018f\37\15"+ - "\6\0\23\54\1\u0190\23\54\6\0\25\15\1\u0191\21\15"+ - "\6\0\24\15\1\u0192\22\15\6\0\25\15\1\u0193\21\15"+ - "\6\0\34\15\1\u0194\12\15\6\0\32\15\1\u0195\14\15"+ - "\6\0\33\15\1\u0196\1\u0197\12\15\6\0\24\15\1\u0198"+ - "\22\15\6\0\7\15\1\u0199\37\15\6\0\32\15\1\u019a"+ - "\14\15\6\0\35\15\1\u019b\11\15\6\0\16\15\1\u019c"+ - "\30\15\6\0\34\15\1\u019d\12\15\6\0\41\15\1\u019e"+ - "\5\15\6\0\23\15\1\u019f\23\15\6\0\41\15\1\u01a0"+ - "\5\15\6\0\41\15\1\u01a1\5\15\6\0\17\15\1\u01a2"+ - "\27\15\6\0\25\15\1\u01a3\21\15\6\0\32\15\1\u01a4"+ - "\14\15\6\0\23\15\1\u01a5\23\15\6\0\16\15\1\u01a6"+ - "\30\15\6\0\32\15\1\u01a7\14\15\6\0\26\15\1\u01a8"+ - "\20\15\6\0\21\15\1\u01a9\25\15\6\0\25\15\1\u01aa"+ - "\21\15\6\0\17\15\1\u01ab\27\15\6\0\7\15\1\u01ac"+ - "\37\15\6\0\21\15\1\u01ad\25\15\6\0\23\15\1\u01ae"+ - "\23\15\6\0\16\15\1\u01af\30\15\6\0\25\15\1\u01b0"+ - "\21\15\6\0\40\15\1\u01b1\6\15\6\0\7\15\1\u01b2"+ - "\37\15\6\0\27\15\1\u01b3\17\15\6\0\26\15\1\u01b4"+ - "\20\15\6\0\24\15\1\u01b5\22\15\6\0\22\15\1\u01b6"+ - "\24\15\6\0\32\15\1\u01b7\14\15\6\0\32\15\1\u01b8"+ - "\14\15\6\0\26\15\1\u01b9\11\15\1\u01ba\6\15\6\0"+ - "\16\15\1\u01bb\30\15\6\0\30\15\1\u01bc\16\15\6\0"+ - "\27\15\1\u01bd\17\15\6\0\16\15\1\u01be\15\15\1\u01bf"+ - "\12\15\6\0\25\15\1\u01c0\21\15\6\0\31\15\1\u01c1"+ - "\15\15\6\0\7\15\1\u01c2\37\15\6\0\27\15\1\u01c3"+ - "\17\15\6\0\25\15\1\u01c4\21\15\6\0\17\15\1\u01c5"+ - "\27\15\6\0\16\15\1\u01c6\30\15\6\0\32\15\1\u01c7"+ - "\14\15\6\0\25\15\1\u01c8\21\15\6\0\16\15\1\u01c9"+ - "\30\15\6\0\34\15\1\u01ca\12\15\6\0\16\15\1\u01cb"+ - "\30\15\6\0\25\15\1\u01cc\21\15\6\0\7\15\1\u01cd"+ - "\37\15\6\0\41\15\1\u01ce\5\15\6\0\17\15\1\u01cf"+ - "\27\15\6\0\27\15\1\u01d0\17\15\6\0\34\15\1\u01d1"+ - "\12\15\6\0\46\15\1\u01d2\6\0\31\15\1\u01d3\15\15"+ - "\6\0\27\15\1\u01d4\17\15\6\0\24\15\1\u01d5\22\15"+ - "\6\0\33\15\1\u01d6\13\15\6\0\7\15\1\u01d7\37\15"+ - "\6\0\16\15\1\u01d8\30\15\6\0\25\15\1\u01d9\21\15"+ - "\6\0\32\15\1\u01da\14\15\6\0\26\15\1\u01db\20\15"+ - "\6\0\23\15\1\u01dc\23\15\6\0\23\15\1\u01dd\23\15"+ - "\6\0\21\15\1\u01de\25\15\6\0\25\15\1\u01df\21\15"+ - "\6\0\16\15\1\u01e0\30\15\6\0\33\15\1\u01e1\13\15"+ - "\6\0\16\15\1\u01e2\30\15\6\0\7\15\1\u01e3\37\15"+ - "\6\0\36\15\1\u01e4\10\15\6\0\20\15\1\u01e5\26\15"+ - "\6\0\40\15\1\u01e6\6\15\6\0\25\15\1\u01e7\21\15"+ - "\6\0\32\15\1\u01e8\14\15\6\0\16\15\1\u01e9\30\15"+ - "\6\0\22\15\1\u01ea\24\15\6\0\16\15\1\u01eb\30\15"+ - "\6\0\32\15\1\u01ec\14\15\6\0\27\15\1\u01ed\17\15"+ - "\6\0\31\15\1\u01ee\15\15\6\0\36\15\1\u01ef\10\15"+ - "\6\0\16\15\1\u01be\30\15\6\0\27\15\1\u01f0\17\15"+ - "\6\0\23\15\1\u01f1\23\15\6\0\35\15\1\u01f2\11\15"+ - "\6\0\30\15\1\u01f3\16\15\6\0\41\15\1\u01f4\5\15"+ - "\6\0\36\15\1\u01f5\10\15\6\0\34\15\1\u01f6\12\15"+ - "\6\0\25\15\1\u01f7\21\15\6\0\16\15\1\u01f8\30\15"+ - "\6\0\16\15\1\u01f9\30\15\6\0\16\15\1\u01fa\30\15"+ - "\6\0\33\15\1\u01fb\13\15\6\0\21\15\1\u01fc\25\15"+ - "\6\0\33\15\1\u01fd\13\15\6\0\16\15\1\u01fe\30\15"+ - "\6\0\24\15\1\u01ff\22\15\6\0\23\15\1\u0200\23\15"+ - "\6\0\43\15\1\u0201\3\15\6\0\23\15\1\u0202\23\15"+ - "\6\0\16\15\1\u0203\30\15\6\0\33\15\1\u0204\13\15"+ - "\6\0\34\15\1\u0205\12\15\6\0\25\15\1\u0206\21\15"+ - "\6\0\16\15\1\u0207\30\15\6\0\17\15\1\u0208\27\15"+ - "\6\0\42\15\1\u0209\4\15\6\0\21\15\1\u020a\25\15"+ - "\6\0\22\15\1\u020b\24\15\6\0\36\15\1\u020c\10\15"+ - "\6\0\22\15\1\u020d\24\15\6\0\16\15\1\u020e\30\15"+ - "\6\0\34\15\1\u020f\12\15\6\0\16\15\1\u0210\30\15"+ - "\6\0\7\15\1\u0211\37\15\6\0\32\15\1\u0212\14\15"+ - "\6\0\16\15\1\u0213\30\15\6\0\25\15\1\u0214\21\15"+ - "\6\0\17\15\1\u0215\27\15\6\0\37\15\1\u0216\7\15"+ - "\6\0\7\15\1\u0217\37\15\6\0\22\15\1\u0218\24\15"+ - "\6\0\16\15\1\u0219\30\15\6\0\27\15\1\u021a\17\15"+ - "\6\0\16\15\1\u021b\30\15\6\0\23\15\1\u021c\23\15"+ - "\6\0\21\15\1\u021d\25\15\6\0\17\15\1\u021e\27\15"+ - "\6\0\33\15\1\u021f\13\15\6\0\21\15\1\u0220\25\15"+ - "\6\0\7\15\1\u0221\37\15\6\0\34\15\1\u0222\12\15"+ - "\6\0\21\15\1\u0223\25\15\6\0\24\15\1\u0224\22\15"+ - "\6\0\22\15\1\u0225\24\15\6\0\16\15\1\u0226\30\15"+ - "\6\0\16\15\1\u0227\30\15\6\0\16\15\1\u0228\30\15"+ - "\6\0\17\15\1\u0229\27\15\6\0\7\15\1\u022a\37\15"+ - "\6\0\21\15\1\u022b\25\15\6\0\36\15\1\u022c\10\15"+ - "\6\0\24\15\1\u022d\22\15\6\0\7\15\1\u022e\37\15"+ - "\6\0\24\15\1\u022f\22\15\6\0\31\15\1\u0230\15\15"+ - "\6\0\17\15\1\u0231\27\15\6\0\33\15\1\u0232\13\15"+ - "\6\0\25\15\1\u0233\21\15\6\0\33\15\1\u0234\13\15"+ - "\6\0\7\15\1\u0235\37\15\6\0\25\15\1\u0236\21\15"+ - "\6\0\36\15\1\u0237\10\15\6\0\32\15\1\u0238\14\15"+ - "\6\0\34\15\1\u0239\12\15\6\0\7\15\1\u023a\37\15"+ - "\6\0\16\15\1\u023b\30\15\6\0\27\15\1\u023c\17\15"+ - "\6\0\23\15\1\u023d\23\15\6\0\22\15\1\u023e\24\15"+ - "\6\0\22\15\1\u023f\24\15\6\0\21\15\1\u0240\25\15"+ - "\6\0\16\15\1\u0241\30\15\6\0\7\15\1\u0242\37\15"+ - "\6\0\33\15\1\u0243\13\15\6\0\25\15\1\u0244\21\15"+ - "\6\0\36\15\1\u0245\10\15\6\0\34\15\1\u0246\12\15"+ - "\6\0\26\15\1\u0247\20\15\6\0\21\15\1\u0248\25\15"+ - "\6\0\25\15\1\u0249\21\15\6\0\20\15\1\u024a\26\15"+ - "\6\0\25\15\1\u024b\21\15\6\0\34\15\1\u024c\12\15"+ - "\6\0\34\15\1\u024d\12\15\6\0\17\15\1\u024e\27\15"+ - "\6\0\34\15\1\u024f\12\15\6\0\22\15\1\u0250\24\15"+ - "\6\0\26\15\1\u0251\20\15\6\0\27\15\1\u0252\17\15"+ - "\6\0\21\15\1\u0253\25\15\6\0\36\15\1\u0254\10\15"+ - "\6\0\22\15\1\u0255\24\15\6\0\24\15\1\u0256\22\15"+ - "\6\0\23\15\1\u0257\23\15\6\0\16\15\1\u0258\30\15"+ - "\6\0\35\15\1\u0259\11\15\6\0\32\15\1\u025a\14\15"+ - "\6\0\7\15\1\u025b\37\15\6\0\16\15\1\u025c\30\15"+ - "\6\0\25\15\1\u025d\21\15\6\0\23\15\1\u025e\23\15"+ - "\6\0\41\15\1\u025f\5\15\6\0\16\15\1\u0260\30\15"+ - "\6\0\41\15\1\u0261\5\15\6\0\25\15\1\u0262\21\15"+ - "\6\0\22\15\1\u0263\24\15\6\0\24\15\1\u0264\22\15"+ - "\6\0\22\15\1\u0265\24\15\6\0\34\15\1\u0266\12\15"+ - "\6\0\25\15\1\u0267\21\15\6\0\16\15\1\u0268\30\15"+ - "\6\0\32\15\1\u0269\14\15\6\0\25\15\1\u026a\21\15"+ - "\6\0\24\15\1\u026b\22\15\6\0\25\15\1\u026c\21\15"+ - "\6\0\16\15\1\u026d\30\15\6\0\22\15\1\u026e\24\15"+ - "\6\0\26\15\1\u026f\20\15\6\0\7\15\1\u0270\37\15"+ - "\6\0\17\15\1\u0271\27\15\6\0\7\15\1\u0272\37\15"+ - "\6\0\16\15\1\u0273\30\15\6\0\37\15\1\u0274\7\15"+ - "\6\0\23\15\1\u0275\23\15\6\0\25\15\1\u0276\21\15"+ - "\6\0\21\15\1\u0277\25\15\6\0\16\15\1\u0278\30\15"+ - "\6\0\31\15\1\u0279\15\15\6\0\25\15\1\u027a\21\15"+ - "\6\0\25\15\1\u027b\21\15\6\0\34\15\1\u027c\12\15"+ - "\6\0\22\15\1\u027d\24\15\6\0\42\15\1\u027e\4\15"+ - "\6\0\21\15\1\u027f\25\15\6\0\35\15\1\u0280\11\15"+ - "\6\0\25\15\1\u0281\21\15\6\0\26\15\1\u0282\20\15"+ - "\6\0\34\15\1\u0283\12\15\6\0\27\15\1\u0284\17\15"+ - "\6\0\27\15\1\u0285\17\15\6\0\16\15\1\u0286\15\15"+ - "\1\u0287\12\15\6\0\21\15\1\u0288\25\15\6\0\17\15"+ - "\1\u0289\27\15\6\0\21\15\1\u028a\25\15\6\0\34\15"+ - "\1\u028b\12\15\6\0\21\15\1\u028c\25\15\6\0\25\15"+ - "\1\u028d\21\15\6\0\16\15\1\u028e\30\15\6\0\22\15"+ - "\1\u028f\24\15\6\0\32\15\1\u0290\14\15\6\0\36\15"+ - "\1\u0291\10\15\6\0\16\15\1\u0286\30\15\6\0\25\15"+ - "\1\u0292\21\15\6\0\33\15\1\u0293\13\15\6\0\16\15"+ - "\1\u0294\30\15\6\0\27\15\1\u0295\17\15\6\0\16\15"+ - "\1\u0296\30\15\6\0\32\15\1\u0297\14\15\6\0\31\15"+ - "\1\u0298\15\15\6\0\7\15\1\u0299\37\15\6\0\21\15"+ - "\1\u029a\25\15\6\0\33\15\1\u029b\13\15\6\0\16\15"+ - "\1\u029c\30\15\6\0\22\15\1\u029d\24\15\6\0\21\15"+ - "\1\u029e\25\15\6\0\36\15\1\u029f\10\15\6\0\27\15"+ - "\1\u02a0\17\15\6\0\34\15\1\u02a1\12\15\6\0\32\15"+ - "\1\u02a2\14\15\6\0\27\15\1\u02a3\17\15\6\0\32\15"+ - "\1\u02a4\14\15\6\0\22\15\1\u02a5\24\15\6\0\7\15"+ - "\1\u02a6\37\15\6\0\34\15\1\u02a7\12\15\6\0\31\15"+ - "\1\u02a8\15\15\6\0\24\15\1\u02a9\22\15\6\0\25\15"+ - "\1\u02aa\21\15\6\0\16\15\1\u02ab\30\15\6\0\25\15"+ - "\1\u02ac\21\15\6\0\34\15\1\u02ad\12\15\6\0\26\15"+ - "\1\u02ae\20\15\6\0\16\15\1\u02af\30\15\6\0\17\15"+ - "\1\u02b0\27\15\6\0\25\15\1\u02b1\21\15\6\0\26\15"+ - "\1\u02b2\20\15\6\0\27\15\1\u02b3\17\15\6\0\16\15"+ - "\1\u02b4\30\15\6\0\22\15\1\u02b5\24\15\6\0\7\15"+ - "\1\u02b6\37\15\6\0\32\15\1\u02b7\14\15\6\0\26\15"+ - "\1\u02b8\20\15\6\0\7\15\1\u02b9\37\15\6\0\22\15"+ - "\1\u02ba\24\15\6\0\25\15\1\u02bb\21\15\6\0\21\15"+ - "\1\u02bc\25\15\6\0\34\15\1\u02bd\12\15\6\0\25\15"+ - "\1\u02be\21\15\6\0\17\15\1\u02bf\27\15\6\0\21\15"+ - "\1\u02c0\25\15\6\0\26\15\1\u02c1\20\15\6\0\16\15"+ - "\1\u02c2\30\15\6\0\7\15\1\u02c3\37\15\6\0\26\15"+ - "\1\u02c4\20\15\6\0\22\15\1\u02c5\24\15\6\0\21\15"+ - "\1\u02c6\25\15\6\0\25\15\1\u02c7\21\15\6\0\21\15"+ - "\1\u02c8\25\15\2\0"; - - private static int [] zzUnpackTrans() { - int [] result = new int[27450]; - int offset = 0; - offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackTrans(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - value--; - do result[j++] = value; while (--count > 0); - } - return j; - } - - - /* error codes */ - private static final int ZZ_UNKNOWN_ERROR = 0; - private static final int ZZ_NO_MATCH = 1; - private static final int ZZ_PUSHBACK_2BIG = 2; - - /* error messages for the codes above */ - private static final String ZZ_ERROR_MSG[] = { - "Unkown internal scanner error", - "Error: could not match input", - "Error: pushback value was too large" - }; - - /** - * ZZ_ATTRIBUTE[aState] contains the attributes of state aState - */ - private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); - - private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\7\0\1\1\1\11\1\1\1\11\4\1\2\11\24\1"+ - "\2\11\1\1\2\11\2\1\2\11\3\1\1\11\1\1"+ - "\3\0\67\1\1\0\3\1\1\0\1\11\105\1\1\0"+ - "\u020f\1"; - - private static int [] zzUnpackAttribute() { - int [] result = new int[712]; - int offset = 0; - offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackAttribute(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do result[j++] = value; while (--count > 0); - } - return j; - } - - /** the input device */ - private java.io.Reader zzReader; - - /** the current state of the DFA */ - private int zzState; - - /** the current lexical state */ - private int zzLexicalState = YYINITIAL; - - /** this buffer contains the current text to be matched and is - the source of the yytext() string */ - private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; - - /** the textposition at the last accepting state */ - private int zzMarkedPos; - - /** the textposition at the last state to be included in yytext */ - private int zzPushbackPos; - - /** the current text position in the buffer */ - private int zzCurrentPos; - - /** startRead marks the beginning of the yytext() string in the buffer */ - private int zzStartRead; - - /** endRead marks the last character in the buffer, that has been read - from input */ - private int zzEndRead; - - /** number of newlines encountered up to the start of the matched text */ - private int yyline; - - /** the number of characters up to the start of the matched text */ - private int yychar; - - /** - * the number of characters from the last newline up to the start of the - * matched text - */ - private int yycolumn; - - /** - * zzAtBOL == true <=> the scanner is currently at the beginning of a line - */ - private boolean zzAtBOL = true; - - /** zzAtEOF == true <=> the scanner is at the EOF */ - private boolean zzAtEOF; - - /* user code: */ - StringBuffer string = new StringBuffer(); - - - /** - * Creates a new scanner - * There is also a java.io.InputStream version of this constructor. - * - * @param in the java.io.Reader to read input from. - */ - SpecctraFileScanner(java.io.Reader in) { - this.zzReader = in; - } - - /** - * Creates a new scanner. - * There is also java.io.Reader version of this constructor. - * - * @param in the java.io.Inputstream to read input from. - */ - SpecctraFileScanner(java.io.InputStream in) { - this(new java.io.InputStreamReader(in)); - } - - /** - * Unpacks the compressed character translation table. - * - * @param packed the packed character translation table - * @return the unpacked character translation table - */ - private static char [] zzUnpackCMap(String packed) { - char [] map = new char[0x10000]; - int i = 0; /* index in packed string */ - int j = 0; /* index in unpacked array */ - while (i < 274) { - int count = packed.charAt(i++); - char value = packed.charAt(i++); - do map[j++] = value; while (--count > 0); - } - return map; - } - - - /** - * Refills the input buffer. - * - * @return false, iff there was new input. - * - * @exception java.io.IOException if any I/O-Error occurs - */ - private boolean zzRefill() throws java.io.IOException { - - /* first: make room (if you can) */ - if (zzStartRead > 0) { - System.arraycopy(zzBuffer, zzStartRead, - zzBuffer, 0, - zzEndRead-zzStartRead); - - /* translate stored positions */ - zzEndRead-= zzStartRead; - zzCurrentPos-= zzStartRead; - zzMarkedPos-= zzStartRead; - zzPushbackPos-= zzStartRead; - zzStartRead = 0; - } - - /* is the buffer big enough? */ - if (zzCurrentPos >= zzBuffer.length) { - /* if not: blow it up */ - char newBuffer[] = new char[zzCurrentPos*2]; - System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); - zzBuffer = newBuffer; - } - - /* finally: fill the buffer with new input */ - int numRead = zzReader.read(zzBuffer, zzEndRead, - zzBuffer.length-zzEndRead); - - if (numRead < 0) { - return true; - } - else { - zzEndRead+= numRead; - return false; - } - } - - - /** - * Closes the input stream. - */ - public final void yyclose() throws java.io.IOException { - zzAtEOF = true; /* indicate end of file */ - zzEndRead = zzStartRead; /* invalidate buffer */ - - if (zzReader != null) - zzReader.close(); - } - - - /** - * Resets the scanner to read from a new input stream. - * Does not close the old reader. - * - * All internal variables are reset, the old input stream - * cannot be reused (internal buffer is discarded and lost). - * Lexical state is set to ZZ_INITIAL. - * - * @param reader the new input stream - */ - public final void yyreset(java.io.Reader reader) { - zzReader = reader; - zzAtBOL = true; - zzAtEOF = false; - zzEndRead = zzStartRead = 0; - zzCurrentPos = zzMarkedPos = zzPushbackPos = 0; - yyline = yychar = yycolumn = 0; - zzLexicalState = YYINITIAL; - } - - - /** - * Returns the current lexical state. - */ - public final int yystate() { - return zzLexicalState; - } - - - /** - * Enters a new lexical state - * - * @param newState the new lexical state - */ - public final void yybegin(int newState) { - zzLexicalState = newState; - } - - - /** - * Returns the text matched by the current regular expression. - */ - public final String yytext() { - return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); - } - - - /** - * Returns the character at position pos from the - * matched text. - * - * It is equivalent to yytext().charAt(pos), but faster - * - * @param pos the position of the character to fetch. - * A value from 0 to yylength()-1. - * - * @return the character at position pos - */ - public final char yycharat(int pos) { - return zzBuffer[zzStartRead+pos]; - } - - - /** - * Returns the length of the matched text region. - */ - public final int yylength() { - return zzMarkedPos-zzStartRead; - } - - - /** - * Reports an error that occured while scanning. - * - * In a wellformed scanner (no or only correct usage of - * yypushback(int) and a match-all fallback rule) this method - * will only be called with things that "Can't Possibly Happen". - * If this method is called, something is seriously wrong - * (e.g. a JFlex bug producing a faulty scanner etc.). - * - * Usual syntax/scanner level error handling should be done - * in error fallback rules. - * - * @param errorCode the code of the errormessage to display - */ - private void zzScanError(int errorCode) { - String message; - try { - message = ZZ_ERROR_MSG[errorCode]; - } - catch (ArrayIndexOutOfBoundsException e) { - message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; - } - - throw new Error(message); - } - - - /** - * Pushes the specified amount of characters back into the input stream. - * - * They will be read again by then next call of the scanning method - * - * @param number the number of characters to be read again. - * This number must not be greater than yylength()! - */ - public void yypushback(int number) { - if ( number > yylength() ) - zzScanError(ZZ_PUSHBACK_2BIG); - - zzMarkedPos -= number; - } - - - /** - * Resumes scanning until the next regular expression is matched, - * the end of input is encountered or an I/O-Error occurs. - * - * @return the next token - * @exception java.io.IOException if any I/O-Error occurs - */ - public Object next_token() throws java.io.IOException { - int zzInput; - int zzAction; - - // cached fields: - int zzCurrentPosL; - int zzMarkedPosL; - int zzEndReadL = zzEndRead; - char [] zzBufferL = zzBuffer; - char [] zzCMapL = ZZ_CMAP; - - int [] zzTransL = ZZ_TRANS; - int [] zzRowMapL = ZZ_ROWMAP; - int [] zzAttrL = ZZ_ATTRIBUTE; - - while (true) { - zzMarkedPosL = zzMarkedPos; - - zzAction = -1; - - zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; - - zzState = zzLexicalState; - - - zzForAction: { - while (true) { - - if (zzCurrentPosL < zzEndReadL) - zzInput = zzBufferL[zzCurrentPosL++]; - else if (zzAtEOF) { - zzInput = YYEOF; - break zzForAction; - } - else { - // store back cached positions - zzCurrentPos = zzCurrentPosL; - zzMarkedPos = zzMarkedPosL; - boolean eof = zzRefill(); - // get translated positions and possibly new buffer - zzCurrentPosL = zzCurrentPos; - zzMarkedPosL = zzMarkedPos; - zzBufferL = zzBuffer; - zzEndReadL = zzEndRead; - if (eof) { - zzInput = YYEOF; - break zzForAction; - } - else { - zzInput = zzBufferL[zzCurrentPosL++]; - } - } - int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; - if (zzNext == -1) break zzForAction; - zzState = zzNext; - - int zzAttributes = zzAttrL[zzState]; - if ( (zzAttributes & 1) == 1 ) { - zzAction = zzState; - zzMarkedPosL = zzCurrentPosL; - if ( (zzAttributes & 8) == 8 ) break zzForAction; - } - - } - } - - // store back cached position - zzMarkedPos = zzMarkedPosL; - - switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 18: - { yybegin(NAME); return Keyword.VIA; - } - case 121: break; - case 24: - { return Keyword.BACK; - } - case 122: break; - case 31: - { yybegin(LAYER_NAME); return Keyword.POLYGON_PATH; - } - case 123: break; - case 71: - { return Keyword.NETWORK_SCOPE; - } - case 124: break; - case 56: - { return Keyword.ROUTES; - } - case 125: break; - case 93: - { return Keyword.FLIP_STYLE; - } - case 126: break; - case 108: - { return Keyword.PLACE_CONTROL; - } - case 127: break; - case 32: - { yybegin(LAYER_NAME); return Keyword.POLYGON; - } - case 128: break; - case 78: - { yybegin(NAME); return Keyword.PADSTACK; - } - case 129: break; - case 110: - { yybegin(NAME); return Keyword.CLEARANCE_CLASS; - } - case 130: break; - case 115: - { return Keyword.AUTOROUTE_SETTINGS; - } - case 131: break; - case 13: - { yybegin(YYINITIAL); return Keyword.OPEN_BRACKET; - } - case 132: break; - case 105: - { return Keyword.START_PASS_NO; - } - case 133: break; - case 23: - { yybegin(YYINITIAL); return Keyword.PCB_SCOPE; - } - case 134: break; - case 34: - { yybegin(LAYER_NAME); return Keyword.RECTANGLE; - } - case 135: break; - case 82: - { return Keyword.STRUCTURE_SCOPE; - } - case 136: break; - case 27: - { yybegin(NAME); return Keyword.COMPONENT_SCOPE; - } - case 137: break; - case 43: - { yybegin(NAME); return Keyword.IMAGE; - } - case 138: break; - case 112: - { return Keyword.FORTYFIVE_DEGREE; - } - case 139: break; - case 60: - { return Keyword.WINDOW; - } - case 140: break; - case 76: - { return Keyword.VERTICAL; - } - case 141: break; - case 20: - { return Keyword.PCB_SCOPE; - } - case 142: break; - case 37: - { return Keyword.SPARE; - } - case 143: break; - case 21: - { return Keyword.PIN; - } - case 144: break; - case 35: - { return Keyword.RULE; - } - case 145: break; - case 29: - { return Keyword.VIAS; - } - case 146: break; - case 16: - { return Keyword.ON; - } - case 147: break; - case 63: - { return Keyword.SESSION; - } - case 148: break; - case 74: - { return Keyword.BOUNDARY; - } - case 149: break; - case 88: - { return Keyword.SNAP_ANGLE; - } - case 150: break; - case 113: - { return Keyword.WRITE_RESOLUTION; - } - case 151: break; - case 54: - { return Keyword.NORMAL; - } - case 152: break; - case 8: - { return Keyword.OPEN_BRACKET; - } - case 153: break; - case 22: - { return Keyword.FIX; - } - case 154: break; - case 89: - { yybegin(NAME); return Keyword.LAYER_RULE; - } - case 155: break; - case 86: - { return Keyword.POSTROUTE; - } - case 156: break; - case 14: - { yybegin(YYINITIAL); return Keyword.CLOSED_BRACKET; - } - case 157: break; - case 9: - { return Keyword.CLOSED_BRACKET; - } - case 158: break; - case 90: - { return Keyword.VIA_AT_SMD; - } - case 159: break; - case 28: - { yybegin(LAYER_NAME); return Keyword.CIRCLE; - } - case 160: break; - case 50: - { return Keyword.ATTACH; - } - case 161: break; - case 92: - { return Keyword.RESOLUTION_SCOPE; - } - case 162: break; - case 77: - { return Keyword.VIA_RULE; - } - case 163: break; - case 70: - { return Keyword.CIRCUIT; - } - case 164: break; - case 87: - { return Keyword.PLACEMENT_SCOPE; - } - case 165: break; - case 36: - { yybegin(NAME); return Keyword.WIRE; - } - case 166: break; - case 116: - { return Keyword.PREFERRED_DIRECTION; - } - case 167: break; - case 40: - { yybegin(NAME); return Keyword.LAYER; - } - case 168: break; - case 69: - { return Keyword.CLASSES; - } - case 169: break; - case 61: - { return Keyword.WIRING_SCOPE; - } - case 170: break; - case 103: - { yybegin(NAME); return Keyword.HOST_VERSION; - } - case 171: break; - case 4: - { return yytext(); - } - case 172: break; - case 73: - { return Keyword.ABSOLUTE; - } - case 173: break; - case 58: - { return Keyword.FANOUT; - } - case 174: break; - case 79: - { return Keyword.POSITION; - } - case 175: break; - case 47: - { return Keyword.RULES; - } - case 176: break; - case 57: - { return Keyword.ROTATE; - } - case 177: break; - case 7: - { string.setLength(0); yybegin(STRING2); - } - case 178: break; - case 84: - { yybegin(NAME); return Keyword.USE_LAYER; - } - case 179: break; - case 80: - { yybegin(NAME); return Keyword.HOST_CAD; - } - case 180: break; - case 64: - { return Keyword.OUTLINE; - } - case 181: break; - case 45: - { yybegin(NAME); return Keyword.PLACE; - } - case 182: break; - case 6: - { string.setLength(0); yybegin(STRING1); - } - case 183: break; - case 99: - { yybegin(IGNORE_QUOTE); return Keyword.STRING_QUOTE; - } - case 184: break; - case 39: - { return Keyword.ORDER; - } - case 185: break; - case 17: - { return Keyword.OFF; - } - case 186: break; - case 81: - { return Keyword.AUTOROUTE; - } - case 187: break; - case 52: - { return Keyword.SIGNAL; - } - case 188: break; - case 107: - { yybegin(LAYER_NAME); return Keyword.POLYLINE_PATH; - } - case 189: break; - case 68: - { return Keyword.CONTROL; - } - case 190: break; - case 46: - { yybegin(NAME); return Keyword.PLANE_SCOPE; - } - case 191: break; - case 1: - { yybegin(YYINITIAL); return yytext(); - } - case 192: break; - case 100: - { yybegin(NAME); return Keyword.LOGICAL_PART; - } - case 193: break; - case 83: - { return Keyword.LOCK_TYPE; - } - case 194: break; - case 109: - { yybegin(NAME); return Keyword.PLACE_KEEPOUT; - } - case 195: break; - case 49: - { return Keyword.WIDTH; - } - case 196: break; - case 106: - { return Keyword.NINETY_DEGREE; - } - case 197: break; - case 67: - { yybegin(NAME); return Keyword.USE_NET; - } - case 198: break; - case 118: - { return Keyword.GENERATED_BY_FREEROUTE; - } - case 199: break; - case 101: - { return Keyword.PART_LIBRARY_SCOPE; - } - case 200: break; - case 85: - { return Keyword.VIA_COSTS; - } - case 201: break; - case 102: - { return Keyword.ROTATE_FIRST; - } - case 202: break; - case 75: - { return Keyword.CONSTANT; - } - case 203: break; - case 12: - { string.append('\\'); - } - case 204: break; - case 15: - { return new Double(yytext()); - } - case 205: break; - case 42: - { yybegin(NAME); return Keyword.CLASS; - } - case 206: break; - case 91: - { return Keyword.PULL_TIGHT; - } - case 207: break; - case 30: - { return Keyword.NONE; - } - case 208: break; - case 120: - { return Keyword.AGAINST_PREFERRED_DIRECTION_TRACE_COSTS; - } - case 209: break; - case 114: - { return Keyword.START_RIPUP_COSTS; - } - case 210: break; - case 53: - { return Keyword.LENGTH; - } - case 211: break; - case 38: - { return Keyword.SHAPE; - } - case 212: break; - case 59: - { return Keyword.FROMTO; - } - case 213: break; - case 44: - { return Keyword.POWER; - } - case 214: break; - case 94: - { return Keyword.HORIZONTAL; - } - case 215: break; - case 26: - { return Keyword.TYPE; - } - case 216: break; - case 51: - { return Keyword.ACTIVE; - } - case 217: break; - case 48: - { return Keyword.FRONT; - } - case 218: break; - case 11: - { yybegin(YYINITIAL); return string.toString(); - } - case 219: break; - case 19: - { yybegin(NAME); return Keyword.NET; - } - case 220: break; - case 96: - { return Keyword.CLASS_CLASS; - } - case 221: break; - case 66: - { yybegin(NAME); return Keyword.USE_VIA; - } - case 222: break; - case 65: - { return Keyword.LIBRARY_SCOPE; - } - case 223: break; - case 3: - { /* ignore */ - } - case 224: break; - case 117: - { yybegin(NAME); return Keyword.LOGICAL_PART_MAPPING; - } - case 225: break; - case 111: - { return Keyword.PLANE_VIA_COSTS; - } - case 226: break; - case 72: - { yybegin(NAME); return Keyword.KEEPOUT; - } - case 227: break; - case 98: - { return Keyword.NETWORK_OUT; - } - case 228: break; - case 55: - { return Keyword.PARSER_SCOPE; - } - case 229: break; - case 10: - { string.append( yytext() ); - } - case 230: break; - case 2: - { throw new Error("Illegal character <"+ - yytext()+">"); - } - case 231: break; - case 95: - { return Keyword.SHOVE_FIXED; - } - case 232: break; - case 104: - { return Keyword.KEEPOUT; - } - case 233: break; - case 33: - { return Keyword.PINS; - } - case 234: break; - case 119: - { return Keyword.PREFERRED_DIRECTION_TRACE_COSTS; - } - case 235: break; - case 5: - { return new Integer(yytext()); - } - case 236: break; - case 25: - { return Keyword.SIDE; - } - case 237: break; - case 41: - { return Keyword.CLEARANCE; - } - case 238: break; - case 97: - { yybegin(NAME); return Keyword.VIA_KEEPOUT; - } - case 239: break; - case 62: - { yybegin(YYINITIAL); return Keyword.SIGNAL; - } - case 240: break; - default: - if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { - zzAtEOF = true; - return null; - } - else { - zzScanError(ZZ_NO_MATCH); - } - } - } - } - - -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Structure.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Structure.java deleted file mode 100644 index f70e5cd..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Structure.java +++ /dev/null @@ -1,1419 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Structure.java - * - * Created on 13. Mai 2004, 09:57 - */ -package designformats.specctra; - -import geometry.planar.IntBox; -import geometry.planar.PolylineShape; -import geometry.planar.TileShape; -import geometry.planar.Point; - -import java.util.Collection; -import java.util.Iterator; -import java.util.LinkedList; - -import datastructures.UndoableObjects; - -import rules.BoardRules; -import rules.DefaultItemClearanceClasses.ItemClass; - -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; -import datastructures.UndoableObjects.Storable; - -import board.FixedState; -import board.TestLevel; - -/** - * Class for reading and writing structure scopes from dsn-files. - * - * @author Alfons Wirtz - */ -class Structure extends ScopeKeyword -{ - - /** Creates a new instance of Structure */ - public Structure() - { - super("structure"); - } - - public boolean read_scope(ReadScopeParameter p_par) - { - BoardConstructionInfo board_construction_info = new BoardConstructionInfo(); - - - // If true, components on the back side are rotated before mirroring - // The correct location is the scope PlaceControl, but Electra writes it here. - boolean flip_style_rotate_first = false; - - Collection keepout_list = new LinkedList(); - Collection via_keepout_list = new LinkedList(); - Collection place_keepout_list = new LinkedList(); - - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_par.scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Structure.read_scope: IO error scanning file"); - System.out.println(e); - return false; - } - if (next_token == null) - { - System.out.println("Structure.read_scope: unexpected end of file"); - return false; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - boolean read_ok = true; - if (prev_token == OPEN_BRACKET) - { - if (next_token == Keyword.BOUNDARY) - { - read_boundary_scope(p_par.scanner, board_construction_info); - } - else if (next_token == Keyword.LAYER) - { - read_ok = read_layer_scope(p_par.scanner, board_construction_info, p_par.string_quote); - if (p_par.layer_structure != null) - { - // correct the layer_structure because another layer isr read - p_par.layer_structure = new LayerStructure(board_construction_info.layer_info); - } - } - else if (next_token == Keyword.VIA) - { - p_par.via_padstack_names = read_via_padstacks(p_par.scanner); - } - else if (next_token == Keyword.RULE) - { - board_construction_info.default_rules.addAll(Rule.read_scope(p_par.scanner)); - } - else if (next_token == Keyword.KEEPOUT) - { - if (p_par.layer_structure == null) - { - p_par.layer_structure = new LayerStructure(board_construction_info.layer_info); - } - keepout_list.add(Shape.read_area_scope(p_par.scanner, p_par.layer_structure, false)); - } - else if (next_token == Keyword.VIA_KEEPOUT) - { - if (p_par.layer_structure == null) - { - p_par.layer_structure = new LayerStructure(board_construction_info.layer_info); - } - via_keepout_list.add(Shape.read_area_scope(p_par.scanner, p_par.layer_structure, false)); - } - else if (next_token == Keyword.PLACE_KEEPOUT) - { - if (p_par.layer_structure == null) - { - p_par.layer_structure = new LayerStructure(board_construction_info.layer_info); - } - place_keepout_list.add(Shape.read_area_scope(p_par.scanner, p_par.layer_structure, false)); - } - else if (next_token == Keyword.PLANE_SCOPE) - { - if (p_par.layer_structure == null) - { - p_par.layer_structure = new LayerStructure(board_construction_info.layer_info); - } - Keyword.PLANE_SCOPE.read_scope(p_par); - } - else if (next_token == Keyword.AUTOROUTE_SETTINGS) - { - if (p_par.layer_structure == null) - { - p_par.layer_structure = new LayerStructure(board_construction_info.layer_info); - p_par.autoroute_settings = AutorouteSettings.read_scope(p_par.scanner, p_par.layer_structure); - } - } - else if (next_token == Keyword.CONTROL) - { - read_ok = read_control_scope(p_par); - } - else if (next_token == Keyword.FLIP_STYLE) - { - flip_style_rotate_first = PlaceControl.read_flip_style_rotate_first(p_par.scanner); - } - else if (next_token == Keyword.SNAP_ANGLE) - { - - board.AngleRestriction snap_angle = read_snap_angle(p_par.scanner); - if (snap_angle != null) - { - p_par.snap_angle = snap_angle; - } - } - else - { - skip_scope(p_par.scanner); - } - } - if (!read_ok) - { - return false; - } - } - - boolean result = true; - if (p_par.board_handling.get_routing_board() == null) - { - result = create_board(p_par, board_construction_info); - } - board.RoutingBoard board = p_par.board_handling.get_routing_board(); - if (board == null) - { - return false; - } - if (flip_style_rotate_first) - { - board.components.set_flip_style_rotate_first(true); - } - FixedState fixed_state; - if (board.get_test_level() == TestLevel.RELEASE_VERSION) - { - fixed_state = FixedState.SYSTEM_FIXED; - } - else - { - fixed_state = FixedState.USER_FIXED; - } - // insert the keepouts - for (Shape.ReadAreaScopeResult curr_area : keepout_list) - { - if (!insert_keepout(curr_area, p_par, KeepoutType.keepout, fixed_state)) - { - return false; - } - } - - for (Shape.ReadAreaScopeResult curr_area : via_keepout_list) - { - if (!insert_keepout(curr_area, p_par, KeepoutType.via_keepout, FixedState.SYSTEM_FIXED)) - { - return false; - } - } - - for (Shape.ReadAreaScopeResult curr_area : place_keepout_list) - { - if (!insert_keepout(curr_area, p_par, KeepoutType.place_keepout, FixedState.SYSTEM_FIXED)) - { - return false; - } - } - - // insert the planes. - Iterator it = p_par.plane_list.iterator(); - while (it.hasNext()) - { - ReadScopeParameter.PlaneInfo plane_info = it.next(); - Net.Id net_id = new Net.Id(plane_info.net_name, 1); - if (!p_par.netlist.contains(net_id)) - { - Net new_net = p_par.netlist.add_net(net_id); - if (new_net != null) - { - board.rules.nets.add(new_net.id.name, new_net.id.subnet_number, true); - } - } - rules.Net curr_net = board.rules.nets.get(plane_info.net_name, 1); - if (curr_net == null) - { - System.out.println("Plane.read_scope: net not found"); - continue; - } - geometry.planar.Area plane_area = - Shape.transform_area_to_board(plane_info.area.shape_list, p_par.coordinate_transform); - Layer curr_layer = (plane_info.area.shape_list.iterator().next()).layer; - if (curr_layer.no >= 0) - { - int clearance_class_no; - if (plane_info.area.clearance_class_name != null) - { - clearance_class_no = board.rules.clearance_matrix.get_no(plane_info.area.clearance_class_name); - if (clearance_class_no < 0) - { - System.out.println("Structure.read_scope: clearance class not found"); - clearance_class_no = BoardRules.clearance_class_none(); - } - } - else - { - clearance_class_no = curr_net.get_class().default_item_clearance_classes.get(rules.DefaultItemClearanceClasses.ItemClass.AREA); - } - int[] net_numbers = new int[1]; - net_numbers[0] = curr_net.net_number; - board.insert_conduction_area(plane_area, curr_layer.no, net_numbers, clearance_class_no, - false, FixedState.SYSTEM_FIXED); - } - else - { - System.out.println("Plane.read_scope: unexpected layer name"); - return false; - } - } - insert_missing_power_planes(board_construction_info.layer_info, p_par.netlist, board); - - p_par.board_handling.initialize_manual_trace_half_widths(); - if (p_par.autoroute_settings != null) - { - p_par.board_handling.get_settings().autoroute_settings = p_par.autoroute_settings; - } - return result; - } - - public static void write_scope(WriteScopeParameter p_par) throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("structure"); - // write the bounding box - p_par.file.start_scope(); - p_par.file.write("boundary"); - IntBox bounds = p_par.board.get_bounding_box(); - double[] rect_coor = p_par.coordinate_transform.board_to_dsn(bounds); - Rectangle bounding_rectangle = new Rectangle(Layer.PCB, rect_coor); - bounding_rectangle.write_scope(p_par.file, p_par.identifier_type); - p_par.file.end_scope(); - // lookup the outline in the board - Storable curr_ob = null; - Iterator it = p_par.board.item_list.start_read_object(); - for (;;) - { - curr_ob = p_par.board.item_list.read_object(it); - if (curr_ob == null) - { - break; - } - if (curr_ob instanceof board.BoardOutline) - { - break; - } - } - if (curr_ob == null) - { - System.out.println("Structure.write_scope; outline not found"); - return; - } - board.BoardOutline outline = (board.BoardOutline) curr_ob; - - // write the outline - for (int i = 0; i < outline.shape_count(); ++i) - { - Shape outline_shape = p_par.coordinate_transform.board_to_dsn(outline.get_shape(i), Layer.SIGNAL); - p_par.file.start_scope(); - p_par.file.write("boundary"); - outline_shape.write_scope(p_par.file, p_par.identifier_type); - p_par.file.end_scope(); - } - - write_snap_angle(p_par.file, p_par.board.rules.get_trace_angle_restriction()); - - // write the routing vias - write_via_padstacks(p_par.board.library, p_par.file, p_par.identifier_type); - - // write the control scope - write_control_scope(p_par.board.rules, p_par.file); - - write_default_rules(p_par); - - // write the autoroute settings - AutorouteSettings.write_scope(p_par.file, p_par.autoroute_settings, - p_par.board.layer_structure, p_par.identifier_type); - - // write the keepouts - it = p_par.board.item_list.start_read_object(); - for (;;) - { - curr_ob = p_par.board.item_list.read_object(it); - if (curr_ob == null) - { - break; - } - if (!(curr_ob instanceof board.ObstacleArea)) - { - continue; - } - board.ObstacleArea curr_keepout = (board.ObstacleArea) curr_ob; - if (curr_keepout.get_component_no() != 0) - { - // keepouts belonging to a component are not written individually. - continue; - } - if (curr_keepout instanceof board.ConductionArea) - { - // conduction area will be written later. - continue; - } - write_keepout_scope(p_par, curr_keepout); - } - - // write the conduction areas - it = p_par.board.item_list.start_read_object(); - for (;;) - { - curr_ob = p_par.board.item_list.read_object(it); - if (curr_ob == null) - { - break; - } - if (!(curr_ob instanceof board.ConductionArea)) - { - continue; - } - board.ConductionArea curr_area = (board.ConductionArea) curr_ob; - if (p_par.board.layer_structure.arr[curr_area.get_layer()].is_signal) - { - // These conduction areas are written in the wiring scope. - continue; - } - Plane.write_scope(p_par, (board.ConductionArea) curr_ob); - } - p_par.file.end_scope(); - } - - static void write_default_rules(WriteScopeParameter p_par) throws java.io.IOException - { - // write the default rule using 0 as default layer. - Rule.write_default_rule(p_par, 0); - - // write the layer structure - for (int i = 0; i < p_par.board.layer_structure.arr.length; ++i) - { - boolean write_layer_rule = - p_par.board.rules.get_default_net_class().get_trace_half_width(i) != p_par.board.rules.get_default_net_class().get_trace_half_width(0) || !clearance_equals(p_par.board.rules.clearance_matrix, i, 0); - Layer.write_scope(p_par, i, write_layer_rule); - } - } - - private static void write_via_padstacks(library.BoardLibrary p_library, IndentFileWriter p_file, - IdentifierType p_identifier_type) throws java.io.IOException - { - p_file.new_line(); - p_file.write("(via"); - for (int i = 0; i < p_library.via_padstack_count(); ++i) - { - library.Padstack curr_padstack = p_library.get_via_padstack(i); - if (curr_padstack != null) - { - p_file.write(" "); - p_identifier_type.write(curr_padstack.name, p_file); - } - else - { - System.out.println("Structure.write_via_padstacks: padstack is null"); - } - } - p_file.write(")"); - } - - private static void write_control_scope(rules.BoardRules p_rules, IndentFileWriter p_file) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("control"); - p_file.new_line(); - p_file.write("(via_at_smd "); - boolean via_at_smd_allowed = false; - for (int i = 0; i < p_rules.via_infos.count(); ++i) - { - if (p_rules.via_infos.get(i).attach_smd_allowed()) - { - via_at_smd_allowed = true; - break; - } - } - if (via_at_smd_allowed) - { - p_file.write("on)"); - } - else - { - p_file.write("off)"); - } - p_file.end_scope(); - } - - private static void write_keepout_scope(WriteScopeParameter p_par, board.ObstacleArea p_keepout) throws java.io.IOException - { - geometry.planar.Area keepout_area = p_keepout.get_area(); - int layer_no = p_keepout.get_layer(); - board.Layer board_layer = p_par.board.layer_structure.arr[layer_no]; - Layer keepout_layer = new Layer(board_layer.name, layer_no, board_layer.is_signal); - geometry.planar.Shape boundary_shape; - geometry.planar.Shape[] holes; - if (keepout_area instanceof geometry.planar.Shape) - { - boundary_shape = (geometry.planar.Shape) keepout_area; - holes = new geometry.planar.Shape[0]; - } - else - { - boundary_shape = keepout_area.get_border(); - holes = keepout_area.get_holes(); - } - p_par.file.start_scope(); - if (p_keepout instanceof board.ViaObstacleArea) - { - p_par.file.write("via_keepout"); - } - else - { - p_par.file.write("keepout"); - } - Shape dsn_shape = p_par.coordinate_transform.board_to_dsn(boundary_shape, keepout_layer); - if (dsn_shape != null) - { - dsn_shape.write_scope(p_par.file, p_par.identifier_type); - } - for (int i = 0; i < holes.length; ++i) - { - Shape dsn_hole = p_par.coordinate_transform.board_to_dsn(holes[i], keepout_layer); - dsn_hole.write_hole_scope(p_par.file, p_par.identifier_type); - } - if (p_keepout.clearance_class_no() > 0) - { - Rule.write_item_clearance_class(p_par.board.rules.clearance_matrix.get_name(p_keepout.clearance_class_no()), - p_par.file, p_par.identifier_type); - } - p_par.file.end_scope(); - } - - private static boolean read_boundary_scope(Scanner p_scanner, BoardConstructionInfo p_board_construction_info) - { - Shape curr_shape = Shape.read_scope(p_scanner, null); - // overread the closing bracket. - try - { - Object prev_token = null; - for (;;) - { - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - if (prev_token == Keyword.OPEN_BRACKET) - { - if (next_token == Keyword.CLEARANCE_CLASS) - { - p_board_construction_info.outline_clearance_class_name = DsnFile.read_string_scope(p_scanner); - } - } - prev_token = next_token; - } - } - catch (java.io.IOException e) - { - System.out.println("Structure.read_boundary_scope: IO error scanning file"); - return false; - } - if (curr_shape == null) - { - System.out.println("Structure.read_boundary_scope: shape is null"); - return true; - } - if (curr_shape.layer == Layer.PCB) - { - if (p_board_construction_info.bounding_shape == null) - { - p_board_construction_info.bounding_shape = curr_shape; - } - else - { - System.out.println("Structure.read_boundary_scope: exact 1 bounding_shape expected"); - } - } - else if (curr_shape.layer == Layer.SIGNAL) - { - p_board_construction_info.outline_shapes.add(curr_shape); - } - else - { - System.out.println("Structure.read_boundary_scope: unexpected layer"); - } - return true; - } - - static boolean read_layer_scope(Scanner p_scanner, BoardConstructionInfo p_board_construction_info, String p_string_quote) - { - try - { - boolean layer_ok = true; - boolean is_signal = true; - Object next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Structure.read_layer_scope: String expected"); - return false; - } - Collection net_names = new LinkedList(); - String layer_string = (String) next_token; - next_token = p_scanner.next_token(); - while (next_token != Keyword.CLOSED_BRACKET) - { - if (next_token != Keyword.OPEN_BRACKET) - { - System.out.println("Structure.read_layer_scope: ( expected"); - return false; - } - next_token = p_scanner.next_token(); - if (next_token == Keyword.TYPE) - { - next_token = p_scanner.next_token(); - if (next_token == Keyword.POWER) - { - is_signal = false; - } - else if (next_token != Keyword.SIGNAL) - { - System.out.print("Structure.read_layer_scope: unknown layer type "); - if (next_token instanceof String) - { - System.out.print((String) next_token); - } - System.out.println(); - layer_ok = false; - } - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Structure.read_layer_scope: ) expected"); - return false; - } - } - else if (next_token == Keyword.RULE) - { - Collection curr_rules = Rule.read_scope(p_scanner); - p_board_construction_info.layer_dependent_rules.add(new LayerRule(layer_string, curr_rules)); - } - else if (next_token == Keyword.USE_NET) - { - for (;;) - { - p_scanner.yybegin(SpecctraFileScanner.NAME); - next_token = p_scanner.next_token(); - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - if (next_token instanceof String) - { - net_names.add((String) next_token); - } - else - { - System.out.println("Structure.read_layer_scope: string expected"); - } - } - } - else - { - skip_scope(p_scanner); - } - next_token = p_scanner.next_token(); - } - if (layer_ok) - { - Layer curr_layer = new Layer(layer_string, p_board_construction_info.found_layer_count, is_signal, net_names); - p_board_construction_info.layer_info.add(curr_layer); - ++p_board_construction_info.found_layer_count; - } - } - catch (java.io.IOException e) - { - System.out.println("Layer.read_scope: IO error scanning file"); - System.out.println(e); - return false; - } - return true; - - } - - static Collection read_via_padstacks(Scanner p_scanner) - { - try - { - Collection normal_vias = new LinkedList(); - Collection spare_vias = new LinkedList(); - for (;;) - { - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.CLOSED_BRACKET) - { - break; - } - if (next_token == Keyword.OPEN_BRACKET) - { - next_token = p_scanner.next_token(); - if (next_token == Keyword.SPARE) - { - spare_vias = read_via_padstacks(p_scanner); - } - else - { - skip_scope(p_scanner); - } - } - else if (next_token instanceof String) - { - normal_vias.add((String) next_token); - } - else - { - System.out.println("Structure.read_via_padstack: String expected"); - return null; - } - } - // add the spare vias to the end of the list - normal_vias.addAll(spare_vias); - return normal_vias; - } - catch (java.io.IOException e) - { - System.out.println("Structure.read_via_padstack: IO error scanning file"); - return null; - } - } - - private static boolean read_control_scope(ReadScopeParameter p_par) - { - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_par.scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Structure.read_control_scope: IO error scanning file"); - return false; - } - if (next_token == null) - { - System.out.println("Structure.read_control_scope: unexpected end of file"); - return false; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == OPEN_BRACKET) - { - if (next_token == Keyword.VIA_AT_SMD) - { - p_par.via_at_smd_allowed = DsnFile.read_on_off_scope(p_par.scanner); - } - else - { - skip_scope(p_par.scanner); - } - } - } - return true; - } - - static board.AngleRestriction read_snap_angle(Scanner p_scanner) - { - try - { - Object next_token = p_scanner.next_token(); - board.AngleRestriction snap_angle; - if (next_token == Keyword.NINETY_DEGREE) - { - snap_angle = board.AngleRestriction.NINETY_DEGREE; - } - else if (next_token == Keyword.FORTYFIVE_DEGREE) - { - snap_angle = board.AngleRestriction.FORTYFIVE_DEGREE; - } - else if (next_token == Keyword.NONE) - { - snap_angle = board.AngleRestriction.NONE; - } - else - { - System.out.println("Structure.read_snap_angle_scope: unexpected token"); - return null; - } - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Structure.read_selection_layer_scop: closing bracket expected"); - return null; - } - return snap_angle; - } - catch (java.io.IOException e) - { - System.out.println("Structure.read_snap_angl: IO error scanning file"); - return null; - } - } - - static void write_snap_angle(IndentFileWriter p_file, board.AngleRestriction p_angle_restriction) throws java.io.IOException - { - p_file.start_scope(); - p_file.write("snap_angle "); - p_file.new_line(); - - if (p_angle_restriction == board.AngleRestriction.NINETY_DEGREE) - { - p_file.write("ninety_degree"); - } - else if (p_angle_restriction == board.AngleRestriction.FORTYFIVE_DEGREE) - { - p_file.write("fortyfive_degree"); - } - else - { - p_file.write("none"); - } - p_file.end_scope(); - } - - private boolean create_board(ReadScopeParameter p_par, BoardConstructionInfo p_board_construction_info) - { - int layer_count = p_board_construction_info.layer_info.size(); - if (layer_count == 0) - { - System.out.println("Structure.create_board: layers missing in structure scope"); - return false; - } - if (p_board_construction_info.bounding_shape == null) - { - // happens if the boundary shape with layer pcb is missing - if (p_board_construction_info.outline_shapes.isEmpty()) - { - System.out.println("Structure.create_board: outline missing"); - p_par.board_outline_ok = false; - return false; - } - Iterator it = p_board_construction_info.outline_shapes.iterator(); - - Rectangle bounding_box = it.next().bounding_box(); - while (it.hasNext()) - { - bounding_box = bounding_box.union(it.next().bounding_box()); - } - p_board_construction_info.bounding_shape = bounding_box; - } - Rectangle bounding_box = p_board_construction_info.bounding_shape.bounding_box(); - board.Layer[] board_layer_arr = new board.Layer[layer_count]; - Iterator it = p_board_construction_info.layer_info.iterator(); - for (int i = 0; i < layer_count; ++i) - { - Layer curr_layer = it.next(); - if (curr_layer.no < 0 || curr_layer.no >= layer_count) - { - System.out.println("Structure.create_board: illegal layer number"); - return false; - } - board_layer_arr[i] = new board.Layer(curr_layer.name, curr_layer.is_signal); - } - board.LayerStructure board_layer_structure = new board.LayerStructure(board_layer_arr); - p_par.layer_structure = new LayerStructure(p_board_construction_info.layer_info); - - // Calculate an appropritate scaling between dsn coordinates and board coordinates. - int scale_factor = Math.max(p_par.resolution, 1); - - double max_coor = 0; - for (int i = 0; i < 4; ++i) - { - max_coor = Math.max(max_coor, Math.abs(bounding_box.coor[i] * p_par.resolution)); - } - if (max_coor == 0) - { - p_par.board_outline_ok = false; - return false; - } - // make scalefactor smaller, if there is a danger of integer overflow. - while (5 * max_coor >= geometry.planar.Limits.CRIT_INT) - { - scale_factor /= 10; - max_coor /= 10; - } - - p_par.coordinate_transform = new CoordinateTransform(scale_factor, 0, 0); - - IntBox bounds = (IntBox) bounding_box.transform_to_board(p_par.coordinate_transform); - bounds = bounds.offset(1000); - - Collection board_outline_shapes = new LinkedList(); - for (Shape curr_shape : p_board_construction_info.outline_shapes) - { - if (curr_shape instanceof PolygonPath) - { - PolygonPath curr_path = (PolygonPath) curr_shape; - if (curr_path.width != 0) - { - // set the width to 0, because the offset function used in transform_to_board is not implemented - // for shapes, which are not convex. - curr_shape = new PolygonPath(curr_path.layer, 0, curr_path.coordinate_arr); - } - } - PolylineShape curr_board_shape = (PolylineShape) curr_shape.transform_to_board(p_par.coordinate_transform); - if (curr_board_shape.dimension() > 0) - { - board_outline_shapes.add(curr_board_shape); - } - } - if (board_outline_shapes.isEmpty()) - { - // construct an outline from the bounding_shape, if the outline is missing. - PolylineShape curr_board_shape = (PolylineShape) p_board_construction_info.bounding_shape.transform_to_board(p_par.coordinate_transform); - board_outline_shapes.add(curr_board_shape); - } - Collection hole_shapes = separate_holes(board_outline_shapes); - rules.ClearanceMatrix clearance_matrix = rules.ClearanceMatrix.get_default_instance(board_layer_structure, 0); - rules.BoardRules board_rules = new rules.BoardRules(board_layer_structure, clearance_matrix); - board.Communication.SpecctraParserInfo specctra_parser_info = - new board.Communication.SpecctraParserInfo(p_par.string_quote, p_par.host_cad, - p_par.host_version, p_par.constants, p_par.write_resolution, p_par.dsn_file_generated_by_host); - board.Communication board_communication = - new board.Communication(p_par.unit, p_par.resolution, specctra_parser_info, - p_par.coordinate_transform, p_par.item_id_no_generator, p_par.observers); - - PolylineShape[] outline_shape_arr = new PolylineShape[board_outline_shapes.size()]; - Iterator it2 = board_outline_shapes.iterator(); - for (int i = 0; i < outline_shape_arr.length; ++i) - { - outline_shape_arr[i] = it2.next(); - } - update_board_rules(p_par, p_board_construction_info, board_rules); - board_rules.set_trace_angle_restriction(p_par.snap_angle); - p_par.board_handling.create_board(bounds, board_layer_structure, outline_shape_arr, - p_board_construction_info.outline_clearance_class_name, board_rules, - board_communication, p_par.test_level); - - board.BasicBoard board = p_par.board_handling.get_routing_board(); - - // Insert the holes in the board outline as keepouts. - for (PolylineShape curr_outline_hole : hole_shapes) - { - for (int i = 0; i < board_layer_structure.arr.length; ++i) - { - board.insert_obstacle(curr_outline_hole, i, 0, FixedState.SYSTEM_FIXED); - } - } - - return true; - } - // Check, if a conduction area is inserted on each plane, - // and insert evtl. a conduction area - - private static void insert_missing_power_planes(Collection p_layer_info, - NetList p_netlist, board.BasicBoard p_board) - { - Collection conduction_areas = p_board.get_conduction_areas(); - for (Layer curr_layer : p_layer_info) - { - if (curr_layer.is_signal) - { - continue; - } - boolean conduction_area_found = false; - for (board.ConductionArea curr_conduction_area : conduction_areas) - { - if (curr_conduction_area.get_layer() == curr_layer.no) - { - conduction_area_found = true; - break; - } - } - if (!conduction_area_found && !curr_layer.net_names.isEmpty()) - { - String curr_net_name = curr_layer.net_names.iterator().next(); - Net.Id curr_net_id = new Net.Id(curr_net_name, 1); - if (!p_netlist.contains(curr_net_id)) - { - Net new_net = p_netlist.add_net(curr_net_id); - if (new_net != null) - { - p_board.rules.nets.add(new_net.id.name, new_net.id.subnet_number, true); - } - } - rules.Net curr_net = p_board.rules.nets.get(curr_net_id.name, curr_net_id.subnet_number); - { - if (curr_net == null) - { - System.out.println("Structure.insert_missing_power_planes: net not found"); - continue; - } - } - int[] net_numbers = new int[1]; - net_numbers[0] = curr_net.net_number; - p_board.insert_conduction_area(p_board.bounding_box, curr_layer.no, net_numbers, BoardRules.clearance_class_none(), - false, FixedState.SYSTEM_FIXED); - } - } - } - - /** - * Calculates shapes in p_outline_shapes, which are holes in the outline and returns - * them in the result list. - */ - private static Collection separate_holes(Collection p_outline_shapes) - { - OutlineShape shape_arr[] = new OutlineShape[p_outline_shapes.size()]; - Iterator it = p_outline_shapes.iterator(); - for (int i = 0; i < shape_arr.length; ++i) - { - shape_arr[i] = new OutlineShape(it.next()); - } - for (int i = 0; i < shape_arr.length; ++i) - { - OutlineShape curr_shape = shape_arr[i]; - for (int j = 0; j < shape_arr.length; ++j) - { - // check if shape_arr[j] may be contained in shape_arr[i] - OutlineShape other_shape = shape_arr[j]; - if (i == j || other_shape.is_hole) - { - continue; - } - if (!other_shape.bounding_box.contains(curr_shape.bounding_box)) - { - continue; - } - curr_shape.is_hole = other_shape.contains_all_corners(curr_shape); - } - } - Collection hole_list = new LinkedList(); - for (int i = 0; i < shape_arr.length; ++i) - { - if (shape_arr[i].is_hole) - { - p_outline_shapes.remove(shape_arr[i].shape); - hole_list.add(shape_arr[i].shape); - } - } - return hole_list; - } - - /** - * Updates the board rules from the rules read from the dsn file. - */ - private static void update_board_rules(ReadScopeParameter p_par, - BoardConstructionInfo p_board_construction_info, BoardRules p_board_rules) - { - boolean smd_to_turn_gap_found = false; - // update the clearance matrix - Iterator it = p_board_construction_info.default_rules.iterator(); - while (it.hasNext()) - { - Rule curr_ob = it.next(); - if (curr_ob instanceof Rule.ClearanceRule) - { - Rule.ClearanceRule curr_rule = (Rule.ClearanceRule) curr_ob; - if (set_clearance_rule(curr_rule, -1, p_par.coordinate_transform, p_board_rules, p_par.string_quote)) - { - smd_to_turn_gap_found = true; - } - } - } - // update width rules - it = p_board_construction_info.default_rules.iterator(); - while (it.hasNext()) - { - Object curr_ob = it.next(); - if (curr_ob instanceof Rule.WidthRule) - { - double wire_width = ((Rule.WidthRule) curr_ob).value; - int trace_halfwidth = (int) Math.round(p_par.coordinate_transform.dsn_to_board(wire_width) / 2); - p_board_rules.set_default_trace_half_widths(trace_halfwidth); - } - } - Iterator it3 = p_board_construction_info.layer_dependent_rules.iterator(); - while (it3.hasNext()) - { - LayerRule layer_rule = it3.next(); - int layer_no = p_par.layer_structure.get_no(layer_rule.layer_name); - if (layer_no < 0) - { - continue; - } - Iterator it2 = layer_rule.rule.iterator(); - while (it2.hasNext()) - { - Rule curr_ob = it2.next(); - if (curr_ob instanceof Rule.WidthRule) - { - double wire_width = ((Rule.WidthRule) curr_ob).value; - int trace_halfwidth = (int) Math.round(p_par.coordinate_transform.dsn_to_board(wire_width) / 2); - p_board_rules.set_default_trace_half_width(layer_no, trace_halfwidth); - } - else if (curr_ob instanceof Rule.ClearanceRule) - { - Rule.ClearanceRule curr_rule = (Rule.ClearanceRule) curr_ob; - set_clearance_rule(curr_rule, layer_no, p_par.coordinate_transform, p_board_rules, p_par.string_quote); - } - } - } - if (!smd_to_turn_gap_found) - { - p_board_rules.set_pin_edge_to_turn_dist(p_board_rules.get_min_trace_half_width()); - } - } - - /** - * Converts a dsn clearance rule into a board clearance rule. - * If p_layer_no < 0, the rule is set on all layers. - * Returns true, if the string smd_to_turn_gap was found. - */ - static boolean set_clearance_rule(Rule.ClearanceRule p_rule, int p_layer_no, - CoordinateTransform p_coordinate_transform, BoardRules p_board_rules, String p_string_quote) - { - boolean result = false; - int curr_clearance = (int) Math.round(p_coordinate_transform.dsn_to_board(p_rule.value)); - if (p_rule.clearance_class_pairs.isEmpty()) - { - if (p_layer_no < 0) - { - p_board_rules.clearance_matrix.set_default_value(curr_clearance); - } - else - { - p_board_rules.clearance_matrix.set_default_value(p_layer_no, curr_clearance); - } - return result; - } - if (contains_wire_clearance_pair(p_rule.clearance_class_pairs)) - { - create_default_clearance_classes(p_board_rules); - } - Iterator it = p_rule.clearance_class_pairs.iterator(); - while (it.hasNext()) - { - String curr_string = it.next(); - if (curr_string.equalsIgnoreCase("smd_to_turn_gap")) - { - p_board_rules.set_pin_edge_to_turn_dist(curr_clearance); - result = true; - continue; - } - String[] curr_pair; - if (curr_string.startsWith(p_string_quote)) - { - // split at the second occurance of p_string_quote - curr_string = curr_string.substring(p_string_quote.length()); - curr_pair = curr_string.split(p_string_quote, 2); - if (curr_pair.length != 2 || !curr_pair[1].startsWith("_")) - { - System.out.println("Structure.set_clearance_rule: '_' exprcted"); - continue; - } - curr_pair[1] = curr_pair[1].substring(1); - } - else - { - curr_pair = curr_string.split("_", 2); - if (curr_pair.length != 2) - { - // pairs with more than 1 underline like smd_via_same_net are not implemented - continue; - } - } - - if (curr_pair[1].startsWith(p_string_quote) && curr_pair[1].endsWith(p_string_quote)) - { - // remove the quotes - curr_pair[1] = curr_pair[1].substring(1, curr_pair[1].length() - 1); - } - else - { - String[] tmp_pair = curr_pair[1].split("_", 2); - if (tmp_pair.length != 1) - { - // pairs with more than 1 underline like smd_via_same_net are not implemented - continue; - } - } - - int first_class_no; - if (curr_pair[0].equals("wire")) - { - first_class_no = 1; // default class - } - else - { - first_class_no = p_board_rules.clearance_matrix.get_no(curr_pair[0]); - } - if (first_class_no < 0) - { - first_class_no = append_clearance_class(p_board_rules, curr_pair[0]); - } - int second_class_no; - if (curr_pair[1].equals("wire")) - { - second_class_no = 1; // default class - } - else - { - second_class_no = p_board_rules.clearance_matrix.get_no(curr_pair[1]); - } - if (second_class_no < 0) - { - second_class_no = append_clearance_class(p_board_rules, curr_pair[1]); - } - if (p_layer_no < 0) - { - p_board_rules.clearance_matrix.set_value(first_class_no, second_class_no, curr_clearance); - p_board_rules.clearance_matrix.set_value(second_class_no, first_class_no, curr_clearance); - } - else - { - p_board_rules.clearance_matrix.set_value(first_class_no, second_class_no, p_layer_no, curr_clearance); - p_board_rules.clearance_matrix.set_value(second_class_no, first_class_no, p_layer_no, curr_clearance); - } - } - return result; - } - - static boolean contains_wire_clearance_pair(Collection p_clearance_pairs) - { - for (String curr_pair : p_clearance_pairs) - { - if (curr_pair.startsWith("wire_") || curr_pair.endsWith("_wire")) - { - return true; - } - } - return false; - } - - static private void create_default_clearance_classes(BoardRules p_board_rules) - { - append_clearance_class(p_board_rules, "via"); - append_clearance_class(p_board_rules, "smd"); - append_clearance_class(p_board_rules, "pin"); - append_clearance_class(p_board_rules, "area"); - } - - static private int append_clearance_class(BoardRules p_board_rules, String p_name) - { - p_board_rules.clearance_matrix.append_class(p_name); - int result = p_board_rules.clearance_matrix.get_no(p_name); - rules.NetClass default_net_class = p_board_rules.get_default_net_class(); - if (p_name.equals("via")) - { - default_net_class.default_item_clearance_classes.set(ItemClass.VIA, result); - } - else if (p_name.equals("pin")) - { - default_net_class.default_item_clearance_classes.set(ItemClass.PIN, result); - } - else if (p_name.equals("smd")) - { - default_net_class.default_item_clearance_classes.set(ItemClass.SMD, result); - } - else if (p_name.equals("area")) - { - default_net_class.default_item_clearance_classes.set(ItemClass.AREA, result); - } - return result; - } - - /** - * Returns true, if all clearance values on the 2 input layers are equal. - */ - private static boolean clearance_equals(rules.ClearanceMatrix p_cl_matrix, int p_layer_1, int p_layer_2) - { - if (p_layer_1 == p_layer_2) - { - return true; - } - for (int i = 1; i < p_cl_matrix.get_class_count(); ++i) - { - for (int j = i; j < p_cl_matrix.get_class_count(); ++j) - { - if (p_cl_matrix.value(i, j, p_layer_1) != p_cl_matrix.value(i, j, p_layer_2)) - { - return false; - } - } - } - return true; - } - - private static boolean insert_keepout(Shape.ReadAreaScopeResult p_area, ReadScopeParameter p_par, KeepoutType p_keepout_type, FixedState p_fixed_state) - { - geometry.planar.Area keepout_area = - Shape.transform_area_to_board(p_area.shape_list, p_par.coordinate_transform); - if (keepout_area.dimension() < 2) - { - System.out.println("Structure.insert_keepout: keepout is not an area"); - return true; - } - board.BasicBoard board = p_par.board_handling.get_routing_board(); - if (board == null) - { - System.out.println("Structure.insert_keepout: board not initialized"); - return false; - } - Layer curr_layer = (p_area.shape_list.iterator().next()).layer; - if (curr_layer == Layer.SIGNAL) - { - for (int i = 0; i < board.get_layer_count(); ++i) - { - if (p_par.layer_structure.arr[i].is_signal) - { - insert_keepout(board, keepout_area, i, p_area.clearance_class_name, p_keepout_type, p_fixed_state); - } - } - } - else if (curr_layer.no >= 0) - { - insert_keepout(board, keepout_area, curr_layer.no, p_area.clearance_class_name, p_keepout_type, p_fixed_state); - } - else - { - System.out.println("Structure.insert_keepout: unknown layer name"); - return false; - } - - return true; - } - - private static void insert_keepout(board.BasicBoard p_board, geometry.planar.Area p_area, int p_layer, - String p_clearance_class_name, KeepoutType p_keepout_type, FixedState p_fixed_state) - { - int clearance_class_no; - if (p_clearance_class_name == null) - { - clearance_class_no = - p_board.rules.get_default_net_class().default_item_clearance_classes.get(rules.DefaultItemClearanceClasses.ItemClass.AREA); - } - else - { - clearance_class_no = p_board.rules.clearance_matrix.get_no(p_clearance_class_name); - if (clearance_class_no < 0) - { - System.out.println("Keepout.insert_leepout: clearance class not found"); - clearance_class_no = BoardRules.clearance_class_none(); - } - } - if (p_keepout_type == KeepoutType.via_keepout) - { - p_board.insert_via_obstacle(p_area, p_layer, clearance_class_no, p_fixed_state); - } - else if (p_keepout_type == KeepoutType.place_keepout) - { - p_board.insert_component_obstacle(p_area, p_layer, clearance_class_no, p_fixed_state); - } - else - { - p_board.insert_obstacle(p_area, p_layer, clearance_class_no, p_fixed_state); - } - } - - enum KeepoutType - { - - keepout, via_keepout, place_keepout - } - - private static class BoardConstructionInfo - { - - Collection layer_info = new LinkedList(); - Shape bounding_shape; - java.util.List outline_shapes = new LinkedList(); - String outline_clearance_class_name = null; - int found_layer_count = 0; - Collection default_rules = new LinkedList(); - Collection layer_dependent_rules = new LinkedList(); - } - - private static class LayerRule - { - - LayerRule(String p_layer_name, Collection p_rule) - { - layer_name = p_layer_name; - rule = p_rule; - } - final String layer_name; - final Collection rule; - } - - /** - * Used to seperate the holes in the outline. - */ - private static class OutlineShape - { - - public OutlineShape(PolylineShape p_shape) - { - shape = p_shape; - bounding_box = p_shape.bounding_box(); - convex_shapes = p_shape.split_to_convex(); - is_hole = false; - } - - /** - * Returns true, if this shape contains all corners of p_other_shape. - */ - private boolean contains_all_corners(OutlineShape p_other_shape) - { - if (this.convex_shapes == null) - { - // calculation of the convex shapes failed - return false; - } - int corner_count = p_other_shape.shape.border_line_count(); - for (int i = 0; i < corner_count; ++i) - { - Point curr_corner = p_other_shape.shape.corner(i); - boolean is_contained = false; - for (int j = 0; j < this.convex_shapes.length; ++j) - { - if (this.convex_shapes[j].contains(curr_corner)) - { - is_contained = true; - break; - } - } - if (!is_contained) - { - return false; - } - } - return true; - } - final PolylineShape shape; - final IntBox bounding_box; - final TileShape[] convex_shapes; - boolean is_hole; - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Wiring.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Wiring.java deleted file mode 100644 index a4c6519..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/Wiring.java +++ /dev/null @@ -1,786 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * Wiring.java - * - * Created on 24. Mai 2004, 07:20 - */ - -package designformats.specctra; - -import java.util.Collection; -import java.util.LinkedList; -import java.util.Iterator; - -import datastructures.UndoableObjects; - -import geometry.planar.FloatPoint; -import geometry.planar.Point; -import geometry.planar.IntBox; -import geometry.planar.IntPoint; -import geometry.planar.Line; -import geometry.planar.Polyline; - -import board.RoutingBoard; -import board.Item; -import board.Via; -import board.Trace; -import board.PolylineTrace; -import board.FixedState; -import board.ItemSelectionFilter; - -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - -/** - * Class for reading and writing wiring scopes from dsn-files. - * - * @author Alfons Wirtz - */ -class Wiring extends ScopeKeyword -{ - - /** Creates a new instance of Wiring */ - public Wiring() - { - super("wiring"); - } - - public boolean read_scope(ReadScopeParameter p_par) - { - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_par.scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Wiring.read_scope: IO error scanning file"); - return false; - } - if (next_token == null) - { - System.out.println("Wiring.read_scope: unexpected end of file"); - return false; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - boolean read_ok = true; - if (prev_token == OPEN_BRACKET) - { - if (next_token == Keyword.WIRE) - { - read_wire_scope(p_par); - } - else if (next_token == Keyword.VIA) - { - read_ok = read_via_scope(p_par); - } - else - { - skip_scope(p_par.scanner); - } - } - if (!read_ok) - { - return false; - } - } - RoutingBoard board = p_par.board_handling.get_routing_board(); - for (int i = 1; i <= board.rules.nets.max_net_no(); ++i) - { - board.normalize_traces(i); - } - return true; - } - - public static void write_scope(WriteScopeParameter p_par) throws java.io.IOException - { - p_par.file.start_scope(); - p_par.file.write("wiring"); - // write the wires - Collection board_wires = p_par.board.get_traces(); - Iterator it = board_wires.iterator(); - while (it.hasNext()) - { - write_wire_scope(p_par, it.next()); - } - Collection board_vias = p_par.board.get_vias(); - for (Via curr_via : board_vias) - { - write_via_scope(p_par, curr_via); - } - // write the conduction areas - Iterator it2 = p_par.board.item_list.start_read_object(); - for(;;) - { - Object curr_ob = p_par.board.item_list.read_object(it2); - if (curr_ob == null) - { - break; - } - if (!(curr_ob instanceof board.ConductionArea)) - { - continue; - } - board.ConductionArea curr_area = (board.ConductionArea) curr_ob; - if (!(p_par.board.layer_structure.arr [curr_area.get_layer()].is_signal)) - { - // This conduction areas arw written in the structure scope. - continue; - } - write_conduction_area_scope(p_par, (board.ConductionArea) curr_ob); - } - p_par.file.end_scope(); - } - - private static void write_via_scope(WriteScopeParameter p_par, Via p_via) throws java.io.IOException - { - library.Padstack via_padstack = p_via.get_padstack(); - FloatPoint via_location = p_via.get_center().to_float(); - double [] via_coor = p_par.coordinate_transform.board_to_dsn(via_location); - int net_no; - rules.Net via_net; - if (p_via.net_count() > 0) - { - net_no = p_via.get_net_no(0); - via_net = p_par.board.rules.nets.get(net_no); - } - else - { - net_no = 0; - via_net = null; - } - p_par.file.start_scope(); - p_par.file.write("via "); - p_par.identifier_type.write(via_padstack.name, p_par.file); - for (int i = 0; i < via_coor.length; ++i) - { - p_par.file.write(" "); - p_par.file.write((new Double(via_coor[i])).toString()); - } - if (via_net != null) - { - write_net(via_net, p_par.file, p_par.identifier_type); - } - Rule.write_item_clearance_class(p_par.board.rules.clearance_matrix.get_name(p_via.clearance_class_no()), - p_par.file, p_par.identifier_type); - write_fixed_state(p_par.file, p_via.get_fixed_state()); - p_par.file.end_scope(); - } - - private static void write_wire_scope(WriteScopeParameter p_par, Trace p_wire) throws java.io.IOException - { - if (!(p_wire instanceof PolylineTrace)) - { - System.out.println("Wiring.write_wire_scope: trace type not yet implemented"); - return; - } - PolylineTrace curr_wire = (PolylineTrace) p_wire; - int layer_no = curr_wire.get_layer(); - board.Layer board_layer = p_par.board.layer_structure.arr[layer_no]; - Layer curr_layer = new Layer(board_layer.name, layer_no, board_layer.is_signal); - double wire_width = p_par.coordinate_transform.board_to_dsn(2 * curr_wire.get_half_width()); - rules.Net wire_net = null; - if (curr_wire.net_count() > 0) - { - wire_net = p_par.board.rules.nets.get(curr_wire.get_net_no(0)); - } - if (wire_net == null) - { - System.out.println("Wiring.write_wire_scope: net not found"); - return; - } - p_par.file.start_scope(); - p_par.file.write("wire"); - - if(p_par.compat_mode) - { - Point[] corner_arr = curr_wire.polyline().corner_arr(); - FloatPoint[] float_corner_arr = new FloatPoint [corner_arr.length]; - for (int i = 0; i < corner_arr.length; ++i) - { - float_corner_arr[i] = corner_arr[i].to_float(); - } - double [] coors = p_par.coordinate_transform.board_to_dsn(float_corner_arr); - PolygonPath curr_path = new PolygonPath(curr_layer, wire_width, coors); - curr_path.write_scope(p_par.file, p_par.identifier_type); - } - else - { - double [] coors = p_par.coordinate_transform.board_to_dsn(curr_wire.polyline().arr); - PolylinePath curr_path = new PolylinePath(curr_layer, wire_width, coors); - curr_path.write_scope(p_par.file, p_par.identifier_type); - } - write_net(wire_net, p_par.file, p_par.identifier_type); - Rule.write_item_clearance_class(p_par.board.rules.clearance_matrix.get_name(p_wire.clearance_class_no()), - p_par.file, p_par.identifier_type); - write_fixed_state(p_par.file, curr_wire.get_fixed_state()); - p_par.file.end_scope(); - } - - private static void write_conduction_area_scope(WriteScopeParameter p_par, board.ConductionArea p_conduction_area) throws java.io.IOException - { - int net_count = p_conduction_area.net_count(); - if (net_count <= 0 || net_count > 1) - { - System.out.println("Plane.write_scope: unexpected net count"); - return; - } - rules.Net curr_net = p_par.board.rules.nets.get(p_conduction_area.get_net_no(0)); - geometry.planar.Area curr_area = p_conduction_area.get_area(); - int layer_no = p_conduction_area.get_layer(); - board.Layer board_layer = p_par.board.layer_structure.arr[ layer_no]; - Layer conduction_layer = new Layer(board_layer.name, layer_no, board_layer.is_signal); - geometry.planar.Shape boundary_shape; - geometry.planar.Shape [] holes; - if (curr_area instanceof geometry.planar.Shape) - { - boundary_shape = (geometry.planar.Shape) curr_area; - holes = new geometry.planar.Shape [0]; - } - else - { - boundary_shape = curr_area.get_border(); - holes = curr_area.get_holes(); - } - p_par.file.start_scope(); - p_par.file.write("wire "); - Shape dsn_shape = p_par.coordinate_transform.board_to_dsn(boundary_shape, conduction_layer); - if (dsn_shape != null) - { - dsn_shape.write_scope(p_par.file, p_par.identifier_type); - } - for (int i = 0; i < holes.length; ++i) - { - Shape dsn_hole = p_par.coordinate_transform.board_to_dsn(holes[i], conduction_layer); - dsn_hole.write_hole_scope(p_par.file, p_par.identifier_type); - } - write_net(curr_net, p_par.file, p_par.identifier_type); - Rule.write_item_clearance_class(p_par.board.rules.clearance_matrix.get_name(p_conduction_area.clearance_class_no()), - p_par.file, p_par.identifier_type); - p_par.file.end_scope(); - } - - static private void write_net(rules.Net p_net, IndentFileWriter p_file, IdentifierType p_identifier_type) throws java.io.IOException - { - p_file.new_line(); - p_file.write("("); - Net.write_net_id(p_net, p_file, p_identifier_type); - p_file.write(")"); - } - - static private void write_fixed_state(IndentFileWriter p_file, FixedState p_fixed_state) throws java.io.IOException - { - if (p_fixed_state == FixedState.UNFIXED) - { - return; - } - p_file.new_line(); - p_file.write("(type "); - if (p_fixed_state == FixedState.SHOVE_FIXED) - { - p_file.write("shove_fixed)"); - } - else if (p_fixed_state == FixedState.SYSTEM_FIXED) - { - p_file.write("fix)"); - } - else - { - p_file.write("protect)"); - } - } - - private Item read_wire_scope(ReadScopeParameter p_par) - { - Net.Id net_id = null; - String clearance_class_name = null; - board.FixedState fixed = board.FixedState.UNFIXED; - Path path = null; // Used, if a trace is read. - Shape border_shape = null; // Used, if a conduction area is read. - Collection hole_list = new LinkedList(); - Object next_token = null; - for (;;) - { - Object prev_token = next_token; - try - { - next_token = p_par.scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Wiring.read_wire_scope: IO error scanning file"); - return null; - } - if (next_token == null) - { - System.out.println("Wiring.read_wire_scope: unexpected end of file"); - return null; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == OPEN_BRACKET) - { - if (next_token == Keyword.POLYGON_PATH) - { - path = Shape.read_polygon_path_scope(p_par.scanner, p_par.layer_structure); - } - else if (next_token == Keyword.POLYLINE_PATH) - { - path = Shape.read_polyline_path_scope(p_par.scanner, p_par.layer_structure); - } - else if (next_token == Keyword.RECTANGLE) - { - - border_shape = Shape.read_rectangle_scope(p_par.scanner, p_par.layer_structure); - } - else if (next_token == Keyword.POLYGON) - { - - border_shape = Shape.read_polygon_scope(p_par.scanner, p_par.layer_structure); - } - else if (next_token == Keyword.CIRCLE) - { - - border_shape = Shape.read_circle_scope(p_par.scanner, p_par.layer_structure); - } - else if (next_token == Keyword.WINDOW) - { - Shape hole_shape = Shape.read_scope(p_par.scanner, p_par.layer_structure); - hole_list.add(hole_shape); - // overread the closing bracket - try - { - next_token = p_par.scanner.next_token(); - } - catch (java.io.IOException e) - { - System.out.println("Wiring.read_wire_scope: IO error scanning file"); - return null; - } - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Wiring.read_wire_scope: closing bracket expected"); - return null; - } - } - else if (next_token == Keyword.NET) - { - net_id = read_net_id(p_par.scanner); - } - else if (next_token == Keyword.CLEARANCE_CLASS) - { - clearance_class_name = DsnFile.read_string_scope(p_par.scanner); - } - else if (next_token == Keyword.TYPE) - { - fixed = calc_fixed(p_par.scanner); - } - else - { - skip_scope(p_par.scanner); - } - } - } - if (path == null && border_shape == null) - { - System.out.println("Wiring.read_wire_scope: shape missing"); - return null; - } - RoutingBoard board = p_par.board_handling.get_routing_board(); - - rules.NetClass net_class = board.rules.get_default_net_class(); - Collection found_nets = get_subnets(net_id, board.rules); - int[] net_no_arr = new int[found_nets.size()]; - int curr_index = 0; - for (rules.Net curr_net : found_nets) - { - net_no_arr[curr_index] = curr_net.net_number; - net_class = curr_net.get_class(); - ++curr_index; - } - int clearance_class_no = -1; - if (clearance_class_name != null) - { - clearance_class_no = board.rules.clearance_matrix.get_no(clearance_class_name); - } - int layer_no; - int half_width; - if (path != null) - { - layer_no = path.layer.no; - half_width = (int) Math.round(p_par.coordinate_transform.dsn_to_board(path.width / 2)); - } - else - { - layer_no = border_shape.layer.no; - half_width = 0; - } - if (layer_no < 0 || layer_no >= board.get_layer_count()) - { - System.out.print("Wiring.read_wire_scope: unexpected layer "); - if (path != null) - { - System.out.println(path.layer.name); - } - else - { - System.out.println(border_shape.layer.name); - } - return null; - } - - IntBox bounding_box = board.get_bounding_box(); - - Item result = null; - if (border_shape != null) - { - if (clearance_class_no < 0) - { - clearance_class_no = - net_class.default_item_clearance_classes.get(rules.DefaultItemClearanceClasses.ItemClass.AREA); - } - Collection area = new LinkedList(); - area.add(border_shape); - area.addAll(hole_list); - geometry.planar.Area conduction_area = - Shape.transform_area_to_board(area, p_par.coordinate_transform); - result = board.insert_conduction_area(conduction_area, layer_no, net_no_arr, clearance_class_no, - false, fixed); - } - else if (path instanceof PolygonPath) - { - if (clearance_class_no < 0) - { - clearance_class_no = - net_class.default_item_clearance_classes.get(rules.DefaultItemClearanceClasses.ItemClass.TRACE); - } - IntPoint [] corner_arr = new IntPoint[path.coordinate_arr.length / 2]; - double [] curr_point = new double [2]; - for (int i = 0; i < corner_arr.length; ++i) - { - curr_point[0] = path.coordinate_arr[2 * i]; - curr_point[1] = path.coordinate_arr[2 * i + 1]; - FloatPoint curr_corner = p_par.coordinate_transform.dsn_to_board(curr_point); - if (!bounding_box.contains(curr_corner)) - { - System.out.println("Wiring.read_wire_scope: wire corner outside board"); - return null; - } - corner_arr[i] = curr_corner.round(); - } - Polyline trace_polyline = new Polyline(corner_arr); - // Traces are not yet normalized here because cycles may be removed premature. - result = board.insert_trace_without_cleaning(trace_polyline, layer_no, half_width, net_no_arr, clearance_class_no, fixed); - } - else if (path instanceof PolylinePath) - { - if (clearance_class_no < 0) - { - clearance_class_no = - net_class.default_item_clearance_classes.get(rules.DefaultItemClearanceClasses.ItemClass.TRACE); - } - Line [] line_arr = new Line[path.coordinate_arr.length / 4]; - double [] curr_point = new double [2]; - for (int i = 0; i < line_arr.length; ++i) - { - curr_point[0] = path.coordinate_arr[4 * i]; - curr_point[1] = path.coordinate_arr[4 * i + 1]; - FloatPoint curr_a = p_par.coordinate_transform.dsn_to_board(curr_point); - curr_point[0] = path.coordinate_arr[4 * i + 2]; - curr_point[1] = path.coordinate_arr[4 * i + 3]; - FloatPoint curr_b = p_par.coordinate_transform.dsn_to_board(curr_point); - line_arr[i] = new Line(curr_a.round(), curr_b.round()); - } - Polyline trace_polyline = new Polyline(line_arr); - result = board.insert_trace_without_cleaning(trace_polyline, layer_no, half_width, net_no_arr, clearance_class_no, fixed); - } - else - { - System.out.println("Wiring.read_wire_scope: unexpected Path subclass"); - return null; - } - if (result != null && result.net_count() == 0) - { - try_correct_net(result); - } - return result; - } - - /** - * Maybe trace of type turret without net in Mentor design. - * Try to assig the net by calculating the overlaps. - */ - private void try_correct_net(Item p_item) - { - if (!(p_item instanceof Trace)) - { - return; - } - Trace curr_trace = (Trace) p_item; - java.util.Set contacts = curr_trace.get_normal_contacts(curr_trace.first_corner(), true); - contacts.addAll(curr_trace.get_normal_contacts(curr_trace.last_corner(), true)); - int corrected_net_no = 0; - for (Item curr_contact : contacts) - { - if (curr_contact.net_count() == 1) - { - corrected_net_no = curr_contact.get_net_no(0); - break; - } - } - if (corrected_net_no != 0) - { - p_item.assign_net_no(corrected_net_no); - } - } - - private static Collection get_subnets(Net.Id p_net_id, rules.BoardRules p_rules) - { - Collection found_nets = new LinkedList(); - if (p_net_id != null) - { - if (p_net_id.subnet_number > 0) - { - rules.Net found_net = p_rules.nets.get(p_net_id.name, p_net_id.subnet_number); - if (found_net != null) - { - found_nets.add(found_net); - } - } - else - { - found_nets = p_rules.nets.get(p_net_id.name); - } - } - return found_nets; - } - - private boolean read_via_scope(ReadScopeParameter p_par) - { - try - { - board.FixedState fixed = board.FixedState.UNFIXED; - // read the padstack name - Object next_token = p_par.scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Wiring.read_via_scope: padstack name expected"); - return false; - } - String padstack_name = (String) next_token; - // read the location - double []location = new double [2]; - for (int i = 0; i < 2; ++i) - { - next_token = p_par.scanner.next_token(); - if (next_token instanceof Double) - { - location[i] = ((Double) next_token).doubleValue(); - } - else if (next_token instanceof Integer) - { - location[i] = ((Integer) next_token).intValue(); - } - else - { - System.out.println("Wiring.read_via_scope: number expected"); - return false; - } - } - Net.Id net_id = null; - String clearance_class_name = null; - for (;;) - { - Object prev_token = next_token; - next_token = p_par.scanner.next_token(); - if (next_token == null) - { - System.out.println("Wiring.read_via_scope: unexpected end of file"); - return false; - } - if (next_token == CLOSED_BRACKET) - { - // end of scope - break; - } - if (prev_token == OPEN_BRACKET) - { - if (next_token == Keyword.NET) - { - net_id = read_net_id(p_par.scanner); - } - else if (next_token == Keyword.CLEARANCE_CLASS) - { - clearance_class_name = DsnFile.read_string_scope(p_par.scanner); - } - else if (next_token == Keyword.TYPE) - { - fixed = calc_fixed(p_par.scanner); - } - else - { - skip_scope(p_par.scanner); - } - } - } - RoutingBoard board = p_par.board_handling.get_routing_board(); - library.Padstack curr_padstack = board.library.padstacks.get(padstack_name); - if (curr_padstack == null) - { - System.out.println("Wiring.read_via_scope: via padstack not found"); - return false; - } - rules.NetClass net_class = board.rules.get_default_net_class(); - Collection found_nets = get_subnets(net_id, board.rules); - if (net_id != null && found_nets.isEmpty()) - { - System.out.print("Wiring.read_via_scope: net with name "); - System.out.print(net_id.name); - System.out.println(" not found"); - } - int[] net_no_arr = new int[found_nets.size()]; - int curr_index = 0; - for (rules.Net curr_net : found_nets) - { - net_no_arr[curr_index] = curr_net.net_number; - net_class = curr_net.get_class(); - } - int clearance_class_no = -1; - if (clearance_class_name != null) - { - clearance_class_no = board.rules.clearance_matrix.get_no(clearance_class_name); - } - if (clearance_class_no < 0) - { - clearance_class_no = net_class.default_item_clearance_classes.get(rules.DefaultItemClearanceClasses.ItemClass.VIA); - } - IntPoint board_location = p_par.coordinate_transform.dsn_to_board(location).round(); - if (via_exists(board_location, curr_padstack, net_no_arr, board)) - { - System.out.print("Multiple via skipped at ("); - System.out.println(board_location.x + ", " + board_location.y + ")"); - } - else - { - boolean attach_allowed = p_par.via_at_smd_allowed && curr_padstack.attach_allowed; - board.insert_via(curr_padstack, board_location, net_no_arr, clearance_class_no, fixed, attach_allowed); - } - return true; - } - catch (java.io.IOException e) - { - System.out.println("Wiring.read_via_scope: IO error scanning file"); - return false; - } - } - - private static boolean via_exists(IntPoint p_location, library.Padstack p_padstack, - int[] p_net_no_arr, board.BasicBoard p_board) - { - ItemSelectionFilter filter = new ItemSelectionFilter(ItemSelectionFilter.SelectableChoices.VIAS); - int from_layer = p_padstack.from_layer(); - int to_layer = p_padstack.to_layer(); - Collection picked_items = p_board.pick_items(p_location, p_padstack.from_layer(), filter); - for (Item curr_item : picked_items) - { - Via curr_via = (Via) curr_item; - if (curr_via.nets_equal(p_net_no_arr) && curr_via.get_center().equals(p_location) - && curr_via.first_layer() == from_layer && curr_via.last_layer() == to_layer) - { - return true; - } - } - return false; - } - - static board.FixedState calc_fixed(Scanner p_scanner) - { - try - { - board.FixedState result = board.FixedState.UNFIXED; - Object next_token = p_scanner.next_token(); - if (next_token == Keyword.SHOVE_FIXED) - { - result = board.FixedState.SHOVE_FIXED; - } - else if (next_token == Keyword.FIX) - { - result = board.FixedState.SYSTEM_FIXED; - } - else if (next_token != Keyword.NORMAL) - { - result = board.FixedState.USER_FIXED; - } - next_token = p_scanner.next_token(); - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Wiring.is_fixed: ) expected"); - return board.FixedState.UNFIXED; - } - return result; - } - catch (java.io.IOException e) - { - System.out.println("Wiring.is_fixed: IO error scanning file"); - return board.FixedState.UNFIXED; - } - } - - /** - * Reads a net_id. The subnet_number of the net_id will be 0, if no subneet_number was found. - */ - private static Net.Id read_net_id(Scanner p_scanner) - { - try - { - int subnet_number = 0; - p_scanner.yybegin(SpecctraFileScanner.NAME); - Object next_token = p_scanner.next_token(); - if (!(next_token instanceof String)) - { - System.out.println("Wiring:read_net_id: String expected"); - return null; - } - String net_name = (String) next_token; - next_token = p_scanner.next_token(); - if (next_token instanceof Integer) - { - subnet_number = (Integer) next_token; - next_token = p_scanner.next_token(); - } - if (next_token != Keyword.CLOSED_BRACKET) - { - System.out.println("Wiring.read_net_id: closing bracket expected"); - } - return new Net.Id(net_name, subnet_number); - } - catch (java.io.IOException e) - { - System.out.println("DsnFile.read_string_scope: IO error scanning file"); - return null; - } - } -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/WriteScopeParameter.java b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/WriteScopeParameter.java deleted file mode 100644 index 2810d08..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/WriteScopeParameter.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2014 Alfons Wirtz - * website www.freerouting.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License at - * for more details. - * - * WriteScopeParameter.java - * - * Created on 21. Juni 2004, 08:37 - */ - -package designformats.specctra; - -import board.BasicBoard; -import datastructures.IndentFileWriter; -import datastructures.IdentifierType; - -/** - * Default parameter type used while writing a Specctra dsn-file. - * - * @author alfons - */ -public class WriteScopeParameter -{ - - /** - * Creates a new instance of WriteScopeParameter. - * If p_compat_mode is true, only standard speecctra dsb scopes are written, so that any - * host system with an specctra interface can read them. - */ - WriteScopeParameter(BasicBoard p_board, interactive.AutorouteSettings p_autoroute_settings, - IndentFileWriter p_file, String p_string_quote, CoordinateTransform p_coordinate_transform, - boolean p_compat_mode) - { - board = p_board; - autoroute_settings = p_autoroute_settings; - file = p_file; - coordinate_transform = p_coordinate_transform; - compat_mode = p_compat_mode; - String[] reserved_chars = {"(", ")", " ", ";", "-", "_"}; - identifier_type = new IdentifierType(reserved_chars, p_string_quote); - } - - final BasicBoard board; - final interactive.AutorouteSettings autoroute_settings; - final IndentFileWriter file; - final CoordinateTransform coordinate_transform; - final boolean compat_mode; - final IdentifierType identifier_type; -} diff --git a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/package.html b/src/main/java/eu/mihosoft/freerouting/designformats/specctra/package.html deleted file mode 100644 index edaee0b..0000000 --- a/src/main/java/eu/mihosoft/freerouting/designformats/specctra/package.html +++ /dev/null @@ -1,21 +0,0 @@ - -java.text package - - - Contains classes for reading and writing board designs in the Specctra dsn text format. - \ No newline at end of file diff --git a/src/main/java/resources/BoardFrame_de.properties b/src/main/java/resources/BoardFrame_de.properties deleted file mode 100644 index 251bf7f..0000000 --- a/src/main/java/resources/BoardFrame_de.properties +++ /dev/null @@ -1,10 +0,0 @@ -# German version of language dependent text of the class BoardMenuInfo -title = Platinen-Layout -confirm_cancel = Bitte Abbrechen best\u00E4tigen -error_1 = Lesen der Gui-Defaults-Datei ist fehlgeschlagen -error_2 = Speichern des Platinendesigns ist fehhlgeschlagen -error_3 = Schreiberlaubnis verweigert -error_4 = Speichern des Board-Frames ist fehlgeschlagen -error_5 = Sclie\u00DFen der Output-Datei ist fehlgeschlagen -error_6 = Lesen der .dsn-Datei fehlgeschlagen -error_7 = Outline fehlt in der .dsn-Datei \ No newline at end of file diff --git a/src/main/java/resources/BoardFrame_en.properties b/src/main/java/resources/BoardFrame_en.properties deleted file mode 100644 index c986a40..0000000 --- a/src/main/java/resources/BoardFrame_en.properties +++ /dev/null @@ -1,10 +0,0 @@ -# English version of language dependent text of the class BoardMenuInfo -title = Board Layout -confirm_cancel = Please confirm cancel -error_1 = unable to read file eu.mihosoft.freerouting.gui defaults file -error_2 = unable to save eu.mihosoft.freerouting.board to file -error_3 = sorry, no write permission -error_4 = unable to write eu.mihosoft.freerouting.board frame to file -error_5 = unable to close output file -error_6 = unable to read .dsn-file -error_7 = outline missing in .dsn-file diff --git a/src/main/java/resources/BoardMenuDisplay_de.properties b/src/main/java/resources/BoardMenuDisplay_de.properties deleted file mode 100644 index ba40021..0000000 --- a/src/main/java/resources/BoardMenuDisplay_de.properties +++ /dev/null @@ -1,9 +0,0 @@ -# German version of language dependent text of the class BoardMenuDisplay -display = Display -object_visibility = Objekt-Sichtbarkeit -object_visibility_tooltip = die Abbildungsintensität eines Objekts ändern -layer_visibility = Lagen-Sichtbarkeit -layer_visibility_tooltip = die Sichtbarkeit einzelner Lagen ändern -colors = Farben -colors_tooltip = Die Farben der Objekte auf der Platine ändern -miscellaneous = sonstiges diff --git a/src/main/java/resources/BoardMenuDisplay_en.properties b/src/main/java/resources/BoardMenuDisplay_en.properties deleted file mode 100644 index 8dad0e7..0000000 --- a/src/main/java/resources/BoardMenuDisplay_en.properties +++ /dev/null @@ -1,9 +0,0 @@ -# English version of language dependent text of the class BoardMenuDisplay -display = Display -object_visibility = Object Visibility -object_visibility_tooltip = to change the drawing intensity of an object -layer_visibility = Layer Visibility -layer_visibility_tooltip = to change the visibility of individual layers -colors = Colors -colors_tooltip = to change the colors of the eu.mihosoft.freerouting.board objects on the screen -miscellaneous = Miscellaneous \ No newline at end of file diff --git a/src/main/java/resources/BoardMenuFile_de.properties b/src/main/java/resources/BoardMenuFile_de.properties deleted file mode 100644 index 8354d36..0000000 --- a/src/main/java/resources/BoardMenuFile_de.properties +++ /dev/null @@ -1,45 +0,0 @@ -# German version of language dependent text of the class BoardMenuFile - -file = Datei -save = speichern -save_tooltip = speichert das Design auf Platte im internen .bin Dateiformat -save_message = Design-Datei gespeichert -save_and_exit = speichern und beenden -save_and_exit_tooltip = beendet das Programm nach Speichern des Designs auf Platte -cancel_and_exit = abbrechen und beenden -cancel_and_exit_tooltip = beendet das Programm ohne das Design zu speichern -save_as = speichern unter -save_as_tooltip = Erweiterungen .bin für binär oder .dsn für Specctra-Text-Format können verwendet werden -generate_logfile = Log-Datei erzeugen -generate_logfile_tooltip = schreibt ab jetzt die interaktiven Aktionen in eine Log-Datei -replay_logfile = Log-Datei abspielen -replay_logfile_tooltip = wiederholt die in einer Log_Datei gespeicherten interactiven Aktionen -session_file = Specctra-Session-Datei exportieren -session_file_tooltip = Schreibt eine Session-Datei im .ses-Format von Specctra -eagle_script = Eagle-Session-Script exportieren -eagle_script_tooltip = Schreibt die Änderungen im Routing in ein Eagle-Script zum Update der entsprechenden .brd-Datei in Eagle -settings = GUI-Einstellungen als Default speichern -settings_tooltip = Speichert die aktuellen Einstellungen im graphischen User-Interface als default -confirm = Möchten Sie auch die in diesem Programm erzeugten Regeln zur späteren Wiederverwendung speichern? -message_1 = Speichern der Design-Datei ist fehlgeschlagen -message_2 = die Design-Datei wird von jetzt ab gespeichert unter dem Namen -message_3 = legale Dateierweiterungen sind .bin and .dsn -message_4 = Textdatei -message_5 = im Specctra-Textformat geschrieben -message_6 = Schreiben auf Textdatei -message_7 = ist fehlgeschlagen -message_8 = Erzeugen der Log-Datei ist fehlgeschlagen. -message_9 = Schreibe Log-Datei -message_10 = Lesen der Log_datei ist fehlgeschlagen -message_11 = Session-Datei -message_12 = im Specctra-Format geschrieben -message_13 = schreibe Session-Datei -message_14 = Eagle-Script-Datei -message_15 = geschrieben -message_16 = erzeuge Eagle-Script-Datei -message_17 = GUI-Default-Einstellungen gespeichert -message_18 = Speichern der GUI-Default-Einstellungen ist fehlgeschlagen -message_19 = Speichern fehlgeschlagen da Datei nicht mit .dsn endet -message_20 = Das Host-Cad-System erwartet evtl. den Session-Dateinamen -message_21 = Bitte Datei gegebenenfalls umbenennen -message_22 = Eagle erwartet evtl. die Dateierweiterung .scr für das Script-File. \ No newline at end of file diff --git a/src/main/java/resources/BoardMenuFile_en.properties b/src/main/java/resources/BoardMenuFile_en.properties deleted file mode 100644 index 4309cc1..0000000 --- a/src/main/java/resources/BoardMenuFile_en.properties +++ /dev/null @@ -1,44 +0,0 @@ -# English version of language dependent text of the class BoardMenuFile -file = File -save = Save -save_tooltip = saves the design to disk in the internal .bin file format -save_message = design file saved -save_and_exit = Save and Exit -save_and_exit_tooltip = exits the program after saving the design to disk -cancel_and_exit = Cancel and Exit -cancel_and_exit_tooltip = exits the program without saving the design -save_as = Save as -save_as_tooltip = use extensions .bin for binary and .dsn for Specctra text format -generate_logfile = Generate Logfile -generate_logfile_tooltip = starts writing the eu.mihosoft.freerouting.interactive actions to a logfile -replay_logfile = Replay Logfile -replay_logfile_tooltip = repeats the eu.mihosoft.freerouting.interactive actions stored in a logfile -session_file = Export Specctra Session File -session_file_tooltip = writes a session file in the Specctra .ses format -eagle_script = Export Eagle Session Script -eagle_script_tooltip = creates an eagle script to export the changes in routing -settings = Save GUI Settings as Default -settings_tooltip = saves the current settings of the graphical user interface as default -confirm = Save also the eu.mihosoft.freerouting.rules created in this program for later reuse? -message_1 = unable to save design file -message_2 = saving design file from now on as -message_3 = legal file extensions are .bin and .dsn -message_4 = textfile -message_5 = in Specctra text format written -message_6 = writing to textfile -message_7 = failed -message_8 = unable to create logfile -message_9 = writing logfile -message_10 = unable to read logfile -message_11 = session file -message_12 = in Specctra format written -message_13 = writing session file -message_14 = Eagle script file -message_15 = written -message_16 = creating Eagle script file -message_17 = GUI default settings saved -message_18 = saving GUI default settings failed -message_19 = File not saved because file extension .dsn expected -message_20 = Host cad system might expect the session file name -message_21 = Please rename the file if necessary -message_22 = Eagle might expect the script file extension .scr \ No newline at end of file diff --git a/src/main/java/resources/BoardMenuHelp_de.properties b/src/main/java/resources/BoardMenuHelp_de.properties deleted file mode 100644 index 2eb800a..0000000 --- a/src/main/java/resources/BoardMenuHelp_de.properties +++ /dev/null @@ -1,5 +0,0 @@ -# German version of language dependent text of the class BoardMenuHelp -help = Hilfe -contents = allgemeine Hilfe -direct_help = kontextsensitive Hilfe -about = über diese Software diff --git a/src/main/java/resources/BoardMenuHelp_en.properties b/src/main/java/resources/BoardMenuHelp_en.properties deleted file mode 100644 index 0d8c2c2..0000000 --- a/src/main/java/resources/BoardMenuHelp_en.properties +++ /dev/null @@ -1,5 +0,0 @@ -# English version of language dependent text of the class BoardMenuHelp -help = Help -contents = Help Contents -direct_help = Help Context -about = About this Software diff --git a/src/main/java/resources/BoardMenuInfo_de.properties b/src/main/java/resources/BoardMenuInfo_de.properties deleted file mode 100644 index cf05faf..0000000 --- a/src/main/java/resources/BoardMenuInfo_de.properties +++ /dev/null @@ -1,10 +0,0 @@ -# German version of language dependent text of the class BoardMenuInfo -info = Info -incompletes = offene Verbindungen -length_violations = Längenverletzungen -clearance_violations = Clearance-Verletzungen -library_packages = Bibliotheks-Packages -library_padstacks = Bibliotheks-Padstacks -board_components = platzierte Bauteile -unconnected_route = nicht verbundener Route -route_stubs = Route-Stummel \ No newline at end of file diff --git a/src/main/java/resources/BoardMenuInfo_en.properties b/src/main/java/resources/BoardMenuInfo_en.properties deleted file mode 100644 index de3f11a..0000000 --- a/src/main/java/resources/BoardMenuInfo_en.properties +++ /dev/null @@ -1,10 +0,0 @@ -# English version of language dependent text of the class BoardMenuInfo -info = Info -incompletes = Incompletes -length_violations = Length Violations -clearance_violations = Clearance Violations -library_packages = Library Packages -library_padstacks = Library Padstacks -board_components = Placed Components -unconnected_route = Unconnected Route -route_stubs = Route Stubs \ No newline at end of file diff --git a/src/main/java/resources/BoardMenuOther_de.properties b/src/main/java/resources/BoardMenuOther_de.properties deleted file mode 100644 index 95244ba..0000000 --- a/src/main/java/resources/BoardMenuOther_de.properties +++ /dev/null @@ -1,4 +0,0 @@ -# German version of language dependent text of the class BoardMenuOther -other = Sonstiges -snapshots = Snapshots -snapshots_tooltip = öffnet Fenster für eu.mihosoft.freerouting.interactive Snapshots diff --git a/src/main/java/resources/BoardMenuOther_en.properties b/src/main/java/resources/BoardMenuOther_en.properties deleted file mode 100644 index de91aac..0000000 --- a/src/main/java/resources/BoardMenuOther_en.properties +++ /dev/null @@ -1,4 +0,0 @@ -# English version of language dependent text of the class BoardMenuOther -other = Other -snapshots = Snapshots -snapshots_tooltip = opens window for eu.mihosoft.freerouting.interactive snapshots diff --git a/src/main/java/resources/BoardMenuParameter_de.properties b/src/main/java/resources/BoardMenuParameter_de.properties deleted file mode 100644 index 75b14cb..0000000 --- a/src/main/java/resources/BoardMenuParameter_de.properties +++ /dev/null @@ -1,6 +0,0 @@ -# German version of language dependent text of the class BoardMenuParameter -parameter = Parameter -select = selektieren -route = routen -eu.mihosoft.freerouting.autoroute = autorouten -move = platzieren diff --git a/src/main/java/resources/BoardMenuParameter_en.properties b/src/main/java/resources/BoardMenuParameter_en.properties deleted file mode 100644 index 02a89fc..0000000 --- a/src/main/java/resources/BoardMenuParameter_en.properties +++ /dev/null @@ -1,6 +0,0 @@ -# English version of language dependent text of the class BoardMenuParameter -parameter = Parameter -select = Select -route = Route -eu.mihosoft.freerouting.autoroute = Autoroute -move = Move diff --git a/src/main/java/resources/BoardMenuRules_de.properties b/src/main/java/resources/BoardMenuRules_de.properties deleted file mode 100644 index 39b1dae..0000000 --- a/src/main/java/resources/BoardMenuRules_de.properties +++ /dev/null @@ -1,6 +0,0 @@ -# German version of language dependent text of the class BoardMenuRules -eu.mihosoft.freerouting.rules = Regeln -clearance_matrix = Clearance-Matrix -vias = Vias -nets = Netze -net_classes = Netzklassen diff --git a/src/main/java/resources/BoardMenuRules_en.properties b/src/main/java/resources/BoardMenuRules_en.properties deleted file mode 100644 index e87a9d5..0000000 --- a/src/main/java/resources/BoardMenuRules_en.properties +++ /dev/null @@ -1,6 +0,0 @@ -# English version of language dependent text of the class BoardMenuRules -eu.mihosoft.freerouting.rules = Rules -clearance_matrix = Clearance Matrix -vias = Vias -nets = Nets -net_classes = Net Classes \ No newline at end of file diff --git a/src/main/java/resources/BoardPanelStatus_de.properties b/src/main/java/resources/BoardPanelStatus_de.properties deleted file mode 100644 index 0adafc7..0000000 --- a/src/main/java/resources/BoardPanelStatus_de.properties +++ /dev/null @@ -1,5 +0,0 @@ -# German version of language dependent text of the class BoardPanelStatus -status_line = Statuszeile -additional_text_field = zusätzliches Textfeld -current_layer = aktuelle Lage: Bauteil-Seite -cursor = Cursor: diff --git a/src/main/java/resources/BoardPanelStatus_en.properties b/src/main/java/resources/BoardPanelStatus_en.properties deleted file mode 100644 index d17b7c4..0000000 --- a/src/main/java/resources/BoardPanelStatus_en.properties +++ /dev/null @@ -1,5 +0,0 @@ -# English version of language dependent text of the class BoardPanelStatus -status_line = status line -additional_text_field = additional text field -current_layer = current layer: Component Side -cursor = cursor: diff --git a/src/main/java/resources/BoardToolbarSelectedItem_de.properties b/src/main/java/resources/BoardToolbarSelectedItem_de.properties deleted file mode 100644 index 8716f1e..0000000 --- a/src/main/java/resources/BoardToolbarSelectedItem_de.properties +++ /dev/null @@ -1,43 +0,0 @@ -# German version of language dependent text of the class BoardToolbarSelectedItem -info = Info -info_tooltip = zeigt Informationen \u00FCber die ausgew\u00E4hlten Objekte (i) -cancel = Abbrechen -cancel_tooltip = das Auswahlmen\u00FC verlassen (Esc) -delete = L\u00F6schen -delete_tooltip = die unfixierten ausgew\u00E4hlten Objekte l\u00F6schen (Entf) -cutout = Ausschneiden -cutout_tooltip = den ausgew\u00E4hlten Route innerhalb eines Rechtecks l\u00F6schen (d) -fix = Fix -fix_tooltip = die ausgew\u00E4hlten Objekte fixieren (f) -unfix = Unfix -unfix_tooltip = die Fixierung der ausgew\u00E4hlten Objekte aufheben (u) -spacing = Clearance -spacing_tooltip = den ausgew\u00E4hlten Objekten eine neue Clearance-Klasse zuweisen -pull_tight = Gl\u00E4tten -pull_tight_tooltip = Die ausgew\u00E4hlten Bahnen und Vias glattt ziehen (p) -eu.mihosoft.freerouting.autoroute = Autoroute -autoroute_tooltip = die ausgew\u00E4hlten Objekte autorouten (a) -fanout = Fanout -fanout_tooltip = die ausgew\u00E4hlten SMD-Pins bis zum ersten Via autorouten -nets = Netze -nets_tooltip = die Auswahl auf ganze Netze erweitern (n) -conn_sets = Zush. -conn_sets_tooltip = die Auswahl auf ganze zusammenh\u00E4ngende Teilmengen erweitern (s) -connections = Verb. -connections_tooltip = die Auswahl auf ganze Verbindungen erweitern (e) -components = Bauteile -components_tooltip = die Auswahl auf ganze Bauteile erweitern (b) -new_net = Neues Netz -new_net_tooltip = die ausgew\u00E4hlten Objekte einem neuen Netz zuweisen -new_component = Neues Bauteil -new_component_tooltip = die ausgew\u00E4hlten Objekte einem neuen Bauteil zuweisen -violations = Verletzungen -violations_tooltip = Das Zeigen der Clearance-Verletzungen der ausgew\u00E4hlten Objekte an- oder abschalten (v) -zoom_selection = Auswahl abbilden -zoom_selection_tooltip = ein umgebendes Rechteck der ausgew\u00E4hlten Objekte abbilden(w) -zoom_all = Alles abb. -zoom_all_tooltip = die gesamte Platine abbilden (a) -zoom_region = Ausschnitt abb. -zoom_region_tooltip = ein Rechteck der Platine zum Abbilden ausw\u00E4hlen (r) -select_clearance_class = W\u00E4hle Clearance-Klasse -assign_clearance_class = Clearance-Klasse zuweisen diff --git a/src/main/java/resources/BoardToolbarSelectedItem_en.properties b/src/main/java/resources/BoardToolbarSelectedItem_en.properties deleted file mode 100644 index 8231e67..0000000 --- a/src/main/java/resources/BoardToolbarSelectedItem_en.properties +++ /dev/null @@ -1,43 +0,0 @@ -# English version of language dependent text of the class BoardToolbarSelectedItem -info = Info -info_tooltip = displays information about the selected items (i) -cancel = Cancel -cancel_tooltip = to cancel the current selection (esc) -delete = Delete -delete_tooltip = to delete the selected items which are not fixed (del) -cutout = Cutout -cutout_tooltip = to delete the selected route inside a rectangle (d) -fix = Fix -fix_tooltip = to fix the selected items (f) -unfix = Unfix -unfix_tooltip = to unfix the selected items (u) -spacing = Clearance -spacing_tooltip = to assign a new clearance class to the selected items -pull_tight = Pull Tight -pull_tight_tooltip = to optimize the selected traces and vias (p) -eu.mihosoft.freerouting.autoroute = Autoroute -autoroute_tooltip = to eu.mihosoft.freerouting.autoroute the selected items (a) -fanout = Fanout -fanout_tooltip = to eu.mihosoft.freerouting.autoroute the selected SMD pins until the first via -nets = Nets -nets_tooltip = to extend the selection to whole nets (n) -conn_sets = Conn. Sets -conn_sets_tooltip = to extend the selection to whole connected sets (s) -connections = Connections -connections_tooltip = to extend the selection until the next fork or terminal item (e) -components = Components -components_tooltip = to extend the selection to whole components (b) -new_net = New Net -new_net_tooltip = to assign the selected items to a new net -new_component = New Component -new_component_tooltip = to assign the selected items to a new component -violations = Violations -violations_tooltip = to show or hide the clearance violations of the selected items (v) -zoom_selection = Zoom Selection -zoom_selection_tooltip = to display a window containing the selected items (w) -zoom_all = Zoom All -zoom_all_tooltip = to display the whole eu.mihosoft.freerouting.board (a) -zoom_region = Zoom Region -zoom_region_tooltip = to display a region of the eu.mihosoft.freerouting.board (r) -select_clearance_class = Select clearance class -assign_clearance_class = Assign Clearance Class \ No newline at end of file diff --git a/src/main/java/resources/BoardToolbar_de.properties b/src/main/java/resources/BoardToolbar_de.properties deleted file mode 100644 index c7872c1..0000000 --- a/src/main/java/resources/BoardToolbar_de.properties +++ /dev/null @@ -1,22 +0,0 @@ -# German Version of language dependent text of the eu.mihosoft.freerouting.board toolbar -select_button = Selektieren -select_button_tooltip = linke Maustaste selektiert Objekte (s) -route_button = Routen -route_button_tooltip = linke Maustaste beginnt eine neue Bahn (r) -drag_button = Ziehen -drag_button_tooltip = Objekte mit gedr\u00FCckter linker Maustaste ziehen oder Bahnen vom leeren Raum aus schieben(d) -undo_button = Undo -undo_button_tooltip = die letzte \u00C4nderung r\u00FCckg\u00E4ngig machen (u) -redo_button = Redo -redo_button_tooltip = die letzte \u00C4nderung wiederherstellen (b) -incompletes_button = Incompletes -incompletes_button_tooltip = das Zeigen der offenen Verbindungen an- oder abschalten (g) -violations_button = Verletzungen -violations_button_tooltip = das Zeigen der Clearance-Verletzungen an- oder abschalten (v) -autoroute_button = Autorouter -autoroute_button_tooltip = den Batch-Autorouter starten -display_all_button = Alles abbilden -display_all_button_tooltip = die gesamte Platine abbilden (a) -display_region_button = Ausschnitt abbilden -display_region_button_tooltip = ein Rechteck der Platine zum Abbilden ausw\u00E4hlen (f) -unit_button = Unit: \ No newline at end of file diff --git a/src/main/java/resources/BoardToolbar_en.properties b/src/main/java/resources/BoardToolbar_en.properties deleted file mode 100644 index f452b58..0000000 --- a/src/main/java/resources/BoardToolbar_en.properties +++ /dev/null @@ -1,23 +0,0 @@ -# English version of language dependent text of the eu.mihosoft.freerouting.board toolbar - -select_button = Select -select_button_tooltip = left button selects items (s) -route_button = Route -route_button_tooltip = left button starts a new trace (r) -drag_button = Drag -drag_button_tooltip = to drag items with the left button or to push traces out of empty space (d) -undo_button = Undo -undo_button_tooltip = to undo the last change (u) -redo_button = Redo -redo_button_tooltip = to redo the last change (b) -incompletes_button = Incompletes -incompletes_button_tooltip = to display or hide the incomplete connections (g) -violations_button = Violations -violations_button_tooltip = to display or hide the clearance violations (v) -autoroute_button = Autorouter -autoroute_button_tooltip = to start the batch autorouter -display_all_button = Zoom All -display_all_button_tooltip = to display the whole eu.mihosoft.freerouting.board (a) -display_region_button = Zoom Region -display_region_button_tooltip = to select a region of the eu.mihosoft.freerouting.board for display(f) -unit_button = Unit: diff --git a/src/main/java/resources/CleanupWindows_de.properties b/src/main/java/resources/CleanupWindows_de.properties deleted file mode 100644 index d78a58e..0000000 --- a/src/main/java/resources/CleanupWindows_de.properties +++ /dev/null @@ -1,13 +0,0 @@ -# German version of language dependent text of the cleanup windows in the info menu -at = bei -net = Netz -no_route_stubs_found = keine Route-Stummel gefunden -no_unconnected_route_found = keine nicht verbundenen Traces oder Vias gefunden -on_layer = auf Lage -route_stubs = Route-Stummel -stub_net = Stummel Netz -trace = Trace -trace_count = Trace-Anzahl -unconnected_route = Nicht verbundener Route -via = Via -via_count = Via-Anzahl diff --git a/src/main/java/resources/CleanupWindows_en.properties b/src/main/java/resources/CleanupWindows_en.properties deleted file mode 100644 index a138280..0000000 --- a/src/main/java/resources/CleanupWindows_en.properties +++ /dev/null @@ -1,13 +0,0 @@ -# English version of language dependent text of the cleanup windows in the info menu -at = at -net = Net -no_route_stubs_found = no route stubs found -no_unconnected_route_found = no unconnected traces or vias found -on_layer = on layer -route_stubs = Route Stubs -stub_net = stub net -trace = Trace -trace_count = trace count -unconnected_route = Unconnected Route -via = Via -via_count = via count \ No newline at end of file diff --git a/src/main/java/resources/Default_de.properties b/src/main/java/resources/Default_de.properties deleted file mode 100644 index 9528c42..0000000 --- a/src/main/java/resources/Default_de.properties +++ /dev/null @@ -1,40 +0,0 @@ -# German version of the default file with language dependent text -add_corner = Ecke hinzufügen (linke Maustaste) -all = alle -cancel = abbrechen (Esc) -cancel_route = Route abbrechen(Esc) -center_display = Bild zentrieren (c) -change_layer = Lage wechseln -change_layer_tooltip = geht auch mit Zifferntaste oder '+' '-' -close = schließen -color_manager = Farbverwaltung -components = Bauteile -copy = kopieren -done = beenden (Leertaste) -end_route = Route beenden (linke Maustaste) -generate_snapshot = Snapshot erzeugen (s) -incompletes = Offene Verbindungen -inner = innere -insert = einfügen (linke Maustaste) -layer_changed_to = Lage gewechselt nach -layer_visibility = Lagen-Sichtbarkeit -layer_visibility_header = Regler zum Ändern der Sichtbarkeit von Lage -maximum_all = Alle Maximum -maximum_all_tooltip = schiebt alle Regler nach rechts -minimum_all = Alle Minimum -minimum_all_tooltip = schiebt alle Regler nach links -move = verschieben (m) -packages = Packages -padstacks = Padstacks -pick_a_color = Wählen Sie eine Farbe -route_completed = Platine vollständig entflochten -zoom = zoomen -zoom_in = größer (z) -zoom_out = kleiner (o) - - - - - - - diff --git a/src/main/java/resources/Default_en.properties b/src/main/java/resources/Default_en.properties deleted file mode 100644 index 8c40873..0000000 --- a/src/main/java/resources/Default_en.properties +++ /dev/null @@ -1,41 +0,0 @@ -# English version of the default file with language dependent text -add_corner = add corner (left button) -all = all -cancel = cancel (Esc) -cancel_route = cancel route (Esc) -center_display = center display (c) -change_layer = change layer -change_layer_tooltip = also possible with number key or '+' '-' -close = close -color_manager = Color Manager -components = Components -copy = copy -done = done (Space) -end_route = end route (left button) -generate_snapshot = generate snapshot (s) -incompletes = Incompletes -inner = inner -insert = insert (left button) -layer_changed_to = layer changed to -layer_visibility = Layer Visibility -layer_visibility_header = Use slider to modify the visibility on layer -maximum_all = Maximum All -maximum_all_tooltip = pushs all sliders to the right -minimum_all = Minimum All -minimum_all_tooltip = pushs all sliders to the left -move = move (m) -packages = Packages -padstacks = Padstacks -pick_a_color = Pick a Color -route_completed = route completed -zoom = zoom -zoom_in = in (z) -zoom_out = out (o) - - - - - - - - diff --git a/src/main/java/resources/DisplayMisc_de.properties b/src/main/java/resources/DisplayMisc_de.properties deleted file mode 100644 index 80c8e46..0000000 --- a/src/main/java/resources/DisplayMisc_de.properties +++ /dev/null @@ -1,16 +0,0 @@ -# German version of language dependent text of the class DisplayMisc -title = Abbildung sonstiges -cross_hair_cursor = Crosshair-Cursor -small = klein -big = groß -cursor_checkbox_tooltip = Shortcut ist die Komma-Taste -rotation = Platinenrotation: -none = keine -90_degree = 90 Grad -180_degree = 180 Grad --90_degree = -90 Grad -board_mirroring = Platinenspiegelung: -left_right = links rechts -top_bottom = oben unten -layer_dimming = automatisches Lagen-Dimmen: -layer_dimming_tooltip = Mit dem Regler können Sie die Intensität des automatischen Lagen-Dimmens verändern diff --git a/src/main/java/resources/DisplayMisc_en.properties b/src/main/java/resources/DisplayMisc_en.properties deleted file mode 100644 index 89bcb11..0000000 --- a/src/main/java/resources/DisplayMisc_en.properties +++ /dev/null @@ -1,16 +0,0 @@ -# English version of language dependent text of the class DisplayMisc -title = Display Miscellaneous -cross_hair_cursor = crosshair cursor -small = small -big = big -cursor_checkbox_tooltip = Shortcut is the comma-key -rotation = eu.mihosoft.freerouting.board rotation: -none = none -90_degree = 90 degree -180_degree = 180 degree --90_degree = -90 degree -board_mirroring = eu.mihosoft.freerouting.board mirroring: -left_right = left right -top_bottom = top bottom -layer_dimming = automatic layer dimming: -layer_dimming_tooltip = Use slider to change intensity of automatic layer dimming diff --git a/src/main/java/resources/MainApplication_de.properties b/src/main/java/resources/MainApplication_de.properties deleted file mode 100644 index 8f6a083..0000000 --- a/src/main/java/resources/MainApplication_de.properties +++ /dev/null @@ -1,25 +0,0 @@ -# German version of language dependent text of the class MainApplication - -title = Freerouter -confirm_cancel = Bitte Verlassen des Programms best\u00E4tigen -loading_design = Lade Design -router_demonstrations = Demonstrations-Beispiele -router_demonstrations_tooltip = spiele Demonstrations-Beispiele f\u00FCr den Router ab -sample_designs = Beispiel-Designs -sample_designs_tooltip = Beispiel-Platinen-Designs im Netz \u00F6ffnen -open_own_design = Eigenes Design \u00F6ffnen -open_own_design_tooltip = ein Platinen-Design im Specctra .dsn Format auf der eigenen Festplatte \u00F6ffnen -restore_defaults = System-Defaults wiederherstellen -restore_defaults_tooltip = l\u00F6scht die vom User gespeicherten Einstellungen und stellt die System-Defaults wieder her. -defaults_restored = System-Voreinstellungen wiederhergestellt. -nothing_to_restore = nichts wiederherzustellen -confirm_delete = Bitte das L\u00F6schen der von Ihnen gespeicherten Einstellungen best\u00E4tigen -confirm_import_rules = Bitte das Importieren der gespeicherten Regeln best\u00E4tigen\nBeachten Sie dass dabei aus dem Host-System importierte Regeln \u00FCberschrieben werden k\u00F6nnen -message_3 = kann Platinendesign nicht \u00F6ffnen -message_4 = Design-Datei -message_5 = ge\u00F6ffnet -message_6 = Datei mit Namen -message_7 = nicht gefunden -message_8 = kann Designfile nicht lesen! -user_online_message_1 = Internet Verbindung zum Starten der Freerouter Anwendung erforderlich! -user_online_message_2 = Danach k\u00F6nnen Sie die Verbindung wieder abschalten! \ No newline at end of file diff --git a/src/main/java/resources/MainApplication_en.properties b/src/main/java/resources/MainApplication_en.properties deleted file mode 100644 index eb5b9e5..0000000 --- a/src/main/java/resources/MainApplication_en.properties +++ /dev/null @@ -1,25 +0,0 @@ -# English version of language dependent text of the class MainApplication - -title = Freerouter -confirm_cancel = Please confirm exit -loading_design = Loading design -router_demonstrations = Router Demonstrations -router_demonstrations_tooltip = replay demonstration examples of the router -sample_designs = Sample Designs -sample_designs_tooltip = open example eu.mihosoft.freerouting.board designs in the net -open_own_design = Open Your Own Design -open_own_design_tooltip = open a eu.mihosoft.freerouting.board design in the Specctra .dsn format on your own local disc -restore_defaults = Restore System Defaults -restore_defaults_tooltip = deletes the settings stored by the user and restores the system defaults -defaults_restored = system default settings restored -nothing_to_restore = nothing to restore -confirm_delete = Please confirm deleting your stored settings -confirm_import_rules = Please confirm importing stored eu.mihosoft.freerouting.rules\nBeware that eu.mihosoft.freerouting.rules imported from the the host system may be overwritten -message_3 = unable to open eu.mihosoft.freerouting.board design -message_4 = design file -message_5 = opened -message_6 = File with name -message_7 = not found -message_8 = unable to read design file! -user_online_message_1 = Internet connection required to start the Freerouter application! -user_online_message_2 = After that you can switch the connection off again! \ No newline at end of file diff --git a/src/main/java/resources/PopupMenuMain_de.properties b/src/main/java/resources/PopupMenuMain_de.properties deleted file mode 100644 index d47b163..0000000 --- a/src/main/java/resources/PopupMenuMain_de.properties +++ /dev/null @@ -1,9 +0,0 @@ -# German version of language dependent text of the class PopupMenuMain -select_item = Objekt selektieren (i) -start_route = Route starten (t) -swap_pin = Pin tauschen (w) -create_keepout = Sperrfläche konstruieren -tile = convexes Polygon -circle = Kreis -polygon = Polygon -hole = Loch diff --git a/src/main/java/resources/PopupMenuMain_en.properties b/src/main/java/resources/PopupMenuMain_en.properties deleted file mode 100644 index 682f33b..0000000 --- a/src/main/java/resources/PopupMenuMain_en.properties +++ /dev/null @@ -1,9 +0,0 @@ -# English version of language dependent text of the class PopupMenuMain -select_item = select item (i) -start_route = start route (t) -swap_pin = swap pin (w) -create_keepout = create keepout -tile = tile -circle = circle -polygon = polygon -hole = hole diff --git a/src/main/java/resources/PopupMenuMove_de.properties b/src/main/java/resources/PopupMenuMove_de.properties deleted file mode 100644 index e99d03c..0000000 --- a/src/main/java/resources/PopupMenuMove_de.properties +++ /dev/null @@ -1,13 +0,0 @@ -# German version of language dependent text of the class PopupMenuMove -turn = drehen -90_degree = 90 Grad (+) -180_degree = 180 Grad (*) --90_degree = -90 Grad (-) -45_degree = 45 Grad -135_degree = 135 Grad --135_degree = -135 Grad --45_degree = -45 Grad -change_side = Seite wechseln(/) -reset_rotation = Rotation zurücksetzen -insert = einfügen (linke Maustaste) -cancel = abbrechen (Esc) diff --git a/src/main/java/resources/PopupMenuMove_en.properties b/src/main/java/resources/PopupMenuMove_en.properties deleted file mode 100644 index 022168d..0000000 --- a/src/main/java/resources/PopupMenuMove_en.properties +++ /dev/null @@ -1,13 +0,0 @@ -# English version of language dependent text of the class PopupMenuMain -turn = turn -90_degree = 90 degree (+) -180_degree = 180 degree (*) --90_degree = -90 degree (-) -45_degree = 45 degree -135_degree = 135 degree --135_degree = -135 degree --45_degree = -45 degree -change_side = change side (/) -reset_rotation = reset rotation -insert = insert (left button) -cancel = cancel (Esc) \ No newline at end of file diff --git a/src/main/java/resources/WindowAbout_de.properties b/src/main/java/resources/WindowAbout_de.properties deleted file mode 100644 index 947ff4a..0000000 --- a/src/main/java/resources/WindowAbout_de.properties +++ /dev/null @@ -1,7 +0,0 @@ -# German version of language dependent text of the class WindowAbout -title = \u00DCber diese Software -description = Freie Software zum Entflechten von Leiterplatten -warranty = Wir \u00FCbernehmen keinerlei Garantie oder Gew\u00E4hrleistung! -version = Version: -homepage = Homepage: http://www.freerouting.net -support = Kontakt: support@freerouting.net diff --git a/src/main/java/resources/WindowAbout_en.properties b/src/main/java/resources/WindowAbout_en.properties deleted file mode 100644 index d015032..0000000 --- a/src/main/java/resources/WindowAbout_en.properties +++ /dev/null @@ -1,7 +0,0 @@ -# English version of language dependent text of the class WindowAbout -title = About this software -description = Free software for Printed Circuit Board Routing -version = Version: -warranty = This program comes with absolutely no warranty! -homepage = Homepage: http://www.freerouting.net -support = Contact: support@freerouting.net diff --git a/src/main/java/resources/WindowAssignNetClass_de.properties b/src/main/java/resources/WindowAssignNetClass_de.properties deleted file mode 100644 index 2c79dbb..0000000 --- a/src/main/java/resources/WindowAssignNetClass_de.properties +++ /dev/null @@ -1,6 +0,0 @@ -# German version of language dependent text of the class WindowAssignNetClass -title = Netzklasse zuweisen -net_name = Netzname -class_name = Klassenname -net_name_tooltip = Der Name des Netzes -class_name_tooltip = Die zugewiesene Netzklasse diff --git a/src/main/java/resources/WindowAssignNetClass_en.properties b/src/main/java/resources/WindowAssignNetClass_en.properties deleted file mode 100644 index 19cbc06..0000000 --- a/src/main/java/resources/WindowAssignNetClass_en.properties +++ /dev/null @@ -1,6 +0,0 @@ -# English version of language dependent text of the class WindowAssignNetClass -title = Assign Net Class -net_name = net name -class_name = class name -net_name_tooltip = The net name -class_name_tooltip = The assigned net class \ No newline at end of file diff --git a/src/main/java/resources/WindowAutorouteParameter_de.properties b/src/main/java/resources/WindowAutorouteParameter_de.properties deleted file mode 100644 index 3d73df9..0000000 --- a/src/main/java/resources/WindowAutorouteParameter_de.properties +++ /dev/null @@ -1,25 +0,0 @@ -# German version of language dependent text of the class WindowAutorouteParameter -title = Autoroute-Einstellungen -layer = Lage: -active = aktiv: -preferred_direction = Vorzugsrichtung: -horizontal = horizontal -vertical = vertikal -detail_parameter = Detail-Einstellungen -detail_autoroute_parameter = Detailierte Autoroute-Einstellungen -trace_costs_on_layer = Trace-Kosten auf Lage: -in_preferred_direction in Vorzugsrichtung: -against_preferred_direction gegen die Vorzugsrichtung: -with_fanout = Fanout vorrouten: -vias_allowed = Vias erlaubt: -via_costs Via-Kosten: -plane_via_costs Stromlagen-Via-Kosten: -start_ripup_costs = Ripup-Anfangskosten: -start_pass = Start-Pass: -speed = Tempo: -fast = schnell -slow = langsam -passes = Passes: -fanout = Fanout -eu.mihosoft.freerouting.autoroute = Autoroute -postroute = Postroute diff --git a/src/main/java/resources/WindowAutorouteParameter_en.properties b/src/main/java/resources/WindowAutorouteParameter_en.properties deleted file mode 100644 index ccb9bff..0000000 --- a/src/main/java/resources/WindowAutorouteParameter_en.properties +++ /dev/null @@ -1,25 +0,0 @@ -# English version of language dependent text of the class WindowRouteParameter -title = Autoroute Parameter -layer = Layer: -active = Active: -preferred_direction = Preferred Direction: -horizontal = horizontal -vertical = vertical -detail_parameter = Detail parameter -detail_autoroute_parameter = Detail Autoroute Parameter -trace_costs_on_layer = Trace costs on layer: -in_preferred_direction In preferred direction: -against_preferred_direction Against preferred direction: -with_fanout = Preroute fanout: -vias_allowed = Vias allowed: -via_costs Via costs: -plane_via_costs Powerplane via costs: -start_ripup_costs = Ripup start costs: -start_pass = Start pass: -speed = Speed: -fast = fast -slow = slow -passes = Passes: -fanout = Fanout -eu.mihosoft.freerouting.autoroute = Autoroute -postroute = Postroute diff --git a/src/main/java/resources/WindowClearanceMatrix_de.properties b/src/main/java/resources/WindowClearanceMatrix_de.properties deleted file mode 100644 index b51540f..0000000 --- a/src/main/java/resources/WindowClearanceMatrix_de.properties +++ /dev/null @@ -1,16 +0,0 @@ -# English version of language dependent text of the class WindowClearanceClass -title = Clearance-Matrix -layer = Lage: -layer_tooltip = Lage einstellen, wo die die Werte der Clearance-Matrix geändert werden können -add_class = Klasse hinzufügen -add_class_tooltip = Eine neue Clearance-Klasse Klasse hinzufügen -prune = Trimmen -prune_tooltip = Redundante Klassen löschen -new_name = Bitte geben Sie den Namen der neuen Klasse ein -confirm_remove = Bitte bestätigen Sie das Löschen der Klasse -class = Klasse -the_class = der Klasse -the_classes = den Klassen -and = und -already_assigned = Objekte sind schon zugewiesen zu -change_anyway = !\nClearance-Regel trotzdem ändern? diff --git a/src/main/java/resources/WindowClearanceMatrix_en.properties b/src/main/java/resources/WindowClearanceMatrix_en.properties deleted file mode 100644 index d5dc4d6..0000000 --- a/src/main/java/resources/WindowClearanceMatrix_en.properties +++ /dev/null @@ -1,16 +0,0 @@ -# English version of language dependent text of the class WindowClearanceClass -title = Clearance Matrix -layer = Layer: -layer_tooltip = Set the layer, where the clearance matrix can be changed -add_class = Add Class -add_class_tooltip = Append a new clearance class -prune = Trim -prune_tooltip = Remove redundant classes -new_name = Please enter the name of the new class -confirm_remove = Please confirm removing class -class = class -the_class = the class -the_classes = the classes -and = and -already_assigned = Items already assigned to -change_anyway = !\nChange clearance anyway? \ No newline at end of file diff --git a/src/main/java/resources/WindowClearanceViolations_de.properties b/src/main/java/resources/WindowClearanceViolations_de.properties deleted file mode 100644 index 66bfe69..0000000 --- a/src/main/java/resources/WindowClearanceViolations_de.properties +++ /dev/null @@ -1,14 +0,0 @@ -# German version of language dependent text of the class WindowClearanceViolations -title = Clearance-Verletzungen -list_empty_message = keine Verletzungen gefunden -at = bei -on_layer = auf Lage -pin = Pin -via = Via -trace = Bahn -conduction_area = Leitungsfläche -keepout = Sperrfläche -via_keepout = Via-Sperrfläche -component_keepout = Bauteil-Sperrfläche -board_outline = Platinen-Rand -unknown = unbekannt diff --git a/src/main/java/resources/WindowClearanceViolations_en.properties b/src/main/java/resources/WindowClearanceViolations_en.properties deleted file mode 100644 index 055ab19..0000000 --- a/src/main/java/resources/WindowClearanceViolations_en.properties +++ /dev/null @@ -1,14 +0,0 @@ -# English version of language dependent text of the class WindowClearanceViolations -title = Clearance Violations -list_empty_message = no violations found -at = at -on_layer = on layer -pin = pin -via = via -trace = trace -conduction_area = conduction area -keepout = keepout -via_keepout = via keepout -component_keepout = component keepout -board_outline = eu.mihosoft.freerouting.board outline -unknown = unknown \ No newline at end of file diff --git a/src/main/java/resources/WindowEditVias_de.properties b/src/main/java/resources/WindowEditVias_de.properties deleted file mode 100644 index 9ead8f6..0000000 --- a/src/main/java/resources/WindowEditVias_de.properties +++ /dev/null @@ -1,15 +0,0 @@ -# English version of language dependent text of the class WindowEditVias -title = Vias editieren -add = Hinzufügen -add_tooltip = Ein neues Via hinzufügen -remove = Löschen -remove_tooltip = Das augewählte Via löschen -new_via = neues_via_ -via = Via -removed = gelöscht -NAME = Name -PADSTACK = Padstack -CLEARANCE_CLASS = Clearance-Klasse -ATTACH_SMD = SMD-Überlappung -message_1 = letztes Via niccht gelöscht -message_2 = Via nicht gelöscht weil es noch verwendet wird in der Via-Regel diff --git a/src/main/java/resources/WindowEditVias_en.properties b/src/main/java/resources/WindowEditVias_en.properties deleted file mode 100644 index ca661de..0000000 --- a/src/main/java/resources/WindowEditVias_en.properties +++ /dev/null @@ -1,15 +0,0 @@ -# English version of language dependent text of the class WindowEditVias -title = Edit Vias -add = Add -add_tooltip = Append a new via -remove = Remove -remove_tooltip = Remove the selected via -new_via = new_via_ -via = via -removed = removed -NAME = name -PADSTACK = padstack -CLEARANCE_CLASS = clearance class -ATTACH_SMD = attach smd -message_1 = last via not removed -message_2 = via not removed because it is still used in via rule diff --git a/src/main/java/resources/WindowLengthViolations_de.properties b/src/main/java/resources/WindowLengthViolations_de.properties deleted file mode 100644 index f013933..0000000 --- a/src/main/java/resources/WindowLengthViolations_de.properties +++ /dev/null @@ -1,7 +0,0 @@ -# German version of language dependent text of the class WindowAbout -title = Längenverletzungen -list_empty = keine Längenverletzungen gefunden -maximum_allowed = maximal erlaubt -minimum_allowed = minimal erlaubt -net = Netz -trace_length = : Bahnlänge diff --git a/src/main/java/resources/WindowLengthViolations_en.properties b/src/main/java/resources/WindowLengthViolations_en.properties deleted file mode 100644 index cbb2db9..0000000 --- a/src/main/java/resources/WindowLengthViolations_en.properties +++ /dev/null @@ -1,7 +0,0 @@ -# English version of language dependent text of the class WindowAbout -title = Length Violations -list_empty = no length violations found -maximum_allowed = maximum allowed -minimum_allowed = minimum allowed -net = Net -trace_length = : trace length diff --git a/src/main/java/resources/WindowManualRule_de.properties b/src/main/java/resources/WindowManualRule_de.properties deleted file mode 100644 index 7cf21bc..0000000 --- a/src/main/java/resources/WindowManualRule_de.properties +++ /dev/null @@ -1,6 +0,0 @@ -# German version of language dependent text of the class WindowManualRule -title = Manuelle Regeln -via_rule = Via-Regel: -trace_clearance_class = Clearance-Klasse für Bahnen: -trace_width = Bahnbreite: -on_layer = auf Lage: diff --git a/src/main/java/resources/WindowManualRule_en.properties b/src/main/java/resources/WindowManualRule_en.properties deleted file mode 100644 index dbe4a0e..0000000 --- a/src/main/java/resources/WindowManualRule_en.properties +++ /dev/null @@ -1,6 +0,0 @@ -# English version of language dependent text of the class WindowManualRule -title = Manual Rules -via_rule = via rule: -trace_clearance_class = trace clearance class: -trace_width = trace width: -on_layer = on layer: diff --git a/src/main/java/resources/WindowMoveParameter_de.properties b/src/main/java/resources/WindowMoveParameter_de.properties deleted file mode 100644 index dfa89d0..0000000 --- a/src/main/java/resources/WindowMoveParameter_de.properties +++ /dev/null @@ -1,8 +0,0 @@ -# German version of language dependent text of the class WindowMoveParameter -title = Platzierungs-Parameter -horizontal_component_grid = horizontales Bauteilraster: -vertical_component_grid = vertikales Bauteilraste: -wheel_function = Mausrad-Funktion: -wheel_function_tooltip = Definiert die Funktion des Mausrads beim Platzieren von Bauteilen -zoom = zoomen -rotate = drehen diff --git a/src/main/java/resources/WindowMoveParameter_en.properties b/src/main/java/resources/WindowMoveParameter_en.properties deleted file mode 100644 index 0e714c8..0000000 --- a/src/main/java/resources/WindowMoveParameter_en.properties +++ /dev/null @@ -1,8 +0,0 @@ -# English version of language dependent text of the class WindowMoveParameter -title = Move Parameter -horizontal_component_grid = horizontal component grid: -vertical_component_grid = vertical component grid: -wheel_function = wheel function: -wheel_function_tooltip = Defines the function of the mouse wheel while moving components -zoom = zoom -rotate = rotate \ No newline at end of file diff --git a/src/main/java/resources/WindowNetClasses_de.properties b/src/main/java/resources/WindowNetClasses_de.properties deleted file mode 100644 index 85a7e95..0000000 --- a/src/main/java/resources/WindowNetClasses_de.properties +++ /dev/null @@ -1,37 +0,0 @@ -# German version of language dependent text of the class WindowNetClasses -title = Netzklassen -add = Hinzufügen -add_tooltip = eine neue Netzklasse hinzufügen -remove = Löschen -remove_tooltip = die ausgewählte Netzklasse löschen -assign = Zuweisen -assign_tooltip = Netzklassen zuweisen -select = Selektieren -select_tooltip = Die Objekte der ausgewählten Netzklassen auf der Platine selektieren -filter_incompletes = Incompletes filtern -filter_incompletes_tooltip = Nur die offenen Verbindungen der ausgewählten Netzklassen anzeigen -show_nets = Netze anzeigen -show_nets_tooltip = Öffnet eine Liste mit allen in den ausgewählten Klassen enthaltenen Netzen -contained_nets = Enthaltene Netze -message_1 = Default-Netzklasse nicht gelöscht -message_2 = Netzklasse nicht gelöscht, weil sie noch benutzt wird für Netz -net_class = Netzklasse -removed = gelöscht -column_tool_tip_1 = Der geordnete Satz von Vias -column_tool_tip_2 = Die Clearance-Klasse für Bahnen -column_tool_tip_3 = Die Bahnbreite -column_tool_tip_4 = Die Lagen für die Bahnbreite -column_tool_tip_5 = Gibt an, ob Bahnen aus dieser Netzklasse verschoben oder glattgezogen werden dürfen -column_tool_tip_6 = Wenn nicht selektiert, werden Mehrfachverbindungen zu Leitungsflächen entfernt -If true, multiple connections to conduction areas are not removed -column_tool_tip_7 = Wenn > 0 muss die kumulative Bahnlänge mindestens diesen Wert haben -column_tool_tip_8 = Wenn > 0 darf die kumulative Bahnlänge höchstens diesen Wert haben -NAME = Name -VIA_RULE = Via-Regel -CLEARANCE_CLASS = Clearance-Klasse -TRACE_WIDTH = Bahnbreite -ON_LAYER = auf Lage -SHOVE_FIXED = schiebe-fixiert -CYCLES_WITH_AREAS = Zykeln mit Flächen -MIN_TRACE_LENGTH = min. Länge -MAX_TRACE_LENGTH = max. Länge diff --git a/src/main/java/resources/WindowNetClasses_en.properties b/src/main/java/resources/WindowNetClasses_en.properties deleted file mode 100644 index 4a23ca4..0000000 --- a/src/main/java/resources/WindowNetClasses_en.properties +++ /dev/null @@ -1,36 +0,0 @@ -# English version of language dependent text of the class WindowNetClasses -title = Net Classes -add = Add -add_tooltip = Append a new class -remove = Remove -remove_tooltip = Remove the selected class -assign = Assign -assign_tooltip = Assign net classes -select = Select -select_tooltip = Select the items of the chosen net classes on the eu.mihosoft.freerouting.board -filter_incompletes = Filter Incompletes -filter_incompletes_tooltip = Display only the open connections of the selected net classes -show_nets = Show Nets -show_nets_tooltip = Displays a list with all nets contained in the selected classes -contained_nets = Contained Nets -message_1 = default net class not removed -message_2 = net class not removed because it is still used in net -net_class = net class -removed = removed -column_tool_tip_1 = The orded set of vias -column_tool_tip_2 = The trace clearance class -column_tool_tip_3 = The trace width -column_tool_tip_4 = The layers of the trace width -column_tool_tip_5 = Indicates, if items of this net can be pushed aside or pulled tight -column_tool_tip_6 = If not selected, multiple connections to conduction areas are removed -column_tool_tip_7 = If > 0, the cumulative trace length must be at least this value -column_tool_tip_8 = If > 0, the cumulative trace length must be less than this value -NAME = name -VIA_RULE = via rule -CLEARANCE_CLASS = clearance class -TRACE_WIDTH = trace width -ON_LAYER = on layer -SHOVE_FIXED = shove fixed -CYCLES_WITH_AREAS = cycles with areas -MIN_TRACE_LENGTH = min. length -MAX_TRACE_LENGTH = max. length diff --git a/src/main/java/resources/WindowNetSamples_de.properties b/src/main/java/resources/WindowNetSamples_de.properties deleted file mode 100644 index 5864c93..0000000 --- a/src/main/java/resources/WindowNetSamples_de.properties +++ /dev/null @@ -1,12 +0,0 @@ -# German version of language dependent text of the subclasses of WindowNetSamples - -router_demonstrations = Demonstrations-Beispiele -open_sample_design = Beispiel-Design öffnen -sample_designs = Beispiel-Designs -replay_example = Beispiel abspielen -45_degree_logfile = Router-Beispiel für 45 Grad -drag_component_logfile = Beispiel für das Ziehen von Bauteilen -any_angle_logfile = Router-Beispiel für beliebige Winkel -autorouter_example_1 = erstes Autorouter-Beispiel -autorouter_example_2 = zweites Autorouter-Beispiel -autorouter_example_3 = drittes Autorouter-Beispiel diff --git a/src/main/java/resources/WindowNetSamples_en.properties b/src/main/java/resources/WindowNetSamples_en.properties deleted file mode 100644 index d2ad0bd..0000000 --- a/src/main/java/resources/WindowNetSamples_en.properties +++ /dev/null @@ -1,12 +0,0 @@ -# English version of language dependent text of the subclasses of WindowNetSamples - -router_demonstrations = Router Demonstrations -open_sample_design = Open Sample Design -sample_designs = Sample Designs -replay_example = Replay Example -45_degree_logfile = 45 degree routing example -drag_component_logfile = Example for dragging components -any_angle_logfile = Free angle routing example -autorouter_example_1 = first autorouter example -autorouter_example_2 = second autorouter example -autorouter_example_3 = third autorouter example diff --git a/src/main/java/resources/WindowNets_de.properties b/src/main/java/resources/WindowNets_de.properties deleted file mode 100644 index 5f1b3e9..0000000 --- a/src/main/java/resources/WindowNets_de.properties +++ /dev/null @@ -1,8 +0,0 @@ -# English version of language dependent text of the class WindowNet -title = Netze -assign_class = Klasse zuweisen -assign_class_tooltip = den ausgewählten Netzen eine Klasse zuweisen -filter_incompletes = Incompletes filtern -filter_incompletes_tooltip = Nur die Luftlinien der ausgewählten Netze abbilden -message_1 = Wähle Netzklasse -message_2 = Netzklasse zuweisen diff --git a/src/main/java/resources/WindowNets_en.properties b/src/main/java/resources/WindowNets_en.properties deleted file mode 100644 index cc0d6a1..0000000 --- a/src/main/java/resources/WindowNets_en.properties +++ /dev/null @@ -1,8 +0,0 @@ -# English version of language dependent text of the class WindowNets -title = Nets -assign_class = Assign Class -assign_class_tooltip = Assign class to selected nets -filter_incompletes = Filter Incompletes -filter_incompletes_tooltip = Display only the incompletes of the selected nets -message_1 = Select net class -message_2 = Net Class Selection \ No newline at end of file diff --git a/src/main/java/resources/WindowObjectInfo_de.properties b/src/main/java/resources/WindowObjectInfo_de.properties deleted file mode 100644 index 3b32099..0000000 --- a/src/main/java/resources/WindowObjectInfo_de.properties +++ /dev/null @@ -1,10 +0,0 @@ -# German version of language dependent text of the class WindowObjectInfo -title = Ausgewählte Objekte -summary = Zusammenfassung: -pin = Pin -pins = Pins -via = Via -vias = Vias -trace = Bahn, kumulative Bahnlänge -traces = Bahnen, kumulative Bahnlänge -list_empty = Liste ist leer diff --git a/src/main/java/resources/WindowObjectInfo_en.properties b/src/main/java/resources/WindowObjectInfo_en.properties deleted file mode 100644 index 0bed452..0000000 --- a/src/main/java/resources/WindowObjectInfo_en.properties +++ /dev/null @@ -1,10 +0,0 @@ -# English version of language dependent text of the class WindowObjectInfo -title = Selected Items -summary = Summary: -pin = pin -pins = pins -via = via -vias = vias -trace = trace, cumulative trace length -traces = traces, cumulative trace length -list_empty = list is empty diff --git a/src/main/java/resources/WindowObjectList_de.properties b/src/main/java/resources/WindowObjectList_de.properties deleted file mode 100644 index d7208bc..0000000 --- a/src/main/java/resources/WindowObjectList_de.properties +++ /dev/null @@ -1,12 +0,0 @@ -# German version of language dependent text of the class WindowObjectList -info = Info -info_tooltip = zeigt Informationen über die ausgewählten Objekte -select = Anzeigen -select_tooltip = selektiert die ausgewählten Objekte auf der Platine -invert = Invertieren -invert_tooltip = invertiert die Auswahl -recalculate = Neu berechnen -recalculate_tooltip = berechnet den Inhalt dieses Fensters neu -list_empty = keine Objekte gefunden -window_title = Selektierte Objekte -filter = Filter: diff --git a/src/main/java/resources/WindowObjectList_en.properties b/src/main/java/resources/WindowObjectList_en.properties deleted file mode 100644 index bcc34bd..0000000 --- a/src/main/java/resources/WindowObjectList_en.properties +++ /dev/null @@ -1,12 +0,0 @@ -# English version of language dependent text of the class WindowObjectList -info = Info -info_tooltip = Displays information about the selected objects -select = Show -select_tooltip = Selects the chosen objects on the eu.mihosoft.freerouting.board -invert = Inverse -invert_tooltip = inverts the selection -recalculate = Recalculate -recalculate_tooltip = Recalculates the content of this window -list_empty = no items found -window_title = Selected Objects -filter = Filter: diff --git a/src/main/java/resources/WindowObjectVisibility_de.properties b/src/main/java/resources/WindowObjectVisibility_de.properties deleted file mode 100644 index 2d24ccd..0000000 --- a/src/main/java/resources/WindowObjectVisibility_de.properties +++ /dev/null @@ -1,14 +0,0 @@ -# German version of language dependent text of the class WindowObjectVisibility -title = Objekt-Sichbarkeit -header_message = Regler zum Ändern der Sichtbarkeit von -TRACES = Bahnen -VIAS = Vias -PINS = Pins -CONDUCTION_AREAS = Leitungsflächen -KEEPOUTS = Sperrflächen -VIA_KEEPOUTS = Via-Sperrflächen -PLACE_KEEPOUTS = Platzierungs-Sperrflächen -COMPONENT_OUTLINES = Bauteil-Umrandungen -HILIGHT = markierten Objekten -INCOMPLETES = Incompletes -LENGTH_MATCHING_AREAS = Längenbeschränkungs-Flächen \ No newline at end of file diff --git a/src/main/java/resources/WindowObjectVisibility_en.properties b/src/main/java/resources/WindowObjectVisibility_en.properties deleted file mode 100644 index 229fe92..0000000 --- a/src/main/java/resources/WindowObjectVisibility_en.properties +++ /dev/null @@ -1,14 +0,0 @@ -# English version of language dependent text of the class WindowObjectVisibility -title = Object Visibility -header_message = Use slider to modify the visibility of -TRACES = traces -VIAS = vias -PINS = pins -CONDUCTION_AREAS = conduction areas -KEEPOUTS = keepouts -VIA_KEEPOUTS = via keepouts -PLACE_KEEPOUTS = place keepouts -COMPONENT_OUTLINES = component outlines -HILIGHT = hilight -INCOMPLETES = incompletes -LENGTH_MATCHING_AREAS = length matching areas \ No newline at end of file diff --git a/src/main/java/resources/WindowRouteDetail_de.properties b/src/main/java/resources/WindowRouteDetail_de.properties deleted file mode 100644 index 1080fc3..0000000 --- a/src/main/java/resources/WindowRouteDetail_de.properties +++ /dev/null @@ -1,10 +0,0 @@ -# German version of language dependent text of the class WindowRouteDetail -title = Detailierte Route-Parameter -clearance_compensation = Clearance-Kompensation: -clearance_compensation_tooltip = Clearance-Kompensation ist sinnvoll, wenn es nur eine Clearance-Klasse f\u00FCr Bahnen gibt -on = ein -off = aus -pull_tight_accuracy = Glattzieh-Genauigkeit f\u00FCr Bahnen: -pull_tight_accuracy_tooltip = Regler zum \u00C4ndern der Glattzieh-Genauigkeit f\u00FCr Bahnen -keepout_outside_outline = Keepout au\u00DFerhalb der Board-Outline -keepout_outside_outline_tooltip = Falls gesetzt, wird die gesamte Fl\u00E4che au\u00DFerhalb der Board-Outline zu Keepout. \ No newline at end of file diff --git a/src/main/java/resources/WindowRouteDetail_en.properties b/src/main/java/resources/WindowRouteDetail_en.properties deleted file mode 100644 index 9ccc8c2..0000000 --- a/src/main/java/resources/WindowRouteDetail_en.properties +++ /dev/null @@ -1,10 +0,0 @@ -# English version of language dependent text of the class WindowRouteDetail -title = Detail Route Parameter -clearance_compensation = clearance compensation: -clearance_compensation_tooltip = Clearance compensation on may be useful if you have only one trace clearance type -on = on -off = off -pull_tight_accuracy = pull tight accuracy: -pull_tight_accuracy_tooltip = Use slider to change the accuracy for pulling tight traces -keepout_outside_outline = keepout outside eu.mihosoft.freerouting.board outline -keepout_outside_outline_tooltip = If enabled, the complete area outside the eu.mihosoft.freerouting.board outline gets keepout \ No newline at end of file diff --git a/src/main/java/resources/WindowRouteParameter_de.properties b/src/main/java/resources/WindowRouteParameter_de.properties deleted file mode 100644 index 5c4056f..0000000 --- a/src/main/java/resources/WindowRouteParameter_de.properties +++ /dev/null @@ -1,34 +0,0 @@ -# German version of language dependent text of the class WindowRouteParameter -title = Route-Einstellungen -snap_angle = Winkel-Einschr\u00E4nkung: -snap_angle_tooltip = Winkeleinschr\u00E4nkung f\u00FCr Bahnen -90_degree = 90 Grad -45_degree = 45 Grad -none = keine -route_mode = Route-Modus: -dynamic = dynamisch -stitching = stitching -rule_selection = Regel-Auswahl: -automatic = automatisch -manual = manuell -push&shove_enabled = schieben erlaubt -push&shove_enabled_tooltip = erm\u00F6glicht das Wegschieben von Hindernissen -drag_components_enabled = Bauteil-ziehen erlaubt -drag_components_enabled_tooltip = erm\u00F6glicht das Wegziehen von Bauteilen mit gedr\u00FCckter linker Maustaste -via_snap_to_smd_center = Vias schnappen zum SMD-Zentrum -via_snap_to_smd_center_tooltip = wenn gesetzt schnappen Vias, die SMD-Pins ber\u00FChren, zum Pin-Zentrum -hilight_routing_obstacle = Route-Hindernis highlighten -hilight_routing_obstacle_tooltip = markiert das aktuelle Route-Hindernis im dynamischen Route-Modus -ignore_conduction_areas = Leitungsfl\u00E4chen ignorieren -ignore_conduction_areas_tooltip = wenn gesetzt werden Leitungsfl\u00E4chen nicht als Route-Hindernis angesehen -automatic_neckdown = automatisches Neckdown -automatic_neckdown_tooltip = wenn gesetzt wird bei Pins, die schmaler als die aktuelle Bahnbreite sind, die aktuelle Bahnbreite automatisch reduziert -restrict_pin_exit_directions = Exit-Richtungen bei Pins einschr\u00E4nken -restrict_pin_exit_directions_tooltip = wenn gesetzt werden die Exit-Richtungen von Bahnen bei rechteckigen Pins auf die Schmalseiten begrenzt -pin_pad_to_turn_gap = Pad-Abbiege-Abstand: -pin_pad_to_turn_gap_tooltip = definiert die Mindestl\u00E4nge der Exit-Beschr\u00E4nkungen f\u00FCr Bahnen bei rechteckigen Pins -pull_tight_region = Glattzieh-Bereich: -pull_tight_region_tooltip = Textfeld oder Regler k\u00F6nnen zum \u00C4ndern der Glattzieh-Region um den Cursor verwendet werden -detail_parameter = Detail-Parameter -change_snap_angle_45 = Winkelfreie Bahnen im 45-Grad-Modus noch nicht vollst\u00E4ndig unterst\u00FCtzt. Winkel-Einschr\u00E4nkung trotzdem \u00E4ndern? -change_snap_angle_90 = Nur achsenparallele Bahnen im 90-Grad-Modus bisher vollst\u00E4ndig unterst\u00FCtzt. Winkel-Einschr\u00E4nkung trotzdem \u00E4ndern? diff --git a/src/main/java/resources/WindowRouteParameter_en.properties b/src/main/java/resources/WindowRouteParameter_en.properties deleted file mode 100644 index e06c9f5..0000000 --- a/src/main/java/resources/WindowRouteParameter_en.properties +++ /dev/null @@ -1,34 +0,0 @@ -# English version of language dependent text of the class WindowRouteParameter -title = Route Parameter -snap_angle = snap angle: -snap_angle_tooltip = Angle Restriction for Traces -90_degree = 90 degree -45_degree = 45 degree -none = none -route_mode = route mode: -dynamic = dynamic -stitching = stitching -rule_selection = rule selection: -automatic = automatic -manual = manual -push&shove_enabled = push & shove enabled -push&shove_enabled_tooltip = Enables pushing obstacles -drag_components_enabled = drag components enabled -drag_components_enabled_tooltip = Enables dragging components with the pressed left mouse button -via_snap_to_smd_center = vias snap to smd center -via_snap_to_smd_center_tooltip = If set, vias attaching smd pins snap to the pin center -hilight_routing_obstacle = highlight routing obstacle -hilight_routing_obstacle_tooltip = to highlight the current routing obstacle in dynamic routing -ignore_conduction_areas = ignore conduction areas -ignore_conduction_areas_tooltip = If set, conduction areas are not regarded as routing obstacles -automatic_neckdown = automatic neckdown -automatic_neckdown_tooltip = If set, at pins smaller than the current trace width the trace width will be automatically lowered -restrict_pin_exit_directions = restrict pin exit directions -restrict_pin_exit_directions_tooltip = If set, the trace exit directions of rectangular pins are restricted to the small sides -pin_pad_to_turn_gap = pad to turn gap: -pin_pad_to_turn_gap_tooltip = Defines the length of the trace exit restrictions for rectangular pins -pull_tight_region = pull tight region: -pull_tight_region_tooltip = Use text field or slider to change the pull tight region around the cursor -detail_parameter = detail parameter -change_snap_angle_45 = Free angle traces with snap angle 45 degree not yet fully supported. Change snap angle anyway? -change_snap_angle_90 = Only orthoganal traces with snap angle 90 degree fully supported yet. Change snap angle anyway? \ No newline at end of file diff --git a/src/main/java/resources/WindowSelectParameter_de.properties b/src/main/java/resources/WindowSelectParameter_de.properties deleted file mode 100644 index 1cce29c..0000000 --- a/src/main/java/resources/WindowSelectParameter_de.properties +++ /dev/null @@ -1,20 +0,0 @@ -# German version of language dependent text of the class WindowSelectParameter -title = Select-Einstellungen -selection_layers = Selektions-Lagen: -all_visible = alle sichtbaren -all_visible_tooltip = Selektion auf allen sichtbaren Lagen, die aktuelle Lage wird bevorzugt -current_only = nur aktuelle -current_only_tooltip = Selektion nur auf der aktuellen Lage -selectable_items = Selektierbare Objekte: -TRACES = Bahnen -VIAS = Vias -PINS = Pins -CONDUCTION = Leitungsflächen -KEEPOUT = Sperrflächen -VIA_KEEPOUT = Via-Sperrflächen -COMPONENT_KEEPOUT = Platzierungs-Sperrflächen -BOARD_OUTLINE = Platinenrand -FIXED = fixiert -UNFIXED = unfixiert -current_layer = Aktuelle Lage: -current_layer_tooltip = kann auch mit Ziffertasten oder '+' '-' geändert werden diff --git a/src/main/java/resources/WindowSelectParameter_en.properties b/src/main/java/resources/WindowSelectParameter_en.properties deleted file mode 100644 index ab97f73..0000000 --- a/src/main/java/resources/WindowSelectParameter_en.properties +++ /dev/null @@ -1,20 +0,0 @@ -# English version of language dependent text of the class WindowSelectParameter -title = Select Parameter -selection_layers = Selection Layers: -all_visible = all visible -all_visible_tooltip = selection on all visible layer, the current layer is preferred -current_only = current only -current_only_tooltip = selection only on the current layer -selectable_items = Selectable Items: -TRACES = traces -VIAS = vias -PINS = pins -CONDUCTION = conduction areas -KEEPOUT = keepout -VIA_KEEPOUT = via keepout -COMPONENT_KEEPOUT = place keepout -BOARD_OUTLINE = eu.mihosoft.freerouting.board outline -FIXED = fixed -UNFIXED = unfixed -current_layer = Current Layer: -current_layer_tooltip = can be changed also with number key or '+' '-' \ No newline at end of file diff --git a/src/main/java/resources/WindowSnapshotSettings_de.properties b/src/main/java/resources/WindowSnapshotSettings_de.properties deleted file mode 100644 index f3ade65..0000000 --- a/src/main/java/resources/WindowSnapshotSettings_de.properties +++ /dev/null @@ -1,17 +0,0 @@ -# German version of language dependent text of the class WindowSnapshotSettings -title = Snapshot-Einstellungen -object_colors = Objekt-Farben -object_visibility = Objekt-Sichtbarkeit -layer_visibility = Lagen-Sichtbarkeit -display_region = Abbildungs-Ausschnitt -interactive_state = interaktiver Zustand -selection_layers = Selektions-Lagen -selectable_items = selektierbare Objekte -current_layer = aktuelle Lage -rule_selection = Regel-Auswahl -manual_rule_settings = manuelle Regel-Einstellungen -push&shove_enabled = schieben erlaubt -drag_components_enabled = Bauteil-Ziehen erlaubt -pull_tight_region = Glattzieh-Bereich -component_grid = Bauteil-Raster -info_list_selections = Info-Listen-Selektion \ No newline at end of file diff --git a/src/main/java/resources/WindowSnapshotSettings_en.properties b/src/main/java/resources/WindowSnapshotSettings_en.properties deleted file mode 100644 index 1e94338..0000000 --- a/src/main/java/resources/WindowSnapshotSettings_en.properties +++ /dev/null @@ -1,17 +0,0 @@ -# English version of language dependent text of the class WindowSnapshotSettings -title = Snapshot Settings -object_colors = object colors -object_visibility = object visibility -layer_visibility = layer visibility -display_region = display region -interactive_state = eu.mihosoft.freerouting.interactive state -selection_layers = selection layers -selectable_items = selectable items -current_layer = current layer -rule_selection = rule selection -manual_rule_settings = manual rule settings -push&shove_enabled = push&shove enabled -drag_components_enabled = drag components enabled -pull_tight_region = pull tight region -component_grid = component grid -info_list_selections = info list selections diff --git a/src/main/java/resources/WindowSnapshot_de.properties b/src/main/java/resources/WindowSnapshot_de.properties deleted file mode 100644 index 1420a28..0000000 --- a/src/main/java/resources/WindowSnapshot_de.properties +++ /dev/null @@ -1,10 +0,0 @@ -# German version of language dependent text of the class WindowSnapshot -title = Snapshots -goto_snapshot = Gehe zu ausgewähltem Snapshot -goto_tooltip = Shortcut ist j -create = Neuer Snapshot -snapshot = Snapshot -remove = Ausgewählten Snapshot löschen -remove_all = Alle Snapshots löschen -settings = Snapshot-Einstellungen -settings_tooltip = zum Feslegen der Eigenschaften eines neuen Snapshots diff --git a/src/main/java/resources/WindowSnapshot_en.properties b/src/main/java/resources/WindowSnapshot_en.properties deleted file mode 100644 index 7ac01c5..0000000 --- a/src/main/java/resources/WindowSnapshot_en.properties +++ /dev/null @@ -1,10 +0,0 @@ -# English version of language dependent text of the class WindowSnapshot -title = Snapshots -goto_snapshot = Goto Selected Snapshot -goto_tooltip = shortcut is j -create = Create -snapshot = snapshot -remove = Remove Selected Snapshot -remove_all = Remove All Snapshots -settings = Snapshot Settings -settings_tooltip = to define the settings of a new snapshot diff --git a/src/main/java/resources/WindowViaRule_de.properties b/src/main/java/resources/WindowViaRule_de.properties deleted file mode 100644 index 67653f2..0000000 --- a/src/main/java/resources/WindowViaRule_de.properties +++ /dev/null @@ -1,14 +0,0 @@ -# German version of language dependent text of the class WindowViaRule -title = Via Regel -append = Hinzufügen -append_tooltip = ein Via zu der Regel hinzufügen -remove = Löschen -remove_tooltip = das ausgewählte Via aus der Regel entfernen -move_up = Aufwärts -move_up_tooltip = die Priorität des ausgewählten Vias erhöhen -move_down = Abwärts -move_down_tooltip = die Priorität des ausgewählten Vias verringern -choose_via_to_append = bitte wählen Sie das hinzuzufügende Via -append_via_to_rule = Via zur Regel hinzufügen -remove_2 = lösche -from_the_rule = aus der Regel diff --git a/src/main/java/resources/WindowViaRule_en.properties b/src/main/java/resources/WindowViaRule_en.properties deleted file mode 100644 index a188e2c..0000000 --- a/src/main/java/resources/WindowViaRule_en.properties +++ /dev/null @@ -1,14 +0,0 @@ -# English version of language dependent text of the class WindowViaRule -title = Via Rule -append = Append -append_tooltip = appends a via to the rule -remove = Remove -remove_tooltip = removes the selected via from the rule -move_up = Move Up -move_up_tooltip = increases the priority of the selected via in the rule -move_down = Move Down -move_down_tooltip = decreases the priority of the selected via in the rule -choose_via_to_append = Choose via to append -append_via_to_rule = Append Via to Rule -remove_2 = remove -from_the_rule = from the rule \ No newline at end of file diff --git a/src/main/java/resources/WindowVia_de.properties b/src/main/java/resources/WindowVia_de.properties deleted file mode 100644 index fb5d86b..0000000 --- a/src/main/java/resources/WindowVia_de.properties +++ /dev/null @@ -1,34 +0,0 @@ -# German version of language dependent text of the class WindowVia -title = Via-Regeln -available_via_padstacks = Verfügbare Via-Padstacks -info = Info -info_tooltip = zeigt die zur Verfügung stehenden Via-Padstacks -info_tooltip_2 = zeigt die Vias, die in eiiner Via-Regel verwendet werden können -info_tooltip_3 = zeigt Informationen über die ausgewählte Via-Regel -create = Neu -create_tooltip = einen neuen Via-Padstack definieren -create_tooltip_2 = eine neue leere Via-Regel erzeugen -remove = Löschen -remove_tooltip = einen vorhandenen Via-Padstack löschen -remove_tooltip_2 = die ausgewählte Via-Regel löschen -available_vias = Verfügbare Vias -edit = Editieren -edit_tooltip = die Vias editieren, die in einer Via-Regel verwendet werden können -edit_tooltip_2 = die ausgewählte Via-Regel editieren -via_rules = Via-Regeln -select_start_layer = bitte die erste Lage wählen -start_layer_selection = Auswahl der ersten Lage -select_end_layer = bitte die letzte Lage wählen -end_layer_selection = Auswahl der letzten Lage -adjust_circles = Kreise anpassen -radius_on_layer = Radius auf Lage -choose_padstack_to_remove = bitte zu löschenden Padstach auswählen -remove_via_padstack = Via-Padstack löschen -selected_rule = ausgewählte Regel -remove_via_rule = Via-Regel löschen -message_1 = Bitte den Namen des neuen Via-Padstacks eingeben -message_2 = Name existiert bereits, bitte anpassen -message_3 = Bitte den Default-Radius eingeben -message_4 = Via-Padstack nicht gelöscht, weil er noch verwendet wird in Via -message_5 = Bitte den Namen der neuen Via-Regel eingeben - diff --git a/src/main/java/resources/WindowVia_en.properties b/src/main/java/resources/WindowVia_en.properties deleted file mode 100644 index 6ba8680..0000000 --- a/src/main/java/resources/WindowVia_en.properties +++ /dev/null @@ -1,33 +0,0 @@ -# English version of language dependent text of the class WindowVia -title = Via Rules -available_via_padstacks = Available Via Padstacks -info = Info -info_tooltip = shows the available via padstacks -info_tooltip_2 = shows the vias, which can be used in a via rule -info_tooltip_3 = shows information about the selected via rule -create = Create -create_tooltip = to create a new via padstack -create_tooltip_2 = to create a new empty via rule -remove = Remove -remove_tooltip = to remove an existing via padstack -remove_tooltip_2 = to remove the selected via rule -available_vias = Available Vias -edit = Edit -edit_tooltip = to edits the vias, which can be used in a via rule -edit_tooltip_2 = to edit the selected via rule -via_rules = Via Rules -select_start_layer = Select start layer -start_layer_selection = Start Layer Selection -select_end_layer = Select end layer -end_layer_selection = End Layer Selection -adjust_circles = Adjust Circles -radius_on_layer = radius on layer -choose_padstack_to_remove = Choose padstack to remove -remove_via_padstack = Remove Via Padstack -selected_rule = Selected Rule -remove_via_rule = Remove via rule -message_1 = Please enter the name of the new padstack -message_2 = Name exists already, please adjust -message_3 = Please enter the default radius -message_4 = Via padstack not removed because it is used in via -message_5 = Please enter the name of the new via rule \ No newline at end of file