diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..611048e8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+/target
+.idea
+/.gradle
+/build
+*.iml
+*.swp
+
diff --git a/README.md b/README.md
index 92321185..d84877ce 100644
--- a/README.md
+++ b/README.md
@@ -62,9 +62,9 @@ Here are some instructions how to run the Freerouting project in the NetBeans ID
4) Add your downloaded Freerouting source code with Add Source Package.
-5) Build your new project in NetBeans.
+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 library jh.jar. It is the system library of the Java Help system.
7) Right click on the name of your new project on the left of NetBeans and select Properties.
@@ -76,3 +76,27 @@ Here are some instructions how to run the Freerouting project in the NetBeans ID
For optional parameters of the Freerouting outfile check the usage of the variable p_args in the source file gui/MainApplication.java.
+How to run the Freerouting project as a standalone application
+===========================================================================================
+Using maven
+
+```shell
+$ mvn package
+
+$ java -jar target/freerouting-1.0-SNAPSHOT-jar-with-dependencies.jar
+```
+
+Using gradle
+
+```shell
+$ gradle build
+
+$ java -jar build/libs/FreeRouting.jar
+```
+List of options:
+
+* -de — open design file
+* -di — open directory
+* -l de — set locale to German. Other values are currently ignored
+* -s — Disable "Save/Save As/Generate Logfile/Replay Logfile" menu items from "File" menu.
+* -test — Enable test version. Debug messages, no confirm on exit
diff --git a/board/Unit.java b/board/Unit.java
deleted file mode 100644
index efc06183..00000000
--- a/board/Unit.java
+++ /dev/null
@@ -1,163 +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.
- *
- * Unit.java
- *
- * Created on 13. Dezember 2004, 08:01
- */
-
-package board;
-
-/**
- * Enum for the userunits inch, mil or millimeter.
- *
- * @author Alfons Wirtz
- */
-public enum Unit implements java.io.Serializable
-{
- MIL
- {
- public String toString()
- {
- return "mil";
- }
- },
- INCH
- {
- public String toString()
- {
- return "inch";
- }
- },
-
- MM
- {
- public String toString()
- {
- return "mm";
- }
- },
-
- UM
- {
- public String toString()
- {
- return "um";
- }
- };
-
- /** Scales p_value from p_from_unit to p_to_unit */
- public static double scale(double p_value, Unit p_from_unit, Unit p_to_unit)
- {
- double result;
- if (p_from_unit == p_to_unit)
- {
- result = p_value;
- }
- else if (p_from_unit == INCH)
- {
- if(p_to_unit == MIL)
- {
- result = p_value * 1000.0;
- }
- else if (p_to_unit == MM)
- {
- result = p_value * INCH_TO_MM;
- }
- else // um
- {
- result = p_value * INCH_TO_MM * 1000.0;
- }
- }
- else if (p_from_unit == MIL)
- {
- if(p_to_unit == INCH)
- {
- result = p_value / 1000.0;
- }
- else if(p_to_unit == MM)
- {
- result = p_value * INCH_TO_MM;
- }
- else // um
- {
- result = (p_value * INCH_TO_MM) * 1000.0;
- }
- }
- else if (p_from_unit == MM)
- {
- if(p_to_unit == INCH)
- {
- result = p_value / INCH_TO_MM;
- }
- else if(p_to_unit == UM)
- {
- result = p_value * 1000;
- }
- else // mil
- {
- result = (p_value * 1000.0) / INCH_TO_MM;
- }
- }
- else //UM
- {
- if(p_to_unit == INCH)
- {
- result = p_value / (INCH_TO_MM * 1000.0);
- }
- else if(p_to_unit == MM)
- {
- result = p_value / 1000.0;
- }
- else // mil
- {
- result = p_value / INCH_TO_MM;
- }
- }
- return result;
- }
-
- /**
- * Return the unit corresponding to the input string,
- * or null, if the input string is different from mil, inch and mm.
- */
- public static Unit from_string(String p_string)
- {
- Unit result;
- if (p_string.compareToIgnoreCase("mil") == 0)
- {
- result = MIL;
- }
- else if (p_string.compareToIgnoreCase("inch") == 0)
- {
- result = INCH;
- }
- else if (p_string.compareToIgnoreCase("mm") == 0)
- {
- result = MM;
- }
- else if (p_string.compareToIgnoreCase("um") == 0)
- {
- result = UM;
- }
- else
- {
- result = null;
- }
- return result;
- }
-
- public static final double INCH_TO_MM = 25.4;
-}
diff --git a/board/package.html b/board/package.html
deleted file mode 100644
index 3b397ae8..00000000
--- a/board/package.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
java.text package
-
-
- Contains classes describing items on a printed circuit board and the board itself.
-
-
-
The class LayeredBoard implements elementary functionality for the layout of 2-dimensional items on a board. The board may have several layers. It allows to insert, change, or delete items, or to check, if inserting would result in violations (overlaps) with other items. For fast checking, picking and changing items the class contains a 2-dimensional search tree, whose entries point into the list of items on the board. The search tree is decoupled from the items it is pointing to and may even point into several different databases at the same time.
-
LayeredBoard contains also a list of components, a library of packages and padstacks, and a collection of rules and restrictions, which must be respected by the items on the board.
-
The class RoutingBoard derived from BasicBoard contains higher level functionality, such as shoving items and pulling tight traces, and autorouting incomplete connections.
-
The base classes of all physical items on the board is the abstract class Item. Items must implement the interfaces ShapeTree.Storable and Drawable, so that they can be stored in a search ree and painted onto a graphics screen. Additionally an item contains a pointer to the physical board the item is on, an id number and a list of numbers of nets it belongs to, which may be empty.
-
Classes derived from Item are currently Trace, DrillItem , ObstacleArea and BoardOutline. The class ObstacleArea describe areas on the board, which may be conduction areas or obstacle areas for traces or vias. The abstact class DrillItem describes items with a layer range, a centre point and a (convex) shape on each layer. It has the two implementations Pin and Via. Pins belong to a component, and its shapes are defined by the padstack of the corresponding pin of the components library package. The shapes of a Via are defined directly by a library padstack. The class abstract Trace is used for paths connecting drill items and eventual conduction areas. The only implementation of the class Trace is currently the class PolylineTrace. It adds the concrete description of the geometric path as a Polyline to the class Trace. The reason, why Polylines and not Polygons are used to implement the paths of non-curved tracess, has to do with numerical exactness and performance, as described in the package geometry.planar.
-
Items, which may be electrically connected must implement the interface Connectable. Connectable Items are currently Pins, Vias, Traces and ConductionAreas.
-
-
-
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 00000000..37386838
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,42 @@
+/*
+ * This build file was auto generated by running the Gradle 'init' task
+ * by 'Anand.Tamariya' at '5/31/15 6:50 PM' with Gradle 2.2.1
+ *
+ * This generated file contains a commented-out sample Java project to get you started.
+ * For more details take a look at the Java Quickstart chapter in the Gradle
+ * user guide available at http://gradle.org/docs/2.2.1/userguide/tutorial_java_projects.html
+ */
+
+// Apply the java plugin to add support for Java
+apply plugin: 'application'
+mainClassName = "net.freerouting.gui.MainApplication"
+
+
+// In this section you declare where to find the dependencies of your project
+repositories {
+ // Use 'jcenter' for resolving your dependencies.
+ // You can declare any Maven/Ivy/file repository here.
+ mavenLocal()
+ mavenCentral()
+ jcenter()
+}
+
+// In this section you declare the dependencies for your production and test code
+dependencies {
+ compile 'com.sun.woodstock.dependlibs:jh:2.0'
+ compile 'javax.help:javahelp:2.0.05'
+
+
+ // Declare the dependency for your favourite test framework you want to use in your tests.
+ // TestNG is also supported by the Gradle Test task. Just change the
+ // testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
+ // 'test.useTestNG()' to your build script.
+ testCompile "junit:junit:4.11"
+}
+
+jar {
+ manifest {
+ attributes 'Main-Class': "$mainClassName"
+ }
+}
+
diff --git a/designformats/specctra/SpecctraFileScanner.java b/designformats/specctra/SpecctraFileScanner.java
deleted file mode 100644
index 32df1f06..00000000
--- a/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/geometry/planar/package.html b/geometry/planar/package.html
deleted file mode 100644
index 5a5f6b41..00000000
--- a/geometry/planar/package.html
+++ /dev/null
@@ -1,71 +0,0 @@
-
-java.text package
-
-
- Contains general purpose 2-dimensional geometry classes.
-
-
Some preliminary considerations on computational geometry:
-
-
What is better in arithmetic calculations? Using floating-point or fixed-point arithmetic? In floating-point arithmetic we can forget about absolute exactness. There is for example no way to find out if three points are exactly collinear in floating-point arithmetic. In fixed-point arithmetic however there is an easy way to calculate for any line, if a point is on the left, on the right, or exact on this line. That exactness is the main reason to prefer fixed-point (integer) arithmetic to floating-point arithmetic in computational geometry.
-
With integer arithmetic we get no problems in calculations with orthogonal lines, and some limited problems with 45-degree lines. With any-angle lines however there is a problem. Between the start point and the end point of a line segment there may not exist a single integer point exact on the line. Also the intersection of two lines can in general not be represented exactly by an integer point.
-
Can we get exactness in calculations with shapes defined by integer points in spite of this?
-
-
Suppose we represent polygon shapes by its corner points. The intersection of two polygon shapes is then represented by a subset of the corners of the two polygons and the intersections of its boundary line segments. But these line intersections can in general not be represented by integer points. If we round them to integer points, the result will not be exact.
-
-
But we can do better. We can represent shapes by its boundary lines instead of its corner points. The intersection of two shapes is then described by a subset of the boundary lines of the shapes. The only work to do is skipping boundary lines that do not contribute to the result. But because we have not calculated any new geometrical objects, the result of this calculation remains exact.
-
-
Similar problems exist with polygons for example. Therefore we will not represent them by a sequence of corner points, but by a sequence of lines with integer coordinates.
-
-
Although our key concern will be on fixed-point (integer) arithmetic, we will also use some floating-point and infinite precision rational number arithmetic in our geometry system.
-
-
General Programming Principles used in the code:
-
-
Principle 1: Immutability
-
-
An object is called immutable, if its content will never change after it is constructed. In this prototype all objects are created immutable, if there is no good reason to do otherwise. In a language with a garbage collector there never arises the need to copy an immutable object. Instead just another reference to the object can be added. That is safe because nobody else is allowed to change the object. The garbage collector recycles the object automatically, when there is no more reference to it. Immutable objects also have no synchronisation problems, in case they are accessed by several threads simultaneously.
-
Having objects in geometry immutable lets them look much more like they are used in school or university mathematics. You do not expect in mathematics for example, that the coordinates of a point will change later on.
-
-
Principle 2: Abstract Data Types
-
-
Object variables should be of abstract classes, if possible. Concrete classes should only be used in the creation of objects, that is on the right side of the ‘new’ keyword or in a so-called factory method. That makes it easy to exchange and mix several implementations of an abstract class. The user has no access to the actual implementation, but only to the abstract functions every implementation must provide. There is one major problem. The virtual function mechanism does not work in parameter position. This means that the appropriate concrete class will not be found automatically, if an abstract class is provided in parameter position. Adding for such functions a private helper function for each concrete implementation of the abstract class solves the problem, as long as the function has no more than one abstract parameter. This solution still looks reasonable. Until now I could always avoid the need for functions to have more than one abstract parameter. Functions with many parameters may be bad designed anyway.
-
-
Description of the package:
-
-
This packages contains the implementation of 2-dimensional geometric objects such as points, vectors, lines, shapes, and so on.
-
The abstract class Point for example defines the behaviour, which must be implemented by each concrete Point class. There are two concrete implementations of the class Point at the moment, the class IntPoint, which implements the Point as a tuple of integer values, and the class RationalPoint. The class RationalPoint implements infinite precision integer points in the projective plane. This is a generalisation of an implementation of infinite precision rational points in the affine plane. With RationalPoints for example the intersection of two lines can always be calculated exactly. The usage of these two classes is mixed and RationalPoints will always be converted to IntPoints if possible, to improve the performance.
-
Strongly related to the class Point is the class Vector. A Vector can be added to a Point resulting in another Point. A Point can be subtracted from another Point resulting in a Vector. Of course two vectors can be added resulting in another vector. For every vector v there exists the negative vector v.negate () so that v + v.negate () is the zero vector.
-
-
Instead of angles we use Directions in our geometry system. The reason is that for a Line (to be defined later) its Direction can be represented exactly while its angle can be not. The best we can do with angles is to approximate them by floating point numbers. But in this case there exists for example no exact algorithm to determine if two angles are equal. A Direction is defined as an equivalence class of Vectors. Two vectors define the same Direction, if they point into the same direction.
-
-
Directions are ordered in the following way. A Direction d1 is bigger than a Direction d2, if it has a bigger angle with the positive X-axis. We can compare the size of 2 Directions by calculating the determinant of their defining vectors. This calculation is exact in integer arithmetic.
-
-
An object of the class Line is defined as an infinite directed line. In addition to an ordinary infinite line a directed line defines a positive and a negative half-plane. The positive half-plane is to the left of the line, and the negative half-plane to the right. Such a Line is represented by a tuple of abstract points (a, b) on the line, which are assumed to be not equal. The positive half-plane is the set of points p, so that a path from a to b to p makes a left turn. Of course two different tuples of points can define the same line.
-
-
The class FloatPoint is used in arithmetic calculations, where execution speed is more important than numerical accuracy. The class Line for example contains the two methods: “intersection” and “intersection_approx”. Both of them calculate the intersection of two lines. The function “intersection” returns an object of the abstract class Point. The result is exact, but the calculation may be slow, because it uses infinite precision arithmetic.
-
The function “intersection_approx” uses double precision floating point arithmetic to calculate an object of the class FloatPoint. This calculation is quite fast, but the result of floating point arithmetic is not exact in general.
-
Because all calculations in the abstract class Point are expected to be exact, FloatPoint is not derived from the abstract class Point, as IntPoint and RationalPoint are.
-
-
In the following section we describe the class hierarchy describing shapes in the plane. The root of the hierarchy is the interface Area. It defines functionality of of connected 2-dimensional sets of points in the plane, which need not necessarily to be simply connected. (For non mathematicians that means an Area may have holes.) Derived from the Interface Area is the interface Shape, which defines functionality for simply connected areas (areas without holes). Derived from the interface Shape are the Interface ConvexShape and the abstract class PolylineShape. A shape is convex, if for any 2 points a, b inside the shape the line segment from a to b is contained completely in the shape. A PolylineShape is defined as a shape, whose border consists of a sequence of straight lines. Derived from PolylineShape is the class PolygonShape. A PolygonShape is a PolylineShape represented by a closed polygon of corner points. From ConvexShape the class Circle and the abstract class TileShape are derived. TileShape is also derived from PolylineShape, There are currently 3 implementations of the class TileShape : IntBox, IntOctagon and Simplex. IntBoxes are axis parallel rectangles with int coordinates, IntOctagons are convex shapes, whose boundary line angles are multiples of 45 degree,
-
A Simplex is implemented as a finite set of lines. The shape of a Simplex is defined as the intersection of all positive half-planes of its lines. Simplexes are similar to convex polygons defined by a finite set of corner points. The difference is that a Simplex may contain infinite parts. A half-plane for example is a Simplex, but not a convex polygon. In an Integer geometry system using Simplexes instead of convex polygons has many advantages. Assume for example that we want to calculate the intersection of two polygons. For this purpose we have to calculate the intersections of the crossing edge lines. These intersections are in general no longer integer points. This means, that the intersection of two convex polygons can not be represented exactly by a convex polygon with integer coordinates. We could use RationalPoints for the corners to achieve this goal, but then the arithmetic calculations would get very slow. Calculating the intersection of two Simplexes is quite different. We just take the sum of the defining lines of the two Simplexes. The real work is skipping the lines, which do not contribute to the result. So the intersection of two Simplexes calculated in this way is exact, even if our lines have integer coordinates. A RegularTileShape is a TileShape, where the directions of the boundary lines may only be from a fixed finite set. IntBoxes and IntOctagons are RegularTileShape´s, but Simplexes are not.
-
-
In the class Polyline curves in the plane consisting of a list of straight lines are described. No two consecutive lines in that list may be parallel. Therefore a Polyline of n lines with integer coordinates is equivalent to a polygon of n – 1 RationalPoints, where the k-th RationalPoint is the intersection of the k-th and the k+1-th line for 0 <= k < n –1 (if we disregard the possibility of integer overflow). We will use the class Polyline especially to describe Traces on a Printed Circuit Board. That enables us to implement a numerical stable any-angle pushing algorithm for traces. The reason is similar as for Simplexes. We do not use intersection points of lines to create the geometry of new trace objects in the pushing algorithm. Instead we use lines, which already exist, for that purpose. That concept is also advantageous when we want to smoothen traces by cutting of corners. If this is done with polygons represented by corners, the intersection of lines has to be calculated and used as primary data. If integer points are used, these intersection points are not exact. Neighbour lines change slightly and a small clearance violation may occur. If rational points are used, the algorithm gets very slow. With Polylines these problems do not exist, because intersection points of lines never become primary data.
-
-
-
\ No newline at end of file
diff --git a/gui/DesignFile.java b/gui/DesignFile.java
deleted file mode 100644
index 4b7b9274..00000000
--- a/gui/DesignFile.java
+++ /dev/null
@@ -1,598 +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.
- *
- * DesignFile.java
- *
- * Created on 25. Oktober 2006, 07:48
- *
- */
-package gui;
-
-import datastructures.FileFilter;
-
-/**
- * File functionality with security restrictions used, when the application is opened with Java Webstart
- *
- * @author Alfons Wirtz
- */
-public class DesignFile
-{
-
- public static final String[] all_file_extensions = {"bin", "dsn"};
- public static final String[] text_file_extensions = {"dsn"};
- public static final String binary_file_extension = "bin";
-
- public static DesignFile get_instance(String p_design_file_name, boolean p_is_webstart)
- {
- if (p_design_file_name == null)
- {
- return null;
- }
- DesignFile result = new DesignFile(p_is_webstart, null, new java.io.File(p_design_file_name), null);
- return result;
- }
-
- /**
- * Shows a file chooser for opening a design file.
- * If p_is_webstart there are security restrictions because the application was opened with java web start.
- */
- public static DesignFile open_dialog(boolean p_is_webstart, String p_design_dir_name)
- {
- DesignFile result;
- if (p_is_webstart)
- {
- result = webstart_open_dialog(p_design_dir_name);
- }
- else
- {
- javax.swing.JFileChooser file_chooser = new javax.swing.JFileChooser(p_design_dir_name);
- FileFilter file_filter = new FileFilter(all_file_extensions);
- file_chooser.setFileFilter(file_filter);
- file_chooser.showOpenDialog(null);
- java.io.File curr_design_file = file_chooser.getSelectedFile();
- if (curr_design_file == null)
- {
- return null;
- }
- result = new DesignFile(false, null, curr_design_file, file_chooser);
- }
- return result;
- }
-
- /**
- * Creates a new instance of DesignFile.
- * If p_is_webstart, the application was opened with Java Web Start.
- */
- private DesignFile(boolean p_is_webstart, javax.jnlp.FileContents p_file_contents,
- java.io.File p_design_file, javax.swing.JFileChooser p_file_chooser)
- {
- this.is_webstart = p_is_webstart;
- this.file_contents = p_file_contents;
- this.file_chooser = p_file_chooser;
- this.input_file = p_design_file;
- this.output_file = p_design_file;
- if (p_design_file != null)
- {
- String file_name = p_design_file.getName();
- String[] name_parts = file_name.split("\\.");
- if (name_parts[name_parts.length - 1].compareToIgnoreCase(binary_file_extension) != 0)
- {
- String binfile_name = name_parts[0] + "." + binary_file_extension;
- this.output_file = new java.io.File(p_design_file.getParent(), binfile_name);
- }
- }
- }
-
- /**
- * Gets an InputStream from the file. Returns null, if the algorithm failed.
- */
- public java.io.InputStream get_input_stream()
- {
- java.io.InputStream result;
- if (this.is_webstart)
- {
-
- if (this.file_contents == null)
- {
- return null;
- }
- try
- {
- result = this.file_contents.getInputStream();
- } catch (Exception e)
- {
- result = null;
- }
- }
- else
- {
- if (this.input_file == null)
- {
- return null;
- }
- try
- {
- result = new java.io.FileInputStream(this.input_file);
- } catch (Exception e)
- {
- result = null;
- }
- }
- return result;
- }
-
- /**
- * Gets the file name as a String. Returns null on failure.
- */
- public String get_name()
- {
-
- String result;
- if (this.file_contents != null)
- {
- try
- {
- result = this.file_contents.getName();
- } catch (Exception e)
- {
- result = null;
- }
- }
- else if (this.input_file != null)
- {
- result = this.input_file.getName();
- }
- else
- {
- result = null;
- }
- return result;
- }
-
- public void save_as_dialog(java.awt.Component p_parent, BoardFrame p_board_frame)
- {
- final java.util.ResourceBundle resources =
- java.util.ResourceBundle.getBundle("gui.resources.BoardMenuFile", p_board_frame.get_locale());
- String[] file_name_parts = this.get_name().split("\\.", 2);
- String design_name = file_name_parts[0];
- if (this.is_webstart)
- {
- javax.jnlp.FileContents new_file_contents;
- java.io.ByteArrayOutputStream output_stream = new java.io.ByteArrayOutputStream();
-
- if (p_board_frame.board_panel.board_handling.export_to_dsn_file(output_stream, design_name, false))
- {
- java.io.InputStream input_stream = new java.io.ByteArrayInputStream(output_stream.toByteArray());
- new_file_contents = WebStart.save_dialog(this.get_parent(), DesignFile.text_file_extensions,
- input_stream, this.get_name());
- }
- else
- {
- new_file_contents = null;
- }
-
-
- if (new_file_contents != null)
- {
- this.file_contents = new_file_contents;
- p_board_frame.screen_messages.set_status_message(resources.getString("message_4") + " " + this.get_name() + " " + resources.getString("message_5"));
- }
- else
- {
- p_board_frame.screen_messages.set_status_message(resources.getString("message_19"));
- }
- return;
- }
-
- if (this.file_chooser == null)
- {
- String design_dir_name;
- if (this.output_file == null)
- {
- design_dir_name = null;
- }
- else
- {
- design_dir_name = this.output_file.getParent();
- }
- this.file_chooser = new javax.swing.JFileChooser(design_dir_name);
- FileFilter file_filter = new FileFilter(all_file_extensions);
- this.file_chooser.setFileFilter(file_filter);
- }
-
- this.file_chooser.showSaveDialog(p_parent);
- java.io.File new_file = file_chooser.getSelectedFile();
- if (new_file == null)
- {
- p_board_frame.screen_messages.set_status_message(resources.getString("message_1"));
- return;
- }
- String new_file_name = new_file.getName();
- String[] new_name_parts = new_file_name.split("\\.");
- String found_file_extension = new_name_parts[new_name_parts.length - 1];
- if (found_file_extension.compareToIgnoreCase(binary_file_extension) == 0)
- {
- p_board_frame.screen_messages.set_status_message(resources.getString("message_2") + " " + new_file.getName());
- this.output_file = new_file;
- p_board_frame.save();
- }
- else
- {
- if (found_file_extension.compareToIgnoreCase("dsn") != 0)
- {
- p_board_frame.screen_messages.set_status_message(resources.getString("message_3"));
- return;
- }
- java.io.OutputStream output_stream;
- try
- {
- output_stream = new java.io.FileOutputStream(new_file);
- } catch (Exception e)
- {
- output_stream = null;
- }
- if (p_board_frame.board_panel.board_handling.export_to_dsn_file(output_stream, design_name, false))
- {
- p_board_frame.screen_messages.set_status_message(resources.getString("message_4") + " " + new_file_name + " " + resources.getString("message_5"));
- }
- else
- {
- p_board_frame.screen_messages.set_status_message(resources.getString("message_6") + " " + new_file_name + " " + resources.getString("message_7"));
- }
- }
- }
-
- /**
- * Writes a Specctra Session File to update the design file in the host system.
- * Returns false, if the write failed
- */
- public boolean write_specctra_session_file(BoardFrame p_board_frame)
- {
- final java.util.ResourceBundle resources =
- java.util.ResourceBundle.getBundle("gui.resources.BoardMenuFile", p_board_frame.get_locale());
- String design_file_name = this.get_name();
- String[] file_name_parts = design_file_name.split("\\.", 2);
- String design_name = file_name_parts[0];
- if (this.is_webstart)
- {
- String session_file_name = secure_write_session_file(p_board_frame);
- if (session_file_name == null)
- {
- p_board_frame.screen_messages.set_status_message(resources.getString("message_13") + " " +
- resources.getString("message_7"));
- return false;
- }
- p_board_frame.screen_messages.set_status_message(resources.getString("message_11") + " " +
- session_file_name + " " + resources.getString("message_12"));
- }
- else
- {
- String output_file_name = design_name + ".ses";
- java.io.File curr_output_file = new java.io.File(get_parent(), output_file_name);
- java.io.OutputStream output_stream;
- try
- {
- output_stream = new java.io.FileOutputStream(curr_output_file);
- } catch (Exception e)
- {
- output_stream = null;
- }
-
- if (p_board_frame.board_panel.board_handling.export_specctra_session_file(design_file_name, output_stream))
- {
- p_board_frame.screen_messages.set_status_message(resources.getString("message_11") + " " +
- output_file_name + " " + resources.getString("message_12"));
- }
- else
- {
- p_board_frame.screen_messages.set_status_message(resources.getString("message_13") + " " +
- output_file_name + " " + resources.getString("message_7"));
- return false;
- }
- }
- if (WindowMessage.confirm(resources.getString("confirm")))
- {
- return write_rules_file(design_name, p_board_frame.board_panel.board_handling);
- }
- return true;
- }
-
- /**
- * Saves the board rule to file, so that they can be reused later on.
- */
- private boolean write_rules_file(String p_design_name, interactive.BoardHandling p_board_handling)
- {
- String rules_file_name = p_design_name + RULES_FILE_EXTENSION;
- java.io.OutputStream output_stream;
- if (this.is_webstart)
- {
- output_stream = WebStart.get_file_output_stream(rules_file_name);
- }
- else
- {
- java.io.File rules_file = new java.io.File(this.get_parent(), rules_file_name);
- try
- {
- output_stream = new java.io.FileOutputStream(rules_file);
- } catch (java.io.IOException e)
- {
- System.out.println("unable to create rules file");
- return false;
- }
- }
- designformats.specctra.RulesFile.write(p_board_handling, output_stream, p_design_name);
- return true;
- }
-
- public static boolean read_rules_file(String p_design_name, String p_parent_name,
- interactive.BoardHandling p_board_handling, boolean p_is_web_start, String p_confirm_message)
- {
-
- boolean result = true;
- String rule_file_name = p_design_name + ".rules";
- boolean dsn_file_generated_by_host = p_board_handling.get_routing_board().communication.specctra_parser_info.dsn_file_generated_by_host;
- if (p_is_web_start)
- {
- java.io.InputStream input_stream = WebStart.get_file_input_stream(rule_file_name);
- if (input_stream != null && dsn_file_generated_by_host && WindowMessage.confirm(p_confirm_message))
- {
- result = designformats.specctra.RulesFile.read(input_stream, p_design_name, p_board_handling);
- try
- {
- input_stream.close();
- } catch (Exception e)
- {
- result = false;
- }
- }
- else
- {
- result = false;
- }
- WebStart.delete_files(RULES_FILE_EXTENSION, null);
- }
- else
- {
- try
- {
- java.io.File rules_file = new java.io.File(p_parent_name, rule_file_name);
- java.io.InputStream input_stream = new java.io.FileInputStream(rules_file);
- if (input_stream != null && dsn_file_generated_by_host && WindowMessage.confirm(p_confirm_message))
- {
- result = designformats.specctra.RulesFile.read(input_stream, p_design_name, p_board_handling);
- }
- else
- {
- result = false;
- }
- try
- {
- if (input_stream != null)
- {
- input_stream.close();
- }
- rules_file.delete();
- } catch (java.io.IOException e)
- {
- result = false;
- }
- } catch (java.io.FileNotFoundException e)
- {
- result = false;
- }
- }
- return result;
- }
-
- public void update_eagle(BoardFrame p_board_frame)
- {
- final java.util.ResourceBundle resources =
- java.util.ResourceBundle.getBundle("gui.resources.BoardMenuFile", p_board_frame.get_locale());
- String design_file_name = get_name();
- java.io.ByteArrayOutputStream session_output_stream = new java.io.ByteArrayOutputStream();
- if (!p_board_frame.board_panel.board_handling.export_specctra_session_file(design_file_name, session_output_stream))
- {
- return;
- }
- java.io.InputStream input_stream = new java.io.ByteArrayInputStream(session_output_stream.toByteArray());
-
- String[] file_name_parts = design_file_name.split("\\.", 2);
- String design_name = file_name_parts[0];
- String output_file_name = design_name + ".scr";
- if (this.is_webstart)
- {
- String script_file_name = webstart_update_eagle(p_board_frame, output_file_name, input_stream);
-
- if (script_file_name == null)
- {
- p_board_frame.screen_messages.set_status_message(resources.getString("message_16") + " " +
- resources.getString("message_7"));
- return;
- }
- p_board_frame.screen_messages.set_status_message(resources.getString("message_14") + " " + script_file_name + " " + resources.getString("message_15"));
- }
- else
- {
- java.io.File curr_output_file = new java.io.File(get_parent(), output_file_name);
- java.io.OutputStream output_stream;
- try
- {
- output_stream = new java.io.FileOutputStream(curr_output_file);
- } catch (Exception e)
- {
- output_stream = null;
- }
-
- if (p_board_frame.board_panel.board_handling.export_eagle_session_file(input_stream, output_stream))
- {
- p_board_frame.screen_messages.set_status_message(resources.getString("message_14") + " " + output_file_name + " " + resources.getString("message_15"));
- }
- else
- {
- p_board_frame.screen_messages.set_status_message(resources.getString("message_16") + " " + output_file_name + " " + resources.getString("message_7"));
- }
- }
- if (WindowMessage.confirm(resources.getString("confirm")))
- {
- write_rules_file(design_name, p_board_frame.board_panel.board_handling);
- }
- }
-
- private static DesignFile webstart_open_dialog(String p_design_dir_name)
- {
- try
- {
- javax.jnlp.FileOpenService file_open_service =
- (javax.jnlp.FileOpenService) javax.jnlp.ServiceManager.lookup("javax.jnlp.FileOpenService");
- javax.jnlp.FileContents file_contents =
- file_open_service.openFileDialog(p_design_dir_name, DesignFile.text_file_extensions);
- return new DesignFile(true, file_contents, null, null);
- } catch (Exception e)
- {
- return null;
- }
- }
-
- /**
- * Returns the name of the created session file or null, if the write failed.
- * Put into a separate function to avoid undefines in the offline version.
- */
- private String secure_write_session_file(BoardFrame p_board_frame)
- {
- java.io.ByteArrayOutputStream output_stream = new java.io.ByteArrayOutputStream();
- String file_name = this.get_name();
- if (file_name == null)
- {
- return null;
- }
- String session_file_name = file_name.replace(".dsn", ".ses");
-
- if (!p_board_frame.board_panel.board_handling.export_specctra_session_file(file_name, output_stream))
- {
- return null;
- }
-
- java.io.InputStream input_stream = new java.io.ByteArrayInputStream(output_stream.toByteArray());
-
- javax.jnlp.FileContents session_file_contents =
- WebStart.save_dialog(this.get_parent(), null, input_stream, session_file_name);
-
- if (session_file_contents == null)
- {
- return null;
- }
- String new_session_file_name;
- try
- {
- new_session_file_name = session_file_contents.getName();
- } catch (Exception e)
- {
- return null;
- }
- if (!new_session_file_name.equalsIgnoreCase(session_file_name))
- {
- final java.util.ResourceBundle resources =
- java.util.ResourceBundle.getBundle("gui.resources.BoardMenuFile", p_board_frame.get_locale());
- String curr_message = resources.getString("message_20") + " " + session_file_name + "\n" + resources.getString("message_21");
- WindowMessage.ok(curr_message);
- }
- return new_session_file_name;
- }
-
- /**
- * Returns the name of the created script file or null, if the write failed.
- * Put into a separate function to avoid undefines in the offline version.
- */
- private String webstart_update_eagle(BoardFrame p_board_frame,
- String p_outfile_name, java.io.InputStream p_input_stream)
- {
- java.io.ByteArrayOutputStream output_stream = new java.io.ByteArrayOutputStream();
- if (!p_board_frame.board_panel.board_handling.export_eagle_session_file(p_input_stream, output_stream))
- {
- return null;
- }
- java.io.InputStream input_stream = new java.io.ByteArrayInputStream(output_stream.toByteArray());
- javax.jnlp.FileContents script_file_contents =
- WebStart.save_dialog(this.get_parent(), null, input_stream, p_outfile_name);
-
- if (script_file_contents == null)
- {
- return null;
- }
- String new_script_file_name;
- try
- {
- new_script_file_name = script_file_contents.getName();
- } catch (Exception e)
- {
- return null;
- }
-
- if (!new_script_file_name.endsWith(".scr"))
- {
- final java.util.ResourceBundle resources =
- java.util.ResourceBundle.getBundle("gui.resources.BoardMenuFile", p_board_frame.get_locale());
- String curr_message = resources.getString("message_22") + "\n" + resources.getString("message_21");
- WindowMessage.ok(curr_message);
- }
-
- return new_script_file_name;
- }
-
- /**
- * Gets the binary file for saving or null, if the design file is not available
- * because the application is run with Java Web Start.
- */
- public java.io.File get_output_file()
- {
- return this.output_file;
- }
-
- public java.io.File get_input_file()
- {
- return this.input_file;
- }
-
- public String get_parent()
- {
- if (input_file != null)
- {
- return input_file.getParent();
- }
- return null;
- }
-
- public java.io.File get_parent_file()
- {
- if (input_file != null)
- {
- return input_file.getParentFile();
- }
- return null;
- }
-
- public boolean is_created_from_text_file()
- {
- return this.is_webstart || this.input_file != this.output_file;
- }
- private final boolean is_webstart;
- /** Used, if the application is run with Java Web Start. */
- private javax.jnlp.FileContents file_contents;
- /** Used, if the application is run without Java Web Start. */
- private java.io.File output_file;
- private final java.io.File input_file;
- private javax.swing.JFileChooser file_chooser;
- private static final String RULES_FILE_EXTENSION = ".rules";
-}
diff --git a/gui/GUIDefaultsScanner.java b/gui/GUIDefaultsScanner.java
deleted file mode 100644
index 18768e50..00000000
--- a/gui/GUIDefaultsScanner.java
+++ /dev/null
@@ -1,1683 +0,0 @@
-/* The following code was generated by JFlex 1.4 on 16.03.07 09:07 */
-
-package gui;
-@SuppressWarnings("all")
-
-/**
- * This class is a scanner generated by
- * JFlex 1.4
- * on 16.03.07 09:07 from the specification file
- * C:/Dokumente und Einstellungen/alfons/Eigene Dateien/router/sources/gui/GUIDefaultsDescription.flex
- */
-class GUIDefaultsScanner {
-
- /** 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 YYINITIAL = 0;
-
- /**
- * Translates characters to character classes
- */
- private static final String ZZ_CMAP_PACKED =
- "\11\0\1\3\1\2\1\0\1\3\1\1\22\0\1\3\2\0\1\6"+
- "\4\0\1\45\1\46\1\5\1\11\1\0\1\11\1\13\1\4\1\12"+
- "\11\10\7\0\1\16\1\23\1\33\1\35\1\14\1\37\1\24\1\42"+
- "\1\21\1\43\1\36\1\17\1\32\1\25\1\31\1\40\1\7\1\27"+
- "\1\22\1\26\1\30\1\20\1\44\1\41\1\34\1\7\4\0\1\15"+
- "\1\0\1\16\1\23\1\33\1\35\1\14\1\37\1\24\1\42\1\21"+
- "\1\43\1\36\1\17\1\32\1\25\1\31\1\40\1\7\1\27\1\22"+
- "\1\26\1\30\1\20\1\44\1\41\1\34\1\7\uff85\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 =
- "\1\0\1\1\2\2\2\1\1\3\1\4\1\1\1\4"+
- "\25\3\1\5\1\6\4\0\1\7\30\3\1\10\23\3"+
- "\2\0\2\7\1\0\1\7\36\3\1\11\26\3\1\0"+
- "\7\3\1\12\17\3\1\13\30\3\1\14\57\3\1\15"+
- "\35\3\1\16\4\3\1\17\12\3\1\20\32\3\1\21"+
- "\24\3\1\22\1\3\1\23\12\3\1\24\1\25\10\3"+
- "\1\26\1\27\27\3\1\30\33\3\1\31\7\3\1\32"+
- "\10\3\1\33\1\34\33\3\1\35\15\3\1\36\7\3"+
- "\1\37\5\3\1\40\12\3\1\41\5\3\1\42\10\3"+
- "\1\43\5\3\1\44\3\3\1\45\4\3\1\46\2\3"+
- "\1\47\51\3\1\50\7\3\1\51\4\3\1\52\11\3"+
- "\1\53\1\3\1\54\22\3\1\55\1\56\1\3\1\57"+
- "\2\3\1\60\4\3\1\61\1\62\11\3\1\63\4\3"+
- "\1\64\14\3\1\65\3\3\1\66\2\3\1\67\1\70"+
- "\1\71\2\3\1\72\11\3\1\73\2\3\1\74\6\3"+
- "\1\75\4\3\1\76\10\3\1\77\1\3\1\100\3\3"+
- "\1\101\1\102\1\103\1\104\2\3\1\105\4\3\1\106"+
- "\7\3\1\107\1\110\6\3\1\111\25\3\1\112\5\3"+
- "\1\113\13\3\1\114\4\3\1\115\1\3\1\116\2\3"+
- "\1\117\1\3\1\120\1\121\1\3\1\122\2\3\1\123"+
- "\5\3\1\124";
-
- private static int [] zzUnpackAction() {
- int [] result = new int[796];
- 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\47\0\116\0\47\0\165\0\234\0\303\0\352"+
- "\0\u0111\0\u0138\0\u015f\0\u0186\0\u01ad\0\u01d4\0\u01fb\0\u0222"+
- "\0\u0249\0\u0270\0\u0297\0\u02be\0\u02e5\0\u030c\0\u0333\0\u035a"+
- "\0\u0381\0\u03a8\0\u03cf\0\u03f6\0\u041d\0\u0444\0\u046b\0\47"+
- "\0\47\0\u0492\0\234\0\u04b9\0\u04e0\0\u0138\0\u0507\0\u052e"+
- "\0\u0555\0\u057c\0\u05a3\0\u05ca\0\u05f1\0\u0618\0\u063f\0\u0666"+
- "\0\u068d\0\u06b4\0\u06db\0\u0702\0\u0729\0\u0750\0\u0777\0\u079e"+
- "\0\u07c5\0\u07ec\0\u0813\0\u083a\0\u0861\0\u0888\0\303\0\u08af"+
- "\0\u08d6\0\u08fd\0\u0924\0\u094b\0\u0972\0\u0999\0\u09c0\0\u09e7"+
- "\0\u0a0e\0\u0a35\0\u0a5c\0\u0a83\0\u0aaa\0\u0ad1\0\u0af8\0\u0b1f"+
- "\0\u0b46\0\u0b6d\0\u0b94\0\u0bbb\0\u0be2\0\u0c09\0\u0c30\0\47"+
- "\0\u0c57\0\u0c7e\0\u0ca5\0\u0ccc\0\u0cf3\0\u0d1a\0\u0d41\0\u0d68"+
- "\0\u0d8f\0\u0db6\0\u0ddd\0\u0e04\0\u0e2b\0\u0e52\0\u0e79\0\u0ea0"+
- "\0\u0ec7\0\u0eee\0\u0f15\0\u0f3c\0\u0f63\0\u0f8a\0\u0fb1\0\u0fd8"+
- "\0\u0fff\0\u1026\0\u104d\0\u1074\0\u109b\0\u10c2\0\303\0\u10e9"+
- "\0\u1110\0\u1137\0\u115e\0\u1185\0\u11ac\0\u11d3\0\u11fa\0\u1221"+
- "\0\u1248\0\u126f\0\u1296\0\u12bd\0\u12e4\0\u130b\0\u1332\0\u1359"+
- "\0\u1380\0\u13a7\0\u13ce\0\u13f5\0\u141c\0\u1443\0\u146a\0\u1491"+
- "\0\u14b8\0\u14df\0\u1506\0\u152d\0\u1554\0\303\0\u157b\0\u15a2"+
- "\0\u15c9\0\u15f0\0\u1617\0\u163e\0\u1665\0\u168c\0\u16b3\0\u16da"+
- "\0\u1701\0\u1728\0\u174f\0\u1776\0\u179d\0\303\0\u17c4\0\u17eb"+
- "\0\u1812\0\u1839\0\u1860\0\u1887\0\u18ae\0\u18d5\0\u18fc\0\u1923"+
- "\0\u194a\0\u1971\0\u1998\0\u19bf\0\u19e6\0\u1a0d\0\u1a34\0\u1a5b"+
- "\0\u1a82\0\u1aa9\0\u1ad0\0\u1af7\0\u1b1e\0\u1b45\0\303\0\u1b6c"+
- "\0\u1b93\0\u1bba\0\u1be1\0\u1c08\0\u1c2f\0\u1c56\0\u1c7d\0\u1ca4"+
- "\0\u1ccb\0\u1cf2\0\u1d19\0\u1d40\0\u1d67\0\u1d8e\0\u1db5\0\u1ddc"+
- "\0\u1e03\0\u1e2a\0\u1e51\0\u1e78\0\u1e9f\0\u1ec6\0\u1eed\0\u1f14"+
- "\0\u1f3b\0\u1f62\0\u1f89\0\u1fb0\0\u1fd7\0\u1ffe\0\u2025\0\u204c"+
- "\0\u2073\0\u209a\0\u20c1\0\u20e8\0\u210f\0\u2136\0\u215d\0\u2184"+
- "\0\u21ab\0\u21d2\0\u21f9\0\u2220\0\u2247\0\u226e\0\u2295\0\u22bc"+
- "\0\u22e3\0\u230a\0\u2331\0\u2358\0\u237f\0\u23a6\0\u23cd\0\u23f4"+
- "\0\u241b\0\u2442\0\u2469\0\u2490\0\u24b7\0\u24de\0\u2505\0\u252c"+
- "\0\u2553\0\u257a\0\u25a1\0\u25c8\0\u25ef\0\u2616\0\u263d\0\u2664"+
- "\0\u268b\0\u26b2\0\u26d9\0\u2700\0\303\0\u2727\0\u274e\0\u2775"+
- "\0\u279c\0\303\0\u27c3\0\u27ea\0\u2811\0\u2838\0\u285f\0\u2886"+
- "\0\u28ad\0\u28d4\0\u28fb\0\u2922\0\303\0\u2949\0\u2970\0\u2997"+
- "\0\u29be\0\u29e5\0\u2a0c\0\u2a33\0\u2a5a\0\u2a81\0\u2aa8\0\u2acf"+
- "\0\u2af6\0\u2b1d\0\u2b44\0\u2b6b\0\u2b92\0\u2bb9\0\u2be0\0\u2c07"+
- "\0\u2c2e\0\u2c55\0\u2c7c\0\u2ca3\0\u2cca\0\u2cf1\0\u2d18\0\303"+
- "\0\u2d3f\0\u2d66\0\u2d8d\0\u2db4\0\u2ddb\0\u2e02\0\u2e29\0\u2e50"+
- "\0\u2e77\0\u2e9e\0\u2ec5\0\u2eec\0\u2f13\0\u2f3a\0\u2f61\0\u2f88"+
- "\0\u2faf\0\u2fd6\0\u2ffd\0\u3024\0\303\0\u304b\0\303\0\u3072"+
- "\0\u3099\0\u30c0\0\u30e7\0\u310e\0\u3135\0\u315c\0\u3183\0\u31aa"+
- "\0\u31d1\0\303\0\303\0\u31f8\0\u321f\0\u3246\0\u326d\0\u3294"+
- "\0\u32bb\0\u32e2\0\u3309\0\u3330\0\303\0\u3357\0\u337e\0\u33a5"+
- "\0\u33cc\0\u33f3\0\u341a\0\u3441\0\u3468\0\u348f\0\u34b6\0\u34dd"+
- "\0\u3504\0\u352b\0\u3552\0\u3579\0\u35a0\0\u35c7\0\u35ee\0\u3615"+
- "\0\u363c\0\u3663\0\u368a\0\u36b1\0\303\0\u36d8\0\u36ff\0\u3726"+
- "\0\u374d\0\u3774\0\u379b\0\u37c2\0\u37e9\0\u3810\0\u3837\0\u385e"+
- "\0\u3885\0\u38ac\0\u38d3\0\u38fa\0\u3921\0\u3948\0\u396f\0\u3996"+
- "\0\u39bd\0\u39e4\0\u3a0b\0\u3a32\0\u3a59\0\u3a80\0\u3aa7\0\u3ace"+
- "\0\303\0\u3af5\0\u3b1c\0\u3b43\0\u3b6a\0\u3b91\0\u3bb8\0\u3bdf"+
- "\0\303\0\u3c06\0\u3c2d\0\u3c54\0\u3c7b\0\u3ca2\0\u3cc9\0\u3cf0"+
- "\0\u3d17\0\303\0\303\0\u3d3e\0\u3d65\0\u3d8c\0\u3db3\0\u3dda"+
- "\0\u3e01\0\u3e28\0\u3e4f\0\u3e76\0\u3e9d\0\u3ec4\0\u3eeb\0\u3f12"+
- "\0\u3f39\0\u3f60\0\u3f87\0\u3fae\0\u3fd5\0\u3ffc\0\u4023\0\u404a"+
- "\0\u4071\0\u4098\0\u40bf\0\u40e6\0\u410d\0\u4134\0\303\0\u415b"+
- "\0\u4182\0\u41a9\0\u41d0\0\u41f7\0\u421e\0\u4245\0\u426c\0\u4293"+
- "\0\u42ba\0\u42e1\0\u4308\0\u432f\0\u4356\0\u437d\0\u43a4\0\u43cb"+
- "\0\u43f2\0\u4419\0\u4440\0\u4467\0\303\0\u448e\0\u44b5\0\u44dc"+
- "\0\u4503\0\u452a\0\303\0\u4551\0\u4578\0\u459f\0\u45c6\0\u45ed"+
- "\0\u4614\0\u463b\0\u4662\0\u4689\0\u46b0\0\303\0\u46d7\0\u46fe"+
- "\0\u4725\0\u474c\0\u4773\0\303\0\u479a\0\u47c1\0\u47e8\0\u480f"+
- "\0\u4836\0\u485d\0\u4884\0\u48ab\0\303\0\u48d2\0\u48f9\0\u4920"+
- "\0\u4947\0\u496e\0\303\0\u4995\0\u49bc\0\u49e3\0\u4a0a\0\u4a31"+
- "\0\u4a58\0\u4a7f\0\u4aa6\0\303\0\u4acd\0\u4af4\0\303\0\u4b1b"+
- "\0\u4b42\0\u4b69\0\u4b90\0\u4bb7\0\u4bde\0\u4c05\0\u4c2c\0\u4c53"+
- "\0\u4c7a\0\u4ca1\0\u4cc8\0\u4cef\0\u4d16\0\u4d3d\0\u4d64\0\u4d8b"+
- "\0\u4db2\0\u4dd9\0\u4e00\0\u4e27\0\u4e4e\0\u4e75\0\u4e9c\0\u4ec3"+
- "\0\u4eea\0\u4f11\0\u4f38\0\u4f5f\0\u4f86\0\u4fad\0\u4fd4\0\u4ffb"+
- "\0\u5022\0\u5049\0\u5070\0\u5097\0\u50be\0\u50e5\0\u510c\0\u5133"+
- "\0\303\0\u515a\0\u5181\0\u51a8\0\u51cf\0\u51f6\0\u521d\0\u5244"+
- "\0\303\0\u526b\0\u5292\0\u52b9\0\u52e0\0\303\0\u5307\0\u532e"+
- "\0\u5355\0\u537c\0\u53a3\0\u53ca\0\u53f1\0\u5418\0\u543f\0\303"+
- "\0\u5466\0\303\0\u548d\0\u54b4\0\u54db\0\u5502\0\u5529\0\u5550"+
- "\0\u5577\0\u559e\0\u55c5\0\u55ec\0\u5613\0\u563a\0\u5661\0\u5688"+
- "\0\u56af\0\u56d6\0\u56fd\0\u5724\0\303\0\303\0\u574b\0\303"+
- "\0\u5772\0\u5799\0\303\0\u57c0\0\u57e7\0\u580e\0\u5835\0\303"+
- "\0\303\0\u585c\0\u5883\0\u58aa\0\u58d1\0\u58f8\0\u591f\0\u5946"+
- "\0\u596d\0\u5994\0\303\0\u59bb\0\u59e2\0\u5a09\0\u5a30\0\303"+
- "\0\u5a57\0\u5a7e\0\u5aa5\0\u5acc\0\u5af3\0\u5b1a\0\u5b41\0\u5b68"+
- "\0\u5b8f\0\u5bb6\0\u5bdd\0\u5c04\0\303\0\u5c2b\0\u5c52\0\u5c79"+
- "\0\303\0\u5ca0\0\u5cc7\0\303\0\303\0\303\0\u5cee\0\u5d15"+
- "\0\303\0\u5d3c\0\u5d63\0\u5d8a\0\u5db1\0\u5dd8\0\u5dff\0\u5e26"+
- "\0\u5e4d\0\u5e74\0\303\0\u5e9b\0\u5ec2\0\303\0\u5ee9\0\u5f10"+
- "\0\u5f37\0\u5f5e\0\u5f85\0\u5fac\0\303\0\u5fd3\0\u5ffa\0\u6021"+
- "\0\u6048\0\303\0\u606f\0\u6096\0\u60bd\0\u60e4\0\u610b\0\u6132"+
- "\0\u6159\0\u6180\0\303\0\u61a7\0\303\0\u61ce\0\u61f5\0\u621c"+
- "\0\303\0\303\0\303\0\303\0\u6243\0\u626a\0\303\0\u6291"+
- "\0\u62b8\0\u62df\0\u6306\0\303\0\u632d\0\u6354\0\u637b\0\u63a2"+
- "\0\u63c9\0\u63f0\0\u6417\0\303\0\303\0\u643e\0\u6465\0\u648c"+
- "\0\u64b3\0\u64da\0\u6501\0\303\0\u6528\0\u654f\0\u6576\0\u659d"+
- "\0\u65c4\0\u65eb\0\u6612\0\u6639\0\u6660\0\u6687\0\u66ae\0\u66d5"+
- "\0\u66fc\0\u6723\0\u674a\0\u6771\0\u6798\0\u67bf\0\u67e6\0\u680d"+
- "\0\u6834\0\303\0\u685b\0\u6882\0\u68a9\0\u68d0\0\u68f7\0\303"+
- "\0\u691e\0\u6945\0\u696c\0\u6993\0\u69ba\0\u69e1\0\u6a08\0\u6a2f"+
- "\0\u6a56\0\u6a7d\0\u6aa4\0\303\0\u6acb\0\u6af2\0\u6b19\0\u6b40"+
- "\0\303\0\u6b67\0\303\0\u6b8e\0\u6bb5\0\303\0\u6bdc\0\303"+
- "\0\303\0\u6c03\0\303\0\u6c2a\0\u6c51\0\303\0\u6c78\0\u6c9f"+
- "\0\u6cc6\0\u6ced\0\u6d14\0\303";
-
- private static int [] zzUnpackRowMap() {
- int [] result = new int[796];
- 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\2\1\3\2\4\1\5\1\2\1\6\1\7\1\10"+
- "\1\11\1\12\1\2\1\13\1\7\1\14\1\15\1\16"+
- "\1\17\1\20\1\21\1\22\1\23\1\24\1\25\1\26"+
- "\1\27\1\30\1\31\1\7\1\32\1\33\1\34\1\35"+
- "\1\7\1\36\1\7\1\37\1\40\1\41\51\0\1\4"+
- "\51\0\1\42\41\0\1\43\1\3\1\4\44\43\7\0"+
- "\2\7\1\0\1\7\1\0\31\7\12\0\1\10\1\0"+
- "\1\10\1\44\1\45\42\0\1\10\1\0\1\12\44\0"+
- "\1\46\1\0\1\46\1\44\1\45\41\0\2\7\1\0"+
- "\1\7\1\0\21\7\1\47\7\7\11\0\2\7\1\0"+
- "\1\7\1\0\3\7\1\50\2\7\1\51\5\7\1\52"+
- "\14\7\11\0\2\7\1\0\1\7\1\0\1\53\1\7"+
- "\1\54\26\7\11\0\2\7\1\0\1\7\1\0\5\7"+
- "\1\55\23\7\11\0\2\7\1\0\1\7\1\0\10\7"+
- "\1\56\1\57\17\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\60\10\7\1\61\1\62\13\7\1\63\2\7\11\0"+
- "\2\7\1\0\1\7\1\0\2\7\1\64\12\7\1\65"+
- "\13\7\11\0\2\7\1\0\1\7\1\0\14\7\1\66"+
- "\14\7\11\0\2\7\1\0\1\7\1\0\1\67\4\7"+
- "\1\70\7\7\1\71\13\7\11\0\2\7\1\0\1\7"+
- "\1\0\13\7\1\72\15\7\11\0\2\7\1\0\1\7"+
- "\1\0\14\7\1\73\1\74\13\7\11\0\2\7\1\0"+
- "\1\7\1\0\11\7\1\75\17\7\11\0\2\7\1\0"+
- "\1\7\1\0\7\7\1\76\1\7\1\77\2\7\1\100"+
- "\6\7\1\101\5\7\11\0\2\7\1\0\1\7\1\0"+
- "\2\7\1\102\12\7\1\103\13\7\11\0\2\7\1\0"+
- "\1\7\1\0\3\7\1\104\10\7\1\105\1\106\13\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\107\4\7\1\110"+
- "\5\7\1\111\4\7\1\112\10\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\113\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\5\7\1\114\7\7\1\115\13\7\11\0\2\7"+
- "\1\0\1\7\1\0\2\7\1\116\2\7\1\117\6\7"+
- "\1\120\14\7\11\0\2\7\1\0\1\7\1\0\5\7"+
- "\1\121\23\7\11\0\2\7\1\0\1\7\1\0\5\7"+
- "\1\122\23\7\2\0\5\123\1\124\41\123\10\0\1\125"+
- "\1\0\1\125\44\0\1\126\1\127\1\130\43\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\131\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\3\7\1\132\25\7\11\0\2\7"+
- "\1\0\1\7\1\0\6\7\1\133\22\7\11\0\2\7"+
- "\1\0\1\7\1\0\12\7\1\134\16\7\11\0\2\7"+
- "\1\0\1\7\1\0\11\7\1\135\17\7\11\0\2\7"+
- "\1\0\1\7\1\0\20\7\1\136\10\7\11\0\2\7"+
- "\1\0\1\7\1\0\2\7\1\137\3\7\1\140\6\7"+
- "\1\141\13\7\11\0\2\7\1\0\1\7\1\0\11\7"+
- "\1\142\17\7\11\0\2\7\1\0\1\7\1\0\12\7"+
- "\1\143\4\7\1\144\11\7\11\0\2\7\1\0\1\7"+
- "\1\0\3\7\1\145\25\7\11\0\2\7\1\0\1\7"+
- "\1\0\2\7\1\146\26\7\11\0\2\7\1\0\1\7"+
- "\1\0\5\7\1\147\23\7\11\0\2\7\1\0\1\7"+
- "\1\0\15\7\1\150\13\7\11\0\2\7\1\0\1\7"+
- "\1\0\17\7\1\151\11\7\11\0\2\7\1\0\1\7"+
- "\1\0\2\7\1\152\11\7\1\153\14\7\11\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\154\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\12\7\1\155\16\7\11\0\2\7"+
- "\1\0\1\7\1\0\11\7\1\156\17\7\11\0\2\7"+
- "\1\0\1\7\1\0\11\7\1\157\1\160\16\7\11\0"+
- "\2\7\1\0\1\7\1\0\2\7\1\161\26\7\11\0"+
- "\2\7\1\0\1\7\1\0\3\7\1\162\25\7\11\0"+
- "\2\7\1\0\1\7\1\0\14\7\1\163\14\7\11\0"+
- "\2\7\1\0\1\7\1\0\23\7\1\164\5\7\11\0"+
- "\2\7\1\0\1\7\1\0\27\7\1\165\1\7\11\0"+
- "\2\7\1\0\1\7\1\0\12\7\1\166\16\7\11\0"+
- "\2\7\1\0\1\7\1\0\23\7\1\167\5\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\170\17\7\11\0"+
- "\2\7\1\0\1\7\1\0\4\7\1\171\24\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\172\30\7\11\0\2\7"+
- "\1\0\1\7\1\0\13\7\1\173\15\7\11\0\2\7"+
- "\1\0\1\7\1\0\3\7\1\174\5\7\1\175\4\7"+
- "\1\176\12\7\11\0\2\7\1\0\1\7\1\0\6\7"+
- "\1\177\22\7\11\0\2\7\1\0\1\7\1\0\6\7"+
- "\1\200\22\7\11\0\2\7\1\0\1\7\1\0\2\7"+
- "\1\201\26\7\11\0\2\7\1\0\1\7\1\0\11\7"+
- "\1\202\17\7\11\0\2\7\1\0\1\7\1\0\1\203"+
- "\30\7\11\0\2\7\1\0\1\7\1\0\25\7\1\204"+
- "\3\7\11\0\2\7\1\0\1\7\1\0\13\7\1\205"+
- "\15\7\11\0\2\7\1\0\1\7\1\0\13\7\1\206"+
- "\3\7\1\207\1\7\1\210\7\7\11\0\2\7\1\0"+
- "\1\7\1\0\11\7\1\211\17\7\11\0\2\7\1\0"+
- "\1\7\1\0\3\7\1\212\2\7\1\213\22\7\11\0"+
- "\2\7\1\0\1\7\1\0\3\7\1\214\25\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\215\17\7\2\0"+
- "\5\123\1\216\41\123\4\0\1\4\1\124\51\0\1\125"+
- "\1\0\1\125\1\0\1\45\42\0\1\126\1\0\1\126"+
- "\44\0\1\126\1\0\1\130\43\0\2\7\1\0\1\7"+
- "\1\0\12\7\1\217\16\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\7\1\220\27\7\11\0\2\7\1\0\1\7"+
- "\1\0\5\7\1\221\23\7\11\0\2\7\1\0\1\7"+
- "\1\0\15\7\1\222\13\7\11\0\2\7\1\0\1\7"+
- "\1\0\10\7\1\223\20\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\224\30\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\225\4\7\1\226\22\7\11\0\2\7\1\0"+
- "\1\7\1\0\5\7\1\227\23\7\11\0\2\7\1\0"+
- "\1\7\1\0\3\7\1\230\25\7\11\0\2\7\1\0"+
- "\1\7\1\0\15\7\1\231\13\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\232\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\15\7\1\233\13\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\234\30\7\11\0\2\7\1\0\1\7\1\0"+
- "\24\7\1\235\4\7\11\0\2\7\1\0\1\7\1\0"+
- "\12\7\1\236\16\7\11\0\2\7\1\0\1\7\1\0"+
- "\4\7\1\237\24\7\11\0\2\7\1\0\1\7\1\0"+
- "\22\7\1\240\6\7\11\0\2\7\1\0\1\7\1\0"+
- "\13\7\1\241\15\7\11\0\2\7\1\0\1\7\1\0"+
- "\11\7\1\242\17\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\243\27\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\244\27\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\245\30\7\11\0\2\7\1\0\1\7\1\0\1\246"+
- "\30\7\11\0\2\7\1\0\1\7\1\0\1\7\1\247"+
- "\27\7\11\0\2\7\1\0\1\7\1\0\17\7\1\250"+
- "\11\7\11\0\2\7\1\0\1\7\1\0\1\251\30\7"+
- "\11\0\2\7\1\0\1\7\1\0\12\7\1\252\16\7"+
- "\11\0\2\7\1\0\1\7\1\0\5\7\1\253\23\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\254\30\7\11\0"+
- "\2\7\1\0\1\7\1\0\3\7\1\255\25\7\11\0"+
- "\2\7\1\0\1\7\1\0\14\7\1\256\14\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\257\30\7\11\0\2\7"+
- "\1\0\1\7\1\0\2\7\1\260\26\7\11\0\2\7"+
- "\1\0\1\7\1\0\13\7\1\261\15\7\11\0\2\7"+
- "\1\0\1\7\1\0\15\7\1\262\13\7\11\0\2\7"+
- "\1\0\1\7\1\0\21\7\1\263\7\7\11\0\2\7"+
- "\1\0\1\7\1\0\24\7\1\264\4\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\265\30\7\11\0\2\7\1\0"+
- "\1\7\1\0\24\7\1\266\4\7\11\0\2\7\1\0"+
- "\1\7\1\0\10\7\1\267\20\7\11\0\2\7\1\0"+
- "\1\7\1\0\2\7\1\270\26\7\11\0\2\7\1\0"+
- "\1\7\1\0\24\7\1\271\4\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\272\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\12\7\1\273\16\7\11\0\2\7\1\0\1\7"+
- "\1\0\2\7\1\274\26\7\11\0\2\7\1\0\1\7"+
- "\1\0\22\7\1\275\6\7\11\0\2\7\1\0\1\7"+
- "\1\0\6\7\1\276\22\7\11\0\2\7\1\0\1\7"+
- "\1\0\6\7\1\277\22\7\11\0\2\7\1\0\1\7"+
- "\1\0\3\7\1\300\25\7\11\0\2\7\1\0\1\7"+
- "\1\0\26\7\1\301\2\7\11\0\2\7\1\0\1\7"+
- "\1\0\5\7\1\302\23\7\11\0\2\7\1\0\1\7"+
- "\1\0\21\7\1\303\7\7\2\0\4\123\1\4\1\216"+
- "\41\123\7\0\2\7\1\0\1\7\1\0\1\7\1\304"+
- "\27\7\11\0\2\7\1\0\1\7\1\0\4\7\1\305"+
- "\24\7\11\0\2\7\1\0\1\7\1\0\10\7\1\306"+
- "\20\7\11\0\2\7\1\0\1\7\1\0\16\7\1\307"+
- "\12\7\11\0\2\7\1\0\1\7\1\0\12\7\1\310"+
- "\16\7\11\0\2\7\1\0\1\7\1\0\13\7\1\311"+
- "\15\7\11\0\2\7\1\0\1\7\1\0\6\7\1\312"+
- "\4\7\1\313\6\7\1\314\6\7\11\0\2\7\1\0"+
- "\1\7\1\0\7\7\1\315\21\7\11\0\2\7\1\0"+
- "\1\7\1\0\2\7\1\316\26\7\11\0\2\7\1\0"+
- "\1\7\1\0\13\7\1\317\15\7\11\0\2\7\1\0"+
- "\1\7\1\0\13\7\1\320\15\7\11\0\2\7\1\0"+
- "\1\7\1\0\16\7\1\321\12\7\11\0\2\7\1\0"+
- "\1\7\1\0\17\7\1\322\11\7\11\0\2\7\1\0"+
- "\1\7\1\0\6\7\1\323\22\7\11\0\2\7\1\0"+
- "\1\7\1\0\17\7\1\324\11\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\325\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\10\7\1\326\20\7\11\0\2\7\1\0\1\7"+
- "\1\0\21\7\1\327\7\7\11\0\2\7\1\0\1\7"+
- "\1\0\21\7\1\330\7\7\11\0\2\7\1\0\1\7"+
- "\1\0\21\7\1\331\7\7\11\0\2\7\1\0\1\7"+
- "\1\0\5\7\1\332\23\7\11\0\2\7\1\0\1\7"+
- "\1\0\12\7\1\333\16\7\11\0\2\7\1\0\1\7"+
- "\1\0\4\7\1\334\24\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\335\30\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\336\27\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\337\30\7\11\0\2\7\1\0\1\7\1\0\25\7"+
- "\1\340\3\7\11\0\2\7\1\0\1\7\1\0\17\7"+
- "\1\341\11\7\11\0\2\7\1\0\1\7\1\0\5\7"+
- "\1\342\23\7\11\0\2\7\1\0\1\7\1\0\2\7"+
- "\1\343\26\7\11\0\2\7\1\0\1\7\1\0\1\7"+
- "\1\344\27\7\11\0\2\7\1\0\1\7\1\0\13\7"+
- "\1\345\15\7\11\0\2\7\1\0\1\7\1\0\1\346"+
- "\30\7\11\0\2\7\1\0\1\7\1\0\13\7\1\347"+
- "\15\7\11\0\2\7\1\0\1\7\1\0\14\7\1\350"+
- "\14\7\11\0\2\7\1\0\1\7\1\0\15\7\1\351"+
- "\13\7\11\0\2\7\1\0\1\7\1\0\3\7\1\352"+
- "\25\7\11\0\2\7\1\0\1\7\1\0\3\7\1\353"+
- "\25\7\11\0\2\7\1\0\1\7\1\0\1\7\1\354"+
- "\27\7\11\0\2\7\1\0\1\7\1\0\16\7\1\355"+
- "\12\7\11\0\2\7\1\0\1\7\1\0\15\7\1\356"+
- "\13\7\11\0\2\7\1\0\1\7\1\0\21\7\1\357"+
- "\7\7\11\0\2\7\1\0\1\7\1\0\20\7\1\360"+
- "\10\7\11\0\2\7\1\0\1\7\1\0\16\7\1\361"+
- "\12\7\11\0\2\7\1\0\1\7\1\0\2\7\1\362"+
- "\26\7\11\0\2\7\1\0\1\7\1\0\12\7\1\363"+
- "\16\7\11\0\2\7\1\0\1\7\1\0\1\7\1\364"+
- "\27\7\11\0\2\7\1\0\1\7\1\0\1\7\1\365"+
- "\27\7\11\0\2\7\1\0\1\7\1\0\10\7\1\366"+
- "\20\7\11\0\2\7\1\0\1\7\1\0\15\7\1\367"+
- "\13\7\11\0\2\7\1\0\1\7\1\0\4\7\1\370"+
- "\4\7\1\371\17\7\11\0\2\7\1\0\1\7\1\0"+
- "\5\7\1\372\23\7\11\0\2\7\1\0\1\7\1\0"+
- "\11\7\1\373\17\7\11\0\2\7\1\0\1\7\1\0"+
- "\2\7\1\374\26\7\11\0\2\7\1\0\1\7\1\0"+
- "\26\7\1\375\2\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\376\27\7\11\0\2\7\1\0\1\7\1\0"+
- "\11\7\1\377\17\7\11\0\2\7\1\0\1\7\1\0"+
- "\14\7\1\u0100\14\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\u0101\30\7\11\0\2\7\1\0\1\7\1\0\3\7"+
- "\1\u0102\25\7\11\0\2\7\1\0\1\7\1\0\12\7"+
- "\1\u0103\16\7\11\0\2\7\1\0\1\7\1\0\1\u0104"+
- "\30\7\11\0\2\7\1\0\1\7\1\0\2\7\1\u0105"+
- "\26\7\11\0\2\7\1\0\1\7\1\0\24\7\1\u0106"+
- "\4\7\11\0\2\7\1\0\1\7\1\0\12\7\1\u0107"+
- "\16\7\11\0\2\7\1\0\1\7\1\0\26\7\1\u0108"+
- "\2\7\11\0\2\7\1\0\1\7\1\0\26\7\1\u0109"+
- "\2\7\11\0\2\7\1\0\1\7\1\0\1\7\1\u010a"+
- "\27\7\11\0\2\7\1\0\1\7\1\0\13\7\1\u010b"+
- "\15\7\11\0\2\7\1\0\1\7\1\0\1\7\1\u010c"+
- "\27\7\11\0\2\7\1\0\1\7\1\0\6\7\1\u010d"+
- "\22\7\11\0\2\7\1\0\1\7\1\0\1\u010e\30\7"+
- "\11\0\2\7\1\0\1\7\1\0\11\7\1\u010f\17\7"+
- "\11\0\2\7\1\0\1\7\1\0\20\7\1\u0110\10\7"+
- "\11\0\2\7\1\0\1\7\1\0\5\7\1\u0111\23\7"+
- "\11\0\2\7\1\0\1\7\1\0\6\7\1\u0112\22\7"+
- "\11\0\2\7\1\0\1\7\1\0\6\7\1\u0113\22\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\7\1\u0114\27\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\u0115\30\7\11\0"+
- "\2\7\1\0\1\7\1\0\12\7\1\u0116\16\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\u0117\17\7\11\0"+
- "\2\7\1\0\1\7\1\0\3\7\1\u0118\25\7\11\0"+
- "\2\7\1\0\1\7\1\0\24\7\1\u0119\4\7\11\0"+
- "\2\7\1\0\1\7\1\0\2\7\1\u011a\26\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\u011b\17\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\7\1\u011c\4\7\1\u011d"+
- "\22\7\11\0\2\7\1\0\1\7\1\0\17\7\1\u011e"+
- "\11\7\11\0\2\7\1\0\1\7\1\0\11\7\1\u011f"+
- "\17\7\11\0\2\7\1\0\1\7\1\0\1\u0120\30\7"+
- "\11\0\2\7\1\0\1\7\1\0\2\7\1\u0121\26\7"+
- "\11\0\2\7\1\0\1\7\1\0\17\7\1\u0122\11\7"+
- "\11\0\2\7\1\0\1\7\1\0\5\7\1\u0123\23\7"+
- "\11\0\2\7\1\0\1\7\1\0\14\7\1\u0124\14\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\7\1\u0125\27\7"+
- "\11\0\2\7\1\0\1\7\1\0\23\7\1\u0126\5\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\u0127\30\7\11\0"+
- "\2\7\1\0\1\7\1\0\10\7\1\u0128\20\7\11\0"+
- "\2\7\1\0\1\7\1\0\2\7\1\u0129\26\7\11\0"+
- "\2\7\1\0\1\7\1\0\12\7\1\u012a\16\7\11\0"+
- "\2\7\1\0\1\7\1\0\2\7\1\u012b\26\7\11\0"+
- "\2\7\1\0\1\7\1\0\26\7\1\u012c\2\7\11\0"+
- "\2\7\1\0\1\7\1\0\30\7\1\u012d\11\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\u012e\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\u012f\30\7\11\0\2\7\1\0"+
- "\1\7\1\0\6\7\1\u0130\22\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\7\1\u0131\27\7\11\0\2\7\1\0"+
- "\1\7\1\0\12\7\1\u0132\16\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\7\1\u0133\27\7\11\0\2\7\1\0"+
- "\1\7\1\0\4\7\1\u0134\24\7\11\0\2\7\1\0"+
- "\1\7\1\0\2\7\1\u0135\26\7\11\0\2\7\1\0"+
- "\1\7\1\0\3\7\1\u0136\25\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\u0137\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\u0138\30\7\11\0\2\7\1\0\1\7\1\0"+
- "\5\7\1\u0139\23\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\u013a\27\7\11\0\2\7\1\0\1\7\1\0"+
- "\17\7\1\u013b\11\7\11\0\2\7\1\0\1\7\1\0"+
- "\3\7\1\u013c\25\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\u013d\1\u013e\2\7\1\u013f\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\15\7\1\u0140\13\7\11\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\u0141\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\u0142\30\7\11\0\2\7\1\0"+
- "\1\7\1\0\15\7\1\u0143\13\7\11\0\2\7\1\0"+
- "\1\7\1\0\23\7\1\u0144\5\7\11\0\2\7\1\0"+
- "\1\7\1\0\23\7\1\u0145\5\7\11\0\2\7\1\0"+
- "\1\7\1\0\23\7\1\u0146\5\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\7\1\u0147\27\7\11\0\2\7\1\0"+
- "\1\7\1\0\6\7\1\u0148\22\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\u0149\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\16\7\1\u014a\2\7\1\u014b\2\7\1\u014c\4\7"+
- "\11\0\2\7\1\0\1\7\1\0\21\7\1\u014d\7\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\7\1\u014e\27\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\u014f\30\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\7\1\u0150\27\7\11\0"+
- "\2\7\1\0\1\7\1\0\2\7\1\u0151\26\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\u0152\17\7\11\0"+
- "\2\7\1\0\1\7\1\0\12\7\1\u0153\16\7\11\0"+
- "\2\7\1\0\1\7\1\0\16\7\1\u0154\12\7\11\0"+
- "\2\7\1\0\1\7\1\0\12\7\1\u0155\16\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\u0156\30\7\11\0\2\7"+
- "\1\0\1\7\1\0\17\7\1\u0157\11\7\11\0\2\7"+
- "\1\0\1\7\1\0\20\7\1\u0158\10\7\11\0\2\7"+
- "\1\0\1\7\1\0\15\7\1\u0159\13\7\11\0\2\7"+
- "\1\0\1\7\1\0\17\7\1\u015a\11\7\11\0\2\7"+
- "\1\0\1\7\1\0\12\7\1\u015b\16\7\11\0\2\7"+
- "\1\0\1\7\1\0\4\7\1\u015c\5\7\1\u015d\16\7"+
- "\11\0\2\7\1\0\1\7\1\0\5\7\1\u015e\23\7"+
- "\11\0\2\7\1\0\1\7\1\0\12\7\1\u015f\16\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\u0160\30\7\11\0"+
- "\2\7\1\0\1\7\1\0\17\7\1\u0161\11\7\11\0"+
- "\2\7\1\0\1\7\1\0\5\7\1\u0162\23\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\u0163\17\7\11\0"+
- "\2\7\1\0\1\7\1\0\12\7\1\u0164\16\7\11\0"+
- "\2\7\1\0\1\7\1\0\6\7\1\u0165\22\7\11\0"+
- "\2\7\1\0\1\7\1\0\2\7\1\u0166\26\7\11\0"+
- "\2\7\1\0\1\7\1\0\12\7\1\u0167\16\7\11\0"+
- "\2\7\1\0\1\7\1\0\5\7\1\u0168\23\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\u0169\17\7\11\0"+
- "\2\7\1\0\1\7\1\0\5\7\1\u016a\23\7\11\0"+
- "\2\7\1\0\1\7\1\0\16\7\1\u016b\12\7\11\0"+
- "\2\7\1\0\1\7\1\0\5\7\1\u016c\23\7\11\0"+
- "\2\7\1\0\1\7\1\0\24\7\1\u016d\4\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\u016e\30\7\11\0\2\7"+
- "\1\0\1\7\1\0\24\7\1\u016f\4\7\11\0\2\7"+
- "\1\0\1\7\1\0\15\7\1\u0170\13\7\11\0\2\7"+
- "\1\0\1\7\1\0\17\7\1\u0171\11\7\11\0\2\7"+
- "\1\0\1\7\1\0\12\7\1\u0172\16\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\u0173\30\7\11\0\2\7\1\0"+
- "\1\7\1\0\24\7\1\u0174\4\7\11\0\2\7\1\0"+
- "\1\7\1\0\7\7\1\u0175\21\7\11\0\2\7\1\0"+
- "\1\7\1\0\15\7\1\u0176\13\7\11\0\2\7\1\0"+
- "\1\7\1\0\12\7\1\u0177\16\7\11\0\2\7\1\0"+
- "\1\7\1\0\11\7\1\u0178\17\7\11\0\2\7\1\0"+
- "\1\7\1\0\11\7\1\u0179\17\7\11\0\2\7\1\0"+
- "\1\7\1\0\14\7\1\u017a\14\7\11\0\2\7\1\0"+
- "\1\7\1\0\13\7\1\u017b\15\7\11\0\2\7\1\0"+
- "\1\7\1\0\2\7\1\u017c\26\7\11\0\2\7\1\0"+
- "\1\7\1\0\15\7\1\u017d\13\7\11\0\2\7\1\0"+
- "\1\7\1\0\21\7\1\u017e\7\7\11\0\2\7\1\0"+
- "\1\7\1\0\5\7\1\u017f\23\7\11\0\2\7\1\0"+
- "\1\7\1\0\3\7\1\u0180\25\7\11\0\2\7\1\0"+
- "\1\7\1\0\15\7\1\u0181\13\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\u0182\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\2\7\1\u0183\26\7\11\0\2\7\1\0\1\7"+
- "\1\0\4\7\1\u0184\12\7\1\u0185\11\7\11\0\2\7"+
- "\1\0\1\7\1\0\13\7\1\u0186\15\7\11\0\2\7"+
- "\1\0\1\7\1\0\13\7\1\u0187\15\7\11\0\2\7"+
- "\1\0\1\7\1\0\17\7\1\u0188\11\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\7\1\u0189\27\7\11\0\2\7"+
- "\1\0\1\7\1\0\2\7\1\u018a\26\7\11\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\u018b\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\11\7\1\u018c\17\7\11\0\2\7"+
- "\1\0\1\7\1\0\12\7\1\u018d\16\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\7\1\u018e\27\7\11\0\2\7"+
- "\1\0\1\7\1\0\16\7\1\u018f\12\7\11\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\u0190\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\13\7\1\u0191\15\7\11\0\2\7"+
- "\1\0\1\7\1\0\4\7\1\u0192\24\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\u0193\30\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\7\1\u0194\27\7\11\0\2\7\1\0"+
- "\1\7\1\0\22\7\1\u0195\6\7\11\0\2\7\1\0"+
- "\1\7\1\0\10\7\1\u0196\20\7\11\0\2\7\1\0"+
- "\1\7\1\0\21\7\1\u0197\7\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\7\1\u0198\27\7\11\0\2\7\1\0"+
- "\1\7\1\0\6\7\1\u0199\22\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\7\1\u019a\27\7\11\0\2\7\1\0"+
- "\1\7\1\0\7\7\1\u019b\21\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\u019c\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\17\7\1\u019d\11\7\11\0\2\7\1\0\1\7"+
- "\1\0\2\7\1\u019e\26\7\11\0\2\7\1\0\1\7"+
- "\1\0\6\7\1\u019f\22\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\7\1\u01a0\27\7\11\0\2\7\1\0\1\7"+
- "\1\0\6\7\1\u01a1\22\7\11\0\2\7\1\0\1\7"+
- "\1\0\15\7\1\u01a2\13\7\11\0\2\7\1\0\1\7"+
- "\1\0\11\7\1\u01a3\17\7\11\0\2\7\1\0\1\7"+
- "\1\0\15\7\1\u01a4\13\7\11\0\2\7\1\0\1\7"+
- "\1\0\5\7\1\u01a5\23\7\11\0\2\7\1\0\1\7"+
- "\1\0\12\7\1\u01a6\16\7\11\0\2\7\1\0\1\7"+
- "\1\0\2\7\1\u01a7\26\7\11\0\2\7\1\0\1\7"+
- "\1\0\3\7\1\u01a8\25\7\11\0\2\7\1\0\1\7"+
- "\1\0\11\7\1\u01a9\17\7\11\0\2\7\1\0\1\7"+
- "\1\0\6\7\1\u01aa\22\7\11\0\2\7\1\0\1\7"+
- "\1\0\10\7\1\u01ab\20\7\11\0\2\7\1\0\1\7"+
- "\1\0\2\7\1\u01ac\26\7\11\0\2\7\1\0\1\7"+
- "\1\0\11\7\1\u01ad\17\7\11\0\2\7\1\0\1\7"+
- "\1\0\2\7\1\u01ae\26\7\11\0\2\7\1\0\1\7"+
- "\1\0\14\7\1\u01af\14\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\u01b0\30\7\11\0\2\7\1\0\1\7\1\0"+
- "\7\7\1\u01b1\21\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\u01b2\30\7\11\0\2\7\1\0\1\7\1\0\21\7"+
- "\1\u01b3\7\7\11\0\2\7\1\0\1\7\1\0\12\7"+
- "\1\u01b4\16\7\11\0\2\7\1\0\1\7\1\0\13\7"+
- "\1\u01b5\15\7\11\0\2\7\1\0\1\7\1\0\5\7"+
- "\1\u01b6\23\7\11\0\2\7\1\0\1\7\1\0\15\7"+
- "\1\u01b7\13\7\11\0\2\7\1\0\1\7\1\0\14\7"+
- "\1\u01b8\14\7\11\0\2\7\1\0\1\7\1\0\2\7"+
- "\1\u01b9\26\7\11\0\2\7\1\0\1\7\1\0\1\u01ba"+
- "\30\7\11\0\2\7\1\0\1\7\1\0\3\7\1\u01bb"+
- "\11\7\1\u01bc\13\7\11\0\2\7\1\0\1\7\1\0"+
- "\11\7\1\u01bd\17\7\11\0\2\7\1\0\1\7\1\0"+
- "\15\7\1\u01be\13\7\11\0\2\7\1\0\1\7\1\0"+
- "\12\7\1\u01bf\16\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\u01c0\30\7\11\0\2\7\1\0\1\7\1\0\13\7"+
- "\1\u01c1\2\7\1\u01c2\12\7\11\0\2\7\1\0\1\7"+
- "\1\0\24\7\1\u01c3\4\7\11\0\2\7\1\0\1\7"+
- "\1\0\2\7\1\u01c4\26\7\11\0\2\7\1\0\1\7"+
- "\1\0\2\7\1\u01c5\26\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\u01c6\30\7\11\0\2\7\1\0\1\7\1\0"+
- "\13\7\1\u01c7\15\7\11\0\2\7\1\0\1\7\1\0"+
- "\5\7\1\u01c8\23\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\u01c9\27\7\11\0\2\7\1\0\1\7\1\0"+
- "\26\7\1\u01ca\2\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\u01cb\27\7\11\0\2\7\1\0\1\7\1\0"+
- "\13\7\1\u01cc\15\7\11\0\2\7\1\0\1\7\1\0"+
- "\13\7\1\u01cd\15\7\11\0\2\7\1\0\1\7\1\0"+
- "\3\7\1\u01ce\25\7\11\0\2\7\1\0\1\7\1\0"+
- "\12\7\1\u01cf\16\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\u01d0\27\7\11\0\2\7\1\0\1\7\1\0"+
- "\12\7\1\u01d1\16\7\11\0\2\7\1\0\1\7\1\0"+
- "\5\7\1\u01d2\23\7\11\0\2\7\1\0\1\7\1\0"+
- "\12\7\1\u01d3\16\7\11\0\2\7\1\0\1\7\1\0"+
- "\14\7\1\u01d4\14\7\11\0\2\7\1\0\1\7\1\0"+
- "\6\7\1\u01d5\22\7\11\0\2\7\1\0\1\7\1\0"+
- "\11\7\1\u01d6\17\7\11\0\2\7\1\0\1\7\1\0"+
- "\4\7\1\u01d7\24\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\u01d8\30\7\11\0\2\7\1\0\1\7\1\0\13\7"+
- "\1\u01d9\15\7\11\0\2\7\1\0\1\7\1\0\1\u01da"+
- "\30\7\11\0\2\7\1\0\1\7\1\0\1\7\1\u01db"+
- "\27\7\11\0\2\7\1\0\1\7\1\0\7\7\1\u01dc"+
- "\21\7\11\0\2\7\1\0\1\7\1\0\21\7\1\u01dd"+
- "\7\7\11\0\2\7\1\0\1\7\1\0\16\7\1\u01de"+
- "\12\7\11\0\2\7\1\0\1\7\1\0\3\7\1\u01df"+
- "\25\7\11\0\2\7\1\0\1\7\1\0\10\7\1\u01e0"+
- "\20\7\11\0\2\7\1\0\1\7\1\0\3\7\1\u01e1"+
- "\25\7\11\0\2\7\1\0\1\7\1\0\17\7\1\u01e2"+
- "\11\7\11\0\2\7\1\0\1\7\1\0\1\u01e3\30\7"+
- "\11\0\2\7\1\0\1\7\1\0\2\7\1\u01e4\26\7"+
- "\11\0\2\7\1\0\1\7\1\0\2\7\1\u01e5\26\7"+
- "\11\0\2\7\1\0\1\7\1\0\6\7\1\u01e6\22\7"+
- "\11\0\2\7\1\0\1\7\1\0\3\7\1\u01e7\25\7"+
- "\11\0\2\7\1\0\1\7\1\0\3\7\1\u01e8\25\7"+
- "\11\0\2\7\1\0\1\7\1\0\16\7\1\u01e9\12\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\7\1\u01ea\27\7"+
- "\11\0\2\7\1\0\1\7\1\0\2\7\1\u01eb\26\7"+
- "\11\0\2\7\1\0\1\7\1\0\11\7\1\u01ec\17\7"+
- "\11\0\2\7\1\0\1\7\1\0\2\7\1\u01ed\26\7"+
- "\11\0\2\7\1\0\1\7\1\0\11\7\1\u01ee\17\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\7\1\u01ef\27\7"+
- "\11\0\2\7\1\0\1\7\1\0\21\7\1\u01f0\7\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\u01f1\30\7\11\0"+
- "\2\7\1\0\1\7\1\0\5\7\1\u01f2\23\7\11\0"+
- "\2\7\1\0\1\7\1\0\15\7\1\u01f3\13\7\11\0"+
- "\2\7\1\0\1\7\1\0\6\7\1\u01f4\22\7\11\0"+
- "\2\7\1\0\1\7\1\0\17\7\1\u01f5\11\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\7\1\u01f6\27\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\u01f7\17\7\11\0"+
- "\2\7\1\0\1\7\1\0\5\7\1\u01f8\23\7\11\0"+
- "\2\7\1\0\1\7\1\0\12\7\1\u01f9\16\7\11\0"+
- "\2\7\1\0\1\7\1\0\6\7\1\u01fa\22\7\11\0"+
- "\2\7\1\0\1\7\1\0\15\7\1\u01fb\13\7\11\0"+
- "\2\7\1\0\1\7\1\0\14\7\1\u01fc\14\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\u01fd\30\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\7\1\u01fe\27\7\11\0\2\7"+
- "\1\0\1\7\1\0\3\7\1\u01ff\25\7\11\0\2\7"+
- "\1\0\1\7\1\0\17\7\1\u0200\11\7\11\0\2\7"+
- "\1\0\1\7\1\0\7\7\1\u0201\21\7\11\0\2\7"+
- "\1\0\1\7\1\0\15\7\1\u0202\13\7\11\0\2\7"+
- "\1\0\1\7\1\0\12\7\1\u0203\16\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\7\1\u0204\27\7\11\0\2\7"+
- "\1\0\1\7\1\0\21\7\1\u0205\7\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\u0206\30\7\11\0\2\7\1\0"+
- "\1\7\1\0\6\7\1\u0207\22\7\11\0\2\7\1\0"+
- "\1\7\1\0\2\7\1\u0208\26\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\7\1\u0209\27\7\11\0\2\7\1\0"+
- "\1\7\1\0\3\7\1\u020a\25\7\11\0\2\7\1\0"+
- "\1\7\1\0\3\7\1\u020b\25\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\u020c\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\12\7\1\u020d\16\7\11\0\2\7\1\0\1\7"+
- "\1\0\13\7\1\u020e\15\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\u020f\30\7\11\0\2\7\1\0\1\7\1\0"+
- "\12\7\1\u0210\16\7\11\0\2\7\1\0\1\7\1\0"+
- "\5\7\1\u0211\23\7\11\0\2\7\1\0\1\7\1\0"+
- "\16\7\1\u0212\12\7\11\0\2\7\1\0\1\7\1\0"+
- "\5\7\1\u0213\23\7\11\0\2\7\1\0\1\7\1\0"+
- "\15\7\1\u0214\13\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\u0215\30\7\11\0\2\7\1\0\1\7\1\0\1\u0216"+
- "\30\7\11\0\2\7\1\0\1\7\1\0\16\7\1\u0217"+
- "\1\u0218\11\7\11\0\2\7\1\0\1\7\1\0\20\7"+
- "\1\u0219\10\7\11\0\2\7\1\0\1\7\1\0\3\7"+
- "\1\u021a\25\7\11\0\2\7\1\0\1\7\1\0\10\7"+
- "\1\u021b\20\7\11\0\2\7\1\0\1\7\1\0\5\7"+
- "\1\u021c\1\7\1\u021d\1\u021e\12\7\1\u021f\5\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\7\1\u0220\27\7\11\0"+
- "\2\7\1\0\1\7\1\0\10\7\1\u0221\20\7\11\0"+
- "\2\7\1\0\1\7\1\0\6\7\1\u0222\22\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\u0223\17\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\u0224\30\7\11\0\2\7"+
- "\1\0\1\7\1\0\21\7\1\u0225\7\7\11\0\2\7"+
- "\1\0\1\7\1\0\23\7\1\u0226\5\7\11\0\2\7"+
- "\1\0\1\7\1\0\11\7\1\u0227\17\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\7\1\u0228\27\7\11\0\2\7"+
- "\1\0\1\7\1\0\26\7\1\u0229\2\7\11\0\2\7"+
- "\1\0\1\7\1\0\14\7\1\u022a\14\7\11\0\2\7"+
- "\1\0\1\7\1\0\3\7\1\u022b\25\7\11\0\2\7"+
- "\1\0\1\7\1\0\13\7\1\u022c\15\7\11\0\2\7"+
- "\1\0\1\7\1\0\2\7\1\u022d\26\7\11\0\2\7"+
- "\1\0\1\7\1\0\26\7\1\u022e\2\7\11\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\u022f\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\7\1\u0230\27\7\11\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\u0231\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\14\7\1\u0232\14\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\7\1\u0233\27\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\7\1\u0234\27\7\11\0\2\7"+
- "\1\0\1\7\1\0\16\7\1\u0235\12\7\11\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\u0236\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\2\7\1\u0237\26\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\u0238\30\7\11\0\2\7\1\0"+
- "\1\7\1\0\6\7\1\u0239\22\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\u023a\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\5\7\1\u023b\23\7\11\0\2\7\1\0\1\7"+
- "\1\0\3\7\1\u023c\25\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\u023d\30\7\11\0\2\7\1\0\1\7\1\0"+
- "\7\7\1\u023e\21\7\11\0\2\7\1\0\1\7\1\0"+
- "\13\7\1\u023f\15\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\u0240\4\7\1\u0241\22\7\11\0\2\7\1\0"+
- "\1\7\1\0\12\7\1\u0242\16\7\11\0\2\7\1\0"+
- "\1\7\1\0\2\7\1\u0243\26\7\11\0\2\7\1\0"+
- "\1\7\1\0\15\7\1\u0244\13\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\u0245\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\20\7\1\u0246\10\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\u0247\30\7\11\0\2\7\1\0\1\7\1\0"+
- "\11\7\1\u0248\17\7\11\0\2\7\1\0\1\7\1\0"+
- "\2\7\1\u0249\26\7\11\0\2\7\1\0\1\7\1\0"+
- "\13\7\1\u024a\15\7\11\0\2\7\1\0\1\7\1\0"+
- "\13\7\1\u024b\15\7\11\0\2\7\1\0\1\7\1\0"+
- "\6\7\1\u024c\22\7\11\0\2\7\1\0\1\7\1\0"+
- "\5\7\1\u024d\23\7\11\0\2\7\1\0\1\7\1\0"+
- "\17\7\1\u024e\11\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\u024f\30\7\11\0\2\7\1\0\1\7\1\0\6\7"+
- "\1\u0250\22\7\11\0\2\7\1\0\1\7\1\0\1\u0251"+
- "\30\7\11\0\2\7\1\0\1\7\1\0\15\7\1\u0252"+
- "\13\7\11\0\2\7\1\0\1\7\1\0\23\7\1\u0253"+
- "\5\7\11\0\2\7\1\0\1\7\1\0\2\7\1\u0254"+
- "\10\7\1\u0255\15\7\11\0\2\7\1\0\1\7\1\0"+
- "\15\7\1\u0256\13\7\11\0\2\7\1\0\1\7\1\0"+
- "\12\7\1\u0257\16\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\u0258\30\7\11\0\2\7\1\0\1\7\1\0\14\7"+
- "\1\u0259\14\7\11\0\2\7\1\0\1\7\1\0\20\7"+
- "\1\u025a\10\7\11\0\2\7\1\0\1\7\1\0\5\7"+
- "\1\u025b\23\7\11\0\2\7\1\0\1\7\1\0\3\7"+
- "\1\u025c\25\7\11\0\2\7\1\0\1\7\1\0\6\7"+
- "\1\u025d\22\7\11\0\2\7\1\0\1\7\1\0\11\7"+
- "\1\u025e\17\7\11\0\2\7\1\0\1\7\1\0\17\7"+
- "\1\u025f\11\7\11\0\2\7\1\0\1\7\1\0\6\7"+
- "\1\u0260\22\7\11\0\2\7\1\0\1\7\1\0\5\7"+
- "\1\u0261\23\7\11\0\2\7\1\0\1\7\1\0\1\u0262"+
- "\30\7\11\0\2\7\1\0\1\7\1\0\12\7\1\u0263"+
- "\16\7\11\0\2\7\1\0\1\7\1\0\20\7\1\u0264"+
- "\10\7\11\0\2\7\1\0\1\7\1\0\21\7\1\u0265"+
- "\7\7\11\0\2\7\1\0\1\7\1\0\1\u0266\30\7"+
- "\11\0\2\7\1\0\1\7\1\0\15\7\1\u0267\13\7"+
- "\11\0\2\7\1\0\1\7\1\0\6\7\1\u0268\22\7"+
- "\11\0\2\7\1\0\1\7\1\0\12\7\1\u0269\16\7"+
- "\11\0\2\7\1\0\1\7\1\0\5\7\1\u026a\23\7"+
- "\11\0\2\7\1\0\1\7\1\0\6\7\1\u026b\22\7"+
- "\11\0\2\7\1\0\1\7\1\0\6\7\1\u026c\22\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\u026d\30\7\11\0"+
- "\2\7\1\0\1\7\1\0\12\7\1\u026e\16\7\11\0"+
- "\2\7\1\0\1\7\1\0\16\7\1\u026f\12\7\11\0"+
- "\2\7\1\0\1\7\1\0\13\7\1\u0270\15\7\11\0"+
- "\2\7\1\0\1\7\1\0\13\7\1\u0271\15\7\11\0"+
- "\2\7\1\0\1\7\1\0\23\7\1\u0272\5\7\11\0"+
- "\2\7\1\0\1\7\1\0\17\7\1\u0273\11\7\11\0"+
- "\2\7\1\0\1\7\1\0\5\7\1\u0274\23\7\11\0"+
- "\2\7\1\0\1\7\1\0\15\7\1\u0275\13\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\u0276\17\7\11\0"+
- "\2\7\1\0\1\7\1\0\15\7\1\u0277\13\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\u0278\30\7\11\0\2\7"+
- "\1\0\1\7\1\0\11\7\1\u0279\17\7\11\0\2\7"+
- "\1\0\1\7\1\0\10\7\1\u027a\20\7\11\0\2\7"+
- "\1\0\1\7\1\0\15\7\1\u027b\13\7\11\0\2\7"+
- "\1\0\1\7\1\0\17\7\1\u027c\11\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\u027d\30\7\11\0\2\7\1\0"+
- "\1\7\1\0\4\7\1\u027e\24\7\11\0\2\7\1\0"+
- "\1\7\1\0\5\7\1\u027f\23\7\11\0\2\7\1\0"+
- "\1\7\1\0\6\7\1\u0280\22\7\11\0\2\7\1\0"+
- "\1\7\1\0\3\7\1\u0281\25\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\u0282\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\11\7\1\u0283\17\7\11\0\2\7\1\0\1\7"+
- "\1\0\5\7\1\u0284\23\7\11\0\2\7\1\0\1\7"+
- "\1\0\16\7\1\u0285\12\7\11\0\2\7\1\0\1\7"+
- "\1\0\23\7\1\u0286\5\7\11\0\2\7\1\0\1\7"+
- "\1\0\12\7\1\u0287\16\7\11\0\2\7\1\0\1\7"+
- "\1\0\12\7\1\u0288\16\7\11\0\2\7\1\0\1\7"+
- "\1\0\11\7\1\u0289\17\7\11\0\2\7\1\0\1\7"+
- "\1\0\12\7\1\u028a\16\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\u028b\30\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\u028c\30\7\11\0\2\7\1\0\1\7\1\0\11\7"+
- "\1\u028d\17\7\11\0\2\7\1\0\1\7\1\0\1\u028e"+
- "\30\7\11\0\2\7\1\0\1\7\1\0\3\7\1\u028f"+
- "\25\7\11\0\2\7\1\0\1\7\1\0\1\u0290\30\7"+
- "\11\0\2\7\1\0\1\7\1\0\13\7\1\u0291\15\7"+
- "\11\0\2\7\1\0\1\7\1\0\13\7\1\u0292\15\7"+
- "\11\0\2\7\1\0\1\7\1\0\24\7\1\u0293\4\7"+
- "\11\0\2\7\1\0\1\7\1\0\15\7\1\u0294\13\7"+
- "\11\0\2\7\1\0\1\7\1\0\22\7\1\u0295\6\7"+
- "\11\0\2\7\1\0\1\7\1\0\21\7\1\u0296\7\7"+
- "\11\0\2\7\1\0\1\7\1\0\11\7\1\u0297\17\7"+
- "\11\0\2\7\1\0\1\7\1\0\2\7\1\u0298\26\7"+
- "\11\0\2\7\1\0\1\7\1\0\11\7\1\u0299\17\7"+
- "\11\0\2\7\1\0\1\7\1\0\3\7\1\u029a\25\7"+
- "\11\0\2\7\1\0\1\7\1\0\12\7\1\u029b\16\7"+
- "\11\0\2\7\1\0\1\7\1\0\13\7\1\u029c\15\7"+
- "\11\0\2\7\1\0\1\7\1\0\17\7\1\u029d\11\7"+
- "\11\0\2\7\1\0\1\7\1\0\10\7\1\u029e\20\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\u029f\30\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\u02a0\17\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\u02a1\30\7\11\0\2\7"+
- "\1\0\1\7\1\0\13\7\1\u02a2\15\7\11\0\2\7"+
- "\1\0\1\7\1\0\10\7\1\u02a3\20\7\11\0\2\7"+
- "\1\0\1\7\1\0\12\7\1\u02a4\16\7\11\0\2\7"+
- "\1\0\1\7\1\0\21\7\1\u02a5\7\7\11\0\2\7"+
- "\1\0\1\7\1\0\15\7\1\u02a6\13\7\11\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\u02a7\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\2\7\1\u02a8\26\7\11\0\2\7"+
- "\1\0\1\7\1\0\23\7\1\u02a9\5\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\u02aa\30\7\11\0\2\7\1\0"+
- "\1\7\1\0\16\7\1\u02ab\12\7\11\0\2\7\1\0"+
- "\1\7\1\0\13\7\1\u02ac\15\7\11\0\2\7\1\0"+
- "\1\7\1\0\13\7\1\u02ad\15\7\11\0\2\7\1\0"+
- "\1\7\1\0\5\7\1\u02ae\23\7\11\0\2\7\1\0"+
- "\1\7\1\0\12\7\1\u02af\16\7\11\0\2\7\1\0"+
- "\1\7\1\0\5\7\1\u02b0\23\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\u02b1\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\12\7\1\u02b2\16\7\11\0\2\7\1\0\1\7"+
- "\1\0\24\7\1\u02b3\4\7\11\0\2\7\1\0\1\7"+
- "\1\0\3\7\1\u02b4\25\7\11\0\2\7\1\0\1\7"+
- "\1\0\6\7\1\u02b5\22\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\u02b6\30\7\11\0\2\7\1\0\1\7\1\0"+
- "\14\7\1\u02b7\14\7\11\0\2\7\1\0\1\7\1\0"+
- "\5\7\1\u02b8\23\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\u02b9\27\7\11\0\2\7\1\0\1\7\1\0"+
- "\10\7\1\u02ba\20\7\11\0\2\7\1\0\1\7\1\0"+
- "\6\7\1\u02bb\22\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\u02bc\27\7\11\0\2\7\1\0\1\7\1\0"+
- "\20\7\1\u02bd\10\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\u02be\27\7\11\0\2\7\1\0\1\7\1\0"+
- "\15\7\1\u02bf\13\7\11\0\2\7\1\0\1\7\1\0"+
- "\12\7\1\u02c0\16\7\11\0\2\7\1\0\1\7\1\0"+
- "\15\7\1\u02c1\13\7\11\0\2\7\1\0\1\7\1\0"+
- "\13\7\1\u02c2\15\7\11\0\2\7\1\0\1\7\1\0"+
- "\6\7\1\u02c3\22\7\11\0\2\7\1\0\1\7\1\0"+
- "\6\7\1\u02c4\22\7\11\0\2\7\1\0\1\7\1\0"+
- "\12\7\1\u02c5\16\7\11\0\2\7\1\0\1\7\1\0"+
- "\12\7\1\u02c6\16\7\11\0\2\7\1\0\1\7\1\0"+
- "\25\7\1\u02c7\3\7\11\0\2\7\1\0\1\7\1\0"+
- "\11\7\1\u02c8\17\7\11\0\2\7\1\0\1\7\1\0"+
- "\6\7\1\u02c9\22\7\11\0\2\7\1\0\1\7\1\0"+
- "\2\7\1\u02ca\26\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\7\1\u02cb\27\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\u02cc\30\7\11\0\2\7\1\0\1\7\1\0\13\7"+
- "\1\u02cd\15\7\11\0\2\7\1\0\1\7\1\0\15\7"+
- "\1\u02ce\13\7\11\0\2\7\1\0\1\7\1\0\1\u02cf"+
- "\30\7\11\0\2\7\1\0\1\7\1\0\1\7\1\u02d0"+
- "\27\7\11\0\2\7\1\0\1\7\1\0\21\7\1\u02d1"+
- "\7\7\11\0\2\7\1\0\1\7\1\0\17\7\1\u02d2"+
- "\11\7\11\0\2\7\1\0\1\7\1\0\11\7\1\u02d3"+
- "\17\7\11\0\2\7\1\0\1\7\1\0\1\u02d4\30\7"+
- "\11\0\2\7\1\0\1\7\1\0\20\7\1\u02d5\10\7"+
- "\11\0\2\7\1\0\1\7\1\0\5\7\1\u02d6\23\7"+
- "\11\0\2\7\1\0\1\7\1\0\6\7\1\u02d7\22\7"+
- "\11\0\2\7\1\0\1\7\1\0\26\7\1\u02d8\2\7"+
- "\11\0\2\7\1\0\1\7\1\0\11\7\1\u02d9\17\7"+
- "\11\0\2\7\1\0\1\7\1\0\1\u02da\30\7\11\0"+
- "\2\7\1\0\1\7\1\0\2\7\1\u02db\26\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\u02dc\17\7\11\0"+
- "\2\7\1\0\1\7\1\0\11\7\1\u02dd\17\7\11\0"+
- "\2\7\1\0\1\7\1\0\15\7\1\u02de\13\7\11\0"+
- "\2\7\1\0\1\7\1\0\5\7\1\u02df\23\7\11\0"+
- "\2\7\1\0\1\7\1\0\1\u02e0\30\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\7\1\u02e1\27\7\11\0\2\7"+
- "\1\0\1\7\1\0\11\7\1\u02e2\17\7\11\0\2\7"+
- "\1\0\1\7\1\0\2\7\1\u02e3\26\7\11\0\2\7"+
- "\1\0\1\7\1\0\15\7\1\u02e4\13\7\11\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\u02e5\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\11\7\1\u02e6\17\7\11\0\2\7"+
- "\1\0\1\7\1\0\17\7\1\u02e7\11\7\11\0\2\7"+
- "\1\0\1\7\1\0\2\7\1\u02e8\26\7\11\0\2\7"+
- "\1\0\1\7\1\0\7\7\1\u02e9\21\7\11\0\2\7"+
- "\1\0\1\7\1\0\16\7\1\u02ea\12\7\11\0\2\7"+
- "\1\0\1\7\1\0\11\7\1\u02eb\17\7\11\0\2\7"+
- "\1\0\1\7\1\0\2\7\1\u02ec\26\7\11\0\2\7"+
- "\1\0\1\7\1\0\10\7\1\u02ed\20\7\11\0\2\7"+
- "\1\0\1\7\1\0\12\7\1\u02ee\16\7\11\0\2\7"+
- "\1\0\1\7\1\0\12\7\1\u02ef\16\7\11\0\2\7"+
- "\1\0\1\7\1\0\15\7\1\u02f0\13\7\11\0\2\7"+
- "\1\0\1\7\1\0\2\7\1\u02f1\26\7\11\0\2\7"+
- "\1\0\1\7\1\0\20\7\1\u02f2\10\7\11\0\2\7"+
- "\1\0\1\7\1\0\7\7\1\u02f3\21\7\11\0\2\7"+
- "\1\0\1\7\1\0\6\7\1\u02f4\22\7\11\0\2\7"+
- "\1\0\1\7\1\0\16\7\1\u02f5\12\7\11\0\2\7"+
- "\1\0\1\7\1\0\12\7\1\u02f6\16\7\11\0\2\7"+
- "\1\0\1\7\1\0\13\7\1\u02f7\15\7\11\0\2\7"+
- "\1\0\1\7\1\0\6\7\1\u02f8\22\7\11\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\u02f9\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\7\1\u02fa\27\7\11\0\2\7"+
- "\1\0\1\7\1\0\14\7\1\u02fb\14\7\11\0\2\7"+
- "\1\0\1\7\1\0\7\7\1\u02fc\21\7\11\0\2\7"+
- "\1\0\1\7\1\0\3\7\1\u02fd\25\7\11\0\2\7"+
- "\1\0\1\7\1\0\12\7\1\u02fe\16\7\11\0\2\7"+
- "\1\0\1\7\1\0\5\7\1\u02ff\23\7\11\0\2\7"+
- "\1\0\1\7\1\0\1\u0300\30\7\11\0\2\7\1\0"+
- "\1\7\1\0\1\u0301\30\7\11\0\2\7\1\0\1\7"+
- "\1\0\15\7\1\u0302\13\7\11\0\2\7\1\0\1\7"+
- "\1\0\2\7\1\u0303\26\7\11\0\2\7\1\0\1\7"+
- "\1\0\6\7\1\u0304\22\7\11\0\2\7\1\0\1\7"+
- "\1\0\3\7\1\u0305\25\7\11\0\2\7\1\0\1\7"+
- "\1\0\1\u0306\30\7\11\0\2\7\1\0\1\7\1\0"+
- "\2\7\1\u0307\26\7\11\0\2\7\1\0\1\7\1\0"+
- "\11\7\1\u0308\17\7\11\0\2\7\1\0\1\7\1\0"+
- "\13\7\1\u0309\15\7\11\0\2\7\1\0\1\7\1\0"+
- "\2\7\1\u030a\26\7\11\0\2\7\1\0\1\7\1\0"+
- "\11\7\1\u030b\17\7\11\0\2\7\1\0\1\7\1\0"+
- "\12\7\1\u030c\16\7\11\0\2\7\1\0\1\7\1\0"+
- "\1\u030d\30\7\11\0\2\7\1\0\1\7\1\0\21\7"+
- "\1\u030e\7\7\11\0\2\7\1\0\1\7\1\0\17\7"+
- "\1\u030f\11\7\11\0\2\7\1\0\1\7\1\0\10\7"+
- "\1\u0310\20\7\11\0\2\7\1\0\1\7\1\0\6\7"+
- "\1\u0311\22\7\11\0\2\7\1\0\1\7\1\0\12\7"+
- "\1\u0312\16\7\11\0\2\7\1\0\1\7\1\0\21\7"+
- "\1\u0313\7\7\11\0\2\7\1\0\1\7\1\0\3\7"+
- "\1\u0314\25\7\11\0\2\7\1\0\1\7\1\0\13\7"+
- "\1\u0315\15\7\11\0\2\7\1\0\1\7\1\0\1\u0316"+
- "\30\7\11\0\2\7\1\0\1\7\1\0\5\7\1\u0317"+
- "\23\7\11\0\2\7\1\0\1\7\1\0\7\7\1\u0318"+
- "\21\7\11\0\2\7\1\0\1\7\1\0\14\7\1\u0319"+
- "\14\7\11\0\2\7\1\0\1\7\1\0\12\7\1\u031a"+
- "\16\7\11\0\2\7\1\0\1\7\1\0\1\u031b\30\7"+
- "\11\0\2\7\1\0\1\7\1\0\6\7\1\u031c\22\7"+
- "\2\0";
-
- private static int [] zzUnpackTrans() {
- int [] result = new int[27963];
- 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 =
- "\1\0\1\11\1\1\1\11\33\1\2\11\4\0\55\1"+
- "\2\0\2\1\1\0\1\11\65\1\1\0\u028e\1";
-
- private static int [] zzUnpackAttribute() {
- int [] result = new int[796];
- 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;
-
-
- /**
- * 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.
- */
- GUIDefaultsScanner(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.
- */
- GUIDefaultsScanner(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 < 156) {
- 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 11:
- { return GUIDefaultsFile.Keyword.NONE;
- }
- case 85: break;
- case 52:
- { return GUIDefaultsFile.Keyword.EDIT_NET_RULES;
- }
- case 86: break;
- case 44:
- { return GUIDefaultsFile.Keyword.PACKAGE_INFO;
- }
- case 87: break;
- case 34:
- { return GUIDefaultsFile.Keyword.FIXED_VIAS;
- }
- case 88: break;
- case 60:
- { return GUIDefaultsFile.Keyword.VIOLATIONS_INFO;
- }
- case 89: break;
- case 70:
- { return GUIDefaultsFile.Keyword.FORTYFIVE_DEGREE;
- }
- case 90: break;
- case 54:
- { return GUIDefaultsFile.Keyword.MOVE_PARAMETER;
- }
- case 91: break;
- case 76:
- { return GUIDefaultsFile.Keyword.DISPLAY_MISCELLANIOUS;
- }
- case 92: break;
- case 53:
- { return GUIDefaultsFile.Keyword.RULE_SELECTION;
- }
- case 93: break;
- case 41:
- { return GUIDefaultsFile.Keyword.MANUAL_RULES;
- }
- case 94: break;
- case 17:
- { return GUIDefaultsFile.Keyword.VISIBLE;
- }
- case 95: break;
- case 12:
- { return GUIDefaultsFile.Keyword.PINS;
- }
- case 96: break;
- case 56:
- { return GUIDefaultsFile.Keyword.COMPONENT_BACK;
- }
- case 97: break;
- case 40:
- { return GUIDefaultsFile.Keyword.GUI_DEFAULTS;
- }
- case 98: break;
- case 15:
- { return GUIDefaultsFile.Keyword.TRACES;
- }
- case 99: break;
- case 73:
- { return GUIDefaultsFile.Keyword.PULL_TIGHT_REGION;
- }
- case 100: break;
- case 26:
- { return GUIDefaultsFile.Keyword.VIA_RULES;
- }
- case 101: break;
- case 77:
- { return GUIDefaultsFile.Keyword.VIA_SNAP_TO_SMD_CENTER;
- }
- case 102: break;
- case 38:
- { return GUIDefaultsFile.Keyword.BOARD_FRAME;
- }
- case 103: break;
- case 61:
- { return GUIDefaultsFile.Keyword.ROUTE_PARAMETER;
- }
- case 104: break;
- case 29:
- { return GUIDefaultsFile.Keyword.PARAMETER;
- }
- case 105: break;
- case 33:
- { return GUIDefaultsFile.Keyword.CONDUCTION;
- }
- case 106: break;
- case 48:
- { return GUIDefaultsFile.Keyword.OBJECT_COLORS;
- }
- case 107: break;
- case 28:
- { return GUIDefaultsFile.Keyword.STITCHING;
- }
- case 108: break;
- case 66:
- { return GUIDefaultsFile.Keyword.SELECT_PARAMETER;
- }
- case 109: break;
- case 72:
- { return GUIDefaultsFile.Keyword.OBJECT_VISIBILITY;
- }
- case 110: break;
- case 74:
- { return GUIDefaultsFile.Keyword.PULL_TIGHT_ACCURACY;
- }
- case 111: break;
- case 58:
- { return GUIDefaultsFile.Keyword.DISPLAY_REGION;
- }
- case 112: break;
- case 71:
- { return GUIDefaultsFile.Keyword.INTERACTIVE_STATE;
- }
- case 113: break;
- case 39:
- { return GUIDefaultsFile.Keyword.NOT_VISIBLE;
- }
- case 114: break;
- case 20:
- { return GUIDefaultsFile.Keyword.DYNAMIC;
- }
- case 115: break;
- case 84:
- { return GUIDefaultsFile.Keyword.DESELECTED_SNAPSHOT_ATTRIBUTES;
- }
- case 116: break;
- case 31:
- { return GUIDefaultsFile.Keyword.BACKGROUND;
- }
- case 117: break;
- case 64:
- { return GUIDefaultsFile.Keyword.LAYER_VISIBILITY;
- }
- case 118: break;
- case 43:
- { return GUIDefaultsFile.Keyword.FIXED_TRACES;
- }
- case 119: break;
- case 51:
- { return GUIDefaultsFile.Keyword.PADSTACK_INFO;
- }
- case 120: break;
- case 22:
- { return GUIDefaultsFile.Keyword.HILIGHT;
- }
- case 121: break;
- case 14:
- { return GUIDefaultsFile.Keyword.BOUNDS;
- }
- case 122: break;
- case 82:
- { return GUIDefaultsFile.Keyword.DRAG_COMPONENTS_ENABLED;
- }
- case 123: break;
- case 75:
- { return GUIDefaultsFile.Keyword.MANUAL_RULE_SETTINGS;
- }
- case 124: break;
- case 10:
- { return GUIDefaultsFile.Keyword.VIAS;
- }
- case 125: break;
- case 3:
- { return yytext();
- }
- case 126: break;
- case 55:
- { return GUIDefaultsFile.Keyword.COMPONENT_INFO;
- }
- case 127: break;
- case 32:
- { return GUIDefaultsFile.Keyword.ROUTE_MODE;
- }
- case 128: break;
- case 50:
- { return GUIDefaultsFile.Keyword.COLOR_MANAGER;
- }
- case 129: break;
- case 30:
- { return GUIDefaultsFile.Keyword.VIOLATIONS;
- }
- case 130: break;
- case 67:
- { return GUIDefaultsFile.Keyword.SELECTABLE_ITEMS;
- }
- case 131: break;
- case 19:
- { return GUIDefaultsFile.Keyword.OUTLINE;
- }
- case 132: break;
- case 42:
- { return GUIDefaultsFile.Keyword.CURRENT_ONLY;
- }
- case 133: break;
- case 9:
- { return GUIDefaultsFile.Keyword.OFF;
- }
- case 134: break;
- case 45:
- { return GUIDefaultsFile.Keyword.SHOVE_ENABLED;
- }
- case 135: break;
- case 63:
- { return GUIDefaultsFile.Keyword.ASSIGN_NET_RULES;
- }
- case 136: break;
- case 25:
- { return GUIDefaultsFile.Keyword.EDIT_VIAS;
- }
- case 137: break;
- case 81:
- { return GUIDefaultsFile.Keyword.IGNORE_CONDUCTION_AREAS;
- }
- case 138: break;
- case 5:
- { return GUIDefaultsFile.Keyword.OPEN_BRACKET;
- }
- case 139: break;
- case 36:
- { return GUIDefaultsFile.Keyword.VIA_KEEPOUT;
- }
- case 140: break;
- case 8:
- { return GUIDefaultsFile.Keyword.ON;
- }
- case 141: break;
- case 16:
- { return GUIDefaultsFile.Keyword.COLORS;
- }
- case 142: break;
- case 68:
- { return GUIDefaultsFile.Keyword.SELECTION_LAYERS;
- }
- case 143: break;
- case 46:
- { return GUIDefaultsFile.Keyword.NINETY_DEGREE;
- }
- case 144: break;
- case 23:
- { return GUIDefaultsFile.Keyword.WINDOWS;
- }
- case 145: break;
- case 57:
- { return GUIDefaultsFile.Keyword.COMPONENT_GRID;
- }
- case 146: break;
- case 7:
- { return new Double(yytext());
- }
- case 147: break;
- case 69:
- { return GUIDefaultsFile.Keyword.CLEARANCE_MATRIX;
- }
- case 148: break;
- case 65:
- { return GUIDefaultsFile.Keyword.INCOMPLETES_INFO;
- }
- case 149: break;
- case 62:
- { return GUIDefaultsFile.Keyword.COMPONENT_FRONT;
- }
- case 150: break;
- case 18:
- { return GUIDefaultsFile.Keyword.UNFIXED;
- }
- case 151: break;
- case 59:
- { return GUIDefaultsFile.Keyword.LENGTH_MATCHING;
- }
- case 152: break;
- case 80:
- { return GUIDefaultsFile.Keyword.AUTOMATIC_LAYER_DIMMING;
- }
- case 153: break;
- case 79:
- { return GUIDefaultsFile.Keyword.PUSH_AND_SHOVE_ENABLED;
- }
- case 154: break;
- case 24:
- { return GUIDefaultsFile.Keyword.NET_INFO;
- }
- case 155: break;
- case 78:
- { return GUIDefaultsFile.Keyword.CLEARANCE_COMPENSATION;
- }
- case 156: break;
- case 47:
- { return GUIDefaultsFile.Keyword.ROUTE_DETAILS;
- }
- case 157: break;
- case 2:
- { /* ignore */
- }
- case 158: break;
- case 83:
- { return GUIDefaultsFile.Keyword.HILIGHT_ROUTING_OBSTACLE;
- }
- case 159: break;
- case 35:
- { return GUIDefaultsFile.Keyword.ALL_VISIBLE;
- }
- case 160: break;
- case 6:
- { return GUIDefaultsFile.Keyword.CLOSED_BRACKET;
- }
- case 161: break;
- case 1:
- { throw new Error("Illegal character <"+
- yytext()+">");
- }
- case 162: break;
- case 37:
- { return GUIDefaultsFile.Keyword.INCOMPLETES;
- }
- case 163: break;
- case 49:
- { return GUIDefaultsFile.Keyword.CURRENT_LAYER;
- }
- case 164: break;
- case 21:
- { return GUIDefaultsFile.Keyword.KEEPOUT;
- }
- case 165: break;
- case 4:
- { return new Integer(yytext());
- }
- case 166: break;
- case 13:
- { return GUIDefaultsFile.Keyword.FIXED;
- }
- case 167: break;
- case 27:
- { return GUIDefaultsFile.Keyword.SNAPSHOTS;
- }
- case 168: break;
- default:
- if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
- zzAtEOF = true;
- return null;
- }
- else {
- zzScanError(ZZ_NO_MATCH);
- }
- }
- }
- }
-
-
-}
diff --git a/gui/WebStart.java b/gui/WebStart.java
deleted file mode 100644
index 271b40c3..00000000
--- a/gui/WebStart.java
+++ /dev/null
@@ -1,200 +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.
- *
- * WebStart.java
- *
- * Created on 4. Dezember 2006, 07:01
- *
- */
-
-package gui;
-
-/**
- * Function used for Java Websrart.
- * Some put to a separate class to avoid runtime undefined in offline applications.
- * @author Alfons Wirtz
- */
-public class WebStart
-{
- /*
- * Separate function to avoid runtime undefines in an offline application.
- */
- public static java.net.URL get_code_base()
- {
- try
- {
- javax.jnlp.BasicService basic_service =
- (javax.jnlp.BasicService)javax.jnlp.ServiceManager.lookup("javax.jnlp.BasicService");
- return basic_service.getCodeBase();
- }
- catch(Exception e)
- {
- return null;
- }
- }
-
-
- public static javax.jnlp.FileContents save_dialog(String p_parent, String[] p_file_extensions,
- java.io.InputStream p_input_stream, String p_name)
- {
- try
- {
- javax.jnlp.FileSaveService file_save_service =
- (javax.jnlp.FileSaveService)javax.jnlp.ServiceManager.lookup("javax.jnlp.FileSaveService");
- javax.jnlp.FileContents curr_file_contents =
- file_save_service.saveFileDialog(p_parent, p_file_extensions, p_input_stream, p_name);
- return curr_file_contents;
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- /**
- * Looks up a file with the input name in the Cookie file system of Java Web Start.
- * Returns an input stream from that file or null, if no such file was found.
- */
- public static java.io.InputStream get_file_input_stream(String p_file_name)
- {
- java.net.URL code_base = WebStart.get_code_base();
- if (code_base != null)
- {
- try
- {
- javax.jnlp.PersistenceService persistence_service =
- (javax.jnlp.PersistenceService)javax.jnlp.ServiceManager.lookup("javax.jnlp.PersistenceService");
- String [] muffins = persistence_service.getNames(code_base);
- for (int i = 0; i < muffins.length; ++i)
- {
- if (muffins[i].equals(p_file_name))
- {
- java.net.URL defaults_file_url = new java.net.URL(code_base.toString() + muffins[i]);
- javax.jnlp.FileContents file_contents = persistence_service.get(defaults_file_url);
- return file_contents.getInputStream();
- }
- }
- }
- catch(Exception e)
- {
-
- }
- }
- return null;
- }
-
- /**
- * Looks up a file with the input name in the Cookie file system of Java Web Start.
- * This file will be overwritten.
- * Creates a new file, if no such file exists yet.
- */
- public static java.io.OutputStream get_file_output_stream(String p_file_name)
- {
- java.io.OutputStream output_stream = null;
- String [] muffins = null;
- javax.jnlp.PersistenceService persistence_service = null;
- java.net.URL code_base = get_code_base();
- if (code_base != null)
- {
- try
- {
- persistence_service =
- (javax.jnlp.PersistenceService)javax.jnlp.ServiceManager.lookup("javax.jnlp.PersistenceService");
- muffins = persistence_service.getNames(code_base);
- }
- catch(Exception e)
- {
- muffins = null;
- }
- }
- try
- {
- boolean file_exists = false;
- java.net.URL file_url = null;
- if (muffins != null)
- {
- for (int i = 0; i < muffins.length; ++i)
- {
- if (muffins[i].equals(p_file_name))
- {
- file_url = new java.net.URL(code_base.toString() + muffins[i]);
- file_exists = true;
- }
- }
- }
- if (!file_exists)
- {
- file_url = new java.net.URL(code_base.toString() + p_file_name);
- long act_size = persistence_service.create(file_url, MAX_FILE_SIZE);
- if (act_size < MAX_FILE_SIZE)
- {
- return null;
- }
- }
- javax.jnlp.FileContents file_contents = persistence_service.get(file_url);
- output_stream = file_contents.getOutputStream(true);
-
- }
- catch(Exception e)
- {
- return null;
- }
- return output_stream;
- }
-
- /*
- * Deletes all files ending with p_file_ending from the cookie file system.
- * Return false, if no file to delete was found
- * If p_confirm_message != null, the user is asked to confirm the delete action.
- */
- public static boolean delete_files(String p_file_ending, String p_confirm_messsage)
- {
- boolean file_deleted = false;
- try
- {
- java.net.URL code_base = WebStart.get_code_base();
- if (code_base == null)
- {
- return false;
- }
- javax.jnlp.PersistenceService persistence_service =
- (javax.jnlp.PersistenceService)javax.jnlp.ServiceManager.lookup("javax.jnlp.PersistenceService");
- String [] muffins = persistence_service.getNames(code_base);
- java.net.URL file_url = null;
- if (muffins != null)
- {
- for (int i = 0; i < muffins.length; ++i)
- {
- if (muffins[i].endsWith(p_file_ending))
- {
- file_url = new java.net.URL(code_base.toString() + muffins[i]);
- if (p_confirm_messsage == null || WindowMessage.confirm(p_confirm_messsage))
- {
- persistence_service.delete(file_url);
- file_deleted = true;
- }
- }
- }
- }
- }
- catch(Exception e)
- {
- file_deleted = false;
- }
- return file_deleted;
- }
-
- private static final long MAX_FILE_SIZE = 100000;
-}
diff --git a/gui/WindowNetDemonstrations.java b/gui/WindowNetDemonstrations.java
deleted file mode 100644
index cb1624f2..00000000
--- a/gui/WindowNetDemonstrations.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.
- *
- * WindowNetDemonstration.java
- *
- * Created on 14. November 2006, 12:20
- *
- */
-
-package gui;
-
-import java.util.zip.ZipInputStream;
-
-/**
- * Window with a list for selecting router demonstrations in the net.
- *
- * @author Alfons Wirtz
- */
-public class WindowNetDemonstrations extends WindowNetSamples
-{
-
- /** Creates a new instance of WindowNetDemonstration */
- public WindowNetDemonstrations(java.util.Locale p_locale)
- {
- super(p_locale, "router_demonstrations", "replay_example", 7);
- }
-
- /**
- * To be edited when the demonstration examples change.
- * For every String in the second column a String has to be added to the resource file WindowNetSamples.
- */
- protected void fill_list()
- {
- add("sample_45.dsn", "45_degree_logfile", AdditionalAction.READ_LOGFILE);
- add("int_ar.dsn", "drag_component_logfile", AdditionalAction.READ_LOGFILE);
- add("single_layer.dsn", "any_angle_logfile", AdditionalAction.READ_LOGFILE);
- add("hexapod_empty.dsn", "autorouter_example_1", AdditionalAction.AUTOROUTE);
- add("at14_empty.dsn", "autorouter_example_2", AdditionalAction.AUTOROUTE);
- add("sharp_empty.dsn", "autorouter_example_3", AdditionalAction.AUTOROUTE);
- }
-
- protected void button_pushed()
- {
- int index = list.getSelectedIndex();
- if (index < 0 || index >= list_model.getSize())
- {
- return;
- }
- ListElement selected_element = (ListElement) list_model.elementAt(index);
- String[] name_parts = selected_element.design_name.split("\\.");
- String archive_name = name_parts[0];
- BoardFrame new_frame = open_design(archive_name, selected_element.design_name, this.locale);
- if (new_frame != null)
- {
- selected_element.additional_action.perform(new_frame, archive_name);
- }
- }
-
- /**
- * Adds an element to the list.
- */
- private void add(String p_design_name, String p_message_name, AdditionalAction p_additional_action)
- {
- list_model.addElement(new ListElement(p_design_name,
- resources.getString(p_message_name), p_additional_action));
- }
-
-
- /**
- * Replays a zipped logfile from an URL in the net.
- */
- private static void read_zipped_logfile(BoardFrame p_board_frame, String p_archive_name, String p_logfile_name)
- {
- if (p_board_frame == null)
- {
- return;
- }
- ZipInputStream zip_input_stream = WindowNetSamples.open_zipped_file(p_archive_name, p_logfile_name);
- if (zip_input_stream == null)
- {
- return;
- }
- p_board_frame.read_logfile(zip_input_stream);
- }
-
- /**
- * Additional Acction to be performed after opening the board.
- */
- private enum AdditionalAction
- {
- READ_LOGFILE
- {
- void perform(BoardFrame p_board_frame, String p_archive_name)
- {
- String logfile_archive_name = "route_" + p_archive_name;
- read_zipped_logfile(p_board_frame, logfile_archive_name, logfile_archive_name + ".log");
- }
- },
-
-
- AUTOROUTE
- {
- void perform(BoardFrame p_board_frame, String p_archive_name)
- {
- p_board_frame.board_panel.board_handling.start_batch_autorouter();
- }
- },
-
- NONE
- {
- void perform(BoardFrame p_board_frame, String p_archive_name)
- {
-
- }
- };
-
- abstract void perform(BoardFrame p_board_frame, String p_archive_name);
- }
-
- /**
- * Structure of the elements in the list
- * For every instance in a String has to be added to the resource file WindowNetSamples fo the
- * String in the field message_name.
- */
- private static class ListElement
- {
- ListElement(String p_design_name, String p_message_name, AdditionalAction p_additional_action)
- {
- design_name = p_design_name;
- message_name = p_message_name;
- additional_action = p_additional_action;
- }
-
- public String toString()
- {
- return message_name;
- }
-
- final String design_name;
- final String message_name;
- final AdditionalAction additional_action;
- }
-}
diff --git a/gui/WindowNetSampleDesigns.java b/gui/WindowNetSampleDesigns.java
deleted file mode 100644
index 5c62049b..00000000
--- a/gui/WindowNetSampleDesigns.java
+++ /dev/null
@@ -1,66 +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.
- *
- * WindowNeetSampleDesigns.java
- *
- * Created on 14. November 2006, 10:13
- *
- */
-package gui;
-
-/**
- *
- * Window with a list for selecting sample board designs in the net.
- *
- * @author Alfons Wirtz
- */
-public class WindowNetSampleDesigns extends WindowNetSamples
-{
-
- /** Creates a new instance of WindowNeetSampleDesigns */
- public WindowNetSampleDesigns(java.util.Locale p_locale)
- {
- super(p_locale, "sample_designs", "open_sample_design", 11);
- }
-
- protected void fill_list()
- {
- list_model.addElement("hexapod_empty.dsn");
- list_model.addElement("hexapod_autorouted.dsn");
- list_model.addElement("sharc_handrouted.dsn");
- list_model.addElement("at14_empty.dsn");
- list_model.addElement("at14_autorouted.dsn");
- list_model.addElement("sharp_empty.dsn");
- list_model.addElement("sharp_autorouted.dsn");
- list_model.addElement("bigdesign_unrouted.dsn");
- list_model.addElement("int_empty.dsn");
- list_model.addElement("int_autorouted.dsn");
- list_model.addElement("single_layer_empty.dsn");
- list_model.addElement("single_layer_handrouted.dsn");
- }
-
- protected void button_pushed()
- {
- int index = list.getSelectedIndex();
- if (index < 0 || index >= list_model.getSize())
- {
- return;
- }
- String design_name = (String) list_model.elementAt(index);
- String[] name_parts = design_name.split("\\.");
- String archive_name = name_parts[0];
- open_design(archive_name, design_name, this.locale);
- }
-}
diff --git a/gui/WindowNetSamples.java b/gui/WindowNetSamples.java
deleted file mode 100644
index 6d32bb74..00000000
--- a/gui/WindowNetSamples.java
+++ /dev/null
@@ -1,204 +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.
- *
- * WindowNetSampleDesigns.java
- *
- * Created on 11. November 2006, 07:49
- *
- */
-
-package gui;
-
-import java.util.zip.ZipInputStream;
-
-import java.net.URL;
-import java.net.URLConnection;
-
-/**
- * Window with a list for selecting samples in the net.
- *
- * @author Alfons Wirtz
- */
-public abstract class WindowNetSamples extends BoardSubWindow
-{
-
- /** Creates a new instance of WindowNetSampleDesigns */
- public WindowNetSamples(java.util.Locale p_locale, String p_title, String p_button_name, int p_row_count)
- {
- this.locale = p_locale;
- this.resources = java.util.ResourceBundle.getBundle("gui.resources.WindowNetSamples", p_locale);
- this.setTitle(resources.getString(p_title));
-
- this.setDefaultCloseOperation(DISPOSE_ON_CLOSE );
-
- // create main panel
- final javax.swing.JPanel main_panel = new javax.swing.JPanel();
- this.add(main_panel);
- main_panel.setLayout(new java.awt.BorderLayout());
- javax.swing.border.Border panel_border = javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10);
- main_panel.setBorder(panel_border);
-
-
- // create open button
- javax.swing.JButton open_button = new javax.swing.JButton(resources.getString(p_button_name));
- open_button.addActionListener(new OpenListener());
- main_panel.add(open_button, java.awt.BorderLayout.SOUTH);
-
- // create list with the sample designs
- this.list = new javax.swing.JList(this.list_model);
- fill_list();
- this.list.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
- this.list.setSelectedIndex(0);
- this.list.setVisibleRowCount(p_row_count);
- this.list.addMouseListener(new java.awt.event.MouseAdapter()
- {
- public void mouseClicked(java.awt.event.MouseEvent evt)
- {
- if (evt.getClickCount() > 1)
- {
- button_pushed();
- }
- }
- });
-
- javax.swing.JScrollPane list_scroll_pane = new javax.swing.JScrollPane(this.list);
- list_scroll_pane.setPreferredSize(new java.awt.Dimension(200, 20 * p_row_count));
- main_panel.add(list_scroll_pane, java.awt.BorderLayout.CENTER);
- this.pack();
- }
-
-
- /**
- * Fill the list with the examples.
- */
- protected abstract void fill_list();
-
- /**
- * Action to be perfomed. when the button is pushed after selecting an item in the list.
- */
- protected abstract void button_pushed();
-
- /**
- * Opens a zipped archive from an URL in the net.
- * Returns a zipped input stream, who is positioned at the start of p_file_name,
- * or null, if an error occured,
- */
- protected static ZipInputStream open_zipped_file(String p_archive_name, String p_file_name)
- {
- String archive_path_name = MainApplication.WEB_FILE_BASE_NAME + p_archive_name + ".zip";
- URL archive_url = null;
- try
- {
- archive_url = new URL(archive_path_name);
- }
- catch(java.net.MalformedURLException e)
- {
- return null;
- }
- java.io.InputStream input_stream = null;
- ZipInputStream zip_input_stream = null;
- URLConnection net_connection = null;
- try
- {
- net_connection = archive_url.openConnection();
- }
- catch (Exception e)
- {
- return null;
- }
- try
- {
- input_stream = net_connection.getInputStream();
- }
- catch (java.io.IOException e)
- {
- return null;
- }
- catch (java.security.AccessControlException e)
- {
- return null;
- }
- try
- {
- zip_input_stream = new ZipInputStream(input_stream);
- }
- catch (Exception e)
- {
- WindowMessage.show("unable to get zip input stream");
- return null;
- }
- String compare_name = p_archive_name + "/" + p_file_name;
- java.util.zip.ZipEntry curr_entry = null;
- for (;;)
- {
- try
- {
- curr_entry = zip_input_stream.getNextEntry();
- }
- catch (Exception E)
- {
- return null;
- }
- if (curr_entry == null)
- {
- return null;
- }
- String design_name = curr_entry.getName();
- if (design_name.equals(compare_name))
- {
- break;
- }
- }
- return zip_input_stream;
- }
-
-
- /**
- * Opens a sample design on the website.
- */
- protected static BoardFrame open_design(String p_archive_name, String p_design_name, java.util.Locale p_locale)
- {
- ZipInputStream zip_input_stream = open_zipped_file(p_archive_name, p_design_name);
- if (zip_input_stream == null)
- {
- return null;
- }
- DesignFile design_file = DesignFile.get_instance("sharc_routed.dsn", true);
- BoardFrame new_frame =
- new BoardFrame(design_file, BoardFrame.Option.WEBSTART, board.TestLevel.RELEASE_VERSION,
- p_locale, false);
- boolean read_ok = new_frame.read(zip_input_stream, true, null);
- if (!read_ok)
- {
- return null;
- }
- new_frame.setVisible(true);
- return new_frame;
- }
-
- protected final java.util.ResourceBundle resources;
- protected final java.util.Locale locale;
-
- protected javax.swing.DefaultListModel list_model = new javax.swing.DefaultListModel();
- protected final javax.swing.JList list;
-
- private class OpenListener implements java.awt.event.ActionListener
- {
- public void actionPerformed(java.awt.event.ActionEvent p_evt)
- {
- button_pushed();
- }
- }
-}
diff --git a/gui/resources/WindowNetSamples_de.properties b/gui/resources/WindowNetSamples_de.properties
deleted file mode 100644
index 5864c932..00000000
--- a/gui/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/gui/resources/WindowNetSamples_en.properties b/gui/resources/WindowNetSamples_en.properties
deleted file mode 100644
index d2ad0bde..00000000
--- a/gui/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/helpset/de/HelpIndex.xml b/helpset/de/HelpIndex.xml
deleted file mode 100644
index 54841ef9..00000000
--- a/helpset/de/HelpIndex.xml
+++ /dev/null
@@ -1,187 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/HelpTOC.xml b/helpset/de/HelpTOC.xml
deleted file mode 100644
index 7a6ea469..00000000
--- a/helpset/de/HelpTOC.xml
+++ /dev/null
@@ -1,157 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/Map.jhm b/helpset/de/Map.jhm
deleted file mode 100644
index 655583cd..00000000
--- a/helpset/de/Map.jhm
+++ /dev/null
@@ -1,193 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/FileMenu.html b/helpset/de/html_files/FileMenu.html
deleted file mode 100644
index ceb3905b..00000000
--- a/helpset/de/html_files/FileMenu.html
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
- Das Datei-Menü
-
-
-
- Die Einträge im Dateimenü
-
- speichern
-
- Der aktuelle Stand des Designs wird im internen .bin-Dateiformat gespeichert. Nicht verfügbar in der Web-Version weil Designs im .bin-Format im allgemeinen zwischen verschiedenen Versionen des Routers nicht kompatibel sind.
-
- speichern und beenden
-
- Das Programm wird beendet, nachdem der aktuelle Stand der Design-Datei im internen .bin-Format gespeichert wurde. Nicht verfügbar in der Web-Version weil Designs im .bin-Format im allgemeinen zwischen verschiedenen Versionen des Routers nicht kompatibel sind.
-
- abbrechen und beenden
-
- Das Programm wird beendet. Dabei werden alle interaktiven Änderungen nach dem letzten Speichern verworfen.
-
- speichern unter
-
- Hier können Sie den aktuellen Stand des Designs in einer Datei mit einem von Ihnen gewählten Namen speichern. Erlaubt sind die Dateiendungen .bin und .dsn. Wenn Sie die Endung .bin wählen, wird die Datei im internen Binär-Format abgespeichert. Dabei wird der aktuelle interaktive Zustand des Programms mit abgespeichert. Da in diesem Format abgespeicherte Designs i. a. mit einer späteren Version der Software nicht mehr eingelesen werden können, steht das .bin-Format nur in der Offline-Version des Routers zur Verfügung. Wenn Sie möchten, dass die abgespeicherte Design-Datei mit jeder späteren Version der Software wieder eingelesen werden kann, müssen Sie die Dateiendung .dsn wählen. Die Datei wird dann in einem Textformat abgespeichert, das eine Erweiterung des Specctra-dsn-Formats ist.
-
- Log-Datei erzeugen
-
- Schreibt ab jetzt alle interaktiven Aktionen in eine Log-Datei, so dass diese Abfolge später mit Log-Datei abspielen wiederholt werden kann. Es werden nur Aktionen abgespeichert, die eine Veränderung des Designs zur Folge haben. Dieser Eintrag ist dafür vorgesehen, kurze interaktive Abfolgen zum Debuggen wiederholbar zu machen. Für die genaue Wiederholbarkeit längerer interaktiver Abfolgen wird keine Garantie übernommen. Der Name einer solchen Log-Datei muss mit .log enden. Nicht verfügbar in der Web-Version.
-
- Log-Datei abspielen
-
- Die Abfolge der Aktionen in einer mit Log-Datei erzeugen generierten Datei mit der Endung .log wird wiederholt. Das Design muss sich dabei im gleichen Zustand wie vor dem Erzeugen der Log-Datei befinden. Nicht verfügbar in der Web-Version.
-
- GUI-Einstellungen als Default speichern
-
- Die aktuellen interaktiven Einstellungen werden in einer Datei mit Namen gui_defaults.par abgespeichert. In der Web-Version ist diese Datei im Java-Control-Panel-Cache versteckt. Sie können sie löschen mit "System-Defaults wiederherstellen" im Startfenster des Routers. Wenn später beim Einlesen eines Designs im .dsn-Format eine Datei mit Namen gui_defaults.par vorgefunden wird, werden die dort abgespeicherten Einstellungen wiederhergestellt. Damit können Sie design-unabhängig Ihre persönlichen Vorlieben für die interaktiven Einstellungen abspeichern. Wenn Sie z. B. andere Objektfarben bevorzugen, oder wenn Sie zwei Bildschirme haben und die Position der Unterfenster auf den zweiten Bildschirm verlegen möchten, brauchen Sie das nicht jedes mal neu einzustellen. Es empfiehlt sich, diese Abspeicherung auf einem Design mit möglichst vielen Lagen vorzunehmen. Sonst würden sich die lagenabhängigen Farben der einzelnen Objekttypen wiederholen, da die Datei gui_defaults.par aus einem Design mit weniger Lagen als dem aktuellen Design erzeugt wurde.
-
- Specctra-Session-Datei exportieren
-
- Um die mit dieser Software erzeugten Änderungen an der Design-Datei in das Host-System zurück zu übertragen, können Sie hier können Sie eine Session-Datei im Specctra-.ses-Format schreiben. Diese Datei können Sie dann im Host-System so importieren, wie Sie das bei Verwendung des Specctra- oder des Electra-Autorouters machen würden. Nach dem Schreiben der Session-Datei werden Sie gefragt, ob Sie die in diesem Programm erzeugten Regeln zur späteren Wiederverwendung speichern möchten. Antworten Sie mit Ja, falls Sie z. B. Via-Regeln definiert haben, die Sie nach dem Hin- und Herwechseln zum Host-System und wieder zurück wieder verwenden wollen. Dabei können allerdings im Host-System neu definierte Regeln unter Umständen überschrieben werden.
- Wenn die ursprüngliche Designdatei von Cadsoft-Eagle erzeugt wurde sehen Sie statt diesem Eintrag den folgenden Menü-Eintrag:
-
- Eagle-Session-Script exportieren
-
- Es wird eine Textdatei mit dem Namen des Designs und der Endung .scr geschrieben. Damit können Sie die Änderungen des Designs nach Cadsoft-Eagle importieren, indem Sie dort im Datei-Pulldown-Menü Script ausführen wählen und diese Textdatei einlesen. Nach dem Schreiben der Textdatei werden Sie gefragt, ob Sie die in diesem Programm erzeugten Regeln zur späteren Wiederverwendung speichern möchten. Antworten Sie mit Ja, wenn Sie z. B. Via-Regeln definiert haben, die Sie nach dem Hin- und Herwechseln nach Eagle und wieder zurück wieder verwenden wollen. Dabei können allerdings in Eagle neu definierte Regeln unter Umständen überschrieben werden.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/MenuState.html b/helpset/de/html_files/MenuState.html
deleted file mode 100644
index 337c5236..00000000
--- a/helpset/de/html_files/MenuState.html
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
- Menü-Zustand
-
-
-
- Die Menü-Zustände
- Das Programm hat die folgenden drei Menü-Zustände: Selektieren, Routen und Ziehen. Durch Selektieren eines der drei Buttons links oben auf dem Toolbar können Sie zwischen diesen Zuständen hin- und herschalten. Am Anfang befindet sich das Programm im Select-Menü-Zustand.
- Allen drei Zuständen sind der Toolbar und das Popup-Menü unter der rechten Maustaste gemeinsam.
- Die weiteren Toolbar-Einträge:
-
- Autorouter
-
- Den Batch-Autorouter auf dem gesamten Board aufrufen.
-
-
-
- Undo, Redo
-
- Das Programm hat unbegrenzte Undo-Redo-Fähigkeiten. In der Offline-Version geht der Undo-Stack selbst nach Speichern des Designs und Neustart des Programms nicht verloren. Shortcuts sind u für Undo und b für Redo
-
- Incompletes
-
- Hier können Sie das Zeigen der offenen Verbindungen als Luftlinien ein- oder ausschalten. Wenn die Luftlinien vorher ausgeschaltet waren, werden sie eingeschaltet und umgekehrt. Shortcut ist g.
-
- Verletzungen
-
- Hier können Sie das Zeigen der Abstandsverletzungen an- oder abschalten. Wenn die Abstandsverletzungen vorher abgeschaltet waren, werden sie eingeschaltet und umgekehrt. Shortcut ist v.
-
- Alles abbilden
-
- Zum Abbilden der gesamten Platine. Shortcut ist a.
-
- Ausschnitt abbilden
-
- Nachdem Sie diesen Eintrag angewählt haben, können Sie durch Ziehen der Maus mit gedrückter linker Maustaste ein abzubildendes Rechteck auswählen. Shortcut ist f. Zoomen können Sie auch durch Drehen des Mausrads und Pannen durch Ziehen der Maus mit gedrücktem Mausrad.
-
- Unit
-
- Hier kann die Maßeinheit und der Maßeinheits-Faktor eingestellt werden. Sie können auswählen zwischen mil, inch, mm und um. Wenn Sie z. B. 0.1 mm einstellen, werden alle Koordinaten auf der Benutzeroberfläche als vielfache von 0,1 mm angezeigt.
-
-
- Die Popup-Menü-Einträge:
-
- Objekt selektieren
-
- Zum Selektieren von Objekten unter dem Cursor. Dabei werden die Einstellungen aus dem Fenster Select-Einstellungen ausgewertet. Wurden Objekte zum Auswählen gefunden, befindet sich das Programm danach im Auswahl-Zustand. Im Select-Menü-Zustand könne Sie auch mit der linken Maustaste Objekte selektieren.
-
- Route starten
- Vom Objekt unter dem Mauszeiger aus wird eine neue Bahn begonnen. Dabei werden die Einstellungen aus dem Fenster Select-Einstellungen ausgewertet. Wurde ein geeignetes Objekt gefunden, befindet sich das Programm danach im Route-Zustand. Im Route-Menü-Zustand reicht dazu das Klicken mit der linken Maustaste,
- Sperrfläche konstruieren
- Hiermit können Sie auf der aktuellen Lage eine Sperrfläche konstruieren. Dabei kann es sich um einen Kreis, ein Polygon, oder um ein Loch in einer existierenden polygonalen Sperrfläche handeln.
- Pin tauschen
- Dieser Menü-Eintrag erscheint nur, wenn es auf der Platine tauschbare Pins gibt. Ist der Pin unter dem Cursor tauschbar, können Sie hier die Netz-Zugehörigkeit dieses Pins mit einem anderen Pin tauschen.
- Die Zeichen in Klammern hinter den Popup-Menü-Einträgen bezeichnen die Shortcuts für die entsprechenden Aktionen.
-
- Die Funktion des Mausrad:
-
- Durch Drehen mit dem Mausrad können Sie den abgebildeten Ausschnitt der Platine vergrößern oder verkleinern, und durch Ziehen der Maus mit gedrücktem Mausrad können Sie das abgebildete Rechteck verschieben.
-
-
-
- Der Selektions-Menü-Zustand
-
- Ist oben links auf der Werkzeugleiste der Button Selektieren angewählt, befindet sich das Programm im Selektions-Menü-Zustand. Die linke Maustaste dient hier als Shortcut für die Aktion Objekt selektieren im Popup-Menü. Außer dem können Sie durch Ziehen der Maus mit gedrückter linker Taste alle Objekte in einem Rechteck selektieren.
-
- zurück
-
- Der Route-Menü-Zustand
-
- Ist oben links auf der Werkzeugleiste der Button Routen angewählt, befindet sich das Programm im Route-Menü-Zustand. Die linke Maustaste dient hier als Shortcut für die Aktion Route starten im Popup-Menü.
-
- zurück
-
- Der Zieh-Menü-Zustand
-
- Ist oben links auf der Werkzeugleiste der Button Ziehen angewählt, befindet sich das Programm im Zieh-Menü-Zustand. Hier können Sie mit gedrückter linker Maustaste Vias oder Bauteile ziehen und so ihre Position verändern. Dabei werden die angeschlossenen Bahnen automatisch mit verändert. Weiter können Sie mit gedrückter linker Maustaste aus dem leeren Raum heraus Bahnen beiseite schieben und sich so Platz schaffen z. B. für das Einfügen eines weiteren Bauteils. Diese Aktion wird auf der Aktuellen Lage ausgeführt, die im Fenster mit den Select-Einstellungen eingestellt werden kann.
-
- zurück
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/MoveItemState.html b/helpset/de/html_files/MoveItemState.html
deleted file mode 100644
index fd4eed21..00000000
--- a/helpset/de/html_files/MoveItemState.html
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
- Move-Zustand
-
-
-
- Der Move-Zustand
- Hierher gelangen Sie, nachdem Sie in Auswahl-Zustand im Popup-Menü verschieben gewählt haben. Die selektierten Objekte folgen jetzt dem Cursor.
- Wenn Teile der sich bewegenden Objekte rot markiert sind, würde beim Einfügen an dieser Stelle eine Clearance-Verletzung entstehen.
- Es können mehrere Bauteile gleichzeitig verschoben werden. Der interne Route wird mitgenommen, insofern er komplett zum Verschieben markiert ist. Bauteile können nicht verschoben werden, wenn sie mit Objekten verbunden sind, die nicht zum Verschieben markiert sind. Solche Bauteile können Sie evtl. im Drag-Menü-Zustand durch Ziehen mit der linken Maustaste bewegen. Ansonsten müssen Sie vorher den Route entfernen.
- Es werden die Einstellungen im Fenster mit den Platzierungs-Parametern ausgewertet.
- Die Einträge im Popup-Menü unter der rechten Maustaste:
-
- drehen
-
- Hier können Sie die ausgewählten Bauteile um vielfache von 45 Grad um den Cursor drehen. Für Drehungen um 90, 180, und -90 Grad gibt es die Shortcuts +, * und - auf der Tastatur rechts vom Ziffernblock. Wenn Sie um einen Winkel drehen möchten, der kein vielfaches von 45 Grad ist, können Sie das durch Drehen mit dem Mausrad, nachdem Sie im Fenster mit den Platzierungs-Parametern die Funktion des Mausrads von zoomen auf drehen umgestellt haben.
-
- Seite wechseln
-
- Hier können Sie die Platzierungsseite der ausgewählten Bauteile wechseln. Shortcut ist /.
-
- Rotation zurücksetzen
-
- Hier können Sie die Rotation der selektierten Bauteile auf 0 Grad zurücksetzen, nachdem Sie sie vorher durch Drehen mit dem Mausrad verändert hatten.
-
- einfügen
-
- Zum Einfügen der am Cursor hängenden Bauteile. Wenn dabei Clearance-Verletzungen entstehen würden, wird das Einfügen verweigert. Shortcut ist die linke Maustaste.
-
- abbrechen
-
- Zum Abrechen der Verschiebe-Aktion. Die selektierten Bauteile springen an ihren Ausgangspunkt zurück. Shortcut ist die Esc-Taste.
-
-
- zurück
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/RouteState.html b/helpset/de/html_files/RouteState.html
deleted file mode 100644
index 6c4562b5..00000000
--- a/helpset/de/html_files/RouteState.html
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
- Route-Zustand
-
-
-
- Die Route-Zustände
- Nachdem Sie im Grundzustand einen Route gestartet haben, befindet sich das Programm in einem Route-Zustand., und zwar im Dynamic-Route-Zustand oder im Stitching-Route-Zustand, abhängig davon ob im Route-Parameter-Fenster der Route-Modus auf dynamisch oder stitching eingestellt ist.
- Je nachdem ob die Regel-Auswahl auf automatisch oder manuell eingestellt ist, werden die Regeln zum Routen wie Bahnbreite, Clearance-Klasse und Via-Regel durch die Netzklasse des aktiven Netz oder durch die Einstellungen im Fenster für die manuellen Regeln bestimmt.
-
- Nähert sich die neu geroutete Bahn einem noch nicht verbundenen Objekt vom gleichen Netz auf der gleichen Lage, wird dort automatisch angeschlossen. Danach kehrt das Programm in den interaktiven Zustand vor dem Routen zurück.
- zurück
- Der Dynamic-Route-Zustand
-
- In diesem Route-Zustand wird bei jeder Bewegung des Cursors automatisch ein Stück Bahn von der letzten Cursor-Position zur aktuellen Cursor-Position eingefügt. Abhängig von der Einstellung für den Glattzieh-Bereich im Route-Parameter-Fenster wird die Bahn danach sofort glatt gezogen. Die Einträge im Popup-Menü unter der rechten Maustaste im Dynamic-Route-Zustand:
-
- Lage wechseln
-
- Zum Wechseln auf eine andere Lage. Das zugehörige Via wird folgendermaßen aus der eingestellten Via-Regel bestimmt: Die Vias in der Via-Regel werden von oben nach unten durchprobiert, ob sie die alte und die neue Lage umfassen, und ob ein Einfügen ohne Clearance-Verletzungen möglich ist. Das erste dabei gefundene Via wird eingesetzt. Shortcut sind die Zifferntasten 1-9 und die Tasten + und -. Mit "+" können Sie zur nächst größeren Lage wechseln und mit "-" zur nächst kleineren.
-
- Route beenden
-
- Das Routen wird beendet und das Programm kehrt in den vorherigen Zustand zurück. Shortcut ist die linke Maustaste
-
- Route abbrechen
-
- Die zuletzt geroutete Bahn wird weggeworfen und das Programm kehrt in den vorherigen Zustand zurück. Shortcut ist die Esc-Taste.
-
- Snapshot erzeugen
-
- Das Programm erzeugt einen Snapshot, so dass Sie später die Situation zum Zeitpunkt des Snapshots mit Undo wiederherstellen können. Sonst können Sie mit Undo nur die Situation vor dem Beginn der letzten Bahn wiederherstellen. Shortcut ist s.
-
-
- zurück
-
-
-
-
-
- Der Stitching-Route-Zustand
In diesem Route-Zustand wird bei Klicken der linken Maustaste ein Stück Bahn von der letzten Klick-Position zur aktuellen Cursor-Position eingefügt. Abhängig von der Einstellung für den Glattzieh-Bereich im Route-Parameter-Fenster wird die Bahn danach glatt gezogen.
- Die Einträge im Popup-Menü unter der rechten Maustaste im Stitching-Route-Zustand:
-
- einfügen
-
- Vom letzten Einfügepunkt zum aktuellen Einfügepunkt wird eine Bahn gezogen und abhängig von der Einstellung für den Glattzieh-Bereich im Route-Parameter-Fenster glatt gezogen. Shortcut ist die linke Maustaste
-
- beenden
-
- Das Programm kehrt in den Zustand vor dem Routen zurück. Shortcut ist die Esc-Taste.
-
- Lage wechseln
-
- Zum Wechseln auf eine andere Lage. Das zugehörige Via wird folgendermaßen aus der eingestellten Via-Regel bestimmt: Die Vias in der Via-Regel werden von oben nach unten durchprobiert, ob sie die alte und die neue Lage umfassen, und ob ein Einfügen ohne Clearance-Verletzungen möglich ist. Das erste dabei gefundene Via wird eingesetzt. Shortcut sind die Zifferntasten 1-9 und die Tasten + und -. Mit "+" können Sie zur nächst größeren Lage wechseln und mit "-" zur nächst kleineren.
-
-
- zurück
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/SelectedItemState.html b/helpset/de/html_files/SelectedItemState.html
deleted file mode 100644
index 7d6cc50c..00000000
--- a/helpset/de/html_files/SelectedItemState.html
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
- Auswahl-Zustand
-
-
-
- Der Auswahl-Zustand
- Nachdem Sie im Grundzustand Objekte selektiert haben, befindet sich das Programm im Auswahl-Zustand. Die selektierten Objekte werden gehighlightet und es erscheint am oberen Rand ein neuer Toolbar. Mit der linken Maustaste können Sie weitere Objekte selektieren oder schon selektierte Objekte wieder abwählen. Der Toolbar im Auswahl-Zustand
-
- Abbrechen
-
- Das Programm kehrt in den interaktiven Zustand vor dem Selektieren zurück. Shortcut ist die Esc-Taste.
-
- Info
-
- In einem Fenster werden Informationen über die selektierten Objekte ausgegeben. Über die dort blau markierten Begriffe können Sie sich durch Klicken mit der linken Maustaste weitere Informationen besorgen. Shortcut ist i.
-
- Löschen
-
- Die markierten Objekte werden gelöscht, sofern sie nicht gefixt sind. Shortcut ist die Entf-Taste.
-
- Ausschneiden
-
- Durch Ziehen der Maus mit gedrückter linker Taste können Sie ein Rechteck definieren, aus dem die selektierten Bahnen und Vias ausgeschnitten werden. Shortcut ist d.
-
- Fix
-
- Die selektierten Objekte fixieren, so dass sie nicht mehr verschoben oder gelöscht werden können. Shortcut ist f.
-
- Unfix
-
- Die Fixierung der selektierten Objekte aufheben. Shortcut ist u.
-
- Autoroute
-
- Die selektierten Objekte automatisch routen. Shortcut ist a.
-
- Glätten
-
- Die selektierten Bahnen glatt ziehen. Shortcut ist p.
-
- Fanout
-
- Die selektierten SMD-Pins automatisch bis zum ersten Via routen.
-
- Clearance
-
- Den selektierten Objekten eine neue Clearance-Klasse zuweisen.
- Beispiel: Wenn Sie in einem bestimmten Bereich der Platine einen größeren Mindestabstand brauchen, können Sie alle Pins in einem Rechteck selektieren und ihnen eine neue Clearance-Klasse zuweisen.
-
- Netze
-
- Die Auswahl auf alle selektierbaren Objekte ausdehnen, die das gleiche Netz wie ein schon ausgewähltes Objekt haben. Shortcut ist n.
-
- Zush.
-
- Die Auswahl auf alle selektierbaren Objekte ausdehnen, die mit einem schon ausgewählten Objekt elektrisch verbunden sind. Shortcut ist s.
-
- Verb.
-
- Die Auswahl auf alle Bahnen und Vias ausdehnen, die zur gleichen Verbindung wie ein schon ausgewählten Objekts gehören. Shortcut ist e.
- Beispiel: Sie möchten eine komplette Verbindung löschen. Selektieren Sie eine Bahn der Verbindung. Drücken Sie zuerst auf den Button Verb. um die Auswahl auf die ganze Verbindung auszudehnen, und dann auf den Button Löschen.
-
- Bauteile
-
- Die Auswahl auf alle selektierbaren Objekte ausdehnen, die zum gleichen Bauteil wie ein schon ausgewähltes Objekt gehören. Shortcut ist b.
-
- Verletzungen
-
- Hier können Sie das Zeigen der Abstandsverletzungen der selektierten Objekte an- oder abschalten. Wenn die Abstandsverletzungen vorher abgeschaltet waren, werden sie eingeschaltet und umgekehrt. Shortcut ist v.
-
- Auswahl abbilden
-
- Bildet ein umgebendes Rechteck um alle selektierten Objekte ab.
-
-
- Das Popup-Menü unter der rechten Maustaste
-
- verschieben
- Hier werden die selektierten Objekte zum Verschieben vorbereitet. Der Dreh- und Angelpunkt beim Verschieben ist die aktuelle Cursor-Position. Es können mehrere Bauteile gleichzeitig verschoben werden. Nach dieser Aktion befindet sich das Programm im Move-Zustand. Shortcut is m.
-
- zurück
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/WindowAutorouteDetailParameter.html b/helpset/de/html_files/WindowAutorouteDetailParameter.html
deleted file mode 100644
index ab450bef..00000000
--- a/helpset/de/html_files/WindowAutorouteDetailParameter.html
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
- Detailierte Autoroute-Einstellungen
-
-
-
- Detailierte Autoroute-Einstellungen
- Beschreibung des Fensters mit den detailierten Autoroute-Einstellungen:
- Via-Kosten:
-
-
-
Zum Einstellen der Kosten für Vias im Autoroute-Algorithmus. Wenn Sie den Wert vergrößern, wird der Autorouter versuchen, mit weniger Durchkontaktierungen auszukommen. Ein zu hoher Wert beeintächtigt die Auflösung des Autoroute-Algorithmus,
-
-
- Start-Pass:
-
- Zum Einstellen der Nummer des ersten Pass im Batch-Autorouter. Diese Pass-Nummer beinflusst die Ripup-Kosten. Die Ripup-Kosten steigen bei Passes mit höherer Nummer.
-
- Ripup-Anfangskosten:
-
- Zum Einstellen der Ripup-Kosten im Pass mit der Nummer 1. Die Ripup-Kosten im Pass mit der Nummer N betragen (N * Ripup-Anfangskosten).
-
- Trace-Kosten auf Lage:
-
- Hier können Sie für jede Signallage die Kosten für Traces in und gegen die Vorzugsrichtung einstellen.
-
- zurück
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/WindowAutorouteParameter.html b/helpset/de/html_files/WindowAutorouteParameter.html
deleted file mode 100644
index f68de7dd..00000000
--- a/helpset/de/html_files/WindowAutorouteParameter.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
- Autoroute-Einstellungen
-
-
-
- Autoroute-Einstellungen
Hier können Sie die Lagen definieren, die der Autorouter benutzen darf, die Vorzugsrichtung für Bahnen auf jeder Lage, und ob der Autorouter Vias setzen darf.
- Außerdem können Sie festlegen, ob vor dem Autorouten ein Fanout Pass und ob nach dem Autorouten ein Postroute Pass zum Reduzieren der Via-Anzahl und der Gesamtbahnlänge laufen soll.
- Der Postroute Pass kann sehr lange dauern und jederzeit durch Klicken der linken Maustaste beendet werden.
- Beim Fanout Pass werden die Verbindungen nur bis zum ersten Via geroutet. Das kann bei Platinen und vielen Lagen und Ball Grid Arrays sinnvoll sein.
-
- Der Button Detail-Einstellungen öffnet ein Fenster, in dem Sie die im Autoroute-Algorithmus verwendeten Kosten ändern können.
- zurück
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/WindowClearanceMatrix.html b/helpset/de/html_files/WindowClearanceMatrix.html
deleted file mode 100644
index d2589c7b..00000000
--- a/helpset/de/html_files/WindowClearanceMatrix.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
- Clearance-Matrix
-
-
-
- Die Clearance-Matrix
- Im Fenster mit der Clearance-Matrix können Sie die Mindestabstandsregeln zwischen Objekten festlegen. Das geschieht mittels Clearance-Klassen. Eine Objekt-Clearance-Klasse ist durch die Festlegung eines Mindestabstand zu Objekten von allen vorhandenen Clearance-Klasssen definiert. Diese Werte können in der Clearance-Matrix eingesehen und editiert werden.
- Vordefiniert sind die Clearance-Klassen null und default. Objekte der Clearance-Klasse null haben einen Mindestabstand von 0 zu allen anderen Objekten. Dieser Wert kann in der Clearance-Matrix nicht verändert werden.
- Das Specctra-DSN-Format kennt nur die hard-codierten Clearance-Klassen pin, smd, via, wire, area und testpoint. Beim Einlesen des DSN-Files nach dem Start des Programms werden die Clearance-Klassen aus dem Hostsystem übernommen. Dabei wird die Clearance-Klasse wire in default umbenannt. Die anderen hard-codierten Clearance-Klassen werden nur dann beim Einlesen erzeugt, wenn dafür eigene Werte im DSN-File gefunden werden.
- Eine neue Clearance-Klasse hinzufügen
- Drücken Sie den Button Klasse hinzufügen und geben Sie im daraufhin erscheinenden Dialogfeld den Namen der neuen Klasse ein. Die Matrix wird um eine Zeile und eine Spalte mit den Werten für die neue Clearance-Klasse erweitert. Ändern Sie die voreingestellten Werte in der neuen Zeile nach Ihren Anforderungen. Redundante Clearance-Klassen entfernen
- Indem Sie den Button Trimmen drücken, können Sie Clearance-Klassen, deren Matrixeinträge mit den Werten einer anderen Clearance-Klasse genau übereinstimmen, als redundant entfernen. Alle Objekte, die zu der gelöschten Clearance-Klasse gehörten, werden dann dieser anderen Clearance-Klasse zugewiesen. Lagenabhängige Clearance-Werte
- Das Lagenfeld oben am Fenster gibt an, auf welchen Lagen die Clearance-Werte in der Matrix gelten sollen. Bei der voreingestellten Auswahl von alle gelten die Werte auf allen Lagen. Ob für ein bestimmtes Feld lagenabhängige Clearance-Werte definiert sind, sehen Sie daran, dass bei der Einstellung von alle in diesem Feld der Wert -1 erscheint. (Es kann nämlich kein für alle Lagen gültiger Wert ausgegeben werden.) Analoges gilt bei der Auswahl von innere, die für alle Innenlagen gilt. Einen lagenabhängigen Wert können Sie ansehen oder ändern, nachdem Sie im Lagenfeld den Namen Ihrer gewünschten Lage eingestellt haben.
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/WindowDisplay.html b/helpset/de/html_files/WindowDisplay.html
deleted file mode 100644
index c3f8e20e..00000000
--- a/helpset/de/html_files/WindowDisplay.html
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
- Display-Einstellungen
-
-
-
- Display-Einstellungen
- Beschreibung der Fenster für die Display-Einstellungen.
-
- Objekt-Sichtbarkeit
- Mit den Schiebereglern in diesem Fenster können Sie die Intensität einstellen, mit denen die einzelnen Objekttypen abgebildet werden. Die Werte gehen kontinuierlich von alles überdeckender Sichtbarkeit ganz rechts bis zu völliger Unsichtbarkeit ganz links über. Es empfiehlt sich die Sichtbarkeit für Flächen-Objekte (Leitungsflächen, Sperrflächen) nicht zu groß einzustellen.
- Lagen-Sichtbarkeit
-
- Mit diesen Schiebereglern können Sie für jede einzelne Lage einstellen, mit welcher Intensität Objekte auf dieser Lage abgebildet werden sollen. Ziehen Sie einen Schieberegler ganz links, werden die Objekte auf der entsprechenden Lage unsichtbar.
-
- Farben
-
- Hier können Sie die Farben festlegen, mit denen Objekte auf der Platine abgebildet werden, indem Sie mit der linken Maustaste auf das entsprechende Farbfeld klicken. Für die Objekttypen in der oberen Tabelle kann die Farbe für jede Lage einzeln eingestellt werden.
-
- sonstiges
-
- Crosshair-Cursor
-
- Hier können Sie vom normalen kleinem Crosshair-Cursor zu einem großen 45-Grad Crosshair-Cursor umschalten. Das Verwenden des großen Crosshair-Cursors kann die Display-Performance erheblich beeinträchtigen. Shortcut ist die Komma-Taste.
-
- Platinenrotation
-
- Hier können Sie die Platine um vielfache von 90 Grad drehen.
-
- Platinenspiegelung
-
- Hier können Sie die Platine an der horizontalen oder vertikalen Achse spiegeln.
-
- automatisches Lagen-Dimmen
-
- mit dem Schieberegler können Sie einstellen, wie stark Objekte auf der in den Select-Einstellungen beschriebenen aktuellen Lage hervorgehoben werden sollen. Wenn Sie den Regler ganz nach links schieben, wird das automatische Lagen-Dimmen komplett abgeschaltet, schieben Sie ihn ganz nach rechts, werden alle Lagen bis auf die aktuelle Lage unsichtbar.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/WindowManualRules.html b/helpset/de/html_files/WindowManualRules.html
deleted file mode 100644
index 52c09392..00000000
--- a/helpset/de/html_files/WindowManualRules.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
- Manuelle Regeln
-
-
-
- Manuelle Regeln
Fenster mit den Regeln, die beim interaktiven Routen verwendet werden, wenn der Route-Modus in den Route-Einstellungen auf manuell gesetzt ist.
-
- Via-Regel:
-
- Hier können Sie die beim interaktiven Routen zu verwendende Via-Regel einstellen.
- Clearance-Klasse für Bahnen:
-
- Stellen Sie hier die Clearance-Klasse ein, die für neu geroutete Bahnen gelten soll.
- Bahnbreite:
-
- Stellen Sie hier die Bahnbreite für die neu zu routenden Bahnen ein.
- auf Lage:
-
- Gibt an, auf welchen Lagen die im Feld darüber eingestellte Bahnbreite gelten soll. Bei Auswahl von alle gilt die eingestellte Bahnbreite auf allen Lagen. Bei Auswahl von innere gilt die eingestellte Bahnbreite auf allen Innenlagen. Sonst gilt die Bahnbreite nur für die Lage mit dem ausgewählten Namen. Ist die Bahnbreite lagenabhängig, bleibt das Bahnbreitenfeld bei Einstellung von alle leer. Analog für die Innenlagen.
-
- zurück
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/WindowMoveParameter.html b/helpset/de/html_files/WindowMoveParameter.html
deleted file mode 100644
index 4a653671..00000000
--- a/helpset/de/html_files/WindowMoveParameter.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
- Plazierungs-Parameter
-
-
-
- Platzierungs-Parameter
- Die Parameter in diesem Fenster werden beim Verschieben von Bauteilen ausgewertet.
- Hier können Sie einen horizontales und vertikales Raster einstellen, Die Bauteile springen dann beim Verschieben auf Koordinaten, die vielfache von diesem Raster sind.
- Außerdem können sie die Funktion des Mausrads von Zoomen auf Drehen umstellen. Diese Funktionalität brauchen Sie, wenn Sie Bauteile um Winkel Drehen möchten, die keine vielfachen von 90 Grad sind.
- zurück
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/WindowNetClasses.html b/helpset/de/html_files/WindowNetClasses.html
deleted file mode 100644
index 50d2ec36..00000000
--- a/helpset/de/html_files/WindowNetClasses.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
- Netzklassen
-
-
-
- Netzklassen
- Eine Netzklasse besteht aus einem Satz von Regeln, die standardmäßig beim Routen von Netzen aus dieser Netzklasse verwendet werden. Diese Regeln können in der Tabelle im Netzklassen-Fenster editiert werden. Im Folgenden werden die Spalteneinträge in dieser Tabelle beschrieben:
- Die Netzklassentabelle:
-
- Name
-
- Hier steht der Name der Netzklasse, deren Regeln in dieser Zeile beschrieben sind.
-
- Via-Regel
-
- Hier können Sie die Via-Regel einstellen, die beim Routen eines Netz aus dieser Klasse verwendet werden soll.
-
- Clearance-Klasse
-
- Dieses Feld ist zum Einstellen der Clearance-Klasse für die neu gerouteten Bahnen eines Netz aus dieser Klasse.
-
- Bahnbreite
-
- Hier können Sie die Bahnbreite für die neu gerouteten Bahnen eines Netz aus dieser Klasse einstellen.
- Wenn Sie die Bahnbreite auf 0 setzen, werden beim automatischen und interaktiven Routen auf den im folgenden Feld eingestellten Lagen für diese Netzklasse keine Bahnen zugelassen.
-
- auf Lage
-
- Geben Sie hier an, für welchen Lagen der im Bahnbreitenfeld eingestellte Wert gelten soll. Wenn alle eingestellt ist, gilt der Wert auf allen Lagen. Bei der Einstellung von innere gilt der Wert auf allen Innenlagen. Sonst gilt der Wert nur auf der Lage mit dem ausgewählten Namen. Wenn die Bahnbreite lagenabhängig ist, wird bei Einstellung von alle im Bahnbreitenfeld der Wert -1 angezeigt. (Es kann nämlich kein für alle Lagen gültiger Wert ausgegeben werden.)
-
- schiebe-fixiert
-
- Wenn dieses Feld angewählt ist, können Bahnen aus dieser Netzklasse beim Routen nicht verschoben oder glatt gezogen werden.
-
- Zyklen mit Flächen
-
- Normalerweise werden beim Routen entstehende geschlossene Zyklen automatisch entfernt. Wenn dieses Feld angewählt ist, geschieht das nur, wenn dabei keine Leitungsflächen involviert sind. So können Sie zum Beispiel Objekte mehrfach mit einer Kupferfläche verbinden, ohne dass dabei die redundanten Anschlüsse automatisch entfernt werden.
-
- min. Länge
-
- Hier können Sie einen Minimalwert für die kumulative Bahnlänge eines Netz aus dieser Klasse angeben. Beim Routen erscheint dann eine Ellipse. Ob die Minimallänge unterschritten wurde sehen Sie daran, dass sich der Cursor beim Anschließen außerhalb dieser Ellipse befindet. Diese Software bietet allerdings noch keine gute Unterstützung beim Routen mit Minimallängen. Es empfiehlt sich, in den Route-Parametern den Route-Modus auf stitching zu stellen und den Wert für den Glattzieh-Bereich auf 0 zu setzen.
-
- max. Länge
-
- Hier können Sie einen Maximalwert für die kumulative Bahnlänge eines Netz aus dieser Klasse angeben. Beim Routen erscheint dann ein Ellipsen-Ring. Ob die Maximallänge eingehalten wurde sehen Sie daran, dass sich der Cursor beim Anschließen innerhalb dieses Ellipsenring befindet.
-
-
- Die Buttons im Netzklassen-Fenster:
-
- Hinzufügen
-
- Wenn Sie den Button Hinzufügen drücken, wird am Ende der Netzklassen-Tabelle eine neue Zeile mit Default-Werten angehängt. Dort können Sie in der ersten Spalte den vordefinierten Namen der neuen Netzklasse ändern, und danach die Einträge in den anderen Spalten an Ihre Erfordernisse anpassen.
-
- Löschen
-
- Nachdem Sie mit der linken Maustaste eine Zeile in der Netzklassen-Tabelle ausgewählt haben, können Sie die zugehörige Netzklasse durch Drücken dieses Buttons löschen. Das Löschen wird verweigert, wenn es noch Netze gibt, die an diese Netzklasse zugewiesen sind.
-
- Zuweisen
-
- Nach Drücken dieses Buttons erscheint ein Fenster mit einer Tabelle, wo Sie den Netzen in der ersten Spalte einzeln eine Netzklasse in der zweiten Spalte neu zuweisen können.
-
- Selektieren
-
- Auf der Platine werden alle Objekte von allen Netzen selektiert, die zu der in der Tabelle ausgewählten Netzklasse gehören. Anschließend befindet sich das Programm im Auswahl-Zustand.
-
- Netze anzeigen
-
- Öffnet eine Liste mit allen in den selektierten Klassen enthaltenen Netzen.
-
- Incompletes filtern
-
- Es werden nur die Luftlinien der offenen Verbindungen abgebildet, die zu Netzen aus der ausgewählten Netzklasse gehören. Diese Möglichkeit ist als Hilfe gedacht, wenn Sie die Netze einer bestimmten Klasse zuerst routen wollen.
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/WindowObjectList.html b/helpset/de/html_files/WindowObjectList.html
deleted file mode 100644
index 543d0831..00000000
--- a/helpset/de/html_files/WindowObjectList.html
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
- Die Objektlisten
-
-
-
- Die Objektlisten
- Hier werden die Fenster mit den Objektlisten dokumentiert, wie sie in der Menüleiste unter Info zu finden sind.
- Die Objekte in einer solchen Liste können mit der linken Maustaste selektiert werden. Wenn Sie die Strg- oder Ctrl-Taste dabei gedrückt halten, können Sie auch mehrere Objekte auswählen. Mit gedrückter Shift-Taste können Sie alle Objekte zwischen dem zuerst selektierten und dem zuletzt selektierten Objekt ausgewählen.
- Die Buttons im Objektlisten-Fenster:
-
- Info
-
- Öffnet ein Textfenster mit Informationen über die selektierten Objekte. Über die blau markierten Ausdrücke in diesem Textfenster können Sie sich durch Klicken mit der linken Maustaste weitere Informationen besorgen.
-
- Anzeigen
-
- Es wird ein Ausschnitt der Platine mit den ausgewählten Objekten abgebildet. Die selektierten Objekte werden dabei gehighlighted. Danach befindet sich das Programm im Auswahlzustand.
-
- Invertieren
-
- Selektierte Objekte in der Liste werden deselektiert und umgekehrt.
-
- Neu berechnen
-
- Die Objektliste wird neu berechnet.
-
- Filter
-
- Hier können Sie eine Zeichenfolge zum Filtern der Objekte in der Liste angeben. Wenn Sie danach auf Neu berechnen drücken, werden nur noch die Objekte ausgegeben, die diese Zeichenfolge enthalten.
-
-
- Es gibt Objektlisten für offene Verbindungen, Längenverletzungen, Clearance-Verletzungen, Bibliotheks-Packages, Bibliotheks-Padstacks, platzierte Bauteile und Netze. Es folgt eine kurze Beschreibung dieser Listen.
- Die einzelnen Objektlisten:
-
- Clearance-Verletzungen
-
- Es werden die Objektpaare ausgegeben, wo der für diese Objekte geltende Mindestabstand nicht eingehalten wurde. Durch Drücken des Buttons Anzeigen können diese auf der Platine leicht gefunden werden.
-
- Bibliotheks-Packages
-
- Es werden alle in der Bibliothek vorkommenden Packages ausgegeben. Nach Drücken des Buttons Anzeigen sehen Sie sich alle Bauteile auf der Platine, in denen die selektierten Packages verwendet werden.
-
- Bibliotheks-Padstacks
-
- Es werden alle in der Bibliothek vorkommenden Padstacks ausgegeben. Nach Drücken des Buttons Anzeigen sehen Sie sich alle Pins und Vias auf der Platine, in denen die selektierten Padstacks verwendet werden.
-
- platzierte Bauteile
-
- Es werden alle auf der Platine platzierten Bauteile ausgegeben. Nach Drücken des Buttons Anzeigen sehen Sie sich die selektierten Bauteile auf der Platine.
-
-
-
- offene Verbindungen
-
- Es werden alle noch zu routenden offenen Verbindungen ausgegeben. Die Einträge enthalten den Netznamen gefolgt von Bauteil-Name und Pin-Name der beiden End-Objekte der offenen Verbindung. Wenn es nur noch wenige offene Verbindungen gibt, können diese durch Drücken des Buttons Anzeigen auf der Platine leicht gefunden werden.
-
- Längenverletzungen
-
- Es werden die gerouteten Verbindungen ausgegeben, bei denen die erlaubte Mindestlänge unterschritten oder die erlaubte Maximallänge überschritten wurde. Bei Unterschreiten der Mindestlänge wird auf der Platine an den Endpunkten der Verbindung ein Kreis mit einem "-" abgebildet, bei Überschreiten der Maximallänge ein Kreis mit einem "+". Die Größe eines solchen Kreis entspricht der Größe der Längenverletzung.
-
- Clearance-Verletzungen
-
- Es werden die Objektpaare ausgegeben, wo der für diese Objekte geltende Mindestabstand nicht eingehalten wurde. Durch Drücken des Buttons Anzeigen können diese auf der Platine leicht gefunden werden.
-
- nicht verbundener Route
-
- Es werden die elektrisch verbundenen Traces und Vias ausgegeben, die nicht an Pins oder Leitungsflächen angeschlossen sind und somit in der Luft hängen.. Durch Drücken des Buttons Anzeigen können die selektierten Objekte auf der Platine leicht gefunden werden. Anschließend können Sie diese durch Drücken des Buttons Löschen im Toolbar entfernen.
-
- Route-Stummel
-
- Es werden Trace-Stummel und und Vias mit nur einem Kontakt ausgegeben. Durch Drücken des Buttons Anzeigen können die selektierten Stummel auf der Platine leicht gefunden werden. Anschließend können Sie die Stummel durch Drücken des Buttons Verb. auf die dazugehörigen Verbindungen erweitern und diese dann durch Drücken des Buttons Löschen im Toolbar entfernen.
-
- Netze
-
- Es werden alle auf der Platine verwendeten Netze ausgegeben. Dieses Fenster enthält zwei weitere Buttons. Mit dem Button Klasse zuweisen können Sie den ausgewählten Netzen eine neue Netzklasse zuweisen. Nach Drücken des Button Incompletes filtern werden nur die Luftlinien der offenen Verbindungen abgebildet, die zu einem selektierten Netz gehören.
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/WindowRouteParameter.html b/helpset/de/html_files/WindowRouteParameter.html
deleted file mode 100644
index 3862d8b5..00000000
--- a/helpset/de/html_files/WindowRouteParameter.html
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
- Route-Einstellungen
-
-
-
- Route-Einstellungen
- Beschreibung des Fensters mit den Route-Einstellungen
- Winkel-Einschränkung:
-
- 90 Grad:
-
- Beim interaktiven Routen entstehen nur horizontale und vertikale Bahnen.
-
- 45 Grad:
-
- Die Winkel der beim interaktiven Routen entstehenden Bahnen sind auf vielfache von 45 Grad beschränkt.
-
- keine:
-
- Es gibt keine Winkelbeschränkungen beim interaktiven Routen.
-
-
- Route-Modus:
-
- dynamisch:
-
- Bahn wird eingefügt bei jeder Bewegung des Cursors.
-
- stitching:
-
- Bahn wird eingefügt beim Klicken der linken Maustaste.
-
-
- Regel-Auswahl:
-
- automatisch:
-
- Die beim Routen verwendeten Regeln werden durch die Netzklasse des zu routenden Netz bestimmt.
-
- manuell:
-
- Die beim Routen verwendeten Regeln werden im Fenster Manuelle Regeln festgelegt. Das Fenster öffnet sich automatisch beim Anwählen von manuell.
-
-
- schieben erlaubt
-
- Hier können sie einstellen, ob fremde Bahnen beim Routen verschoben werden dürfen.
- ziehen von Bauteilen erlaubt
- Hier können Sie einstellen, ob Bauteile mit gedrückter linker Maustaste gezogen werden dürfen. Die schon gerouteten Verbindungen des entsprechenden Bauteils werden automatisch mitgezogen.
- Vias schnappen zum SMD-Zentrum
-
- Stellen Sie hier ein, ob Vias, für die Bohren auf SMD-Pins erlaubt ist, in diesem Fall automatisch zum Zentrum des Pins schnappen sollen.
- Highlight Route-Hindernis
- Wenn eingeschaltet, wird das Objekt gehighlighted, das ein Weiterrouten verhindert.
- Leitungsflächen ignorieren
-
- Wenn eingeschaltet, werden Leitungsflächen (z. B. Kupferflächen) von fremden Netzen nicht als Hindernis betrachtet. Damit können sie z.B. im Hostsystem automatisch ausgespart werden.
- automatisches Neckdown
-
- Wenn eingeschaltet, wird beim Starten oder Anschließen an Pins, die schmaler als die beim Routen verwendete Bahnbreite sind und dadurch ein Weiterrouten verhindern, die Bahnbreite automatisch auf die Pinbreite reduziert.
- Exit-Richtungen bei Pins einschränken
-
- Hier können Sie festlegen, ob bei länglichen Pins Bahnen nur an den Schmalseiten angeschlossen werden dürfen.
- Pad-Abbiege-Abstand
-
- Geben Sie hier den Mindestabstand vom Pad-Rand der Pins mit Exitbeschränkungen an, ab denen Bahnen die Richtung ändern dürfen.
- Glattzieh-Bereich
- Hier können Sie den Bereich um den Cursor einschränken, in dem die Bahnen beim Routen glatt gezogen werden. Bei 0 ist das Glattziehen vollständig abgeschaltet, bei 999 gibt es keine Einschränkung des Glattziehbereichs. Ein Wert von 0 ist nur sinnvoll, wenn der Route-Modus auf stitching geschaltet ist.
- back
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/WindowSelectParameter.html b/helpset/de/html_files/WindowSelectParameter.html
deleted file mode 100644
index 829d53b8..00000000
--- a/helpset/de/html_files/WindowSelectParameter.html
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
- Select-Einstellungen
-
-
-
- Select-Einstellungen
- Beschreibung des Fensters mit den Select-Einstellungen
- Selektions-Lagen:
-
- alle sichtbaren:
-
- Es wird auf allen Lagen mit Sichtbarkeitsfaktor > 0 selektiert (siehe auch Lagensichtbarkeit). Die aktuelle Lage wird bevorzugt.
-
- nur aktuelle:
-
- Es wird nur auf der unter aktuelle Lage eingestellten Lage selektiert.
-
-
- Selektierbare Objekte:
- Nur die angewählten Objekttypen werden beim Selektieren berücksichtigt.
- Aktuelle Lage:
- Hier können Sie die Lage einstellen, die bei interaktiven Aktionen verwendet werden soll.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/WindowSnapshots.html b/helpset/de/html_files/WindowSnapshots.html
deleted file mode 100644
index ef4743c6..00000000
--- a/helpset/de/html_files/WindowSnapshots.html
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
-
-
-
- Snapshots
-
-
-
- Snapshots
- Im Snapshots-Fenster können Sie den aktuellen interaktiven Zustand des Programms abspeichern, um ihn später bei Bedarf wiederherzustellen.
- Beschreibung der Buttons:
-
- Gehe zu ausgewähltem Snapshot
-
- Stellt den Interaktiven Zustand wieder her, der in dem ausgewählten Snapshot abgespeichert ist. Alternativ können Sie einen Snapshot in der Liste doppelklicken.
- Um ständigesWechseln zwischen dem Hauptfenster und dem Snapshot-Fenster zu vermeiden, können Sie statt dessen auch die j-Taste drücken. Mit der h-Taste können Sie den vorherigen und mit der k-Taste den nächsten Snapshot selektieren.
-
- Neuer Snapshot
-
- Hier können Sie den aktuellen interaktiven Zustand in einem neuen Snapshot abspeichern, nachdem Sie den voreingestellten Namen in einen aussagekräftigeren Namen umgeändert haben.
-
- Ausgewählten Snapshot löschen
-
- Löscht den mit der linken Maustaste ausgewählten Snapshot.
-
- Alle Snapshots löschen
-
- Entfernt alle Snapshots aus der Liste.
-
- Snapshot-Einstellungen
-
- Öffnet ein Fenster mit den Snapshot-Einstellungen. Dort können Sie die Attribute abwählen, die nicht mit abgespeichert werden sollen.
-
-
- Beschreibung der Felder im Fenster mit den Snapshot-Einstellungen:
-
- Objekt-Farben
-
- Die aktuellen Farbeinstellungen für die Objekttypen werden mit abgespeichert.
-
- Objekt-Sichtbarkeit
-
- Die aktuell eingestellte Intensität für die Abbildung der einzelnen Objekttypen wird mit abgespeichert.
-
- Lagen-Sichtbarkeit
-
- Die aktuell eingestellte Intensität für die Abbildung der Objekttypen auf den einzelnen Lagen wird mit abgespeichert.
-
- Abbildungs-Ausschnitt
-
- Der zurzeit abgebildete Ausschnitt der Platine wird mit abgespeichert.
-
- interaktiver Zustand
-
- Es wird mit abgespeichert, ob sich das Programm zurzeit im Select- Route- oder Drag-Zustand befindet.
-
- Selektions-Lagen
-
- Es wird mit abgespeichert, ob im Fenster mit den Select-Einstellungen die Selektions-Lagen auf alle sichtbaren oder auf nur aktuelle geschaltet sind.
-
- selektierbare Objekte
-
- Die im Fenster mit den Select-Einstellungen unter Selektierbare Objekte eingestellten Werte werden mit abgespeichert.
-
- aktuelle Lage
-
- Die im Fenster mit den Select-Einstellungen unter Aktuelle-Lage eingestellte Lage wird mit abgespeichert.
-
- Regel-Auswahl
-
- Es wird mit abgespeichert, ob im Fenster mit den Route-Einstellungen die Regel-Auswahl auf automatisch oder manuell eingestellt ist.
-
- manuelle Regel-Einstellungen
-
- Die Einstellungen im Fenster mit den manuellen Regeln werden mit abgespeichert.
-
- schieben erlaubt
-
- Es wird mit abgespeichert, ob im Fenster mit den Route-Einstellungen schieben erlaubt angewählt ist.
-
- Bauteil-Ziehen erlaubt
-
- Es wird mit abgespeichert, ob im Fenster mit den Route-Einstellungen Bauteil-Ziehen erlaubt angewählt ist.
-
- Glattzieh-Bereich
-
- Der im Fenster mit den Route-Einstellungen eingestellte Wert für den Glattzieh-Bereich beim Routen wird mit abgespeichert.
-
- Bauteil-Raster
-
- Der im Fenster mit den Platzierungs-Parametern eingestellte Wert für das Bauteil-Raster beim Verschieben von Bauteilen wird mit abgespeichert.
-
- Info-Listen-Selektion
-
- Die selektierten Indizes und die Filter-Strings in den Fenstern offene Verbindungen, Bibliotheks-Packages, Bibliotheks-Padstacks, platzierte Bauteile und Netze werden mit abgespeichert.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/html_files/WindowVia.html b/helpset/de/html_files/WindowVia.html
deleted file mode 100644
index bc6db19e..00000000
--- a/helpset/de/html_files/WindowVia.html
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
- Via-Regeln
-
-
-
- Die Via-Regeln
- Eine Via-Regel besteht aus einem Satz von Vias, die bei einer bestimmten Route-Einstellung verwendet werden dürfen. Wenn beim Lagenwechsel mehrere Vias die alte und die neue Lage umfassen und keine Clearance-Verletzungen verursachen würden, werden die Vias weiter vorne in der Regel werden gegenüber Vias weiter hinten in der Regel bevorzugt.
- Vias
- Ein Via besteht aus einem Namen, einem Via-Padstack, einer Clearance-Klasse und einem Eintrag, ob Überlappungen mit SMD-Pins vom gleichen Netz erlaubt sind oder nicht.
- Via-Padstacks
- Ein Via-Padstack besteht aus einer Anfangs- und einer Endlage, sowie aus einem kreisförmigen Shape auf jeder Lage zwischen Anfangs- und Endlage.
- Es folgt eine Beschreibung der Funktionalität im Fenster mit den Via-Regeln.
- Verfügbare Via-Padstacks
- Hier sehen Sie die drei Buttons Info, Neu und Löschen.
- Mit Info können Sie sich alle verfügbaren Via-Padstacks anzeigen lassen.
- Mit Neu könne Sie einen neuen Via-Padstack anlegen. Geben Sie den Namen des neuen Via-Padstacks in das erscheinende Eingabefeld ein. Danach werden Sie aufgefordert, die erste und die letzte Lage des neuen Padstacks auszuwählen. In das darauf erscheinende Eingabefeld geben Sie bitte den Default-Radius für die kreisförmigen Shapes des neuen Padstacks ein. Im nachfolgenden Fenster können diesen Radius auf jeder einzelnen Lage verändern, falls die Shapes des neuen Padstacks lagenabhängig sein sollen.
- Mit Löschen können Sie einen existierenden Via-Padstack löschen. Das Löschen wird verweigert, wenn der Padstack in einer Via-Definition oder an anderer Stelle verwendet wird.
- Verfügbare Vias
- Beschreibung der Buttons:
-
- Info
-
- Gibt alle Vias aus, die für das Routen zur Verfügung stehen.
-
- Editieren
-
- Wenn Sie diesen Button drücken, erscheint ein neues Fenster mit einer Tabelle zum Editieren der Vias. Hier können Sie Namen, Padstack, Clearance-Klasse und die SMD-Überlappungseigenschaft gemäß Ihren Anforderungen verändern. Unten an diesem Fenster befinden sich zwei Buttons, mit denen Sie neue Vias hinzufügen oder existierende Vias löschen können.
-
-
- Via-Regeln
Unterhalb befindet sich ein Fenster, in dem alle Via-Regeln namentlich aufgelistet sind. Im Folgenden wird die Funktion der vier Buttons am unteren Rand beschrieben:
-
- Info
-
- Nachdem Sie mit der linken Maustaste eine Via-Regel ausgewählt haben, können Sie sich diese mit Info anzeigen lassen. Die Vias weiter oben in der dann erscheinenden Liste werden gegenüber den Vias weiter unten beim Routen bevorzugt.
-
- Neu
-
- Wenn Sie den Button Neu drücken, werden Sie nach dem Namen der neuen Via-Regel gefragt. Nachdem Sie diesen angegeben haben, wird im Fenster oberhalb eine leere Regel mit dem neuen Namen hinzugefügt. Wählen Sie jetzt die neue Regel mit der linken Maustaste aus und drücken Sie den Button Editieren, um Vias in die neue Regel einzufügen.
-
- Editieren
-
- Wenn Sie eine Via-Regel mit der linken Maustaste auswählen und danach den Button Editieren drücken, erscheint ein neues Fenster, in dem Sie die Via-Regel verändern können. Weiteres finden Sie unter Via-Regel editieren.
-
- Löschen
-
- Mit diesem Button können Sie die ausgewählte Via-Regel löschen.
-
-
- Via-Regel editieren
- Wenn Sie eine Via-Regel zum Editieren ausgewählt haben, erscheint ein neues Fenster, in dem alle Vias aufgelistet sind, die in der selektierten Regel vorkommen. Vias weiter oben in dieser Liste werden gegenüber Vias weiter unten beim Routen bevorzugt. Im Folgenden wird die Funktion der Buttons in diesem neuen Fenster beschrieben. Hinzufügen
-
- Es erscheint ein Fenster in dem Sie ein Via aus allen zur Verfügung stehenden Vias auswählen können. Nachdem Sie das Via ausgewählt haben und den OK-Button gedrückt haben, wird das ausgewählte Via an das Ende der Liste angehängt.
-
- Löschen
-
- Nachdem Sie mit der linken Maustaste ein Via ausgewählt haben, können Sie es durch Drücken des Button Löschen aus der Liste entfernen.
-
- Aufwärts
-
- Nachdem Sie mit der linken Maustaste ein Via ausgewählt haben, können Sie durch Drücken des Button Aufwärts die Position des Vias in der Liste um einen Platz nach oben verschieben. Dadurch wird die Priorität dieses Vias beim Routen erhöht. Vias weiter oben in der Liste werden gegenüber Vias weiter unten bevorzugt.
-
- Abwärts
-
- Nachdem Sie mit der linken Maustaste ein Via ausgewählt haben, können Sie durch Drücken des Button Abwärts die Position des Vias in der Liste um einen Platz nach unten verschieben. Dadurch wird die Priorität dieses Vias beim Routen verringert. Vias weiter oben in der Liste werden gegenüber Vias weiter unten bevorzugt.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/de/index.html b/helpset/de/index.html
deleted file mode 100644
index 9af3e4fc..00000000
--- a/helpset/de/index.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
- Bedienungsanleitung
-
-
-
- Bedienungsanleitung für die Online-Hilfe
- Das Inhaltsverzeichnis
- Im linken Fenster dieser Online-Hilfe sehen Sie das Inhaltsverzeichnis. Es enthält die drei Ordner Menüleiste, Interaktive Zustände und Fenster. Im Ordner Menüleiste finden Sie Hilfe zu den einzelnen Einträgen im Pulldown-Menü. Der Ordner Interaktive Zustände enthält Hilfe über die möglichen interaktiven Zustände des Programms. Im Ordner mit dem Namen Fenster erhalten Sie Hilfe zur Funktionalität der einzelnen Zusatzfenster des Programms.Kontextsensitive Hilfe
Wenn Sie im Hilfe-Menü kontextsensitive Hilfe gewählt haben, erscheint ein Frageteichen rechts vom Cursor. Drücken Sie in diesem Zustand die linke Maustaste im Grafikbereich des Hauptfensters, um Hilfe über den aktuellen interaktiven Zustand des Programms zu bekommen, oder in einem Zusatzfenster, um sich die die dortige Funktionalität beschreiben zu lassen. In der Offline-Version können Sie stattdessen auch die F1-Taste benutzen.Die Online-Hilfe durchsuchen
- Für eine Volltextsuche in der Online-Hilfe klicken Sie im linken Fenster die Spalte Suchen und geben Sie den gesuchten Begriff in das Textfeld ein.
- Den Index verwenden
-
- Klicken Sie einen Eintrag in der Spalte Index im linken Fenster, um Auskunft über das entsprechende Thema zu erhalten. Durch mehrfaches Drücken der Return-Taste erhalten sie alle Einträge zum gesuchten Thema.
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/HelpIndex.xml b/helpset/en/HelpIndex.xml
deleted file mode 100644
index 6574e6b9..00000000
--- a/helpset/en/HelpIndex.xml
+++ /dev/null
@@ -1,179 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/HelpTOC.xml b/helpset/en/HelpTOC.xml
deleted file mode 100644
index 42f6d4b8..00000000
--- a/helpset/en/HelpTOC.xml
+++ /dev/null
@@ -1,157 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/Map.jhm b/helpset/en/Map.jhm
deleted file mode 100644
index f97d8ee6..00000000
--- a/helpset/en/Map.jhm
+++ /dev/null
@@ -1,197 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/FileMenu.html b/helpset/en/html_files/FileMenu.html
deleted file mode 100644
index 218e3989..00000000
--- a/helpset/en/html_files/FileMenu.html
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
- Das Datei-Menü
-
-
-
- The File Menu Entries
-
- Save
-
- The current state of the design will be saved in the internal .bin file format. Not available in the web-based version because designs in the .bin format may be not compatible acrosss different versions of the router.
-
- Save and Exit
-
- The program exits after saving the current state of the design in the internal .bin file format.Not available in the web-based version because designs in the .bin format may be not compatible across different versions of the router.
-
- Cancel and Exit
-
- The program exits discarding the changes in the design.
-
- Save as
-
- Here you can save the current state of the design in a file with a file name of your choice. Allowed are the extensions .bin and .dsn. If you choose the extension .bin, the design will be saved in the internal binary format. In this case the current state of the IDE will also be saved. Because a design saved in this file format cannot be read in general by a later version of the router, the .bin-format is only available in the offline version. If you want to be able to read the saved design with a later version of this software, you have to select the extension .dsn.The design will then be saved in a text file format which is an extension of the Specctra-dsn format.
-
- Generate Logfile
-
- From now on all interactive actions are written to a log-file, so that this sequence can be repeated later on with Replay Logfile. Only actions, where the design is changed, are saved. This menu entry is provided in order to make short interactive actions repeatable for debugging. There is no warranty that it will work correctly on long interactive sequences. The name of such a log-file must have the extension .log. Not available in the web-based version.
-
- Replay Logfile
-
- The sequence of actions in a file with the extension .log generated by Generate Logfile will be repeated. The design must be in the same state as it was before generating the log-file. Not available in the web-based version.
-
- Save GUI Settings as Default
-
- The current interactive settings will be saved in a file with name gui_defaults.par. In the web-based version this file is hidden in the the Java Control Panel cache. You can delete it with Restore System Defaults in the router control panel. When you open later on a design in the .dsn format and a file with name gui_defaults.par is found, the saved settings are restored. In this way you can save your personal preferences for the GUI independent of the design. If you prefer different colors for the object types, or if you have two display screens and want to move the positions of the subwindows to the second screen, you do not have to make this change each time you open a new design. It is recommended to create the file gui_defaults.par from a design with as many layers as possible. Otherwise the layer dependent colors of the single object types would repeat, if this file was created from a design with fewer layers than the current design.
-
- Export Specctra Session File
-
- If you want to transfer the changes of the design created by this software back to the host system, you can write here a session file in the Specctra .ses format. You can then import this file into the host system, as you would do it when using the Specctra or Electra autorouter. After the session file is written, you will be asked if you also want to save the rules created inside this program for later reuse. Answer with yes, if for example you have created Via Rules, which you want to reuse after switching forth and back to the host system. However a new created rule in the host system might be overwritten by a saved rule in this case.
- If the original design file was created by Cadsoft-Eagle, you will see the following entry instead:
-
- Export Eagle Session Script
-
- A text file with the same name as the design file and the extension .scr will be written. You can import the changes of the design to Cadsoft Eagle by selecting in the Files pull down menu of Eagle script... and choosing this text file. After the text file is written, you will be asked if you also want to save the rules created inside this program for later reuse. Answer with yes, if for example you have created Via Rules, which you want to reuse after switching forth and back to Eagle. However a new created rule in the Eagle might be overwritten by a saved rule in this case
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/MenuState.html b/helpset/en/html_files/MenuState.html
deleted file mode 100644
index f1e5b17b..00000000
--- a/helpset/en/html_files/MenuState.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
- Menü-Zustand
-
-
-
- The Menu States
- The program contains the following three Menu States: Select, Route and Drag. By selecting one of the three buttons on the upper left side of the tool bar you can switch between this states. In the beginning the program will be in the Select Menu State.The three states have a common tool bar and a common popup menu under the right mouse button.
- Further Entries in the Tool Bar:
-
- Autorouter
-
- To start the batch autorouter on the whole board.
-
- Undo, Redo
-
- The program has unlimited Undo Redo capability. In the offline version the Undo stack does not get lost even after saving the design and restarting the program. Shortcuts are u for Undo and b for Redo.
-
- Incompletes
-
- Here you can switch on or off displaying the open connections as air lines. If the airlines were switched off before, they will be switched on and vice versa. Shortcut is g.
-
- Violations
-
- Here you can switch on or off displaying the clearance violations. If the violations were switched off before, they will be switched on and vice versa. Shortcut is v.
-
- Zoom All
-
- To display the whole board. Shortcut is a.
-
- Zoom Region
-
- After selecting this button you can choose a display rectangle by dragging the mouse with the left button pressed. Shortcut is f. You can also zoom by turning the mouse wheel and pan by dragging the mouse with the mouse wheel pressed.
-
- Unit
-
- To change the Unit or the Unit Factor. Possible choices are mil, inch, mm and um. After selecting for example 0.1 mm all coordinates in the IDE are displayed as multiples of 0.1 mm.
-
-
- The Entries in the Popup Menu:
-
- select item
-
- To select the items under the cursor. Only items switched on in the Select Parameter window can be selected. After selecting some items the current interactive state will change to the Selected Item State. In the Select Menu State you can select items also with the left mouse button.
-
- start route
- A new trace will be started beginning at the item under the cursor. For the selection of the start item the settings in the Select Parameter window are evaluated . If a suitable item was found the interactive state will change to the Route State. In the Route Menu State you can do this also by clicking the left mouse button.
- create keepout
-
- To create a keepout on the current layer. You can create a circle, a polygons or a hole into an existing polygonal keepout.
- swap pin
-
- This menu entry appears only if the board contains swappable pins. If the pin under the cursor is swappable, you can change the net of this pin with a suitable other pin.
- The letters in brackets behind the Popup Menu entries describe the shortcuts for the corresponding actions.
-
- The Function of the Mouse Wheel:
-
- By rotating the mouse wheel you can zoom in or out and by dragging the mouse with the mouse wheel pressed you can change the displayed section of the board.
-
-
-
- The Select Menu State
- If on the upper left side in the tool bar the button Select is selected, the program will be in the Select Menu State. Here you can use the left mouse button as a shortcut for the action select item in the popup menu. You also can select all items in a rectangle by dragging the mouse with the left button pressed.
-
- back
-
- The Route Menu State
- If on the upper left side in the tool bar the button Route is selected, the program will be in the Route Menu State. Here you can use the left mouse button as a shortcut for the action start route in the popup menu.
-
- back
-
- The Drag Menu State
- If on the upper left side in the tool bar the button Drag is selected, the program will be in the Drag Menu State Here you can drag vias or components with the left button pressed. The connected traces will be adjusted automatically. You can also out of the empty space shove traces aside with the left button pressed This way you can for example make space for inserting another component. This action will be performed on the current layer, which can be set in the Select Parameter window.
-
- back
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/MoveItemState.html b/helpset/en/html_files/MoveItemState.html
deleted file mode 100644
index 0496eec3..00000000
--- a/helpset/en/html_files/MoveItemState.html
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
- Move-Zustand
-
-
-
- The Move State
You will get into this state after selecting in the popup menu of the Selected Item State the menu entry move. The selected items are now following the cursor. If parts of the moving items are marked red, inserting at the current location would cause a clearance violation.
- Several components can be moved at once. The internal route will also change location, if he is completely marked for moving. Components connected to items, which are not marked for moving, will not change location. Such components can eventually be moved in the Drag Menu State by dragging them with the left mouse button. If that does not work, you have to remove the route first.
- The settings in the Move Parameter window are evaluated while moving components.
- The entries in the popup menu under the left mouse button:
-
- turn
-
- Here you can rotate the selected components by multiples of 45 degree around the cursor location. For turning by 90, 180, and -90 degree there are the shortcuts +, * and - on the right of the number key block. If you want to rotate by an angle, which is not a multiple of 45 degree, you can do that with the mouse wheel after first changing in the Move Parameter window the wheel function from zoom to rotate.
-
- change side
-
- Here you can change the placement side of the selected components. Shortcut is /.
-
- reset rotation
-
- Here you can reset the rotation of the selected components, which you have changed with the mouse wheel, to 0 degree.
-
- insert
-
- To insert the moving components. If there would occur clearance violations, he insertion will be rejected. Shortcut is the left mouse button.
-
- cancel
-
- To cancel the move action. The selected components will spring back to their location before the moving. Shortcut is the Esc-key.
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/RouteState.html b/helpset/en/html_files/RouteState.html
deleted file mode 100644
index 08b4d5d6..00000000
--- a/helpset/en/html_files/RouteState.html
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
- Route-Zustand
-
-
-
- The Route States
After you have started a new route in a basic state, the IDE will change to the Dynamic Route State or to the Stitching Route State depending on your selection for the route mode in the Route Parameter window.
- If rule selection is set to automatic, the routing rules such as trace width, trace clearance class and via rule are defined by the net class of the current net, if it is set to manual, the routing rules are defined by the settings in the Manual Rules window.
- If the new trace gets near to a not yet connected item of the same net on the same layer, the connection will be completed automatically. After completion the IDE will return to the state before routing.
- back
- The Dynamic Route State
If the IDE is in this route state, at each change of the cursor location a piece of trace will be inserted automatically from the previous cursor location to the current cursor location. The new trace piece will then immediately be optimized depending on the settings for the pull tight region in the Route Parameter window. The entries in the popup menu under the left mouse button in the Dynamic Route state:
-
- change layer
-
- To change to a different layer. The corresponding via will be selected from the selected via rule in the following way. The vias in the via rules will be tried from top to bottom, if they contain the old and the new layer, and if inserting would be possible without clearance violations. The first via found in this way will be inserted. Shortcuts are the number keys 1-9 and the keys "+" and "-". With "+" you can change to the next bigger layer and with "-" to the next smaller layer.
-
- end route
-
- The routing will be finished and the IDE changes back to the previous state. Shortcut is the left mouse button.
-
- cancel route
-
- The last routed trace will be discarded and the IDE changes back to the previous state Shortcut is the Esc-key.
-
- generate snapshot
-
- The program generates a snapshot, so that the current situation can be restored later on with Undo. Otherwise you could only restore the situation before starting the last trace with Undo.
-
-
- back
- Der Stitching Route State
-
- In this route state a piece of trace will be inserted from the previous click position to the current cursor position, when you click the left mouse key. The new trace piece will then be optimized depending on the settings for the pull tight region in the Route Parameter window.
- The entries in the popup menu under the left mouse button in the Stitching Route state:
-
- insert
-
- A trace will be inserted from the previous insert position to the current position and then be optimized depending on the settings for the pull tight region in the Route Parameter window.
-
- done
-
- The program returns to the state before routing. Shortcut is the Esc-key.
-
- change layer
-
- To change to a different layer. The corresponding via will be selected from the selected via rule in the following way. The vias in the via rules will be tried from top to bottom, if they contain the old and the new layer, and if inserting would be possible without clearance violations. The first via found in this way will be inserted. Shortcuts are the number keys 1-9 and the keys "+" and "-". With "+" you can change to the next bigger layer and with "-" to the next smaller layer.
-
-
- back
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/SelectedItemState.html b/helpset/en/html_files/SelectedItemState.html
deleted file mode 100644
index b8af3c26..00000000
--- a/helpset/en/html_files/SelectedItemState.html
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
- Auswahl-Zustand
-
-
-
- The Selected Item State
After you have selected items in a basic state, the IDE will change to the Selected Item State. The selected items get highlighted and a new tool bar appears at the upper border. With the left button you can select more items or deselect already selected items. The toolbar in the Selected Item State
-
- Cancel
-
- The IDE returns to the interactive state before selecting. Shortcut is the Esc-key.
-
- Info
-
- Information about the selected items will be printed to a new window. The blue marked words in this window can be clicked for more information. Shortcut is i.
-
- Delete
-
- The selected items will be deleted, if they are not fixed. Shortcut is the Delete-key.
-
- Cutout
-
- By dragging the mouse with the left button pressed you can select a rectangle, from which the selected trace and vias will be cut out. Shortcut is d.
-
- Fix
-
- To fix the selected items, so that they cannot be pushed or deleted any more. Shortcut is f.
-
- Unfix
-
- To unfix the selected items. Shortcut is u.
-
- Autoroute
-
- To route the selected items automatically. Shortcut is a.
-
- Pull Tight
-
- To optimize the selected traces by pulling them tight. Shortcut is p.
-
- Fanout
-
- To autoroute the selected SMD-Pins until the next via.
-
- Clearance
-
- To assign a new clearance class to the selected items.
- Example: If you need in a special area of the board a different spacing, you can select all pins in a rectangle and assign to them a new clearance class.
-
- Nets
-
- To extend the selection to all items with the same net as an already selected item. Shortcut is n.
-
- Conn. Sets
-
- To extend the selection to all items, which belong to the same connected set as an already selected item. Shortcut is s.
-
- Connections
-
- To extend the selection to all traces and vias, which belong to the same connection as an already selected item. Shortcut is e.
- Example: You want to delete a whole connection. Select a trace of the connection, push the Connections button to extend the selection to the whole connection and push then the Delete button.
-
- Components
-
- To extend the selection to all items, which belong to the same component as an already selected item. Shortcut is b.
-
- Violations
-
- Here you can switch on or off displaying the clearance violations. If the violations were switched off before, they will be switched on and vice versa. Shortcut is v.
-
- Zoom Selection
-
- To display a rectangle containing all selected items.
-
-
- The popup menu below the left mouse button
-
- move
- The selected items will be prepared for moving. The pivot for rotating and moving is the current cursor position. Several components can be moved at once. After this action the IDE will be in the Move State.
-
- back
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/WindowAutorouteDetailParameter.html b/helpset/en/html_files/WindowAutorouteDetailParameter.html
deleted file mode 100644
index 8bd4e996..00000000
--- a/helpset/en/html_files/WindowAutorouteDetailParameter.html
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
- Detail Autoroute Parameter
-
-
-
- Detail Autoroute Parameter
Description of the window with the detailed autoroute parameter:Via costs:
-
-
-
To adjust the costs for vias in the autoroute algorithm. If you increase the value, the autorouter will try to insert less vias. If the value is to high, the autorouter may not be able to complete 100%.
-
-
- Start pass:
-
- To adjust the number of the first pass in the batch autorouter. The ripup-costs increase in passes with higher pass number.
-
- Ripup start costs:
-
- To define the ripup costs in the pass with number 1. The ripup costs in the pass with the number N are (N * (Ripup start costs)).
-
- Trace costs on layer:
-
- To adjust for each signal layer the costs for traces in and against the preferred direction.
-
- back
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/WindowAutorouteParameter.html b/helpset/en/html_files/WindowAutorouteParameter.html
deleted file mode 100644
index 5bfe5160..00000000
--- a/helpset/en/html_files/WindowAutorouteParameter.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
- Autoroute Parameter
-
-
-
- Autoroute Parameter
- Here you can define the layers which may be used by the autorouter, the preferred direction for traces on each layer, and if vias may be inserted by the autorouter.
-
- You can also define, if before autorouting a fanout pass and after autorouting a postroute pass for reducing the via count and the cumulative trace length should run.
- The postroute pass may take a very long time and can be stopped by clicking the left mouse button.
- In a fanout pass the connections will be routed only till the first via. That may be useful on boards with many layers and ball grid arrrays.
- The detail parameter button opens a window, where you can adjust the individual costs used in the autoroute algorithm.
- back
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/WindowClearanceMatrix.html b/helpset/en/html_files/WindowClearanceMatrix.html
deleted file mode 100644
index 30502f36..00000000
--- a/helpset/en/html_files/WindowClearanceMatrix.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
- Clearance-Matrix
-
-
-
- The Clearance Matrix
- In the window with the Clearance Matrix you can define the spacing rules between the object types. This is done via clearance classes. An Item clearance class is described by the definition of a minimal spacing to items of all existing clearance classes. These values can be looked up and changed in the Clearance Matrix
- Predefined are the clearance classes null and default. Items of the clearance class null have a minimal spacing of 0 to all other items. This value cannot be changed in the Clearance Matrix.
- In the Specctra-DSN-Format there exist only the hard coded clearance classes pin, smd, via, wire, area and testpoint. When reading the DSN-file at the program start the clearance classes of the host system will be taken over. The class wire will be renamed to default. The rest of the hard coded clearance classes will only be generated, if values for these classes are found in the DSN-file.
- To add a new clearance class
- Press the button Add Class and enter the name of the new class into the dialog field, which is popping up. The Clearance Matrix will be extended by a row and a column with the values for the new class. Change the predefined values in the new row according to your needs.
- To remove redundant clearance classes
By pushing the Trim Button you can remove classes as redundant, whose entries in the Clearance Matrix are exact equal to the entries of an other class. All items belonging to the deleted clearance class will then be assigned to this other clearance class. Layer dependent clearance classes
- In the layer field on top of the window you see the layers, for which the entries in the Clearance Matrix are valid. When all is selected in the combo box, the matrix entries are valid on all layers. If in this case layer dependent clearance values are defined for a special field, the value -1 is displayed, because it is not possible to output a value, which is valid on all layers. Analog if inner is selected in the combo box. You can view or edit a layer dependent clearance value after selecting the name of the layer of your choice in the layer combo box.
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/WindowDisplay.html b/helpset/en/html_files/WindowDisplay.html
deleted file mode 100644
index 5b3d5bdc..00000000
--- a/helpset/en/html_files/WindowDisplay.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
- Display-Einstellungen
-
-
-
- Display Settings
- Describes the windows with the display parameters
-
-
- Object Visibility
- With the sliders in this window you can adjust the intensity for displaying the single object types. If you push the slider for an object type is to the right, objects of this type will get displayed with full intensity, if you push it to the left, objects of this type will become invisible.
- Layer Visibility
-
- With the sliders in this window you can adjust the intensity for displaying objects on each layer individually. If you push a slider to the left, all objects on the corresponding layer will get invisible.
-
- Colors
-
- Here you can define the colors for displaying objects on the board by clicking the corresponding color field with the left button. For the object types in the upper table you can choose the color for each layer individually.
-
- Miscellaneous
-
- crosshair cursor
-
- Here you can change from the standard small crosshair cursor to a big 45-degree crosshair cursor. Using the big crosshair cursor may slow down the display performance a lot. Shortcut is the comma-key.
-
- board rotation
-
- To turn the board by multiples of 90 degree.
-
- board mirroring
-
- For horizontal or vertical mirroring of the board.
-
- automatic layer dimming
-
- With this slider you can increase the intensity of the items on the current layer. If you push the slider to the left, the automatic layer dimming will get switched off, if you push it to the right, all layers beside the current layer will become invisible.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/WindowManualRules.html b/helpset/en/html_files/WindowManualRules.html
deleted file mode 100644
index c1021d04..00000000
--- a/helpset/en/html_files/WindowManualRules.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
- Manuelle Regeln
-
-
-
- Manual Rules
- Window for the rules used in interactive routing when the route mode in the Route Parameter window is set to manual.
- via rule
-
-
- In this combo box you can choose the via rule which you want to use currently in interactive routing.
- trace clearance class:
-
- Use this combo box for selecting the clearance class which you want to use currently in interactive routing for traces.
- trace width:
-
- Here you can edit the trace width you want to use currently in interactive routing.
- on layer:
-
- Defines the layers, for which the trace width in the field above is valid. If all is selected in the combo box, the value in the trace width field is valid on all layers. If inner is selected, it is valid on all inner layers. Otherwise the value is valid only on the layer with the selected name in the combo box. The trace width field remains empty, if the trace width is layer dependent and all is selected in the combo box. Analog if inner is selected.
-
- back
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/WindowMoveParameter.html b/helpset/en/html_files/WindowMoveParameter.html
deleted file mode 100644
index 0fedfa34..00000000
--- a/helpset/en/html_files/WindowMoveParameter.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
- Plazierungs-Parameter
-
-
-
- Move Parameter
- The parameter in this window are used when moving components.
- Here you can define a horizontal and vertical component grid. The components will then snap while moving to coordinates, which are multiples of the chosen grid.
- You can also change the function of the mouse wheel from zooming to rotating. You will need this functionality, if you want to rotate components by angles, which are not multiples of 90 degree.
- back
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/WindowNetClasses.html b/helpset/en/html_files/WindowNetClasses.html
deleted file mode 100644
index b685169b..00000000
--- a/helpset/en/html_files/WindowNetClasses.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
- Netzklassen
-
-
-
- Net Classes
- A net class consists of a rule set, which is used by default when routing nets of this class. These rules can be edited in the table in the Net Classes window. The following is a description of the columns of this table.
- The net class table:
-
- name
-
- Contains the name of the net class, whose rules are described in the corresponding row.
-
- via rule
-
- In this combo box you can select the via rule you want to use when routing a net of this class.
-
- clearance class
-
- Combo box to select the clearance class for routing traces of nets of this class.
-
- trace width
-
- To define the trace width for new routed traces of nets of this class.
- You can set the value to 0 to disallow traces of this net class in automatic and interactive routing on the layers defined in the following field.
-
- on layer
-
- In this combo box you can select the layers for which the value in the trace width field is valid. If all is selected, the value is valid on all layers. If you select inner, the value is valid on all inner layers. Otherwise the value in the trace width field is only valid on the layer with the selected name. If the trace width of this net class is layer dependent and all is selected in this combo box, in the trace width field appears the value -1, because it is not possible to output a value which is valid on all layers.
-
- shove fixed
-
- If this field is selected, traces of this net class cannot be shoved or pulled tight while routing.
-
- cycles with areas
-
- Normally closed cycles created while routing will be removed automatically. If this field is selected, that will only happen, if no conduction areas are involved. In that way you can for example connect items several times to a copper area without the redundant connections being removed automatically.
-
- min. length
-
- Here you can define a minimal value for the cumulative trace length of the nets from this class. In interactive routing than appears an ellipse. If the actual trace length is smaller than allowed, the cursor will be on the outside of this ellipse. This software however has no good support for routing nets with minimal lengths. We suggest to switch the route mode in the Route Parameter window to stitching and to set the value in the pull tight region to 0 .
-
- max. length
-
- Here you can define a maximal value for the cumulative trace length of the nets from this class. In interactive routing than appears an elliptic ring. If the cursor is outside this ring when connecting a trace, the actual trace length is smaller than allowed.
-
-
- The buttons in the net class window:
-
- Add
-
- When you press the Add button, a new row with default values will be appended to the table. After changing the predefined name of the new class in the first column you can adjust the values in the other columns according to your needs.
-
- Remove
-
- After selecting a row in the table with the left button, you can delete the corresponding net class by pushing the Remove button. The deletion will be refused, if there are still nets assigned to this class.
-
- Assign
-
- After pushing this button a window with a table will appear, where you can assign to a each net in the first row a new class with the combo box in the second row.
-
- Select
-
- All items of all nets belonging to the selected net class will be highlighted on the board. The IDE then changes to the Selected Item State.
-
- Show Nets
-
- Displays a list with all nets contained in the selected classes.
-
- Filter Incompletes
-
- Only airlines of the open connections belonging to nets of the selected class will be displayed. This possibility is meant as an aid, if you want to route the nets of a certain class first.
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/WindowObjectList.html b/helpset/en/html_files/WindowObjectList.html
deleted file mode 100644
index 716a483d..00000000
--- a/helpset/en/html_files/WindowObjectList.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
- Die Objektlisten
-
-
-
- The Object Lists
- Here the windows with the object lists are documented, as they can be found in the Info menu of the menu bar.
- The objects in such a list can be selected with the left button. If you hold the Ctrl-key pressed you can select several objects at once. With pressed Shift-key you can choose all objects between the first and last selected object.
- The buttons in an object list window:
-
- Info
-
- Opens a text window with information about the selected objects. By clicking a blue marked word you can get more information about the corresponding object.
-
- Show
-
- Displays rectangle on the board containing the selected objects. The selected objects get highlighted and the IDE changes to the Selected Item State.
-
- Invert
-
- Selected objects will be deselected and vice versa.
-
- Recalculate
-
- The object list will be recalculated.
-
- Filter
-
- Were you can input a pattern in order to filter the objects in the list. After pushing the Recalculate button only the objects matching this pattern will be displayed.
-
-
- There are object lists for incomplete connections, length violations, clearance violations, library packages, library padstacks, board components and nets. The following contains a short description of these lists.
- The individual object lists:
-
-
- Library Packages
-
- All packages in the library will be output. After pushing the Show button you will see all components on the board containing the selected packages.
-
- Library Padstacks
-
- Outputs all padstacks in the library. After pushing the Show button you will see all pins and vias on the board using the selected padstack.
-
- Placed Components
-
- Outputs all components placed on the board. After pushing the Show button you will see the selected components on the board.
-
- Incompletes
-
- All open connections will be displayed. The entries contain the net name followed by component and pin name of both end items of the incomplete. If there are only a few open connections left on the board, you can find them easily by pushing the Show button.
-
- Length Violations
-
- Outputs the routed connections, which are shorter than the minimal allowed length or longer than the maximal allowed length. If the minimum length is violated, at the end points of the connection appears a circle containing a "-". If the maximum length is violated, at the end points of the connection appears a circle containing a "+". The size of such a circle corresponds to the size of the length violation.
-
- Clearance Violations
-
- Outputs the item pairs where the the minimal allowed spacing is violated. By pushing the Show button you can find the selected violations easily on the board.
-
- Unconnected Route
-
- Outputs the sets of electrically connected traces and vias without contact to a terminal item. By pushing the Show button you can find the selected unconnected items on the board. Then you can remove them by pushing the Delete button in the board toolbar.
-
- Route Stubs
-
- Outputs unsufficiantly connected traces and vias. By pushing the Show button you can find the selected stubs on the board. After that you can remove the whole connections containing the stubs by pushing first the Connections button and then the Delete button in the board toolbar.
-
- Nets
-
- All nets of the design will be output. This window contains two more buttons. With the Assign Class button you can assign a new net class to the selected nets. After pushing the Filter Incompletes button only the airlines of open connections belonging to a selected net will be displayed.
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/WindowRouteParameter.html b/helpset/en/html_files/WindowRouteParameter.html
deleted file mode 100644
index 9156e837..00000000
--- a/helpset/en/html_files/WindowRouteParameter.html
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
- Route Parameter
-
-
-
- Route Parameter
Description of the Route Parameter window. snap angle:
- 90 degree:
- Only orthogonal traces are created in interactive routing.
-
- 45 Grad:
-
- The angles of the traces created in interactive routing are restricted to multiples of 45 degree.
-
- none:
-
- There are no angle restrictions in interactive routing.
-
-
- route mode:
- dynamic:
- Trace will be inserted when the cursor position changes.
-
- stitching:
-
- Trace will be inserted after clicking the left button.
-
-
- rule selection:
- automatic:
- The routing rules are defined by the net class of the current net.
-
- manual:
-
- The routing rules are defined in the Manual Rules window. The window opens automatically after selecting manual.
-
-
- push and shove enabled
- To define, if foreign traces can be pushed aside in interactive routing.
- drag components enabled
- Here you can define, if components can be dragged with the left button pressed. The already routed connections of the component will be adjusted automatically.
- vias snap to the smd center
-
- Here you can define, if vias, for which attaching smd pins is allowed, should snap automatically to the pin center in this case.
- highlight routing obstacle
- If selected, the current routing obstacle will be highlighted.
- ignore conduction areas
- If selected, conduction areas of foreign nets will not be treated as obstacles. The host system can for example automatically create gaps for traces overlapping with such a conduction area.
- automatic neckdown
- When starting on pins or connecting to pins smaller than the current routing trace width, the trace width will be automatically reduced to the pin width, if connecting is not possible otherwise.
- restrict pin exit directions
- Here you can define, if connecting to rectangular pins is only allowed on the smaller sides.
- pad to turn gap
- To define the minimum distance from the pad border of a pin with exit restriction, where connecting traces are allowed to change direction.
- pull tight region
-
- To restrict the region around the cursor, where traces are pulled tight while routing. If the value is 0, the pull tight algorithm is switched off, if the value is 999, the pull tight region is unrestricted. Setting the value to 0 makes only sense in the stitching route mode.
- back
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/WindowSelectParameter.html b/helpset/en/html_files/WindowSelectParameter.html
deleted file mode 100644
index 3fe255b7..00000000
--- a/helpset/en/html_files/WindowSelectParameter.html
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
- Select-Einstellungen
-
-
-
- Select Parameter
- Description of the Select Parameter window.
- Selections Layers:
- all visible:
-
- Items are selected on all layers with visibility factor > 0 (see also Layer Visibility). Objects on the current layer are preferred.
-
- current only:
-
- Items can be selected only on the current layer.
-
-
- Selectable Items:
- To define the selectable item types.
- Current Layer:
-
- Here you can change the layer, which is used in interactive actions.
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/WindowSnapshots.html b/helpset/en/html_files/WindowSnapshots.html
deleted file mode 100644
index c853b091..00000000
--- a/helpset/en/html_files/WindowSnapshots.html
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
-
-
-
-
- Snapshots
-
-
-
- Snapshots
- In the Snapshot window the current interactive situation of the IDE can be saved for restoring it later on.
- Description of the buttons:
-
- Goto Selected Snapshot
-
- Restores the interactive situation, when the selected snapshot was saved. You can also double click a snapshot in the list instead.
- To avoid frequent changing between the main window and the Snapshots window, you can use the j-key instead. With the h-key you can select the previous snapshot and with the k-key the next snapshot.
-
- Create
-
- Here you can store current interactive situation after changing the predefined name.
-
- Remove Selected Snapshot
-
- Removes the selected snapshot from the list.
-
- Remove All Snapshots
-
- Removes all snapshots from the list.
-
- Snapshot Settings
-
- Opens a window with the Snapshot Settings. There you can deselect attributes, which you do not want to be saved in a snapshot.
-
-
- Description of the fields in the Snapshot Settings window:
-
- object colors
-
- The current color settings of the object types will be saved in the snapshots.
-
- object visibility
-
- The current color intensity of the single object types will be saved.
-
- layer visibility
-
- The current intensity for displaying objects on the individual layers is saved.
-
- display region
-
- The currently displayed region of the board will be saved.
-
- interactive state
-
- In the snapshots will be saved, if the IDE is currently in the Select- Route- or Drag-State.
-
- selection layers
-
- In the snapshots will be saved, if in the Select Parameter window selection layers is set to all visible or to current only.
-
- selectable items
-
- The settings for the Selectable Items in the Select Parameter window will be saved in the snapshots.
-
- current layer
-
- The Current Layer in the Select Parameter window will be saved.
-
- rule selection
-
- In the snapshots will be saved, if in the Route Parameter Window the rule selection is set to automatic or to manual.
-
- manual rule settings
-
- The settings in the Manual Rules window will be saved.
-
- push&shove enabled
-
- In the snapshots will be saved, if in the Route Parameter push&shove enabled is selected.
-
- drag components enabled
-
- In the snapshots will be saved, if in the Route Parameter drag components enabled is selected.
-
- pull tight region
-
- The value for the pull tight region in the Route Parameter window will be saved.
-
- component grid
-
- The value for the component grid in the Move Parameter window will be saved.
-
- info list selections
-
- The selected indices and the filter strings in the windows for Incompletes, Library Packages, Library Padstacks, Placed Components and Nets will be saved.
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/html_files/WindowVia.html b/helpset/en/html_files/WindowVia.html
deleted file mode 100644
index bff2922a..00000000
--- a/helpset/en/html_files/WindowVia.html
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
- Via-Regeln
-
-
-
- The Via Rules
- A via rule consists of a ordered set of vias, which is used in the routing . If a layer is changed while routing and several vias would contain the previous and the next layer and would cause no clearance violations, vias earlier in the rule will be preferred to vias later on in the rule.
- Vias
- A via consists of a name, a via padstack, a clearance class and a switch, if attaching smd-pins of the same net is allowed or not.
- Via Padstacks
- A via padstack consists of a begin layer and an end layer and of a circle shape on each layer between the begin and the end layer.
- The following is a description of the window with the via rules.
- Available Via Padstacks
Here you see the three buttons Info, Create and Remove.
- After pushing the Info button a list with all available via padstacks will be displayed.
- With the Create Button you can create a new via padstack. You you will be asked to provide the name of the new via padstack, the start and the end layer, and the default radius of the circle shape. In the following input window you can adjust this radius on each single layer, if you want the shapes of the new via padstack to be layer dependent
- With the Remove button you can delete an existing via padstack in the database. The deletion will be refused, if the padstack is still used in a via definition or somewhere else.
- Available Vias
Description of the buttons:
- Info
-
- Outputs a list of all vias available for routing.
-
- Edit
-
- If you push this button, a window with a table for editing the vias will appear. Here you can adjust the name, the padstack, the clearance class and the attach smd property of the via according to your needs. Below this window are two buttons for adding new vias or removing existing vias.
-
-
- Via Rules
Below the Via Rules label is a window with a list of the names of all existing via rules. The following is a description of the four buttons at the lower border.
- Info
-
- After selecting a via rule with the left button, you can output the rule with Info to a new window. In routing the vias earlier in the list in this window are preferred to vias later on in the list
-
- Create
-
- If you push the Create button you will be asks for the name of the new via rule. After you have provided this name, a new empty via rule with the new name will be appended to the list above. Select the new rule with the left button and push the Edit to insert vias into the new rule.
-
- Edit
-
- After selecting a via rule with the left mouse button and pushing Edit, a new window appears where you can change the selected via rule. For a detailed description see Edit Via Rule below.
-
- Remove
-
- To delete the selected via rule.
-
-
- Edit Via Rule
-
- After selecting a via rule for editing, a new window appears with a list of all vias contained in the selected rule. In routing the vias earlier in this list are preferred to vias later on in the list. The following is a description of the buttons in this new window.
- Append
-
- A window with a combo box with all available vias not yet contained in the rule appears. After you have selected a via and pushed the OK button, the selected via will be appended to the end of the list..
-
- Remove
-
- After selecting a via with the left mouse button you can remove it from the via rule by pushing the Remove button.
-
- Move Up
-
- After selecting a via with the left mouse button you can exchange its position with the previous via in the list by pushing the Move Up button. That increases the priority of the selected via. In routing vias earlier in the list are preferred to vias later on in the list.
-
- Move Down
-
- After selecting a via with the left mouse button you can exchange its position with the next via in the list by pushing the Move Down button. That decreases the priority of the selected via. In routing vias earlier in the list are preferred to vias later on in the list.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/helpset/en/index.html b/helpset/en/index.html
deleted file mode 100644
index cddcef0d..00000000
--- a/helpset/en/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
- Bedienungsanleitung
-
-
-
- Using the IDE Help System
- The Contents Tab
- The Contents tab contains the three folders MenuBar, Interactive States and Windows. In the Menu Bar folder you find help about the entries in the Pull Down Menus. The folder Interactive States contains help for the possible states of the program in interactive action. In the folder Windows you can get help about the contents of the additional windows of the IDE.Getting Help for IDE Windows and Interactive States
After selecting Help Context in the help menu a question mark appears on the right side of the cursor. In this state push the left button in the graphics area of the main window to open a help topic that is specific to the task you are currrently doing or in an additional window to get help about the contents of that specific window. In the offline version you can use the F1-key as a shortcut for Help Context.Searching the Online Help
- To perform a full-text search of all IDE help topics, click the Search tab and type a keyword in the Find text box.
- Using the Index
- Click any entry in the Index tab to view the topic. To search the index, enter a term in the search field and press Enter. Press Enter multiple times to cycle through all occurrences of the term in the index.
-
-
-
-
\ No newline at end of file
diff --git a/interactive/ClearanceViolations.java b/interactive/ClearanceViolations.java
deleted file mode 100644
index 8fe90d6f..00000000
--- a/interactive/ClearanceViolations.java
+++ /dev/null
@@ -1,74 +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.
- *
- * ClearanceViolations.java
- *
- * Created on 3. Oktober 2004, 09:13
- */
-
-package interactive;
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.Iterator;
-
-
-import java.awt.Graphics;
-
-import boardgraphics.GraphicsContext;
-
-import board.Item;
-import board.ClearanceViolation;
-
-/**
- * To display the clearance violations between items on the screen.
- *
- * @author alfons
- */
-public class ClearanceViolations
-{
-
- /** Creates a new instance of ClearanceViolations */
- public ClearanceViolations(Collection- p_item_list)
- {
- this.list = new LinkedList();
- Iterator
- it = p_item_list.iterator();
- while (it.hasNext())
- {
- Item curr_item = it.next();
- this.list.addAll(curr_item.clearance_violations());
- }
- }
-
- public void draw(Graphics p_graphics, GraphicsContext p_graphics_context)
- {
- java.awt.Color draw_color = p_graphics_context.get_violations_color();
- Iterator it = list.iterator();
- while (it.hasNext())
- {
- ClearanceViolation curr_violation = it.next();
- double intensity = p_graphics_context.get_layer_visibility(curr_violation.layer);
- p_graphics_context.fill_area(curr_violation.shape, p_graphics, draw_color, intensity);
- // draw a circle around the violation.
- double draw_radius = curr_violation.first_item.board.rules.get_min_trace_half_width() * 5;
- p_graphics_context.draw_circle(curr_violation.shape.centre_of_gravity(), draw_radius, 0.1 * draw_radius, draw_color,
- p_graphics, intensity);
- }
- }
-
-
- /** The list of clearance violations. */
- public final Collection list;
-}
diff --git a/interactive/LogfileScanner.java b/interactive/LogfileScanner.java
deleted file mode 100644
index 9b9d9015..00000000
--- a/interactive/LogfileScanner.java
+++ /dev/null
@@ -1,542 +0,0 @@
-/* The following code was generated by JFlex 1.4 on 06.07.05 18:12 */
-
-package interactive;
-@SuppressWarnings("all")
-
-/**
- * This class is a scanner generated by
- * JFlex 1.4
- * on 06.07.05 18:12 from the specification file
- * C:/Dokumente und Einstellungen/alfons/Eigene Dateien/freeroute/interactive/LogfileDescription.flex
- */
-class LogfileScanner {
-
- /** 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 YYINITIAL = 0;
-
- /**
- * Translates characters to character classes
- */
- private static final String ZZ_CMAP_PACKED =
- "\11\0\1\3\1\2\1\0\1\3\1\1\22\0\1\3\2\0\1\6"+
- "\1\7\5\0\1\5\1\14\1\0\1\12\1\11\1\4\1\13\11\10"+
- "\7\0\32\7\4\0\1\7\1\0\32\7\uff85\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 =
- "\1\0\1\1\2\2\3\3\1\4\1\1\1\4\1\1"+
- "\3\0\1\5\2\0\1\5\1\0";
-
- private static int [] zzUnpackAction() {
- int [] result = new int[19];
- 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\15\0\32\0\15\0\47\0\64\0\101\0\116"+
- "\0\133\0\150\0\165\0\202\0\217\0\234\0\150\0\251"+
- "\0\266\0\234\0\303";
-
- private static int [] zzUnpackRowMap() {
- int [] result = new int[19];
- 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\2\1\3\2\4\1\5\1\2\1\6\1\7\1\10"+
- "\1\7\1\11\1\12\1\13\17\0\1\4\16\0\1\7"+
- "\1\14\4\7\1\0\1\7\1\0\1\15\1\3\1\4"+
- "\1\15\1\6\1\15\4\6\1\15\1\6\1\15\4\0"+
- "\1\7\1\0\4\7\1\0\1\7\11\0\1\10\1\16"+
- "\1\0\1\10\11\0\1\10\2\0\1\12\11\0\1\17"+
- "\1\16\1\0\1\17\11\0\1\17\2\0\1\17\1\0"+
- "\5\20\1\21\7\20\1\15\1\3\1\4\12\15\10\0"+
- "\1\22\2\0\1\22\1\0\5\20\1\23\7\20\4\0"+
- "\1\4\1\21\7\0\4\20\1\4\1\23\7\20";
-
- private static int [] zzUnpackTrans() {
- int [] result = new int[208];
- 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 =
- "\1\0\1\11\1\1\1\11\7\1\3\0\1\1\2\0"+
- "\1\1\1\0";
-
- private static int [] zzUnpackAttribute() {
- int [] result = new int[19];
- 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;
-
-
- /**
- * 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.
- */
- LogfileScanner(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.
- */
- LogfileScanner(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 < 54) {
- 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 3:
- { return yytext();
- }
- case 6: break;
- case 4:
- { return new Integer(yytext());
- }
- case 7: break;
- case 2:
- { /* ignore */
- }
- case 8: break;
- case 5:
- { return new Double(yytext());
- }
- case 9: break;
- case 1:
- { throw new Error("Illegal character <"+
- yytext()+">");
- }
- case 10: break;
- default:
- if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
- zzAtEOF = true;
- return null;
- }
- else {
- zzScanError(ZZ_NO_MATCH);
- }
- }
- }
- }
-
-
-}
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 00000000..76079104
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,81 @@
+
+ 4.0.0
+
+ net.freerouting
+ freerouting
+ 1.0-SNAPSHOT
+ jar
+
+ freerouting
+ http://maven.apache.org
+
+
+ UTF-8
+
+
+
+
+ junit
+ junit
+ 3.8.1
+ test
+
+
+ javax.help
+ javahelp
+ 2.0.05
+
+
+
+
+
+ maven-assembly-plugin
+ 2.5.3
+
+
+ jar-with-dependencies
+
+
+
+ net.freerouting.gui.MainApplication
+
+
+
+
+
+
+ make-assembly
+
+ package
+
+
+ single
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ 2.16
+
+
+ validate
+ validate
+
+
+ UTF-8
+ true
+ false
+ false
+
+
+ check
+
+
+
+
+
+
+
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 00000000..e63cad7c
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,19 @@
+/*
+ * This settings file was auto generated by the Gradle buildInit task
+ * by 'Anand.Tamariya' at '5/31/15 6:50 PM' with Gradle 2.2.1
+ *
+ * The settings file is used to specify which projects to include in your build.
+ * In a single project build this file can be empty or even removed.
+ *
+ * Detailed information about configuring a multi-project build in Gradle can be found
+ * in the user guide at http://gradle.org/docs/2.2.1/userguide/multi_project_builds.html
+ */
+
+/*
+// To declare projects as part of a multi-project build use the 'include' method
+include 'shared'
+include 'api'
+include 'services:webservice'
+*/
+
+rootProject.name = 'FreeRouting'
diff --git a/autoroute/AutorouteControl.java b/src/main/java/net/freerouting/autoroute/AutorouteControl.java
similarity index 61%
rename from autoroute/AutorouteControl.java
rename to src/main/java/net/freerouting/autoroute/AutorouteControl.java
index d9f96111..297452d7 100644
--- a/autoroute/AutorouteControl.java
+++ b/src/main/java/net/freerouting/autoroute/AutorouteControl.java
@@ -17,41 +17,139 @@
*
* Created on 25. Januar 2004, 09:38
*/
-package autoroute;
+package net.freerouting.autoroute;
-import geometry.planar.ConvexShape;
-
-import rules.ViaInfo;
-import rules.ViaRule;
-
-import board.RoutingBoard;
+import net.freerouting.board.RoutingBoard;
+import net.freerouting.geometry.planar.ConvexShape;
+import net.freerouting.rules.ViaInfo;
+import net.freerouting.rules.ViaRule;
/**
* Structure for controlling the autoroute algorithm.
*
- * @author Alfons Wirtz
+ * @author Alfons Wirtz
*/
-public class AutorouteControl
-{
+public class AutorouteControl {
- /** Creates a new instance of AutorouteControl for the input net */
- public AutorouteControl(RoutingBoard p_board, int p_net_no, interactive.Settings p_settings)
- {
+ /**
+ * The horizontal and vertical trace costs on each layer
+ */
+ public final ExpansionCostFactor[] trace_costs;
+ public final boolean with_neckdown;
+ final int layer_count;
+ /**
+ * Defines for each layer, if it may used for routing.
+ */
+ final boolean[] layer_active;
+ /**
+ * The currently used trace half widths in the autoroute algorithm on each layer
+ */
+ final int[] trace_half_width;
+ /**
+ * The currently used compensated trace half widths in the autoroute algorithm on each layer.
+ * Equal to trace_half_width if no clearance compensation is used.
+ */
+ final int[] compensated_trace_half_width;
+ final double[] via_radius_arr;
+ /**
+ * the additiomal costs to min_normal via_cost for inserting a via between 2 layers
+ */
+ final ViaCost[] add_via_costs;
+ /**
+ * The currently used clearance class for traces in the autoroute algorithm
+ */
+ public int trace_clearance_class_no;
+ /**
+ * True, if layer change by inserting of vias is allowed
+ */
+ public boolean vias_allowed;
+ /**
+ * True, if vias may drill to the pad of SMD pins
+ */
+ public boolean attach_smd_allowed;
+ /**
+ * The minimum cost valua of all normal vias
+ */
+ public double min_normal_via_cost;
+ public boolean ripup_allowed;
+ public int ripup_costs;
+ public int ripup_pass_no;
+ /**
+ * If true, the autoroute algorithm completes after the first drill
+ */
+ public boolean is_fanout;
+ /**
+ * Normally true, if the autorouter contains no fanout pass
+ */
+ public boolean remove_unconnected_vias;
+ /**
+ * The currently used net number in the autoroute algorithm
+ */
+ int net_no;
+ /**
+ * The currently used clearance class for vias in the autoroute algorithm
+ */
+ int via_clearance_class;
+ /**
+ * The possible (partial) vias, which can be used by the autorouter
+ */
+ ViaRule via_rule;
+ /**
+ * The array of possible via ranges used bei the autorouter
+ */
+ ViaMask[] via_info_arr;
+ /**
+ * The lower bound for the first layer of vias
+ */
+ int via_lower_bound;
+ /**
+ * The upper bound for the last layer of vias
+ */
+ int via_upper_bound;
+ double max_via_radius;
+ /**
+ * The width of the region around changed traces, where traces are pulled tight
+ */
+ int tidy_region_width;
+ /**
+ * The pull tight accuracy of traces
+ */
+ int pull_tight_accuracy;
+ /**
+ * The maximum recursion depth for shoving traces
+ */
+ int max_shove_trace_recursion_depth;
+ /**
+ * The maximum recursion depth for shoving obstacles
+ */
+ int max_shove_via_recursion_depth;
+ /**
+ * The maximum recursion depth for traces springing over obstacles
+ */
+ int max_spring_over_recursion_depth;
+ /**
+ * The minimal cost value of all cheap vias
+ */
+ double min_cheap_via_cost;
+ /**
+ * Creates a new instance of AutorouteControl for the input net
+ */
+ public AutorouteControl(RoutingBoard p_board, int p_net_no, net.freerouting.interactive.Settings p_settings) {
this(p_board, p_settings, p_settings.autoroute_settings.get_trace_cost_arr());
init_net(p_net_no, p_board, p_settings.autoroute_settings.get_via_costs());
}
-
- /** Creates a new instance of AutorouteControl for the input net */
- public AutorouteControl(RoutingBoard p_board, int p_net_no, interactive.Settings p_settings, int p_via_costs, ExpansionCostFactor[] p_trace_cost_arr)
- {
+ /**
+ * Creates a new instance of AutorouteControl for the input net
+ */
+ public AutorouteControl(RoutingBoard p_board, int p_net_no, net.freerouting.interactive.Settings p_settings, int p_via_costs, ExpansionCostFactor[] p_trace_cost_arr) {
this(p_board, p_settings, p_trace_cost_arr);
init_net(p_net_no, p_board, p_via_costs);
}
-
- /** Creates a new instance of AutorouteControl */
- private AutorouteControl(RoutingBoard p_board, interactive.Settings p_settings,
- ExpansionCostFactor[] p_trace_costs_arr)
- {
+ /**
+ * Creates a new instance of AutorouteControl
+ */
+ private AutorouteControl(RoutingBoard p_board, net.freerouting.interactive.Settings p_settings,
+ ExpansionCostFactor[] p_trace_costs_arr) {
layer_count = p_board.get_layer_count();
trace_half_width = new int[layer_count];
compensated_trace_half_width = new int[layer_count];
@@ -60,8 +158,7 @@ private AutorouteControl(RoutingBoard p_board, interactive.Settings p_settings,
via_radius_arr = new double[layer_count];
add_via_costs = new ViaCost[layer_count];
- for (int i = 0; i < layer_count; ++i)
- {
+ for (int i = 0; i < layer_count; ++i) {
add_via_costs[i] = new ViaCost(layer_count);
layer_active[i] = p_settings.autoroute_settings.get_layer_active(i);
}
@@ -73,10 +170,8 @@ private AutorouteControl(RoutingBoard p_board, interactive.Settings p_settings,
max_shove_trace_recursion_depth = 20;
max_shove_via_recursion_depth = 5;
max_spring_over_recursion_depth = 5;
- for (int i = 0; i < layer_count; ++i)
- {
- for (int j = 0; j < layer_count; ++j)
- {
+ for (int i = 0; i < layer_count; ++i) {
+ for (int j = 0; j < layer_count; ++j) {
add_via_costs[i].to_layer[j] = 0;
}
}
@@ -90,76 +185,57 @@ private AutorouteControl(RoutingBoard p_board, interactive.Settings p_settings,
ripup_pass_no = 1;
}
- private void init_net(int p_net_no, RoutingBoard p_board, int p_via_costs)
- {
+ private void init_net(int p_net_no, RoutingBoard p_board, int p_via_costs) {
net_no = p_net_no;
- rules.Net curr_net = p_board.rules.nets.get(p_net_no);
- rules.NetClass curr_net_class;
- if (curr_net != null)
- {
+ net.freerouting.rules.Net curr_net = p_board.rules.nets.get(p_net_no);
+ net.freerouting.rules.NetClass curr_net_class;
+ if (curr_net != null) {
curr_net_class = curr_net.get_class();
trace_clearance_class_no = curr_net_class.get_trace_clearance_class();
via_rule = curr_net_class.get_via_rule();
- }
- else
- {
+ } else {
trace_clearance_class_no = 1;
via_rule = p_board.rules.via_rules.firstElement();
curr_net_class = null;
}
- for (int i = 0; i < layer_count; ++i)
- {
- if (net_no > 0)
- {
+ for (int i = 0; i < layer_count; ++i) {
+ if (net_no > 0) {
trace_half_width[i] = p_board.rules.get_trace_half_width(net_no, i);
- }
- else
- {
+ } else {
trace_half_width[i] = p_board.rules.get_trace_half_width(1, i);
}
compensated_trace_half_width[i] = trace_half_width[i] + p_board.rules.clearance_matrix.clearance_compensation_value(trace_clearance_class_no, i);
- if (curr_net_class != null && !curr_net_class.is_active_routing_layer(i))
- {
+ if (curr_net_class != null && !curr_net_class.is_active_routing_layer(i)) {
layer_active[i] = false;
}
}
- if (via_rule.via_count() > 0)
- {
+ if (via_rule.via_count() > 0) {
this.via_clearance_class = via_rule.get_via(0).get_clearance_class();
- }
- else
- {
+ } else {
this.via_clearance_class = 1;
}
this.via_info_arr = new ViaMask[via_rule.via_count()];
- for (int i = 0; i < via_rule.via_count(); ++i)
- {
+ for (int i = 0; i < via_rule.via_count(); ++i) {
ViaInfo curr_via = via_rule.get_via(i);
- if (curr_via.attach_smd_allowed())
- {
+ if (curr_via.attach_smd_allowed()) {
this.attach_smd_allowed = true;
}
- library.Padstack curr_via_padstack = curr_via.get_padstack();
+ net.freerouting.library.Padstack curr_via_padstack = curr_via.get_padstack();
int from_layer = curr_via_padstack.from_layer();
int to_layer = curr_via_padstack.to_layer();
- for (int j = from_layer; j <= to_layer; ++j)
- {
+ for (int j = from_layer; j <= to_layer; ++j) {
ConvexShape curr_shape = curr_via_padstack.get_shape(j);
double curr_radius;
- if( curr_shape != null)
- {
- curr_radius = 0.5 * curr_shape.max_width();
- }
- else
- {
+ if (curr_shape != null) {
+ curr_radius = 0.5 * curr_shape.max_width();
+ } else {
curr_radius = 0;
}
this.via_radius_arr[j] = Math.max(this.via_radius_arr[j], curr_radius);
}
via_info_arr[i] = new ViaMask(from_layer, to_layer, curr_via.attach_smd_allowed());
}
- for (int j = 0; j < this.layer_count; ++j)
- {
+ for (int j = 0; j < this.layer_count; ++j) {
this.via_radius_arr[j] = Math.max(this.via_radius_arr[j], trace_half_width[j]);
this.max_via_radius = Math.max(this.max_via_radius, this.via_radius_arr[j]);
}
@@ -168,102 +244,47 @@ private void init_net(int p_net_no, RoutingBoard p_board, int p_via_costs)
min_normal_via_cost = p_via_costs * via_cost_factor;
min_cheap_via_cost = 0.8 * min_normal_via_cost;
}
- final int layer_count;
- /** The horizontal and vertical trace costs on each layer */
- public final ExpansionCostFactor[] trace_costs;
- /** Defines for each layer, if it may used for routing. */
- final boolean[] layer_active;
- /** The currently used net number in the autoroute algorithm */
- int net_no;
- /** The currently used trace half widths in the autoroute algorithm on each layer */
- final int[] trace_half_width;
- /**
- * The currently used compensated trace half widths in the autoroute algorithm on each layer.
- * Equal to trace_half_width if no clearance compensation is used.
- */
- final int[] compensated_trace_half_width;
- /** The currently used clearance class for traces in the autoroute algorithm */
- public int trace_clearance_class_no;
- /** The currently used clearance class for vias in the autoroute algorithm */
- int via_clearance_class;
- /** The possible (partial) vias, which can be used by the autorouter */
- ViaRule via_rule;
- /** The array of possible via ranges used bei the autorouter */
- ViaMask[] via_info_arr;
- /** The lower bound for the first layer of vias */
- int via_lower_bound;
- /** The upper bound for the last layer of vias */
- int via_upper_bound;
- final double[] via_radius_arr;
- double max_via_radius;
- /** The width of the region around changed traces, where traces are pulled tight */
- int tidy_region_width;
- /** The pull tight accuracy of traces*/
- int pull_tight_accuracy;
- /** The maximum recursion depth for shoving traces */
- int max_shove_trace_recursion_depth;
- /** The maximum recursion depth for shoving obstacles */
- int max_shove_via_recursion_depth;
- /** The maximum recursion depth for traces springing over obstacles */
- int max_spring_over_recursion_depth;
- /** True, if layer change by inserting of vias is allowed */
- public boolean vias_allowed;
- /** True, if vias may drill to the pad of SMD pins */
- public boolean attach_smd_allowed;
- /** the additiomal costs to min_normal via_cost for inserting a via between 2 layers */
- final ViaCost[] add_via_costs;
- /** The minimum cost valua of all normal vias */
- public double min_normal_via_cost;
- /** The minimal cost value of all cheap vias */
- double min_cheap_via_cost;
- public boolean ripup_allowed;
- public int ripup_costs;
- public int ripup_pass_no;
- public final boolean with_neckdown;
- /** If true, the autoroute algorithm completes after the first drill */
- public boolean is_fanout;
+
/**
- * Normally true, if the autorouter contains no fanout pass
+ * horizontal and vertical costs for traces on a board layer
*/
- public boolean remove_unconnected_vias;
-
- /** horizontal and vertical costs for traces on a board layer */
- public static class ExpansionCostFactor
- {
+ public static class ExpansionCostFactor {
- public ExpansionCostFactor(double p_horizontal, double p_vertical)
- {
+ /**
+ * The horizontal expansion cost factor on a layer of the board
+ */
+ public final double horizontal;
+ /**
+ * The verical expansion cost factor on a layer of the board
+ */
+ public final double vertical;
+ public ExpansionCostFactor(double p_horizontal, double p_vertical) {
horizontal = p_horizontal;
vertical = p_vertical;
}
- /** The horizontal expansion cost factor on a layer of the board */
- public final double horizontal;
- /** The verical expansion cost factor on a layer of the board */
- public final double vertical;
}
- /** Array of via costs from one layer to the other layers */
- static class ViaCost
- {
+ /**
+ * Array of via costs from one layer to the other layers
+ */
+ static class ViaCost {
- private ViaCost(int p_layer_count)
- {
+ public int[] to_layer;
+
+ private ViaCost(int p_layer_count) {
to_layer = new int[p_layer_count];
}
- public int[] to_layer;
}
- static class ViaMask
- {
+ static class ViaMask {
- ViaMask(int p_from_layer, int p_to_layer, boolean p_attach_smd_allowed)
- {
+ final int from_layer;
+ final int to_layer;
+ final boolean attach_smd_allowed;
+ ViaMask(int p_from_layer, int p_to_layer, boolean p_attach_smd_allowed) {
from_layer = p_from_layer;
to_layer = p_to_layer;
attach_smd_allowed = p_attach_smd_allowed;
}
- final int from_layer;
- final int to_layer;
- final boolean attach_smd_allowed;
}
}
diff --git a/autoroute/AutorouteEngine.java b/src/main/java/net/freerouting/autoroute/AutorouteEngine.java
similarity index 74%
rename from autoroute/AutorouteEngine.java
rename to src/main/java/net/freerouting/autoroute/AutorouteEngine.java
index 7b305ad3..b2417c39 100644
--- a/autoroute/AutorouteEngine.java
+++ b/src/main/java/net/freerouting/autoroute/AutorouteEngine.java
@@ -17,46 +17,74 @@
*
* Created on 11. Januar 2004, 11:14
*/
-package autoroute;
-
-import geometry.planar.Line;
-import geometry.planar.Simplex;
-import geometry.planar.TileShape;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.TreeSet;
-import java.util.Set;
-import java.util.SortedSet;
-
-import datastructures.Stoppable;
-import datastructures.TimeLimit;
-
-import board.SearchTreeObject;
-import board.Item;
-import board.RoutingBoard;
-import board.ShapeSearchTree;
-import board.ShapeSearchTree90Degree;
-import board.ShapeSearchTree45Degree;
-import board.TestLevel;
+package net.freerouting.autoroute;
+
+import net.freerouting.board.*;
+import net.freerouting.datastructures.Stoppable;
+import net.freerouting.datastructures.TimeLimit;
+import net.freerouting.geometry.planar.Line;
+import net.freerouting.geometry.planar.Simplex;
+import net.freerouting.geometry.planar.TileShape;
+
+import java.util.*;
/**
* Temporary autoroute data stored on the RoutingBoard.
*
- * @author Alfons Wirtz
+ * @author Alfons Wirtz
*/
-public class AutorouteEngine
-{
+public class AutorouteEngine {
+
+ static final int TRACE_WIDTH_TOLERANCE = 2;
+ /**
+ * The current search tree used in autorouting.
+ * It depends on the trac clearance class used in the autoroute algorithm.
+ */
+ public final ShapeSearchTree autoroute_search_tree;
+ /**
+ * If maintain_database, the autorouter database is maintained after a connection is
+ * completed for performance reasons.
+ */
+ public final boolean maintain_database;
+ /**
+ * The 2-dimensional array of rectangular pages of ExpansionDrills
+ */
+ final DrillPageArray drill_page_array;
+ /**
+ * The PCB-board of this autoroute algorithm.
+ */
+ final RoutingBoard board;
+ /**
+ * To be able to stop the expansion algorithm.
+ */
+ Stoppable stoppable_thread;
+ /**
+ * The net number used for routing in this autoroute algorithm.
+ */
+ private int net_no;
+ /**
+ * To stop the expansion algorithm after a time limit is exceeded.
+ */
+ private TimeLimit time_limit;
+ /**
+ * The list of incomplete expansion rooms on the routing board
+ */
+ private List incomplete_expansion_rooms = null;
+ /**
+ * The list of complete expansion rooms on the routing board
+ */
+ private List complete_expansion_rooms = null;
+ /**
+ * The count of expansion rooms created so far
+ */
+ private int expansion_room_instance_count = 0;
/**
* Creates a new instance of BoardAoutorouteEngine
* If p_maintain_database, the autorouter database is maintained after a connection is
* completed for performance reasons.
*/
- public AutorouteEngine(RoutingBoard p_board, int p_trace_clearance_class_no, boolean p_maintain_database)
- {
+ public AutorouteEngine(RoutingBoard p_board, int p_trace_clearance_class_no, boolean p_maintain_database) {
this.board = p_board;
this.maintain_database = p_maintain_database;
this.net_no = -1;
@@ -67,34 +95,25 @@ public AutorouteEngine(RoutingBoard p_board, int p_trace_clearance_class_no, boo
this.stoppable_thread = null;
}
- public void init_connection(int p_net_no, Stoppable p_stoppable_thread, TimeLimit p_time_limit)
- {
- if (this.maintain_database)
- {
- if (p_net_no != this.net_no)
- {
- if (this.complete_expansion_rooms != null)
- {
+ public void init_connection(int p_net_no, Stoppable p_stoppable_thread, TimeLimit p_time_limit) {
+ if (this.maintain_database) {
+ if (p_net_no != this.net_no) {
+ if (this.complete_expansion_rooms != null) {
// invalidate the net dependent complete free space expansion rooms.
Collection rooms_to_remove = new LinkedList();
- for (CompleteFreeSpaceExpansionRoom curr_room : complete_expansion_rooms)
- {
- if (curr_room.is_net_dependent())
- {
+ for (CompleteFreeSpaceExpansionRoom curr_room : complete_expansion_rooms) {
+ if (curr_room.is_net_dependent()) {
rooms_to_remove.add(curr_room);
}
}
- for (CompleteFreeSpaceExpansionRoom curr_room : rooms_to_remove)
- {
+ for (CompleteFreeSpaceExpansionRoom curr_room : rooms_to_remove) {
this.remove_complete_expansion_room(curr_room);
}
}
// invalidate the neighbour rooms of the items of p_net_no
Collection- item_list = this.board.get_items();
- for (Item curr_item : item_list)
- {
- if (curr_item.contains_net(p_net_no))
- {
+ for (Item curr_item : item_list) {
+ if (curr_item.contains_net(p_net_no)) {
this.board.additional_update_after_change(curr_item);
}
}
@@ -109,58 +128,43 @@ public void init_connection(int p_net_no, Stoppable p_stoppable_thread, TimeLimi
* Returns ALREADY_CONNECTED, ROUTED, NOT_ROUTED, or INSERT_ERROR.
*/
public AutorouteResult autoroute_connection(Set
- p_start_set, Set
- p_dest_set,
- AutorouteControl p_ctrl, SortedSet
- p_ripped_item_list)
- {
+ AutorouteControl p_ctrl, SortedSet
- p_ripped_item_list) {
MazeSearchAlgo maze_search_algo;
- try
- {
+ try {
maze_search_algo = MazeSearchAlgo.get_instance(p_start_set, p_dest_set, this, p_ctrl);
- } catch (Exception e)
- {
+ } catch (Exception e) {
System.out.println("AutorouteEngine.autoroute_connection: Exception in MazeSearchAlgo.get_instance");
System.out.println(e);
maze_search_algo = null;
}
MazeSearchAlgo.Result search_result = null;
- if (maze_search_algo != null)
- {
- try
- {
+ if (maze_search_algo != null) {
+ try {
search_result = maze_search_algo.find_connection();
- } catch (Exception e)
- {
+ } catch (Exception e) {
System.out.println("AutorouteEngine.autoroute_connection: Exception in maze_search_algo.find_connection");
}
}
LocateFoundConnectionAlgo autoroute_result = null;
- if (search_result != null)
- {
- try
- {
+ if (search_result != null) {
+ try {
autoroute_result =
LocateFoundConnectionAlgo.get_instance(search_result, p_ctrl, this.autoroute_search_tree,
- board.rules.get_trace_angle_restriction(), p_ripped_item_list, board.get_test_level());
- } catch (Exception e)
- {
+ board.rules.get_trace_angle_restriction(), p_ripped_item_list, board.get_test_level());
+ } catch (Exception e) {
System.out.println("AutorouteEngine.autoroute_connection: Exception in LocateFoundConnectionAlgo.get_instance");
}
}
- if (!this.maintain_database)
- {
+ if (!this.maintain_database) {
this.clear();
- }
- else
- {
+ } else {
this.reset_all_doors();
}
- if (autoroute_result == null)
- {
+ if (autoroute_result == null) {
return AutorouteResult.NOT_ROUTED;
}
- if (autoroute_result.connection_items == null)
- {
- if (this.board.get_test_level().ordinal() >= TestLevel.CRITICAL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (autoroute_result.connection_items == null) {
+ if (this.board.get_test_level().ordinal() >= TestLevel.CRITICAL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("AutorouteEngine.autoroute_connection: result_items != null expected");
}
return AutorouteResult.ALREADY_CONNECTED;
@@ -169,45 +173,36 @@ public AutorouteResult autoroute_connection(Set
- p_start_set, Set
- p_d
SortedSet
- ripped_connections = new TreeSet
- ();
Set changed_nets = new TreeSet();
Item.StopConnectionOption stop_connection_option;
- if (p_ctrl.remove_unconnected_vias)
- {
+ if (p_ctrl.remove_unconnected_vias) {
stop_connection_option = Item.StopConnectionOption.NONE;
- }
- else
- {
+ } else {
stop_connection_option = Item.StopConnectionOption.FANOUT_VIA;
}
- for (Item curr_ripped_item : p_ripped_item_list)
- {
+ for (Item curr_ripped_item : p_ripped_item_list) {
ripped_connections.addAll(curr_ripped_item.get_connection_items(stop_connection_option));
- for (int i = 0; i < curr_ripped_item.net_count(); ++i)
- {
+ for (int i = 0; i < curr_ripped_item.net_count(); ++i) {
changed_nets.add(curr_ripped_item.get_net_no(i));
}
}
// let the observers know the changes in the board database.
boolean observers_activated = !this.board.observers_active();
- if (observers_activated)
- {
+ if (observers_activated) {
this.board.start_notify_observers();
}
board.remove_items(ripped_connections, false);
- for (int curr_net_no : changed_nets)
- {
+ for (int curr_net_no : changed_nets) {
this.board.remove_trace_tails(curr_net_no, stop_connection_option);
}
InsertFoundConnectionAlgo insert_found_connection_algo =
InsertFoundConnectionAlgo.get_instance(autoroute_result, board, p_ctrl);
- if (observers_activated)
- {
+ if (observers_activated) {
this.board.end_notify_observers();
}
- if (insert_found_connection_algo == null)
- {
+ if (insert_found_connection_algo == null) {
return AutorouteResult.INSERT_ERROR;
}
return AutorouteResult.ROUTED;
@@ -216,25 +211,20 @@ public AutorouteResult autoroute_connection(Set
- p_start_set, Set
- p_d
/**
* Returns the net number of the current connection to route.
*/
- public int get_net_no()
- {
+ public int get_net_no() {
return this.net_no;
}
/**
* Returns if the user has stopped the autorouter.
*/
- public boolean is_stop_requested()
- {
- if (this.time_limit != null)
- {
- if (this.time_limit.limit_exceeded())
- {
+ public boolean is_stop_requested() {
+ if (this.time_limit != null) {
+ if (this.time_limit.limit_exceeded()) {
return true;
}
}
- if (this.stoppable_thread == null)
- {
+ if (this.stoppable_thread == null) {
return false;
}
return this.stoppable_thread.is_stop_requested();
@@ -243,12 +233,9 @@ public boolean is_stop_requested()
/**
* Clears all temporary data
*/
- public void clear()
- {
- if (complete_expansion_rooms != null)
- {
- for (CompleteFreeSpaceExpansionRoom curr_room : complete_expansion_rooms)
- {
+ public void clear() {
+ if (complete_expansion_rooms != null) {
+ for (CompleteFreeSpaceExpansionRoom curr_room : complete_expansion_rooms) {
curr_room.remove_from_tree(this.autoroute_search_tree);
}
}
@@ -261,26 +248,21 @@ public void clear()
/**
* Draws the shapes of the expansion rooms created so far.
*/
- public void draw(java.awt.Graphics p_graphics, boardgraphics.GraphicsContext p_graphics_context, double p_intensity)
- {
- if (complete_expansion_rooms == null)
- {
+ public void draw(java.awt.Graphics p_graphics, net.freerouting.boardgraphics.GraphicsContext p_graphics_context, double p_intensity) {
+ if (complete_expansion_rooms == null) {
return;
}
- for (CompleteFreeSpaceExpansionRoom curr_room : complete_expansion_rooms)
- {
+ for (CompleteFreeSpaceExpansionRoom curr_room : complete_expansion_rooms) {
curr_room.draw(p_graphics, p_graphics_context, p_intensity);
}
Collection
- item_list = this.board.get_items();
- for (Item curr_item : item_list)
- {
+ for (Item curr_item : item_list) {
ItemAutorouteInfo autoroute_info = curr_item.get_autoroute_info();
- if (autoroute_info != null)
- {
+ if (autoroute_info != null) {
autoroute_info.draw(p_graphics, p_graphics_context, p_intensity);
}
}
- // this.drill_page_array.draw(p_graphics, p_graphics_context, p_intensity);
+ // this.drill_page_array.draw(p_graphics, p_graphics_context, p_intensity);
}
/**
@@ -290,11 +272,9 @@ public void draw(java.awt.Graphics p_graphics, boardgraphics.GraphicsContext p_g
* does not overlap with any obstacle, and it is as big as possible.
* p_contained_points will remain contained in the shape, after it is completed.
*/
- public IncompleteFreeSpaceExpansionRoom add_incomplete_expansion_room(TileShape p_shape, int p_layer, TileShape p_contained_shape)
- {
+ public IncompleteFreeSpaceExpansionRoom add_incomplete_expansion_room(TileShape p_shape, int p_layer, TileShape p_contained_shape) {
IncompleteFreeSpaceExpansionRoom new_room = new IncompleteFreeSpaceExpansionRoom(p_shape, p_layer, p_contained_shape);
- if (this.incomplete_expansion_rooms == null)
- {
+ if (this.incomplete_expansion_rooms == null) {
this.incomplete_expansion_rooms = new LinkedList();
}
this.incomplete_expansion_rooms.add(new_room);
@@ -304,14 +284,11 @@ public IncompleteFreeSpaceExpansionRoom add_incomplete_expansion_room(TileShape
/**
* Returns the first elemment in the list of incomplete expansion rooms or null, if the list is empty.
*/
- public IncompleteFreeSpaceExpansionRoom get_first_incomplete_expansion_room()
- {
- if (incomplete_expansion_rooms == null)
- {
+ public IncompleteFreeSpaceExpansionRoom get_first_incomplete_expansion_room() {
+ if (incomplete_expansion_rooms == null) {
return null;
}
- if (incomplete_expansion_rooms.isEmpty())
- {
+ if (incomplete_expansion_rooms.isEmpty()) {
return null;
}
Iterator it = incomplete_expansion_rooms.iterator();
@@ -321,8 +298,7 @@ public IncompleteFreeSpaceExpansionRoom get_first_incomplete_expansion_room()
/**
* Removes an incomplete room from the database.
*/
- public void remove_incomplete_expansion_room(IncompleteFreeSpaceExpansionRoom p_room)
- {
+ public void remove_incomplete_expansion_room(IncompleteFreeSpaceExpansionRoom p_room) {
this.remove_all_doors(p_room);
incomplete_expansion_rooms.remove(p_room);
}
@@ -331,22 +307,18 @@ public void remove_incomplete_expansion_room(IncompleteFreeSpaceExpansionRoom p_
* Removes a complete expansion room from the database and creates
* new incomplete expansion rooms for the neighbours.
*/
- public void remove_complete_expansion_room(CompleteFreeSpaceExpansionRoom p_room)
- {
+ public void remove_complete_expansion_room(CompleteFreeSpaceExpansionRoom p_room) {
// create new incomplete expansion rooms for all neighbours
TileShape room_shape = p_room.get_shape();
int room_layer = p_room.get_layer();
Collection room_doors = p_room.get_doors();
- for (ExpansionDoor curr_door : room_doors)
- {
+ for (ExpansionDoor curr_door : room_doors) {
ExpansionRoom curr_neighbour = curr_door.other_room(p_room);
- if (curr_neighbour != null)
- {
+ if (curr_neighbour != null) {
curr_neighbour.remove_door(curr_door);
TileShape neighbour_shape = curr_neighbour.get_shape();
TileShape intersection = room_shape.intersection(neighbour_shape);
- if (intersection.dimension() == 1)
- {
+ if (intersection.dimension() == 1) {
// add a new incomplete room to curr_neighbour.
int[] touching_sides = room_shape.touching_sides(neighbour_shape);
Line[] line_arr = new Line[1];
@@ -362,12 +334,9 @@ public void remove_complete_expansion_room(CompleteFreeSpaceExpansionRoom p_room
}
this.remove_all_doors(p_room);
p_room.remove_from_tree(this.autoroute_search_tree);
- if (complete_expansion_rooms != null)
- {
+ if (complete_expansion_rooms != null) {
complete_expansion_rooms.remove(p_room);
- }
- else
- {
+ } else {
System.out.println("AutorouteEngine.remove_complete_expansion_room: this.complete_expansion_rooms is null");
}
this.drill_page_array.invalidate(room_shape);
@@ -378,20 +347,16 @@ public void remove_complete_expansion_room(CompleteFreeSpaceExpansionRoom p_room
* Returns the resulting rooms after completing the shape.
* p_room will no more exist after this function.
*/
- public Collection complete_expansion_room(IncompleteFreeSpaceExpansionRoom p_room)
- {
+ public Collection complete_expansion_room(IncompleteFreeSpaceExpansionRoom p_room) {
- try
- {
+ try {
Collection result = new LinkedList();
TileShape from_door_shape = null;
SearchTreeObject ignore_object = null;
Collection room_doors = p_room.get_doors();
- for (ExpansionDoor curr_door : room_doors)
- {
+ for (ExpansionDoor curr_door : room_doors) {
ExpansionRoom other_room = curr_door.other_room(p_room);
- if (other_room instanceof CompleteFreeSpaceExpansionRoom && curr_door.dimension == 2)
- {
+ if (other_room instanceof CompleteFreeSpaceExpansionRoom && curr_door.dimension == 2) {
from_door_shape = curr_door.get_shape();
ignore_object = (CompleteFreeSpaceExpansionRoom) other_room;
break;
@@ -402,47 +367,38 @@ public Collection complete_expansion_room(Incomp
this.remove_incomplete_expansion_room(p_room);
Iterator it = completed_shapes.iterator();
boolean is_first_completed_room = true;
- while (it.hasNext())
- {
+ while (it.hasNext()) {
IncompleteFreeSpaceExpansionRoom curr_incomplete_room = it.next();
- if (curr_incomplete_room.get_shape().dimension() != 2)
- {
+ if (curr_incomplete_room.get_shape().dimension() != 2) {
continue;
}
- if (is_first_completed_room)
- {
+ if (is_first_completed_room) {
is_first_completed_room = false;
CompleteFreeSpaceExpansionRoom completed_room = this.add_complete_room(curr_incomplete_room);
- if (completed_room != null)
- {
+ if (completed_room != null) {
result.add(completed_room);
}
- }
- else
- {
+ } else {
// the shape of the first completed room may have changed and may
// intersect now with the other shapes. Therefore the completed shapes
// have to be recalculated.
Collection curr_completed_shapes =
this.autoroute_search_tree.complete_shape(curr_incomplete_room, this.net_no,
- ignore_object, from_door_shape);
+ ignore_object, from_door_shape);
Iterator it2 = curr_completed_shapes.iterator();
- while (it2.hasNext())
- {
+ while (it2.hasNext()) {
IncompleteFreeSpaceExpansionRoom tmp_room = it2.next();
CompleteFreeSpaceExpansionRoom completed_room = this.add_complete_room(tmp_room);
- if (completed_room != null)
- {
+ if (completed_room != null) {
result.add(completed_room);
}
}
}
}
return result;
- } catch (Exception e)
- {
+ } catch (Exception e) {
System.out.print("AutorouteEngine.complete_expansion_room: ");
- System.out.println(e);
+ e.printStackTrace();
return new LinkedList();
}
@@ -451,22 +407,17 @@ public Collection complete_expansion_room(Incomp
/**
* Calculates the doors and adds the completed room to the room database.
*/
- private CompleteFreeSpaceExpansionRoom add_complete_room(IncompleteFreeSpaceExpansionRoom p_room)
- {
+ private CompleteFreeSpaceExpansionRoom add_complete_room(IncompleteFreeSpaceExpansionRoom p_room) {
CompleteFreeSpaceExpansionRoom completed_room = (CompleteFreeSpaceExpansionRoom) calculate_doors(p_room);
CompleteFreeSpaceExpansionRoom result;
- if (completed_room != null && completed_room.get_shape().dimension() == 2)
- {
- if (complete_expansion_rooms == null)
- {
+ if (completed_room != null && completed_room.get_shape().dimension() == 2) {
+ if (complete_expansion_rooms == null) {
complete_expansion_rooms = new LinkedList();
}
complete_expansion_rooms.add(completed_room);
this.autoroute_search_tree.insert(completed_room);
result = completed_room;
- }
- else
- {
+ } else {
result = null;
}
return result;
@@ -477,53 +428,40 @@ private CompleteFreeSpaceExpansionRoom add_complete_room(IncompleteFreeSpaceExpa
* the new created neighbour rooms.
* The shape of the result room may be different to the shape of p_room
*/
- private CompleteExpansionRoom calculate_doors(ExpansionRoom p_room)
- {
+ private CompleteExpansionRoom calculate_doors(ExpansionRoom p_room) {
CompleteExpansionRoom result;
- if (this.autoroute_search_tree instanceof ShapeSearchTree90Degree)
- {
+ if (this.autoroute_search_tree instanceof ShapeSearchTree90Degree) {
result = SortedOrthogonalRoomNeighbours.calculate(p_room, this);
- }
- else if (this.autoroute_search_tree instanceof ShapeSearchTree45Degree)
- {
+ } else if (this.autoroute_search_tree instanceof ShapeSearchTree45Degree) {
result = Sorted45DegreeRoomNeighbours.calculate(p_room, this);
- }
- else
- {
+ } else {
result = SortedRoomNeighbours.calculate(p_room, this);
}
return result;
}
- /** Completes the shapes of the neigbour rooms of p_room, so that the
+ /**
+ * Completes the shapes of the neigbour rooms of p_room, so that the
* doors of p_room will not change later on.
*/
- public void complete_neigbour_rooms(CompleteExpansionRoom p_room)
- {
- if (p_room.get_doors() == null)
- {
+ public void complete_neigbour_rooms(CompleteExpansionRoom p_room) {
+ if (p_room.get_doors() == null) {
return;
}
Iterator it = p_room.get_doors().iterator();
- while (it.hasNext())
- {
+ while (it.hasNext()) {
ExpansionDoor curr_door = it.next();
// cast to ExpansionRoom becaus ExpansionDoor.other_room works differently with
// parameter type CompleteExpansionRoom.
ExpansionRoom neighbour_room = curr_door.other_room((ExpansionRoom) p_room);
- if (neighbour_room != null)
- {
- if (neighbour_room instanceof IncompleteFreeSpaceExpansionRoom)
- {
+ if (neighbour_room != null) {
+ if (neighbour_room instanceof IncompleteFreeSpaceExpansionRoom) {
this.complete_expansion_room((IncompleteFreeSpaceExpansionRoom) neighbour_room);
// restart reading because the doors have changed
it = p_room.get_doors().iterator();
- }
- else if (neighbour_room instanceof ObstacleExpansionRoom)
- {
+ } else if (neighbour_room instanceof ObstacleExpansionRoom) {
ObstacleExpansionRoom obstacle_neighbour_room = (ObstacleExpansionRoom) neighbour_room;
- if (!obstacle_neighbour_room.all_doors_calculated())
- {
+ if (!obstacle_neighbour_room.all_doors_calculated()) {
this.calculate_doors(obstacle_neighbour_room);
obstacle_neighbour_room.set_doors_calculated(true);
}
@@ -536,27 +474,22 @@ else if (neighbour_room instanceof ObstacleExpansionRoom)
* Invalidates all drill pages intersecting with p_shape, so the they must be recalculated at the next
* call of get_ddrills()
*/
- public void invalidate_drill_pages(TileShape p_shape)
- {
+ public void invalidate_drill_pages(TileShape p_shape) {
this.drill_page_array.invalidate(p_shape);
}
/**
* Removes all doors from p_room
*/
- void remove_all_doors(ExpansionRoom p_room)
- {
+ void remove_all_doors(ExpansionRoom p_room) {
Iterator it = p_room.get_doors().iterator();
- while (it.hasNext())
- {
+ while (it.hasNext()) {
ExpansionDoor curr_door = it.next();
ExpansionRoom other_room = curr_door.other_room(p_room);
- if (other_room != null)
- {
+ if (other_room != null) {
other_room.remove_door(curr_door);
- if (other_room instanceof IncompleteFreeSpaceExpansionRoom)
- {
+ if (other_room instanceof IncompleteFreeSpaceExpansionRoom) {
this.remove_incomplete_expansion_room((IncompleteFreeSpaceExpansionRoom) other_room);
}
}
@@ -567,19 +500,14 @@ void remove_all_doors(ExpansionRoom p_room)
/**
* Returns all complete free space expansion rooms with a target door to an item in the set p_items.
*/
- Set get_rooms_with_target_items(Set
- p_items)
- {
+ Set get_rooms_with_target_items(Set
- p_items) {
Set result = new TreeSet();
- if (this.complete_expansion_rooms != null)
- {
- for (CompleteFreeSpaceExpansionRoom curr_room : this.complete_expansion_rooms)
- {
+ if (this.complete_expansion_rooms != null) {
+ for (CompleteFreeSpaceExpansionRoom curr_room : this.complete_expansion_rooms) {
Collection target_door_list = curr_room.get_target_doors();
- for (TargetItemExpansionDoor curr_target_door : target_door_list)
- {
+ for (TargetItemExpansionDoor curr_target_door : target_door_list) {
Item curr_target_item = curr_target_door.item;
- if (p_items.contains(curr_target_item))
- {
+ if (p_items.contains(curr_target_item)) {
result.add(curr_room);
}
}
@@ -591,17 +519,13 @@ Set get_rooms_with_target_items(Set
- p_item
/**
* Checks, if the internal datastructure is valid.
*/
- public boolean validate()
- {
- if (complete_expansion_rooms == null)
- {
+ public boolean validate() {
+ if (complete_expansion_rooms == null) {
return true;
}
boolean result = true;
- for (CompleteFreeSpaceExpansionRoom curr_room : complete_expansion_rooms)
- {
- if (!curr_room.validate(this))
- {
+ for (CompleteFreeSpaceExpansionRoom curr_room : complete_expansion_rooms) {
+ if (!curr_room.validate(this)) {
result = false;
}
}
@@ -611,21 +535,16 @@ public boolean validate()
/**
* Reset all doors for autorouting the next connnection, in case the autorouting database is retained.
*/
- private void reset_all_doors()
- {
- if (this.complete_expansion_rooms != null)
- {
- for (ExpansionRoom curr_room : this.complete_expansion_rooms)
- {
+ private void reset_all_doors() {
+ if (this.complete_expansion_rooms != null) {
+ for (ExpansionRoom curr_room : this.complete_expansion_rooms) {
curr_room.reset_doors();
}
}
Collection
- item_list = this.board.get_items();
- for (Item curr_item : item_list)
- {
+ for (Item curr_item : item_list) {
ItemAutorouteInfo curr_autoroute_info = curr_item.get_autoroute_info_pur();
- if (curr_autoroute_info != null)
- {
+ if (curr_autoroute_info != null) {
curr_autoroute_info.reset_doors();
curr_autoroute_info.set_precalculated_connection(null);
}
@@ -633,51 +552,15 @@ private void reset_all_doors()
this.drill_page_array.reset();
}
- protected int generate_room_id_no()
- {
+ protected int generate_room_id_no() {
++expansion_room_instance_count;
return expansion_room_instance_count;
}
- /**
- * The current search tree used in autorouting.
- * It depends on the trac clearance class used in the autoroute algorithm.
- */
- public final ShapeSearchTree autoroute_search_tree;
- /** If maintain_database, the autorouter database is maintained after a connection is
- * completed for performance reasons.
- */
- public final boolean maintain_database;
- static final int TRACE_WIDTH_TOLERANCE = 2;
- /**
- * The net number used for routing in this autoroute algorithm.
- */
- private int net_no;
- /**
- * The 2-dimensional array of rectangular pages of ExpansionDrills
- */
- final DrillPageArray drill_page_array;
- /**
- * To be able to stop the expansion algorithm.
- */
- Stoppable stoppable_thread;
- /**
- * To stop the expansion algorithm after a time limit is exceeded.
- */
- private TimeLimit time_limit;
- /** The PCB-board of this autoroute algorithm. */
- final RoutingBoard board;
- /** The list of incomplete expansion rooms on the routing board */
- private List incomplete_expansion_rooms = null;
- /** The list of complete expansion rooms on the routing board */
- private List complete_expansion_rooms = null;
- /** The count of expansion rooms created so far */
- private int expansion_room_instance_count = 0;
/**
- * The pussible results of autorouting a connection
+ * The pussible results of autorouting a connection
*/
- public enum AutorouteResult
- {
+ public enum AutorouteResult {
ALREADY_CONNECTED, ROUTED, NOT_ROUTED, INSERT_ERROR
}
diff --git a/autoroute/BatchAutorouter.java b/src/main/java/net/freerouting/autoroute/BatchAutorouter.java
similarity index 71%
rename from autoroute/BatchAutorouter.java
rename to src/main/java/net/freerouting/autoroute/BatchAutorouter.java
index 5bdd0ca9..e86247da 100644
--- a/autoroute/BatchAutorouter.java
+++ b/src/main/java/net/freerouting/autoroute/BatchAutorouter.java
@@ -13,89 +13,56 @@
* GNU General Public License at
* for more details.
*/
-package autoroute;
+package net.freerouting.autoroute;
-import java.util.Iterator;
-import java.util.Collection;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
+import net.freerouting.board.Connectable;
+import net.freerouting.board.DrillItem;
+import net.freerouting.board.Item;
+import net.freerouting.board.RoutingBoard;
+import net.freerouting.datastructures.TimeLimit;
+import net.freerouting.datastructures.UndoableObjects;
+import net.freerouting.geometry.planar.FloatLine;
+import net.freerouting.geometry.planar.FloatPoint;
+import net.freerouting.interactive.BoardHandling;
+import net.freerouting.interactive.InteractiveActionThread;
-import datastructures.TimeLimit;
-import datastructures.UndoableObjects;
-
-import geometry.planar.FloatPoint;
-import geometry.planar.FloatLine;
-
-import board.Connectable;
-import board.Item;
-import board.DrillItem;
-import board.RoutingBoard;
-
-import interactive.BoardHandling;
-import interactive.InteractiveActionThread;
+import java.util.*;
/**
* Handles the sequencing of the batch autoroute passes.
- *
- * @author Alfons Wirtz
+ *
+ * @author Alfons Wirtz
*/
-public class BatchAutorouter
-{
+public class BatchAutorouter {
+ private static final int TIME_LIMIT_TO_PREVENT_ENDLESS_LOOP = 1000;
+ private final InteractiveActionThread thread;
+ private final BoardHandling hdlg;
+ private final RoutingBoard routing_board;
+ private final boolean remove_unconnected_vias;
+ private final AutorouteControl.ExpansionCostFactor[] trace_cost_arr;
+ private final boolean retain_autoroute_database;
+ private final int start_ripup_costs;
+ private boolean is_interrupted = false;
/**
- * Autoroutes ripup passes until the board is completed or the autorouter is stopped by the user,
- * or if p_max_pass_count is exceeded. Is currently used in the optimize via batch pass.
- * Returns the number of oasses to complete the board or p_max_pass_count + 1,
- * if the board is not completed.
+ * Used to draw the airline of the current routed incomplete.
*/
- public static int autoroute_passes_for_optimizing_item(InteractiveActionThread p_thread,
- int p_max_pass_count, int p_ripup_costs, boolean p_with_prefered_directions)
- {
- BatchAutorouter router_instance = new BatchAutorouter(p_thread, true, p_with_prefered_directions, p_ripup_costs);
- boolean still_unrouted_items = true;
- int curr_pass_no = 1;
- while (still_unrouted_items && !router_instance.is_interrupted && curr_pass_no <= p_max_pass_count)
- {
- if (p_thread.is_stop_requested())
- {
- router_instance.is_interrupted = true;
- }
- still_unrouted_items = router_instance.autoroute_pass(curr_pass_no, false);
- if (still_unrouted_items && !router_instance.is_interrupted)
- {
- p_thread.hdlg.settings.autoroute_settings.increment_pass_no();
- }
- ++curr_pass_no;
- }
- router_instance.remove_tails(Item.StopConnectionOption.NONE);
- if (!still_unrouted_items)
- {
- --curr_pass_no;
- }
- return curr_pass_no;
- }
-
+ private FloatLine air_line = null;
/**
* Creates a new batch autorouter.
*/
public BatchAutorouter(InteractiveActionThread p_thread, boolean p_remove_unconnected_vias, boolean p_with_preferred_directions,
- int p_start_ripup_costs)
- {
+ int p_start_ripup_costs) {
this.thread = p_thread;
this.hdlg = p_thread.hdlg;
this.routing_board = this.hdlg.get_routing_board();
this.remove_unconnected_vias = p_remove_unconnected_vias;
- if (p_with_preferred_directions)
- {
+ if (p_with_preferred_directions) {
this.trace_cost_arr = this.hdlg.settings.autoroute_settings.get_trace_cost_arr();
- }
- else
- {
+ } else {
// remove prefered direction
this.trace_cost_arr = new AutorouteControl.ExpansionCostFactor[this.routing_board.get_layer_count()];
- for (int i = 0; i < this.trace_cost_arr.length; ++i)
- {
+ for (int i = 0; i < this.trace_cost_arr.length; ++i) {
double curr_min_cost = this.hdlg.settings.autoroute_settings.get_preferred_direction_trace_costs(i);
this.trace_cost_arr[i] = new AutorouteControl.ExpansionCostFactor(curr_min_cost, curr_min_cost);
}
@@ -106,31 +73,54 @@ public BatchAutorouter(InteractiveActionThread p_thread, boolean p_remove_unconn
}
/**
- * Autoroutes ripup passes until the board is completed or the autorouter is stopped by the user.
- * Returns true if the board is completed.
+ * Autoroutes ripup passes until the board is completed or the autorouter is stopped by the user,
+ * or if p_max_pass_count is exceeded. Is currently used in the optimize via batch pass.
+ * Returns the number of oasses to complete the board or p_max_pass_count + 1,
+ * if the board is not completed.
*/
- public boolean autoroute_passes()
- {
+ public static int autoroute_passes_for_optimizing_item(InteractiveActionThread p_thread,
+ int p_max_pass_count, int p_ripup_costs, boolean p_with_prefered_directions) {
+ BatchAutorouter router_instance = new BatchAutorouter(p_thread, true, p_with_prefered_directions, p_ripup_costs);
+ boolean still_unrouted_items = true;
+ int curr_pass_no = 1;
+ while (still_unrouted_items && !router_instance.is_interrupted && curr_pass_no <= p_max_pass_count) {
+ if (p_thread.is_stop_requested()) {
+ router_instance.is_interrupted = true;
+ }
+ still_unrouted_items = router_instance.autoroute_pass(curr_pass_no, false);
+ if (still_unrouted_items && !router_instance.is_interrupted) {
+ p_thread.hdlg.settings.autoroute_settings.increment_pass_no();
+ }
+ ++curr_pass_no;
+ }
+ router_instance.remove_tails(Item.StopConnectionOption.NONE);
+ if (!still_unrouted_items) {
+ --curr_pass_no;
+ }
+ return curr_pass_no;
+ }
+
+ /**
+ * Autoroutes ripup passes until the board is completed or the autorouter is stopped by the user.
+ * Returns true if the board is completed.
+ */
+ public boolean autoroute_passes() {
java.util.ResourceBundle resources =
- java.util.ResourceBundle.getBundle("interactive.resources.InteractiveState", hdlg.get_locale());
+ java.util.ResourceBundle.getBundle("net.freerouting.interactive.InteractiveState", hdlg.get_locale());
boolean still_unrouted_items = true;
- while (still_unrouted_items && !this.is_interrupted)
- {
- if (thread.is_stop_requested())
- {
+ while (still_unrouted_items && !this.is_interrupted) {
+ if (thread.is_stop_requested()) {
this.is_interrupted = true;
}
Integer curr_pass_no = hdlg.settings.autoroute_settings.get_pass_no();
String start_message = resources.getString("batch_autorouter") + " " + resources.getString("stop_message") + " " + resources.getString("pass") + " " + curr_pass_no.toString() + ": ";
hdlg.screen_messages.set_status_message(start_message);
still_unrouted_items = autoroute_pass(curr_pass_no, true);
- if (still_unrouted_items && !is_interrupted)
- {
+ if (still_unrouted_items && !is_interrupted) {
hdlg.settings.autoroute_settings.increment_pass_no();
}
}
- if (!(this.remove_unconnected_vias || still_unrouted_items || this.is_interrupted))
- {
+ if (!(this.remove_unconnected_vias || still_unrouted_items || this.is_interrupted)) {
// clean up the route if the board is completed and if fanout is used.
remove_tails(Item.StopConnectionOption.NONE);
}
@@ -141,41 +131,30 @@ public boolean autoroute_passes()
* Autoroutes one ripup pass of all items of the board.
* Returns false, if the board is already completely routed.
*/
- private boolean autoroute_pass(int p_pass_no, boolean p_with_screen_message)
- {
- try
- {
+ private boolean autoroute_pass(int p_pass_no, boolean p_with_screen_message) {
+ try {
Collection
- autoroute_item_list = new java.util.LinkedList
- ();
Set
- handeled_items = new TreeSet
- ();
Iterator it = routing_board.item_list.start_read_object();
- for (;;)
- {
+ for (; ; ) {
UndoableObjects.Storable curr_ob = routing_board.item_list.read_object(it);
- if (curr_ob == null)
- {
+ if (curr_ob == null) {
break;
}
- if (curr_ob instanceof Connectable && curr_ob instanceof Item)
- {
+ if (curr_ob instanceof Connectable && curr_ob instanceof Item) {
Item curr_item = (Item) curr_ob;
- if (!curr_item.is_route())
- {
- if (!handeled_items.contains(curr_item))
- {
- for (int i = 0; i < curr_item.net_count(); ++i)
- {
+ if (!curr_item.is_route()) {
+ if (!handeled_items.contains(curr_item)) {
+ for (int i = 0; i < curr_item.net_count(); ++i) {
int curr_net_no = curr_item.get_net_no(i);
Set
- connected_set = curr_item.get_connected_set(curr_net_no);
- for (Item curr_connected_item : connected_set)
- {
- if (curr_connected_item.net_count() <= 1)
- {
+ for (Item curr_connected_item : connected_set) {
+ if (curr_connected_item.net_count() <= 1) {
handeled_items.add(curr_connected_item);
}
}
int net_item_count = routing_board.connectable_item_count(curr_net_no);
- if (connected_set.size() < net_item_count)
- {
+ if (connected_set.size() < net_item_count) {
autoroute_item_list.add(curr_item);
}
}
@@ -183,8 +162,7 @@ private boolean autoroute_pass(int p_pass_no, boolean p_with_screen_message)
}
}
}
- if (autoroute_item_list.isEmpty())
- {
+ if (autoroute_item_list.isEmpty()) {
this.air_line = null;
return false;
}
@@ -192,90 +170,69 @@ private boolean autoroute_pass(int p_pass_no, boolean p_with_screen_message)
int ripped_item_count = 0;
int not_found = 0;
int routed = 0;
- if (p_with_screen_message)
- {
+ if (p_with_screen_message) {
hdlg.screen_messages.set_batch_autoroute_info(items_to_go_count, routed, ripped_item_count, not_found);
}
- for (Item curr_item : autoroute_item_list)
- {
- if (this.is_interrupted)
- {
+ for (Item curr_item : autoroute_item_list) {
+ if (this.is_interrupted) {
break;
}
- for (int i = 0; i < curr_item.net_count(); ++i)
- {
- if (this.thread.is_stop_requested())
- {
+ for (int i = 0; i < curr_item.net_count(); ++i) {
+ if (this.thread.is_stop_requested()) {
this.is_interrupted = true;
break;
}
routing_board.start_marking_changed_area();
SortedSet
- ripped_item_list = new TreeSet
- ();
- if (autoroute_item(curr_item, curr_item.get_net_no(i), ripped_item_list, p_pass_no))
- {
+ if (autoroute_item(curr_item, curr_item.get_net_no(i), ripped_item_list, p_pass_no)) {
++routed;
hdlg.repaint();
- }
- else
- {
+ } else {
++not_found;
}
--items_to_go_count;
ripped_item_count += ripped_item_list.size();
- if (p_with_screen_message)
- {
+ if (p_with_screen_message) {
hdlg.screen_messages.set_batch_autoroute_info(items_to_go_count, routed, ripped_item_count, not_found);
}
}
}
- if (routing_board.get_test_level() != board.TestLevel.ALL_DEBUGGING_OUTPUT)
- {
+ if (routing_board.get_test_level() != net.freerouting.board.TestLevel.ALL_DEBUGGING_OUTPUT) {
Item.StopConnectionOption stop_connection_option;
- if (this.remove_unconnected_vias)
- {
+ if (this.remove_unconnected_vias) {
stop_connection_option = Item.StopConnectionOption.NONE;
- }
- else
- {
+ } else {
stop_connection_option = Item.StopConnectionOption.FANOUT_VIA;
}
remove_tails(stop_connection_option);
}
this.air_line = null;
return true;
- } catch (Exception e)
- {
+ } catch (Exception e) {
this.air_line = null;
return false;
}
}
- private void remove_tails(Item.StopConnectionOption p_stop_connection_option)
- {
+ private void remove_tails(Item.StopConnectionOption p_stop_connection_option) {
routing_board.start_marking_changed_area();
routing_board.remove_trace_tails(-1, p_stop_connection_option);
routing_board.opt_changed_area(new int[0], null, this.hdlg.settings.get_trace_pull_tight_accuracy(),
this.trace_cost_arr, this.thread, TIME_LIMIT_TO_PREVENT_ENDLESS_LOOP);
}
- private boolean autoroute_item(Item p_item, int p_route_net_no, SortedSet
- p_ripped_item_list, int p_ripup_pass_no)
- {
- try
- {
+ private boolean autoroute_item(Item p_item, int p_route_net_no, SortedSet
- p_ripped_item_list, int p_ripup_pass_no) {
+ try {
boolean contains_plane = false;
- rules.Net route_net = routing_board.rules.nets.get(p_route_net_no);
- if (route_net != null)
- {
+ net.freerouting.rules.Net route_net = routing_board.rules.nets.get(p_route_net_no);
+ if (route_net != null) {
contains_plane = route_net.contains_plane();
}
int curr_via_costs;
- if (contains_plane)
- {
+ if (contains_plane) {
curr_via_costs = hdlg.settings.autoroute_settings.get_plane_via_costs();
- }
- else
- {
+ } else {
curr_via_costs = hdlg.settings.autoroute_settings.get_via_costs();
}
AutorouteControl autoroute_control = new AutorouteControl(this.routing_board, p_route_net_no, hdlg.settings, curr_via_costs, this.trace_cost_arr);
@@ -284,32 +241,25 @@ private boolean autoroute_item(Item p_item, int p_route_net_no, SortedSet
-
autoroute_control.remove_unconnected_vias = this.remove_unconnected_vias;
Set
- unconnected_set = p_item.get_unconnected_set(p_route_net_no);
- if (unconnected_set.size() == 0)
- {
+ if (unconnected_set.size() == 0) {
return true; // p_item is already routed.
}
Set
- connected_set = p_item.get_connected_set(p_route_net_no);
Set
- route_start_set;
Set
- route_dest_set;
- if (contains_plane)
- {
- for (Item curr_item : connected_set)
- {
- if (curr_item instanceof board.ConductionArea)
- {
+ if (contains_plane) {
+ for (Item curr_item : connected_set) {
+ if (curr_item instanceof net.freerouting.board.ConductionArea) {
return true; // already connected to plane
}
}
}
- if (contains_plane)
- {
+ if (contains_plane) {
route_start_set = connected_set;
route_dest_set = unconnected_set;
- }
- else
- {
+ } else {
route_start_set = unconnected_set;
route_dest_set = connected_set;
}
@@ -322,58 +272,47 @@ private boolean autoroute_item(Item p_item, int p_route_net_no, SortedSet
-
autoroute_control.trace_clearance_class_no, this.thread, time_limit, this.retain_autoroute_database);
AutorouteEngine.AutorouteResult autoroute_result = autoroute_engine.autoroute_connection(route_start_set, route_dest_set, autoroute_control,
p_ripped_item_list);
- if (autoroute_result == AutorouteEngine.AutorouteResult.ROUTED)
- {
+ if (autoroute_result == AutorouteEngine.AutorouteResult.ROUTED) {
routing_board.opt_changed_area(new int[0], null, this.hdlg.settings.get_trace_pull_tight_accuracy(), autoroute_control.trace_costs, this.thread, TIME_LIMIT_TO_PREVENT_ENDLESS_LOOP);
}
// tests.Validate.check("Autoroute ", hdlg.get_routing_board());
boolean result = autoroute_result == AutorouteEngine.AutorouteResult.ROUTED || autoroute_result == AutorouteEngine.AutorouteResult.ALREADY_CONNECTED;
return result;
- } catch (Exception e)
- {
+ } catch (Exception e) {
return false;
}
}
/**
- * Returns the airline of the current autorouted connnection or null,
- * if no such airline exists
+ * Returns the airline of the current autorouted connnection or null,
+ * if no such airline exists
*/
- public FloatLine get_air_line()
- {
- if (this.air_line == null)
- {
+ public FloatLine get_air_line() {
+ if (this.air_line == null) {
return null;
}
- if (this.air_line.a == null || this.air_line.b == null)
- {
+ if (this.air_line.a == null || this.air_line.b == null) {
return null;
}
return this.air_line;
}
- private void calc_airline(Collection
- p_from_items, Collection
- p_to_items)
- {
+ private void calc_airline(Collection
- p_from_items, Collection
- p_to_items) {
FloatPoint from_corner = null;
FloatPoint to_corner = null;
double min_distance = Double.MAX_VALUE;
- for (Item curr_from_item : p_from_items)
- {
- if (!(curr_from_item instanceof DrillItem))
- {
+ for (Item curr_from_item : p_from_items) {
+ if (!(curr_from_item instanceof DrillItem)) {
continue;
}
FloatPoint curr_from_corner = ((DrillItem) curr_from_item).get_center().to_float();
- for (Item curr_to_item : p_to_items)
- {
- if (!(curr_to_item instanceof DrillItem))
- {
+ for (Item curr_to_item : p_to_items) {
+ if (!(curr_to_item instanceof DrillItem)) {
continue;
}
FloatPoint curr_to_corner = ((DrillItem) curr_to_item).get_center().to_float();
double curr_distance = curr_from_corner.distance_square(curr_to_corner);
- if (curr_distance < min_distance)
- {
+ if (curr_distance < min_distance) {
min_distance = curr_distance;
from_corner = curr_from_corner;
to_corner = curr_to_corner;
@@ -382,15 +321,4 @@ private void calc_airline(Collection
- p_from_items, Collection
- p_to_i
}
this.air_line = new FloatLine(from_corner, to_corner);
}
- private final InteractiveActionThread thread;
- private final BoardHandling hdlg;
- private final RoutingBoard routing_board;
- private boolean is_interrupted = false;
- private final boolean remove_unconnected_vias;
- private final AutorouteControl.ExpansionCostFactor[] trace_cost_arr;
- private final boolean retain_autoroute_database;
- private final int start_ripup_costs;
- /** Used to draw the airline of the current routed incomplete. */
- private FloatLine air_line = null;
- private static final int TIME_LIMIT_TO_PREVENT_ENDLESS_LOOP = 1000;
}
diff --git a/autoroute/BatchFanout.java b/src/main/java/net/freerouting/autoroute/BatchFanout.java
similarity index 66%
rename from autoroute/BatchFanout.java
rename to src/main/java/net/freerouting/autoroute/BatchFanout.java
index f1d968c4..f2a99b24 100644
--- a/autoroute/BatchFanout.java
+++ b/src/main/java/net/freerouting/autoroute/BatchFanout.java
@@ -13,134 +13,116 @@
* GNU General Public License at
* for more details.
*/
-package autoroute;
+package net.freerouting.autoroute;
+
+import net.freerouting.board.RoutingBoard;
+import net.freerouting.datastructures.TimeLimit;
+import net.freerouting.geometry.planar.FloatPoint;
+import net.freerouting.interactive.InteractiveActionThread;
import java.util.Collection;
import java.util.SortedSet;
-import datastructures.TimeLimit;
-
-import geometry.planar.FloatPoint;
-
-import board.RoutingBoard;
-
-import interactive.InteractiveActionThread;
-
/**
* Handles the sequencing of the fanout inside the batch autorouter.
- *
- * @author Alfons Wirtz
+ *
+ * @author Alfons Wirtz
*/
-public class BatchFanout
-{
+public class BatchFanout {
- public static void fanout_board(InteractiveActionThread p_thread)
- {
- BatchFanout fanout_instance = new BatchFanout(p_thread);
- final int MAX_PASS_COUNT = 20;
- for (int i = 0; i < MAX_PASS_COUNT; ++i)
- {
- int routed_count = fanout_instance.fanout_pass(i);
- if (routed_count == 0)
- {
- break;
- }
- }
- }
+ private final InteractiveActionThread thread;
+ private final RoutingBoard routing_board;
+ private final SortedSet sorted_components;
- private BatchFanout(InteractiveActionThread p_thread)
- {
+ private BatchFanout(InteractiveActionThread p_thread) {
this.thread = p_thread;
this.routing_board = p_thread.hdlg.get_routing_board();
- Collection board_smd_pin_list = routing_board.get_smd_pins();
+ Collection board_smd_pin_list = routing_board.get_smd_pins();
this.sorted_components = new java.util.TreeSet();
- for (int i = 1; i <= routing_board.components.count(); ++i)
- {
- board.Component curr_board_component = routing_board.components.get(i);
+ for (int i = 1; i <= routing_board.components.count(); ++i) {
+ net.freerouting.board.Component curr_board_component = routing_board.components.get(i);
Component curr_component = new Component(curr_board_component, board_smd_pin_list);
- if (curr_component.smd_pin_count > 0)
- {
+ if (curr_component.smd_pin_count > 0) {
sorted_components.add(curr_component);
}
}
}
+ public static void fanout_board(InteractiveActionThread p_thread) {
+ BatchFanout fanout_instance = new BatchFanout(p_thread);
+ final int MAX_PASS_COUNT = 20;
+ for (int i = 0; i < MAX_PASS_COUNT; ++i) {
+ int routed_count = fanout_instance.fanout_pass(i);
+ if (routed_count == 0) {
+ break;
+ }
+ }
+ }
+
/**
- * Routes a fanout pass and returns the number of new fanouted SMD-pins
- * in this pass.
+ * Routes a fanout pass and returns the number of new fanouted SMD-pins
+ * in this pass.
*/
- private int fanout_pass(int p_pass_no)
- {
+ private int fanout_pass(int p_pass_no) {
int components_to_go = this.sorted_components.size();
int routed_count = 0;
int not_routed_count = 0;
int insert_error_count = 0;
int ripup_costs = this.thread.hdlg.settings.autoroute_settings.get_start_ripup_costs() * (p_pass_no + 1);
- for (Component curr_component : this.sorted_components)
- {
+ for (Component curr_component : this.sorted_components) {
this.thread.hdlg.screen_messages.set_batch_fanout_info(p_pass_no + 1, components_to_go);
- for (Component.Pin curr_pin : curr_component.smd_pins)
- {
+ for (Component.Pin curr_pin : curr_component.smd_pins) {
double max_milliseconds = 10000 * (p_pass_no + 1);
TimeLimit time_limit = new TimeLimit((int) max_milliseconds);
this.routing_board.start_marking_changed_area();
AutorouteEngine.AutorouteResult curr_result =
this.routing_board.fanout(curr_pin.board_pin, this.thread.hdlg.settings, ripup_costs, this.thread, time_limit);
- if (curr_result == AutorouteEngine.AutorouteResult.ROUTED)
- {
+ if (curr_result == AutorouteEngine.AutorouteResult.ROUTED) {
++routed_count;
- }
- else if (curr_result == AutorouteEngine.AutorouteResult.NOT_ROUTED)
- {
+ } else if (curr_result == AutorouteEngine.AutorouteResult.NOT_ROUTED) {
++not_routed_count;
- }
- else if (curr_result == AutorouteEngine.AutorouteResult.INSERT_ERROR)
- {
+ } else if (curr_result == AutorouteEngine.AutorouteResult.INSERT_ERROR) {
++insert_error_count;
}
- if (curr_result != AutorouteEngine.AutorouteResult.NOT_ROUTED)
- {
+ if (curr_result != AutorouteEngine.AutorouteResult.NOT_ROUTED) {
this.thread.hdlg.repaint();
}
- if (this.thread.is_stop_requested())
- {
+ if (this.thread.is_stop_requested()) {
return routed_count;
}
}
--components_to_go;
}
- if (this.routing_board.get_test_level() != board.TestLevel.RELEASE_VERSION)
- {
- System.out.println("fanout pass: " + (p_pass_no + 1) + ", routed: " + routed_count
+ if (this.routing_board.get_test_level() != net.freerouting.board.TestLevel.RELEASE_VERSION) {
+ System.out.println("fanout pass: " + (p_pass_no + 1) + ", routed: " + routed_count
+ ", not routed: " + not_routed_count + ", errors: " + insert_error_count);
}
return routed_count;
}
-
- private final InteractiveActionThread thread;
- private final RoutingBoard routing_board;
- private static class Component implements Comparable
- {
+ private static class Component implements Comparable {
- Component(board.Component p_board_component, Collection p_board_smd_pin_list)
- {
+ final net.freerouting.board.Component board_component;
+ final int smd_pin_count;
+ final SortedSet smd_pins;
+ /**
+ * The center of gravity of all SMD pins of this component.
+ */
+ final FloatPoint gravity_center_of_smd_pins;
+ Component(net.freerouting.board.Component p_board_component, Collection p_board_smd_pin_list) {
this.board_component = p_board_component;
// calcoulate the center of gravity of all SMD pins of this component.
- Collection curr_pin_list = new java.util.LinkedList();
+ Collection curr_pin_list = new java.util.LinkedList();
int cmp_no = p_board_component.no;
- for (board.Pin curr_board_pin : p_board_smd_pin_list)
- {
- if (curr_board_pin.get_component_no() == cmp_no)
- {
+ for (net.freerouting.board.Pin curr_board_pin : p_board_smd_pin_list) {
+ if (curr_board_pin.get_component_no() == cmp_no) {
curr_pin_list.add(curr_board_pin);
}
}
double x = 0;
double y = 0;
- for (board.Pin curr_pin : curr_pin_list)
- {
+ for (net.freerouting.board.Pin curr_pin : curr_pin_list) {
FloatPoint curr_point = curr_pin.get_center().to_float();
x += curr_point.x;
y += curr_point.y;
@@ -153,71 +135,51 @@ private static class Component implements Comparable
// calculate the sorted SMD pins of this component
this.smd_pins = new java.util.TreeSet();
- for (board.Pin curr_board_pin : curr_pin_list)
- {
+ for (net.freerouting.board.Pin curr_board_pin : curr_pin_list) {
this.smd_pins.add(new Pin(curr_board_pin));
}
}
/**
- * Sort the components, so that components with maor pins come first
+ * Sort the components, so that components with maor pins come first
*/
- public int compareTo(Component p_other)
- {
+ public int compareTo(Component p_other) {
int compare_value = this.smd_pin_count - p_other.smd_pin_count;
int result;
- if (compare_value > 0)
- {
+ if (compare_value > 0) {
result = -1;
- }
- else if (compare_value < 0)
- {
+ } else if (compare_value < 0) {
result = 1;
- }
- else
- {
+ } else {
result = this.board_component.no - p_other.board_component.no;
}
return result;
}
- final board.Component board_component;
- final int smd_pin_count;
- final SortedSet smd_pins;
- /** The center of gravity of all SMD pins of this component. */
- final FloatPoint gravity_center_of_smd_pins;
- class Pin implements Comparable
- {
+ class Pin implements Comparable {
- Pin(board.Pin p_board_pin)
- {
+ final net.freerouting.board.Pin board_pin;
+ final double distance_to_component_center;
+
+ Pin(net.freerouting.board.Pin p_board_pin) {
this.board_pin = p_board_pin;
FloatPoint pin_location = p_board_pin.get_center().to_float();
this.distance_to_component_center = pin_location.distance(gravity_center_of_smd_pins);
}
- public int compareTo(Pin p_other)
- {
+ public int compareTo(Pin p_other) {
int result;
double delta_dist = this.distance_to_component_center - p_other.distance_to_component_center;
- if (delta_dist > 0)
- {
+ if (delta_dist > 0) {
result = 1;
- }
- else if (delta_dist < 0)
- {
+ } else if (delta_dist < 0) {
result = -1;
- }
- else
- {
+ } else {
result = this.board_pin.pin_no - p_other.board_pin.pin_no;
}
return result;
}
- final board.Pin board_pin;
- final double distance_to_component_center;
}
}
- private final SortedSet sorted_components;
}
diff --git a/autoroute/BatchOptRoute.java b/src/main/java/net/freerouting/autoroute/BatchOptRoute.java
similarity index 74%
rename from autoroute/BatchOptRoute.java
rename to src/main/java/net/freerouting/autoroute/BatchOptRoute.java
index 18dfa3fb..4daabc21 100644
--- a/autoroute/BatchOptRoute.java
+++ b/src/main/java/net/freerouting/autoroute/BatchOptRoute.java
@@ -13,58 +13,91 @@
* GNU General Public License at
* for more details.
*/
-package autoroute;
+package net.freerouting.autoroute;
+
+import net.freerouting.board.*;
+import net.freerouting.datastructures.UndoableObjects;
+import net.freerouting.geometry.planar.FloatPoint;
+import net.freerouting.interactive.InteractiveActionThread;
-import java.util.Iterator;
import java.util.Collection;
+import java.util.Iterator;
import java.util.Set;
-import datastructures.UndoableObjects;
-
-import geometry.planar.FloatPoint;
-
-import board.Item;
-import board.Via;
-import board.Trace;
-import board.RoutingBoard;
-import board.FixedState;
-import board.TestLevel;
-
-import interactive.InteractiveActionThread;
-
/**
* To optimize the vias and traces after the batch autorouter has completed the board.
- *
- * @author Alfons Wirtz
+ *
+ * @author Alfons Wirtz
*/
-public class BatchOptRoute
-{
+public class BatchOptRoute {
+
+ private static int MAX_AUTOROUTE_PASSES = 6;
+ private static int ADDITIONAL_RIPUP_COST_FACTOR_AT_START = 10;
+ private final InteractiveActionThread thread;
+ private final RoutingBoard routing_board;
+ private ReadSortedRouteItems sorted_route_items;
+ private boolean use_increased_ripup_costs; // in the first passes the ripup costs are icreased for better performance.
+ private double min_cumulative_trace_length_before = 0;
/**
- * To optimize the route on the board after the autoroute task is finished.
+ * To optimize the route on the board after the autoroute task is finished.
*/
- public BatchOptRoute(InteractiveActionThread p_thread)
- {
+ public BatchOptRoute(InteractiveActionThread p_thread) {
this.thread = p_thread;
this.routing_board = p_thread.hdlg.get_routing_board();
this.sorted_route_items = null;
}
+ static boolean contains_only_unfixed_traces(Collection
- p_item_list) {
+ for (Item curr_item : p_item_list) {
+ if (curr_item.is_user_fixed() || !(curr_item instanceof Trace)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Calculates the cumulative trace lengths multiplied by the trace radius of all traces
+ * on the board, which are not shove_fixed.
+ */
+ private static double calc_weighted_trace_length(RoutingBoard p_board) {
+ double result = 0;
+ int default_clearance_class = net.freerouting.rules.BoardRules.default_clearance_class();
+ Iterator it = p_board.item_list.start_read_object();
+ for (; ; ) {
+ UndoableObjects.Storable curr_item = p_board.item_list.read_object(it);
+ if (curr_item == null) {
+ break;
+ }
+ if (curr_item instanceof Trace) {
+ Trace curr_trace = (Trace) curr_item;
+ FixedState fixed_state = curr_trace.get_fixed_state();
+ if (fixed_state == FixedState.UNFIXED || fixed_state == FixedState.SHOVE_FIXED) {
+ double weighted_trace_length = curr_trace.get_length() * (curr_trace.get_half_width() + p_board.clearance_value(curr_trace.clearance_class_no(), default_clearance_class, curr_trace.get_layer()));
+ if (fixed_state == FixedState.SHOVE_FIXED) {
+ // to produce less violations with pin exit directions.
+ weighted_trace_length /= 2;
+ }
+ result += weighted_trace_length;
+ }
+ }
+ }
+ return result;
+ }
+
/**
* Optimize the route on the board.
*/
- public void optimize_board()
- {
- if (routing_board.get_test_level() != TestLevel.RELEASE_VERSION)
- {
+ public void optimize_board() {
+ if (routing_board.get_test_level() != TestLevel.RELEASE_VERSION) {
System.out.println("Before optimize: Via count: " + routing_board.get_vias().size() + ", trace length: " + Math.round(routing_board.cumulative_trace_length()));
}
boolean route_improved = true;
int curr_pass_no = 0;
use_increased_ripup_costs = true;
- while (route_improved)
- {
+ while (route_improved) {
++curr_pass_no;
boolean with_prefered_directions = (curr_pass_no % 2 != 0); // to create more variations
route_improved = opt_route_pass(curr_pass_no, with_prefered_directions);
@@ -75,33 +108,27 @@ public void optimize_board()
* Pass to reduce the number of vias an to shorten the trace lengthon a completely routed board.
* Returns true, if the route was improved.
*/
- private boolean opt_route_pass(int p_pass_no, boolean p_with_prefered_directions)
- {
+ private boolean opt_route_pass(int p_pass_no, boolean p_with_prefered_directions) {
boolean route_improved = false;
int via_count_before = this.routing_board.get_vias().size();
double trace_length_before = this.thread.hdlg.coordinate_transform.board_to_user(this.routing_board.cumulative_trace_length());
this.thread.hdlg.screen_messages.set_post_route_info(via_count_before, trace_length_before);
this.sorted_route_items = new ReadSortedRouteItems();
this.min_cumulative_trace_length_before = calc_weighted_trace_length(routing_board);
- for (;;)
- {
- if (this.thread.is_stop_requested())
- {
+ for (; ; ) {
+ if (this.thread.is_stop_requested()) {
return route_improved;
}
Item curr_item = sorted_route_items.next();
- if (curr_item == null)
- {
+ if (curr_item == null) {
break;
}
- if (opt_route_item(curr_item, p_pass_no, p_with_prefered_directions))
- {
+ if (opt_route_item(curr_item, p_pass_no, p_with_prefered_directions)) {
route_improved = true;
}
}
this.sorted_route_items = null;
- if (this.use_increased_ripup_costs && !route_improved)
- {
+ if (this.use_increased_ripup_costs && !route_improved) {
this.use_increased_ripup_costs = false;
route_improved = true; // to keep the optimizer going with lower ripup costs
}
@@ -111,10 +138,9 @@ private boolean opt_route_pass(int p_pass_no, boolean p_with_prefered_directions
/**
* Trie to improve the route by retouting the connections containing p_item.
*/
- private boolean opt_route_item(Item p_item, int p_pass_no, boolean p_with_prefered_directions)
- {
+ private boolean opt_route_item(Item p_item, int p_pass_no, boolean p_with_prefered_directions) {
java.util.ResourceBundle resources =
- java.util.ResourceBundle.getBundle("interactive.resources.InteractiveState", this.thread.hdlg.get_locale());
+ java.util.ResourceBundle.getBundle("net.freerouting.interactive.InteractiveState", this.thread.hdlg.get_locale());
String start_message = resources.getString("batch_optimizer") + " " + resources.getString("stop_message") + " " + resources.getString("pass") + " " + (new Integer(p_pass_no)).toString() + ": ";
this.thread.hdlg.screen_messages.set_status_message(start_message);
this.thread.hdlg.remove_ratsnest();
@@ -122,46 +148,37 @@ private boolean opt_route_item(Item p_item, int p_pass_no, boolean p_with_prefer
int via_count_before = this.routing_board.get_vias().size();
Set
- ripped_items = new java.util.TreeSet
- ();
ripped_items.add(p_item);
- if (p_item instanceof Trace)
- {
- // add also the fork items, especially because not all fork items may be
+ if (p_item instanceof Trace) {
+ // add also the fork items, especially because not all fork items may be
// returned by ReadSortedRouteItems because of matching end points.
Trace curr_trace = (Trace) p_item;
Set
- curr_contact_list = curr_trace.get_start_contacts();
- for (int i = 0; i < 2; ++i)
- {
- if (contains_only_unfixed_traces(curr_contact_list))
- {
+ for (int i = 0; i < 2; ++i) {
+ if (contains_only_unfixed_traces(curr_contact_list)) {
ripped_items.addAll(curr_contact_list);
}
curr_contact_list = curr_trace.get_end_contacts();
}
}
Set
- ripped_connections = new java.util.TreeSet
- ();
- for (Item curr_item : ripped_items)
- {
+ for (Item curr_item : ripped_items) {
ripped_connections.addAll(curr_item.get_connection_items(Item.StopConnectionOption.NONE));
}
- for (Item curr_item : ripped_connections)
- {
- if (curr_item.is_user_fixed())
- {
+ for (Item curr_item : ripped_connections) {
+ if (curr_item.is_user_fixed()) {
return false;
}
}
routing_board.generate_snapshot();
this.routing_board.remove_items(ripped_connections, false);
- for (int i = 0; i < p_item.net_count(); ++i)
- {
+ for (int i = 0; i < p_item.net_count(); ++i) {
this.routing_board.combine_traces(p_item.get_net_no(i));
}
int ripup_costs = this.thread.hdlg.settings.autoroute_settings.get_start_ripup_costs();
- if (this.use_increased_ripup_costs)
- {
+ if (this.use_increased_ripup_costs) {
ripup_costs *= ADDITIONAL_RIPUP_COST_FACTOR_AT_START;
}
- if (p_item instanceof Trace)
- {
+ if (p_item instanceof Trace) {
// taking less ripup costs seems to produce better results
ripup_costs = (int) Math.round(0.6 * (double) ripup_costs);
}
@@ -173,18 +190,14 @@ private boolean opt_route_item(Item p_item, int p_pass_no, boolean p_with_prefer
double trace_length_after = calc_weighted_trace_length(routing_board);
boolean route_improved = !this.thread.is_stop_requested() && (incomplete_count_after < incomplete_count_before ||
incomplete_count_after == incomplete_count_before &&
- (via_count_after < via_count_before ||
- via_count_after == via_count_before &&
- this.min_cumulative_trace_length_before > trace_length_after));
- if (route_improved)
- {
+ (via_count_after < via_count_before ||
+ via_count_after == via_count_before &&
+ this.min_cumulative_trace_length_before > trace_length_after));
+ if (route_improved) {
if (incomplete_count_after < incomplete_count_before ||
- incomplete_count_after == incomplete_count_before && via_count_after < via_count_before)
- {
+ incomplete_count_after == incomplete_count_before && via_count_after < via_count_before) {
this.min_cumulative_trace_length_before = trace_length_after;
- }
- else
- {
+ } else {
// Only cumulative trace length shortened.
// Catch unexpected increase of cumulative trace length somewhere for examole by removing acid trapsw.
this.min_cumulative_trace_length_before = Math.min(this.min_cumulative_trace_length_before, trace_length_after);
@@ -192,120 +205,56 @@ private boolean opt_route_item(Item p_item, int p_pass_no, boolean p_with_prefer
routing_board.pop_snapshot();
double new_trace_length = this.thread.hdlg.coordinate_transform.board_to_user(this.routing_board.cumulative_trace_length());
this.thread.hdlg.screen_messages.set_post_route_info(via_count_after, new_trace_length);
- }
- else
- {
+ } else {
routing_board.undo(null);
}
return route_improved;
}
- static boolean contains_only_unfixed_traces(Collection
- p_item_list)
- {
- for (Item curr_item : p_item_list)
- {
- if (curr_item.is_user_fixed() || !(curr_item instanceof Trace))
- {
- return false;
- }
- }
- return true;
- }
-
/**
- * Calculates the cumulative trace lengths multiplied by the trace radius of all traces
- * on the board, which are not shove_fixed.
+ * Returns the current position of the item, which will be rerouted or null, if the optimizer is not active.
*/
- private static double calc_weighted_trace_length(RoutingBoard p_board)
- {
- double result = 0;
- int default_clearance_class = rules.BoardRules.default_clearance_class();
- Iterator it = p_board.item_list.start_read_object();
- for (;;)
- {
- UndoableObjects.Storable curr_item = p_board.item_list.read_object(it);
- if (curr_item == null)
- {
- break;
- }
- if (curr_item instanceof Trace)
- {
- Trace curr_trace = (Trace) curr_item;
- FixedState fixed_state = curr_trace.get_fixed_state();
- if (fixed_state == FixedState.UNFIXED || fixed_state == FixedState.SHOVE_FIXED)
- {
- double weighted_trace_length = curr_trace.get_length() * (curr_trace.get_half_width() + p_board.clearance_value(curr_trace.clearance_class_no(), default_clearance_class, curr_trace.get_layer()));
- if (fixed_state == FixedState.SHOVE_FIXED)
- {
- // to produce less violations with pin exit directions.
- weighted_trace_length /= 2;
- }
- result += weighted_trace_length;
- }
- }
- }
- return result;
- }
-
- /**
- * Returns the current position of the item, which will be rerouted or null, if the optimizer is not active.
- */
- public FloatPoint get_current_position()
- {
- if (sorted_route_items == null)
- {
+ public FloatPoint get_current_position() {
+ if (sorted_route_items == null) {
return null;
}
return sorted_route_items.get_current_position();
}
- private final InteractiveActionThread thread;
- private final RoutingBoard routing_board;
- private ReadSortedRouteItems sorted_route_items;
- private boolean use_increased_ripup_costs; // in the first passes the ripup costs are icreased for better performance.
- private double min_cumulative_trace_length_before = 0;
- private static int MAX_AUTOROUTE_PASSES = 6;
- private static int ADDITIONAL_RIPUP_COST_FACTOR_AT_START = 10;
/**
- * Reads the vias and traces on the board in ascending x order.
- * Because the vias and traces on the board change while optimizing the item list
- * of the board is read from scratch each time the next route item is returned.
+ * Reads the vias and traces on the board in ascending x order.
+ * Because the vias and traces on the board change while optimizing the item list
+ * of the board is read from scratch each time the next route item is returned.
*/
- private class ReadSortedRouteItems
- {
+ private class ReadSortedRouteItems {
+
+ private FloatPoint min_item_coor;
+ private int min_item_layer;
- ReadSortedRouteItems()
- {
+ ReadSortedRouteItems() {
min_item_coor = new FloatPoint(Integer.MIN_VALUE, Integer.MIN_VALUE);
min_item_layer = -1;
}
- Item next()
- {
+ Item next() {
Item result = null;
FloatPoint curr_min_coor = new FloatPoint(Integer.MAX_VALUE, Integer.MAX_VALUE);
int curr_min_layer = Integer.MAX_VALUE;
Iterator it = routing_board.item_list.start_read_object();
- for (;;)
- {
+ for (; ; ) {
UndoableObjects.Storable curr_item = routing_board.item_list.read_object(it);
- if (curr_item == null)
- {
+ if (curr_item == null) {
break;
}
- if (curr_item instanceof Via)
- {
+ if (curr_item instanceof Via) {
Via curr_via = (Via) curr_item;
- if (!curr_via.is_user_fixed())
- {
+ if (!curr_via.is_user_fixed()) {
FloatPoint curr_via_center = curr_via.get_center().to_float();
int curr_via_min_layer = curr_via.first_layer();
if (curr_via_center.x > min_item_coor.x ||
- curr_via_center.x == min_item_coor.x && (curr_via_center.y > min_item_coor.y || curr_via_center.y == min_item_coor.y && curr_via_min_layer > min_item_layer))
- {
+ curr_via_center.x == min_item_coor.x && (curr_via_center.y > min_item_coor.y || curr_via_center.y == min_item_coor.y && curr_via_min_layer > min_item_layer)) {
if (curr_via_center.x < curr_min_coor.x || curr_via_center.x == curr_min_coor.x && (curr_via_center.y < curr_min_coor.y ||
- curr_via_center.y == curr_min_coor.y && curr_via_min_layer < curr_min_layer))
- {
+ curr_via_center.y == curr_min_coor.y && curr_via_min_layer < curr_min_layer)) {
curr_min_coor = curr_via_center;
curr_min_layer = curr_via_min_layer;
result = curr_via;
@@ -316,49 +265,37 @@ Item next()
}
// Read traces last to prefer vias to traces at the same location
it = routing_board.item_list.start_read_object();
- for (;;)
- {
+ for (; ; ) {
UndoableObjects.Storable curr_item = routing_board.item_list.read_object(it);
- if (curr_item == null)
- {
+ if (curr_item == null) {
break;
}
- if (curr_item instanceof Trace)
- {
+ if (curr_item instanceof Trace) {
Trace curr_trace = (Trace) curr_item;
- if (!curr_trace.is_shove_fixed())
- {
+ if (!curr_trace.is_shove_fixed()) {
FloatPoint first_corner = curr_trace.first_corner().to_float();
FloatPoint last_corner = curr_trace.last_corner().to_float();
FloatPoint compare_corner;
if (first_corner.x < last_corner.x ||
- first_corner.x == last_corner.x && first_corner.y < last_corner.y)
- {
+ first_corner.x == last_corner.x && first_corner.y < last_corner.y) {
compare_corner = last_corner;
- }
- else
- {
+ } else {
compare_corner = first_corner;
}
int curr_trace_layer = curr_trace.get_layer();
if (compare_corner.x > min_item_coor.x ||
- compare_corner.x == min_item_coor.x && (compare_corner.y > min_item_coor.y || compare_corner.y == min_item_coor.y && curr_trace_layer > min_item_layer))
- {
+ compare_corner.x == min_item_coor.x && (compare_corner.y > min_item_coor.y || compare_corner.y == min_item_coor.y && curr_trace_layer > min_item_layer)) {
if (compare_corner.x < curr_min_coor.x || compare_corner.x == curr_min_coor.x &&
- (compare_corner.y < curr_min_coor.y || compare_corner.y == curr_min_coor.y && curr_trace_layer < curr_min_layer))
- {
+ (compare_corner.y < curr_min_coor.y || compare_corner.y == curr_min_coor.y && curr_trace_layer < curr_min_layer)) {
boolean is_connected_to_via = false;
Set
- trace_contacts = curr_trace.get_normal_contacts();
- for (Item curr_contact : trace_contacts)
- {
- if (curr_contact instanceof Via && !curr_contact.is_user_fixed())
- {
+ for (Item curr_contact : trace_contacts) {
+ if (curr_contact instanceof Via && !curr_contact.is_user_fixed()) {
is_connected_to_via = true;
break;
}
}
- if (!is_connected_to_via)
- {
+ if (!is_connected_to_via) {
curr_min_coor = compare_corner;
curr_min_layer = curr_trace_layer;
result = curr_trace;
@@ -374,11 +311,8 @@ Item next()
}
- FloatPoint get_current_position()
- {
+ FloatPoint get_current_position() {
return min_item_coor;
}
- private FloatPoint min_item_coor;
- private int min_item_layer;
}
}
diff --git a/autoroute/CompleteExpansionRoom.java b/src/main/java/net/freerouting/autoroute/CompleteExpansionRoom.java
similarity index 78%
rename from autoroute/CompleteExpansionRoom.java
rename to src/main/java/net/freerouting/autoroute/CompleteExpansionRoom.java
index 75a17671..8c1e10af 100644
--- a/autoroute/CompleteExpansionRoom.java
+++ b/src/main/java/net/freerouting/autoroute/CompleteExpansionRoom.java
@@ -19,29 +19,27 @@
*
*/
-package autoroute;
+package net.freerouting.autoroute;
import java.util.Collection;
/**
- *
* @author alfons
*/
-public interface CompleteExpansionRoom extends ExpansionRoom
-{
-
+public interface CompleteExpansionRoom extends ExpansionRoom {
+
/**
* Returns the list of doors to target items of this room
*/
Collection get_target_doors();
-
+
/**
* Returns the object of tthis complete_expansion_rooom.
*/
- board.SearchTreeObject get_object();
-
+ net.freerouting.board.SearchTreeObject get_object();
+
/**
* Draws the shape of this room for test purposes
*/
- void draw(java.awt.Graphics p_graphics, boardgraphics.GraphicsContext p_graphics_context, double p_intensity);
+ void draw(java.awt.Graphics p_graphics, net.freerouting.boardgraphics.GraphicsContext p_graphics_context, double p_intensity);
}
diff --git a/autoroute/CompleteFreeSpaceExpansionRoom.java b/src/main/java/net/freerouting/autoroute/CompleteFreeSpaceExpansionRoom.java
similarity index 68%
rename from autoroute/CompleteFreeSpaceExpansionRoom.java
rename to src/main/java/net/freerouting/autoroute/CompleteFreeSpaceExpansionRoom.java
index ad419139..0b51b601 100644
--- a/autoroute/CompleteFreeSpaceExpansionRoom.java
+++ b/src/main/java/net/freerouting/autoroute/CompleteFreeSpaceExpansionRoom.java
@@ -18,250 +18,212 @@
* Created on 10. Februar 2004, 10:12
*/
-package autoroute;
+package net.freerouting.autoroute;
-import geometry.planar.TileShape;
+import net.freerouting.board.Connectable;
+import net.freerouting.board.Item;
+import net.freerouting.board.SearchTreeObject;
+import net.freerouting.board.ShapeSearchTree;
+import net.freerouting.datastructures.ShapeTree;
+import net.freerouting.geometry.planar.TileShape;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
-import datastructures.ShapeTree;
-
-import board.SearchTreeObject;
-import board.ShapeSearchTree;
-import board.Connectable;
-import board.Item;
-
/**
* An expansion room, whose shape is completely calculated,
* so that it can be stored in a shape tree.
*
- * @author Alfons Wirtz
+ * @author Alfons Wirtz
*/
-public class CompleteFreeSpaceExpansionRoom extends FreeSpaceExpansionRoom implements CompleteExpansionRoom, SearchTreeObject
-{
-
+public class CompleteFreeSpaceExpansionRoom extends FreeSpaceExpansionRoom implements CompleteExpansionRoom, SearchTreeObject {
+
+ //** identification number for implementong the Comparable interfacw */
+ private final int id_no;
+ /**
+ * The array of entries in the SearchTree. Consists of just one element
+ */
+ private ShapeTree.Leaf[] tree_entries = null;
+ /**
+ * The list of doors to items of the own net
+ */
+ private Collection target_doors;
+ private boolean room_is_net_dependent = false;
+
/**
* Creates a new instance of CompleteFreeSpaceExpansionRoom
*/
- public CompleteFreeSpaceExpansionRoom(TileShape p_shape, int p_layer, int p_id_no)
- {
+ public CompleteFreeSpaceExpansionRoom(TileShape p_shape, int p_layer, int p_id_no) {
super(p_shape, p_layer);
target_doors = new LinkedList();
id_no = p_id_no;
}
-
- public void set_search_tree_entries(ShapeTree.Leaf [] p_entries, ShapeTree p_tree)
- {
+
+ public void set_search_tree_entries(ShapeTree.Leaf[] p_entries, ShapeTree p_tree) {
tree_entries = p_entries;
}
-
- public int compareTo(Object p_other)
- {
+
+ public int compareTo(Object p_other) {
int result;
- if (p_other instanceof FreeSpaceExpansionRoom)
- {
+ if (p_other instanceof FreeSpaceExpansionRoom) {
result = ((CompleteFreeSpaceExpansionRoom) p_other).id_no - this.id_no;
- }
- else
- {
+ } else {
result = -1;
}
return result;
}
-
+
/**
* Removes the tree entries of this roomm from p_shape_tree.
*/
- public void remove_from_tree(ShapeTree p_shape_tree)
- {
+ public void remove_from_tree(ShapeTree p_shape_tree) {
p_shape_tree.remove(this.tree_entries);
}
-
- public int tree_shape_count(ShapeTree p_shape_tree)
- {
+
+ public int tree_shape_count(ShapeTree p_shape_tree) {
return 1;
}
-
- public TileShape get_tree_shape(ShapeTree p_shape_tree, int p_index)
- {
+
+ public TileShape get_tree_shape(ShapeTree p_shape_tree, int p_index) {
return this.get_shape();
}
-
- public int shape_layer(int p_index)
- {
+
+ public int shape_layer(int p_index) {
return this.get_layer();
}
-
- public boolean is_obstacle(int p_net_no)
- {
+
+ public boolean is_obstacle(int p_net_no) {
return true;
}
-
- public boolean is_trace_obstacle(int p_net_no)
- {
+
+ public boolean is_trace_obstacle(int p_net_no) {
return true;
}
-
+
/**
* Will be called, when the room overlaps with net dependent objects.
*/
- public void set_net_dependent()
- {
+ public void set_net_dependent() {
this.room_is_net_dependent = true;
}
-
+
/**
* Returns, if the room overlaps with net dependent objects.
* In this case it cannot be retained, when the net number changes in autorouting.
*/
- public boolean is_net_dependent()
- {
+ public boolean is_net_dependent() {
return this.room_is_net_dependent;
}
-
+
/**
* Returns the list doors to target items of this room
*/
- public Collection get_target_doors()
- {
+ public Collection get_target_doors() {
return this.target_doors;
}
-
+
/**
* Adds p_door to the list of target doors of this room.
*/
- public void add_target_door(TargetItemExpansionDoor p_door)
- {
+ public void add_target_door(TargetItemExpansionDoor p_door) {
this.target_doors.add(p_door);
}
-
- public boolean remove_door(ExpandableObject p_door)
- {
+
+ public boolean remove_door(ExpandableObject p_door) {
boolean result;
- if (p_door instanceof TargetItemExpansionDoor)
- {
+ if (p_door instanceof TargetItemExpansionDoor) {
result = this.target_doors.remove(p_door);
- }
- else
- {
+ } else {
result = super.remove_door(p_door);
}
return result;
}
-
- public SearchTreeObject get_object()
- {
+
+ public SearchTreeObject get_object() {
return this;
}
-
+
/**
* Calculates the doors to the start and destination items of the autoroute algorithm.
*/
- public void calculate_target_doors(ShapeTree.TreeEntry p_own_net_object, int p_net_no, ShapeSearchTree p_autoroute_search_tree)
- {
+ public void calculate_target_doors(ShapeTree.TreeEntry p_own_net_object, int p_net_no, ShapeSearchTree p_autoroute_search_tree) {
this.set_net_dependent();
-
- if (p_own_net_object.object instanceof Connectable)
- {
+
+ if (p_own_net_object.object instanceof Connectable) {
Connectable curr_object = (Connectable) p_own_net_object.object;
- if (curr_object.contains_net(p_net_no))
- {
+ if (curr_object.contains_net(p_net_no)) {
TileShape curr_connection_shape =
curr_object.get_trace_connection_shape(p_autoroute_search_tree, p_own_net_object.shape_index_in_object);
- if (curr_connection_shape != null && this.get_shape().intersects(curr_connection_shape))
- {
+ if (curr_connection_shape != null && this.get_shape().intersects(curr_connection_shape)) {
Item curr_item = (Item) curr_object;
TargetItemExpansionDoor new_target_door =
new TargetItemExpansionDoor(curr_item, p_own_net_object.shape_index_in_object, this,
- p_autoroute_search_tree);
+ p_autoroute_search_tree);
this.add_target_door(new_target_door);
}
}
}
}
-
+
/**
* Draws the shape of this room.
*/
- public void draw(java.awt.Graphics p_graphics, boardgraphics.GraphicsContext p_graphics_context, double p_intensity)
- {
+ public void draw(java.awt.Graphics p_graphics, net.freerouting.boardgraphics.GraphicsContext p_graphics_context, double p_intensity) {
java.awt.Color draw_color = p_graphics_context.get_trace_colors(false)[this.get_layer()];
double layer_visibility = p_graphics_context.get_layer_visibility(this.get_layer());
p_graphics_context.fill_area(this.get_shape(), p_graphics, draw_color, p_intensity * layer_visibility);
p_graphics_context.draw_boundary(this.get_shape(), 0, draw_color, p_graphics, layer_visibility);
}
-
+
/**
* Check, if this FreeSpaceExpansionRoom is valid.
*/
- public boolean validate( AutorouteEngine p_autoroute_engine)
- {
+ public boolean validate(AutorouteEngine p_autoroute_engine) {
boolean result = true;
Collection overlapping_objects = new LinkedList();
- int [] net_no_arr = new int[1];
+ int[] net_no_arr = new int[1];
net_no_arr[0] = p_autoroute_engine.get_net_no();
- p_autoroute_engine.autoroute_search_tree.overlapping_tree_entries( this.get_shape(), this.get_layer(),
+ p_autoroute_engine.autoroute_search_tree.overlapping_tree_entries(this.get_shape(), this.get_layer(),
net_no_arr, overlapping_objects);
Iterator it = overlapping_objects.iterator();
- while (it.hasNext())
- {
+ while (it.hasNext()) {
ShapeTree.TreeEntry curr_entry = it.next();
- if (curr_entry.object == this)
- {
+ if (curr_entry.object == this) {
continue;
}
SearchTreeObject curr_object = (SearchTreeObject) curr_entry.object;
- if (!curr_object.is_trace_obstacle(p_autoroute_engine.get_net_no()))
- {
+ if (!curr_object.is_trace_obstacle(p_autoroute_engine.get_net_no())) {
continue;
}
- if (curr_object.shape_layer(curr_entry.shape_index_in_object) != get_layer())
- {
+ if (curr_object.shape_layer(curr_entry.shape_index_in_object) != get_layer()) {
continue;
}
TileShape curr_shape =
curr_object.get_tree_shape(p_autoroute_engine.autoroute_search_tree, curr_entry.shape_index_in_object);
TileShape intersection = this.get_shape().intersection(curr_shape);
- if (intersection.dimension() > 1)
- {
+ if (intersection.dimension() > 1) {
System.out.println("ExpansionRoom overlap conflict");
result = false;
}
}
return result;
}
-
+
/**
* Removes all doors and target doors from this room.
*/
- public void clear_doors()
- {
+ public void clear_doors() {
super.clear_doors();
this.target_doors = new LinkedList();
}
-
- public void reset_doors()
- {
+
+ public void reset_doors() {
super.reset_doors();
- for (ExpandableObject curr_door : this.target_doors)
- {
+ for (ExpandableObject curr_door : this.target_doors) {
curr_door.reset();
}
}
-
-
- /** The array of entries in the SearchTree. Consists of just one element */
- private ShapeTree.Leaf [] tree_entries = null;
-
- //** identification number for implementong the Comparable interfacw */
- private final int id_no;
-
- /** The list of doors to items of the own net */
- private Collection target_doors;
-
- private boolean room_is_net_dependent = false;
}
diff --git a/autoroute/Connection.java b/src/main/java/net/freerouting/autoroute/Connection.java
similarity index 74%
rename from autoroute/Connection.java
rename to src/main/java/net/freerouting/autoroute/Connection.java
index 016c586d..d6b2734b 100644
--- a/autoroute/Connection.java
+++ b/src/main/java/net/freerouting/autoroute/Connection.java
@@ -19,92 +19,99 @@
*
*/
-package autoroute;
+package net.freerouting.autoroute;
+
+import net.freerouting.board.Item;
+import net.freerouting.board.Trace;
+import net.freerouting.geometry.planar.Point;
import java.util.Collection;
import java.util.Set;
import java.util.TreeSet;
-import geometry.planar.Point;
-
-import board.Item;
-import board.Trace;
-
/**
* Describes a routing connection ending at the next fork or terminal item.
*
* @author Alfons Wirtz
*/
-public class Connection
-{
-
+public class Connection {
+
+ private static final double DETOUR_ADD = 100;
+ private static final double DETOUR_ITEM_COST = 0.1;
+ /**
+ * If the connection ens in empty space, start_point or end_point may be null.
+ */
+ public final Point start_point;
+ public final int start_layer;
+ public final Point end_point;
+ public final int end_layer;
+ public final Set
- item_list;
+ /**
+ * Creates a new instance of Connection
+ */
+ private Connection(Point p_start_point, int p_start_layer, Point p_end_point, int p_end_layer, Set
- p_item_list) {
+ start_point = p_start_point;
+ start_layer = p_start_layer;
+ end_point = p_end_point;
+ end_layer = p_end_layer;
+ item_list = p_item_list;
+ }
+
/**
* Gets the connection this item belongs to. A connection ends at the next fork or terminal item.
* Returns null, if p_item is not a route item, or if it is a via belonging to more than 1 connection.
*/
- public static Connection get(Item p_item)
- {
- if (!p_item.is_route())
- {
+ public static Connection get(Item p_item) {
+ if (!p_item.is_route()) {
return null;
}
- Connection precalculated_connection = p_item.get_autoroute_info().get_precalculated_connection();
- if (precalculated_connection != null)
- {
+ Connection precalculated_connection = p_item.get_autoroute_info().get_precalculated_connection();
+ if (precalculated_connection != null) {
return precalculated_connection;
}
Set
- contacts = p_item.get_normal_contacts();
Set
- connection_items = new TreeSet
- ();
connection_items.add(p_item);
-
+
Point start_point = null;
int start_layer = 0;
Point end_point = null;
int end_layer = 0;
-
- for (Item curr_item : contacts)
- {
+
+ for (Item curr_item : contacts) {
Point prev_contact_point = p_item.normal_contact_point(curr_item);
- if (prev_contact_point == null)
- {
+ if (prev_contact_point == null) {
// no unique contact point
continue;
}
int prev_contact_layer = p_item.first_common_layer(curr_item);
boolean fork_found = false;
- if (p_item instanceof Trace)
- {
+ if (p_item instanceof Trace) {
// Check, that there is only 1 contact at this location.
// Only for pins and vias items of more than 1 connection
// are collected
Trace start_trace = (Trace) p_item;
Collection
- check_contacts = start_trace.get_normal_contacts(prev_contact_point, false);
- if (check_contacts.size() != 1)
- {
+ if (check_contacts.size() != 1) {
fork_found = true;
}
}
// Search from curr_item along the contacts
// until the next fork or nonroute item.
- for (;;)
- {
- if(!curr_item.is_route() || fork_found)
- {
+ for (; ; ) {
+ if (!curr_item.is_route() || fork_found) {
// connection ends
- if (start_point == null)
- {
+ if (start_point == null) {
start_point = prev_contact_point;
start_layer = prev_contact_layer;
- }
- else if (!prev_contact_point.equals(start_point))
- {
+ } else if (!prev_contact_point.equals(start_point)) {
end_point = prev_contact_point;
end_layer = prev_contact_layer;
}
break;
}
connection_items.add(curr_item);
- Collection
- curr_item_contacts = curr_item.get_normal_contacts();
+ Collection
- curr_item_contacts = curr_item.get_normal_contacts();
// filter the contacts at the previous contact point,
// because we were already there.
// If then there is not exactly 1 new contact left, there is
@@ -112,25 +119,20 @@ else if (!prev_contact_point.equals(start_point))
Point next_contact_point = null;
int next_contact_layer = -1;
Item next_contact = null;
- for (Item tmp_contact : curr_item_contacts)
- {
+ for (Item tmp_contact : curr_item_contacts) {
int tmp_contact_layer = curr_item.first_common_layer(tmp_contact);
- if (tmp_contact_layer >= 0)
- {
+ if (tmp_contact_layer >= 0) {
Point tmp_contact_point = curr_item.normal_contact_point(tmp_contact);
- if (tmp_contact_point == null)
- {
+ if (tmp_contact_point == null) {
// no unique contact point
fork_found = true;
break;
}
if (prev_contact_layer != tmp_contact_layer ||
- !prev_contact_point.equals(tmp_contact_point))
- {
+ !prev_contact_point.equals(tmp_contact_point)) {
next_contact_point = tmp_contact_point;
next_contact_layer = tmp_contact_layer;
- if (next_contact != null)
- {
+ if (next_contact != null) {
// second new contact found
fork_found = true;
break;
@@ -139,8 +141,7 @@ else if (!prev_contact_point.equals(start_point))
}
}
}
- if (next_contact == null)
- {
+ if (next_contact == null) {
break;
}
curr_item = next_contact;
@@ -149,67 +150,35 @@ else if (!prev_contact_point.equals(start_point))
}
}
Connection result = new Connection(start_point, start_layer, end_point, end_layer, connection_items);
- for (Item curr_item : connection_items)
- {
+ for (Item curr_item : connection_items) {
curr_item.get_autoroute_info().set_precalculated_connection(result);
}
return result;
}
-
- /**
- * Creates a new instance of Connection
- */
- private Connection(Point p_start_point, int p_start_layer, Point p_end_point, int p_end_layer, Set
- p_item_list)
- {
- start_point = p_start_point;
- start_layer = p_start_layer;
- end_point = p_end_point;
- end_layer = p_end_layer;
- item_list = p_item_list;
- }
-
+
/**
* Returns the cumulative length of the traces in this connection.
*/
- public double trace_length()
- {
+ public double trace_length() {
double result = 0;
- for (Item curr_item : item_list)
- {
- if (curr_item instanceof Trace)
- {
- result += ((Trace) curr_item).get_length();
+ for (Item curr_item : item_list) {
+ if (curr_item instanceof Trace) {
+ result += ((Trace) curr_item).get_length();
}
}
return result;
}
-
-
+
/**
* Returns an estimation of the actual length of the connection divided by the minimal possible length.
*/
- public double get_detour()
- {
- if (start_point == null || end_point == null)
- {
+ public double get_detour() {
+ if (start_point == null || end_point == null) {
return Integer.MAX_VALUE;
}
double min_trace_length = start_point.to_float().distance(end_point.to_float());
- double detour = (this.trace_length() + DETOUR_ADD) / (min_trace_length + DETOUR_ADD) +
+ double detour = (this.trace_length() + DETOUR_ADD) / (min_trace_length + DETOUR_ADD) +
DETOUR_ITEM_COST * (item_list.size() - 1);
return detour;
}
-
-
- /**
- * If the connection ens in empty space, start_point or end_point may be null.
- */
- public final Point start_point;
- public final int start_layer;
- public final Point end_point;
- public final int end_layer;
- public final Set
- item_list;
-
- private static final double DETOUR_ADD = 100;
- private static final double DETOUR_ITEM_COST = 0.1;
}
diff --git a/autoroute/DestinationDistance.java b/src/main/java/net/freerouting/autoroute/DestinationDistance.java
similarity index 71%
rename from autoroute/DestinationDistance.java
rename to src/main/java/net/freerouting/autoroute/DestinationDistance.java
index 95481387..ac80270f 100644
--- a/autoroute/DestinationDistance.java
+++ b/src/main/java/net/freerouting/autoroute/DestinationDistance.java
@@ -18,380 +18,337 @@
* Created on 26. Januar 2004, 10:08
*/
-package autoroute;
-
-import geometry.planar.FloatPoint;
-import geometry.planar.IntBox;
-import autoroute.AutorouteControl.ExpansionCostFactor;
+package net.freerouting.autoroute;
+import net.freerouting.autoroute.AutorouteControl.ExpansionCostFactor;
+import net.freerouting.geometry.planar.FloatPoint;
+import net.freerouting.geometry.planar.IntBox;
/**
* Calculation of a good lower bound for the distance between a new MazeExpansionElement
* and the destination set of the expansion.
*
- * @author Alfons Wirtz
+ * @author Alfons Wirtz
*/
-public class DestinationDistance
-{
-
+public class DestinationDistance {
+
+ private final ExpansionCostFactor[] trace_costs;
+ private final boolean[] layer_active;
+ private final int layer_count;
+ private final int active_layer_count;
+ double min_component_side_trace_cost;
+ double max_component_side_trace_cost;
+ double min_solder_side_trace_cost;
+ double max_solder_side_trace_cost;
+ double max_inner_side_trace_cost;
+ // minimum of the maximal trace costs on each inner layer
+ double min_component_inner_trace_cost;
+ // minimum of min_component_side_trace_cost and
+ // max_inner_side_trace_cost
+ double min_solder_inner_trace_cost;
+ // minimum of min_solder_side_trace_cost and max_inner_side_trace_cost
+ double min_component_solder_inner_trace_cost;
+ private double min_normal_via_cost;
+ private double min_cheap_via_cost;
+ // minimum of min_component_inner_trace_cost and
+ // min_solder_inner_trace_cost
+ private IntBox component_side_box = IntBox.EMPTY;
+ private IntBox solder_side_box = IntBox.EMPTY;
+ private IntBox inner_side_box = IntBox.EMPTY;
+ private boolean box_is_empty = true;
+ private boolean component_side_box_is_empty = true;
+ private boolean solder_side_box_is_empty = true;
+ private boolean inner_side_box_is_empty = true;
/**
* Creates a new instance of DestinationDistance.
* p_trace_costs and p_layer_active are arrays of dimension layer_count.
*/
- public DestinationDistance( ExpansionCostFactor [] p_trace_costs,
- boolean [] p_layer_active, double p_min_normal_via_cost, double p_min_cheap_via_cost)
- {
+ public DestinationDistance(ExpansionCostFactor[] p_trace_costs,
+ boolean[] p_layer_active, double p_min_normal_via_cost, double p_min_cheap_via_cost) {
trace_costs = p_trace_costs;
layer_active = p_layer_active;
layer_count = p_layer_active.length;
min_normal_via_cost = p_min_normal_via_cost;
min_cheap_via_cost = p_min_cheap_via_cost;
int curr_active_layer_count = 0;
- for (int ind = 0; ind < layer_count; ++ind)
- {
- if (layer_active[ind])
- {
+ for (int ind = 0; ind < layer_count; ++ind) {
+ if (layer_active[ind]) {
++curr_active_layer_count;
}
}
this.active_layer_count = curr_active_layer_count;
-
- if (layer_active[0])
- {
- if (trace_costs[0].horizontal < trace_costs[0].vertical)
- {
+
+ if (layer_active[0]) {
+ if (trace_costs[0].horizontal < trace_costs[0].vertical) {
min_component_side_trace_cost = trace_costs[0].horizontal;
max_component_side_trace_cost = trace_costs[0].vertical;
- }
- else
- {
+ } else {
min_component_side_trace_cost = trace_costs[0].vertical;
max_component_side_trace_cost = trace_costs[0].horizontal;
}
}
-
- if (layer_active[layer_count - 1])
- {
+
+ if (layer_active[layer_count - 1]) {
ExpansionCostFactor curr_trace_cost = trace_costs[layer_count - 1];
-
- if (curr_trace_cost.horizontal < curr_trace_cost.vertical)
- {
+
+ if (curr_trace_cost.horizontal < curr_trace_cost.vertical) {
min_solder_side_trace_cost = curr_trace_cost.horizontal;
max_solder_side_trace_cost = curr_trace_cost.vertical;
- }
- else
- {
+ } else {
min_solder_side_trace_cost = curr_trace_cost.vertical;
max_solder_side_trace_cost = curr_trace_cost.horizontal;
}
}
-
+
// Note: for inner layers we assume, that cost in preferred direction is 1
max_inner_side_trace_cost =
Math.min(max_component_side_trace_cost, max_solder_side_trace_cost);
- for (int ind2 = 1; ind2 < layer_count - 1; ++ind2)
- {
- if (!layer_active[ind2])
- {
+ for (int ind2 = 1; ind2 < layer_count - 1; ++ind2) {
+ if (!layer_active[ind2]) {
continue;
}
double curr_max_cost = Math.max(trace_costs[ind2].horizontal, trace_costs[ind2].vertical);
-
+
max_inner_side_trace_cost = Math.min(max_inner_side_trace_cost, curr_max_cost);
}
min_component_inner_trace_cost = Math.min(min_component_side_trace_cost, max_inner_side_trace_cost);
min_solder_inner_trace_cost = Math.min(min_solder_side_trace_cost, max_inner_side_trace_cost);
min_component_solder_inner_trace_cost = Math.min(min_component_inner_trace_cost, min_solder_inner_trace_cost);
}
-
- public void join(IntBox p_box, int p_layer)
- {
- if (p_layer == 0)
- {
+
+ public void join(IntBox p_box, int p_layer) {
+ if (p_layer == 0) {
component_side_box = component_side_box.union(p_box);
component_side_box_is_empty = false;
- }
- else if (p_layer == layer_count - 1)
- {
- solder_side_box =solder_side_box.union(p_box);
+ } else if (p_layer == layer_count - 1) {
+ solder_side_box = solder_side_box.union(p_box);
solder_side_box_is_empty = false;
- }
- else
- {
+ } else {
inner_side_box = inner_side_box.union(p_box);
inner_side_box_is_empty = false;
}
box_is_empty = false;
}
-
- public double calculate(FloatPoint p_point, int p_layer)
- {
- return calculate( p_point.bounding_box(), p_layer);
+
+ public double calculate(FloatPoint p_point, int p_layer) {
+ return calculate(p_point.bounding_box(), p_layer);
}
-
- public double calculate(IntBox p_box, int p_layer)
- {
- if (box_is_empty)
- {
+
+ public double calculate(IntBox p_box, int p_layer) {
+ if (box_is_empty) {
return Integer.MAX_VALUE;
}
-
+
double component_side_delta_x;
double component_side_delta_y;
-
- if (p_box.ll.x > component_side_box.ur.x)
- {
+
+ if (p_box.ll.x > component_side_box.ur.x) {
component_side_delta_x = p_box.ll.x - component_side_box.ur.x;
- }
- else if (p_box.ur.x < component_side_box.ll.x)
- {
+ } else if (p_box.ur.x < component_side_box.ll.x) {
component_side_delta_x = component_side_box.ll.x - p_box.ur.x;
- }
- else
- {
+ } else {
component_side_delta_x = 0;
}
-
- if (p_box.ll.y > component_side_box.ur.y)
- {
+
+ if (p_box.ll.y > component_side_box.ur.y) {
component_side_delta_y = p_box.ll.y - component_side_box.ur.y;
- }
- else if (p_box.ur.y < component_side_box.ll.y)
- {
+ } else if (p_box.ur.y < component_side_box.ll.y) {
component_side_delta_y = component_side_box.ll.y - p_box.ur.y;
- }
- else
- {
+ } else {
component_side_delta_y = 0;
}
-
+
double solder_side_delta_x;
double solder_side_delta_y;
-
- if (p_box.ll.x > solder_side_box.ur.x)
- {
+
+ if (p_box.ll.x > solder_side_box.ur.x) {
solder_side_delta_x = p_box.ll.x - solder_side_box.ur.x;
- }
- else if (p_box.ur.x < solder_side_box.ll.x)
- {
+ } else if (p_box.ur.x < solder_side_box.ll.x) {
solder_side_delta_x = solder_side_box.ll.x - p_box.ur.x;
- }
- else
- {
+ } else {
solder_side_delta_x = 0;
}
-
- if (p_box.ll.y > solder_side_box.ur.y)
- {
+
+ if (p_box.ll.y > solder_side_box.ur.y) {
solder_side_delta_y = p_box.ll.y - solder_side_box.ur.y;
- }
- else if (p_box.ur.y < solder_side_box.ll.y)
- {
+ } else if (p_box.ur.y < solder_side_box.ll.y) {
solder_side_delta_y = solder_side_box.ll.y - p_box.ur.y;
- }
- else
- {
+ } else {
solder_side_delta_y = 0;
}
-
+
double inner_side_delta_x;
double inner_side_delta_y;
-
- if (p_box.ll.x > inner_side_box.ur.x)
- {
+
+ if (p_box.ll.x > inner_side_box.ur.x) {
inner_side_delta_x = p_box.ll.x - inner_side_box.ur.x;
- }
- else if (p_box.ur.x < inner_side_box.ll.x)
- {
+ } else if (p_box.ur.x < inner_side_box.ll.x) {
inner_side_delta_x = inner_side_box.ll.x - p_box.ur.x;
- }
- else
- {
+ } else {
inner_side_delta_x = 0;
}
-
- if (p_box.ll.y > inner_side_box.ur.y)
- {
+
+ if (p_box.ll.y > inner_side_box.ur.y) {
inner_side_delta_y = p_box.ll.y - inner_side_box.ur.y;
- }
- else if (p_box.ur.y < inner_side_box.ll.y)
- {
+ } else if (p_box.ur.y < inner_side_box.ll.y) {
inner_side_delta_y = inner_side_box.ll.y - p_box.ur.y;
- }
- else
- {
+ } else {
inner_side_delta_y = 0;
}
-
+
double component_side_max_delta;
double component_side_min_delta;
-
- if (component_side_delta_x > component_side_delta_y)
- {
+
+ if (component_side_delta_x > component_side_delta_y) {
component_side_max_delta = component_side_delta_x;
component_side_min_delta = component_side_delta_y;
- }
- else
- {
+ } else {
component_side_max_delta = component_side_delta_y;
component_side_min_delta = component_side_delta_x;
}
-
+
double solder_side_max_delta;
double solder_side_min_delta;
-
- if (solder_side_delta_x > solder_side_delta_y)
- {
+
+ if (solder_side_delta_x > solder_side_delta_y) {
solder_side_max_delta = solder_side_delta_x;
solder_side_min_delta = solder_side_delta_y;
- }
- else
- {
+ } else {
solder_side_max_delta = solder_side_delta_y;
solder_side_min_delta = solder_side_delta_x;
}
-
+
double inner_side_max_delta;
double inner_side_min_delta;
-
- if (inner_side_delta_x > inner_side_delta_y)
- {
+
+ if (inner_side_delta_x > inner_side_delta_y) {
inner_side_max_delta = inner_side_delta_x;
inner_side_min_delta = inner_side_delta_y;
- }
- else
- {
+ } else {
inner_side_max_delta = inner_side_delta_y;
inner_side_min_delta = inner_side_delta_x;
}
-
+
double result = Integer.MAX_VALUE;
-
+
if (p_layer == 0)
- // calculate shortest distance to component side box
+ // calculate shortest distance to component side box
{
// calculate one layer distance
-
- if (!component_side_box_is_empty)
- {
+
+ if (!component_side_box_is_empty) {
result =
p_box.weighted_distance(component_side_box,
- trace_costs[0].horizontal, trace_costs[0].vertical);
+ trace_costs[0].horizontal, trace_costs[0].vertical);
}
-
- if (active_layer_count <= 1)
- {
+
+ if (active_layer_count <= 1) {
return result;
}
-
+
// calculate two layer distance on component and solder side
-
+
double tmp_distance;
if (min_solder_side_trace_cost < min_component_side_trace_cost)
tmp_distance =
min_solder_side_trace_cost * solder_side_max_delta
- + min_component_side_trace_cost * solder_side_min_delta
- + min_normal_via_cost;
+ + min_component_side_trace_cost * solder_side_min_delta
+ + min_normal_via_cost;
else
tmp_distance =
min_component_side_trace_cost * solder_side_max_delta
- + min_solder_side_trace_cost * solder_side_min_delta
- + min_normal_via_cost;
-
+ + min_solder_side_trace_cost * solder_side_min_delta
+ + min_normal_via_cost;
+
result = Math.min(result, tmp_distance);
-
+
// calculate two layer distance on component and solde side
// with two vias
-
+
tmp_distance = component_side_max_delta
+ component_side_min_delta * min_component_inner_trace_cost
+ 2 * min_normal_via_cost;
-
+
result = Math.min(result, tmp_distance);
-
+
if (active_layer_count <= 2)
return result;
-
+
// calculate two layer distance on component side and an inner side
-
+
tmp_distance = inner_side_max_delta +
inner_side_min_delta * min_component_inner_trace_cost +
min_normal_via_cost;
-
+
result = Math.min(result, tmp_distance);
-
+
// calculate three layer distance
-
+
tmp_distance = solder_side_max_delta +
+min_component_solder_inner_trace_cost * solder_side_min_delta
+ 2 * min_normal_via_cost;
result = Math.min(result, tmp_distance);
-
+
tmp_distance = component_side_max_delta +
component_side_min_delta + 2 * min_normal_via_cost;
result = Math.min(result, tmp_distance);
-
+
if (active_layer_count <= 3)
return result;
-
+
tmp_distance = inner_side_max_delta + inner_side_min_delta
+ 2 * min_normal_via_cost;
-
+
result = Math.min(result, tmp_distance);
-
+
// calculate four layer distance
-
+
tmp_distance = solder_side_max_delta + solder_side_min_delta
+ 3 * min_normal_via_cost;
-
+
result = Math.min(result, tmp_distance);
-
+
return result;
}
if (p_layer == layer_count - 1)
- // calculate shortest distance to solder side box
+ // calculate shortest distance to solder side box
{
// calculate one layer distance
-
- if (!solder_side_box_is_empty)
- {
+
+ if (!solder_side_box_is_empty) {
result =
p_box.weighted_distance(solder_side_box,
- trace_costs[p_layer].horizontal, trace_costs[p_layer].vertical);
+ trace_costs[p_layer].horizontal, trace_costs[p_layer].vertical);
}
-
+
// calculate two layer distance
double tmp_distance;
- if (min_component_side_trace_cost < min_solder_side_trace_cost)
- {
+ if (min_component_side_trace_cost < min_solder_side_trace_cost) {
tmp_distance =
min_component_side_trace_cost * component_side_max_delta
- + min_solder_side_trace_cost * component_side_min_delta
- + min_normal_via_cost;
- }
- else
- {
+ + min_solder_side_trace_cost * component_side_min_delta
+ + min_normal_via_cost;
+ } else {
tmp_distance =
min_solder_side_trace_cost * component_side_max_delta
- + min_component_side_trace_cost * component_side_min_delta
- + min_normal_via_cost;
+ + min_component_side_trace_cost * component_side_min_delta
+ + min_normal_via_cost;
}
result = Math.min(result, tmp_distance);
tmp_distance = solder_side_max_delta
+ solder_side_min_delta * min_solder_inner_trace_cost
+ 2 * min_normal_via_cost;
result = Math.min(result, tmp_distance);
- if (active_layer_count <= 2)
- {
+ if (active_layer_count <= 2) {
return result;
}
tmp_distance = inner_side_min_delta * min_solder_inner_trace_cost
+ inner_side_max_delta + min_normal_via_cost;
result = Math.min(result, tmp_distance);
-
+
// calculate three layer distance
-
+
tmp_distance = component_side_max_delta +
min_component_solder_inner_trace_cost * component_side_min_delta
+ 2 * min_normal_via_cost;
@@ -404,30 +361,29 @@ else if (p_box.ur.y < inner_side_box.ll.y)
tmp_distance = inner_side_max_delta + inner_side_min_delta
+ 2 * min_normal_via_cost;
result = Math.min(result, tmp_distance);
-
+
// calculate four layer distance
-
+
tmp_distance = component_side_max_delta + component_side_min_delta
+ 3 * min_normal_via_cost;
result = Math.min(result, tmp_distance);
return result;
}
-
+
// calculate distance to inner layer box
-
+
// calculate one layer distance
-
- if (!inner_side_box_is_empty)
- {
+
+ if (!inner_side_box_is_empty) {
result =
p_box.weighted_distance(inner_side_box,
- trace_costs[p_layer].horizontal, trace_costs[p_layer].vertical);
+ trace_costs[p_layer].horizontal, trace_costs[p_layer].vertical);
}
-
+
// calculate two layer distance
-
+
double tmp_distance = inner_side_max_delta + inner_side_min_delta + min_normal_via_cost;
-
+
result = Math.min(result, tmp_distance);
tmp_distance = component_side_max_delta
+ component_side_min_delta * min_component_inner_trace_cost
@@ -437,60 +393,26 @@ else if (p_box.ur.y < inner_side_box.ll.y)
+ solder_side_min_delta * min_solder_inner_trace_cost
+ min_normal_via_cost;
result = Math.min(result, tmp_distance);
-
+
// calculate three layer distance
-
+
tmp_distance = component_side_max_delta + component_side_min_delta
+ 2 * min_normal_via_cost;
result = Math.min(result, tmp_distance);
tmp_distance = solder_side_max_delta + solder_side_min_delta
+ 2 * min_normal_via_cost;
result = Math.min(result, tmp_distance);
-
+
return result;
}
-
- public double calculate_cheap_distance(IntBox p_box, int p_layer)
- {
+
+ public double calculate_cheap_distance(IntBox p_box, int p_layer) {
double min_normal_via_cost_save = min_normal_via_cost;
-
+
min_normal_via_cost = min_cheap_via_cost;
double result = calculate(p_box, p_layer);
-
+
min_normal_via_cost = min_normal_via_cost_save;
return result;
}
-
-
-
-
- private final ExpansionCostFactor [] trace_costs;
- private final boolean [] layer_active;
- private final int layer_count;
- private final int active_layer_count;
-
- private double min_normal_via_cost;
- private double min_cheap_via_cost;
- double min_component_side_trace_cost;
- double max_component_side_trace_cost;
- double min_solder_side_trace_cost;
- double max_solder_side_trace_cost;
- double max_inner_side_trace_cost;
- // minimum of the maximal trace costs on each inner layer
- double min_component_inner_trace_cost;
- // minimum of min_component_side_trace_cost and
- // max_inner_side_trace_cost
- double min_solder_inner_trace_cost;
- // minimum of min_solder_side_trace_cost and max_inner_side_trace_cost
- double min_component_solder_inner_trace_cost;
- // minimum of min_component_inner_trace_cost and
- // min_solder_inner_trace_cost
- private IntBox component_side_box = IntBox.EMPTY;
- private IntBox solder_side_box = IntBox.EMPTY;
- private IntBox inner_side_box = IntBox.EMPTY;
-
- private boolean box_is_empty = true;
- private boolean component_side_box_is_empty = true;
- private boolean solder_side_box_is_empty = true;
- private boolean inner_side_box_is_empty = true;
}
diff --git a/autoroute/DrillPage.java b/src/main/java/net/freerouting/autoroute/DrillPage.java
similarity index 65%
rename from autoroute/DrillPage.java
rename to src/main/java/net/freerouting/autoroute/DrillPage.java
index 481e4507..9071cbe2 100644
--- a/autoroute/DrillPage.java
+++ b/src/main/java/net/freerouting/autoroute/DrillPage.java
@@ -19,50 +19,77 @@
*
*/
-package autoroute;
+package net.freerouting.autoroute;
+
+import net.freerouting.board.Item;
+import net.freerouting.board.RoutingBoard;
+import net.freerouting.board.ShapeSearchTree;
+import net.freerouting.datastructures.ShapeTree.TreeEntry;
+import net.freerouting.geometry.planar.IntBox;
+import net.freerouting.geometry.planar.Point;
+import net.freerouting.geometry.planar.PolylineArea;
+import net.freerouting.geometry.planar.TileShape;
import java.util.Collection;
-import java.util.LinkedList;
import java.util.Iterator;
-
-import geometry.planar.Point;
-import geometry.planar.IntBox;
-import geometry.planar.TileShape;
-import geometry.planar.PolylineArea;
-
-import datastructures.ShapeTree.TreeEntry;
-
-import board.RoutingBoard;
-import board.ShapeSearchTree;
-import board.Item;
+import java.util.LinkedList;
/**
- *
* @author Alfons Wirtz
*/
-class DrillPage implements ExpandableObject
-{
-
- /** Creates a new instance of DrillPage */
- public DrillPage(IntBox p_shape, RoutingBoard p_board)
- {
+class DrillPage implements ExpandableObject {
+
+ /**
+ * The shape of the page
+ */
+ final IntBox shape;
+ private final MazeSearchElement[] maze_search_info_arr;
+ private final RoutingBoard board;
+ /**
+ * The list of expansion drills on this page. Null, if not yet calculated.
+ */
+ private Collection drills = null;
+ /**
+ * The number of the net, for which the drills are calculated
+ */
+ private int net_no = -1;
+
+ /**
+ * Creates a new instance of DrillPage
+ */
+ public DrillPage(IntBox p_shape, RoutingBoard p_board) {
shape = p_shape;
board = p_board;
- maze_search_info_arr = new MazeSearchElement[p_board.get_layer_count()];
- for (int i = 0; i < maze_search_info_arr.length; ++i)
- {
- maze_search_info_arr[i] = new MazeSearchElement();
+ maze_search_info_arr = new MazeSearchElement[p_board.get_layer_count()];
+ for (int i = 0; i < maze_search_info_arr.length; ++i) {
+ maze_search_info_arr[i] = new MazeSearchElement();
+ }
+ }
+
+ /**
+ * Looks if p_drill_shape contains the center of a drillable Pin on p_layer.
+ * Returns null, if no such Pin was found.
+ */
+ private static Point calc_pin_center_in_drill(TileShape p_drill_shape, int p_layer, RoutingBoard p_board) {
+ Collection
- overlapping_items = p_board.overlapping_items(p_drill_shape, p_layer);
+ Point result = null;
+ for (Item curr_item : overlapping_items) {
+ if (curr_item instanceof net.freerouting.board.Pin) {
+ net.freerouting.board.Pin curr_pin = (net.freerouting.board.Pin) curr_item;
+ if (curr_pin.drill_allowed() && p_drill_shape.contains_inside(curr_pin.get_center())) {
+ result = curr_pin.get_center();
+ }
+ }
}
+ return result;
}
-
+
/**
* Returns the drills on this page.
* If p_atttach_smd, drilling to smd pins is allowed.
*/
- public Collection get_drills(AutorouteEngine p_autoroute_engine, boolean p_attach_smd)
- {
- if (this.drills == null || p_autoroute_engine.get_net_no() != this.net_no)
- {
+ public Collection get_drills(AutorouteEngine p_autoroute_engine, boolean p_attach_smd) {
+ if (this.drills == null || p_autoroute_engine.get_net_no() != this.net_no) {
this.net_no = p_autoroute_engine.get_net_no();
this.drills = new LinkedList();
ShapeSearchTree search_tree = this.board.search_tree_manager.get_default_tree();
@@ -71,32 +98,25 @@ public Collection get_drills(AutorouteEngine p_autoroute_engine,
Collection cutout_shapes = new LinkedList();
// drills on top of existing vias are used in the ripup algorithm
TileShape prev_obstacle_shape = IntBox.EMPTY;
- for (TreeEntry curr_entry : overlaps)
- {
- if (!(curr_entry.object instanceof Item))
- {
+ for (TreeEntry curr_entry : overlaps) {
+ if (!(curr_entry.object instanceof Item)) {
continue;
}
Item curr_item = (Item) curr_entry.object;
- if (curr_item.is_drillable(this.net_no))
- {
+ if (curr_item.is_drillable(this.net_no)) {
continue;
}
- if (curr_item instanceof board.Pin)
- {
- if (p_attach_smd && ((board.Pin) curr_item).drill_allowed())
- {
+ if (curr_item instanceof net.freerouting.board.Pin) {
+ if (p_attach_smd && ((net.freerouting.board.Pin) curr_item).drill_allowed()) {
continue;
}
}
TileShape curr_obstacle_shape =
curr_item.get_tree_shape(search_tree, curr_entry.shape_index_in_object);
- if (!prev_obstacle_shape.contains(curr_obstacle_shape))
- {
+ if (!prev_obstacle_shape.contains(curr_obstacle_shape)) {
// Checked to avoid multiple cutout for example for vias with the same shape on all layers.
TileShape curr_cutout_shape = curr_obstacle_shape.intersection(this.shape);
- if (curr_cutout_shape.dimension() == 2)
- {
+ if (curr_cutout_shape.dimension() == 2) {
cutout_shapes.add(curr_cutout_shape);
}
}
@@ -104,144 +124,90 @@ public Collection get_drills(AutorouteEngine p_autoroute_engine,
}
TileShape[] holes = new TileShape[cutout_shapes.size()];
Iterator it = cutout_shapes.iterator();
- for (int i = 0; i < holes.length; ++i)
- {
+ for (int i = 0; i < holes.length; ++i) {
holes[i] = it.next();
}
PolylineArea shape_with_holes = new PolylineArea(this.shape, holes);
- TileShape [] drill_shapes = shape_with_holes.split_to_convex(p_autoroute_engine.stoppable_thread);
-
+ TileShape[] drill_shapes = shape_with_holes.split_to_convex(p_autoroute_engine.stoppable_thread);
+
// Use the center points of these drill shapes to try making a via.
int drill_first_layer = 0;
int drill_last_layer = this.board.get_layer_count() - 1;
- for (int i = 0; i < drill_shapes.length; ++i)
- {
+ for (int i = 0; i < drill_shapes.length; ++i) {
TileShape curr_drill_shape = drill_shapes[i];
Point curr_drill_location = null;
- if (p_attach_smd)
- {
+ if (p_attach_smd) {
curr_drill_location =
calc_pin_center_in_drill(curr_drill_shape, drill_first_layer, p_autoroute_engine.board);
- if (curr_drill_location == null)
- {
+ if (curr_drill_location == null) {
curr_drill_location =
calc_pin_center_in_drill(curr_drill_shape, drill_last_layer, p_autoroute_engine.board);
}
}
- if (curr_drill_location == null)
- {
+ if (curr_drill_location == null) {
curr_drill_location = curr_drill_shape.centre_of_gravity().round();
}
ExpansionDrill new_drill =
new ExpansionDrill(curr_drill_shape, curr_drill_location, drill_first_layer, drill_last_layer);
- if (new_drill.calculate_expansion_rooms(p_autoroute_engine))
- {
+ if (new_drill.calculate_expansion_rooms(p_autoroute_engine)) {
this.drills.add(new_drill);
}
}
}
return this.drills;
}
-
- public TileShape get_shape()
- {
+
+ public TileShape get_shape() {
return this.shape;
}
-
- public int get_dimension()
- {
+
+ public int get_dimension() {
return 2;
}
-
- public int maze_search_element_count()
- {
+
+ public int maze_search_element_count() {
return this.maze_search_info_arr.length;
}
-
- public MazeSearchElement get_maze_search_element (int p_no)
- {
+
+ public MazeSearchElement get_maze_search_element(int p_no) {
return this.maze_search_info_arr[p_no];
}
-
+
/**
* Resets all drills of this page for autorouting the next connection.
*/
- public void reset()
- {
- if (this.drills != null)
- {
- for (ExpansionDrill curr_drill : this.drills)
- {
+ public void reset() {
+ if (this.drills != null) {
+ for (ExpansionDrill curr_drill : this.drills) {
curr_drill.reset();
}
}
- for (MazeSearchElement curr_info : maze_search_info_arr)
- {
+ for (MazeSearchElement curr_info : maze_search_info_arr) {
curr_info.reset();
}
}
-
+
/**
* Invalidates the drills of this page so that they are recalculated at the next call of get_drills().
*/
- public void invalidate()
- {
+ public void invalidate() {
this.drills = null;
}
-
+
/*
* Test draw of the drills on this page.
*/
public void draw(java.awt.Graphics p_graphics,
- boardgraphics.GraphicsContext p_graphics_context, double p_intensity)
- {
- if (true || drills == null)
- {
+ net.freerouting.boardgraphics.GraphicsContext p_graphics_context, double p_intensity) {
+ if (true || drills == null) {
return;
}
- for (ExpansionDrill curr_drill : drills)
- {
+ for (ExpansionDrill curr_drill : drills) {
curr_drill.draw(p_graphics, p_graphics_context, p_intensity);
}
}
-
- public CompleteExpansionRoom other_room(CompleteExpansionRoom p_room)
- {
+
+ public CompleteExpansionRoom other_room(CompleteExpansionRoom p_room) {
return null;
}
-
- /**
- * Looks if p_drill_shape contains the center of a drillable Pin on p_layer.
- * Returns null, if no such Pin was found.
- */
- private static Point calc_pin_center_in_drill(TileShape p_drill_shape, int p_layer, RoutingBoard p_board)
- {
- Collection
- overlapping_items = p_board.overlapping_items(p_drill_shape, p_layer);
- Point result = null;
- for (Item curr_item : overlapping_items)
- {
- if (curr_item instanceof board.Pin)
- {
- board.Pin curr_pin = (board.Pin) curr_item;
- if (curr_pin.drill_allowed() && p_drill_shape.contains_inside(curr_pin.get_center()))
- {
- result = curr_pin.get_center();
- }
- }
- }
- return result;
- }
-
- private final MazeSearchElement[] maze_search_info_arr;
-
- /** The shape of the page */
- final IntBox shape;
-
- /** The list of expansion drills on this page. Null, if not yet calculated. */
- private Collection drills = null;
-
- private final RoutingBoard board;
-
- /** The number of the net, for which the drills are calculated */
- private int net_no = -1;
}
diff --git a/autoroute/DrillPageArray.java b/src/main/java/net/freerouting/autoroute/DrillPageArray.java
similarity index 61%
rename from autoroute/DrillPageArray.java
rename to src/main/java/net/freerouting/autoroute/DrillPageArray.java
index 5497c239..36332152 100644
--- a/autoroute/DrillPageArray.java
+++ b/src/main/java/net/freerouting/autoroute/DrillPageArray.java
@@ -19,159 +19,133 @@
*
*/
-package autoroute;
+package net.freerouting.autoroute;
+
+import net.freerouting.board.RoutingBoard;
+import net.freerouting.geometry.planar.IntBox;
+import net.freerouting.geometry.planar.TileShape;
import java.util.Collection;
import java.util.LinkedList;
-import geometry.planar.IntBox;
-import geometry.planar.TileShape;
-
-import board.RoutingBoard;
-
/**
* Describes the 2 dimensional array of pages of ExpansionDrill`s used in the maze search algorithm.
* The pages are rectangles of about equal width and height covering covering the bounding box of the board area.
*
* @author Alfons Wirtz
*/
-public class DrillPageArray
-{
-
- /** Creates a new instance of DrillPageArray */
- public DrillPageArray(RoutingBoard p_board, int p_max_page_width)
- {
+public class DrillPageArray {
+
+ private final IntBox bounds;
+ /**
+ * The number of colums in the array.
+ */
+ private final int COLUMN_COUNT;
+ /**
+ * The number of rows in the array.
+ */
+ private final int ROW_COUNT;
+ /**
+ * The width of a single page in this array.
+ */
+ private final int PAGE_WIDTH;
+ /**
+ * The height of a single page in this array.
+ */
+ private final int PAGE_HEIGHT;
+ private final DrillPage[][] page_arr;
+
+ /**
+ * Creates a new instance of DrillPageArray
+ */
+ public DrillPageArray(RoutingBoard p_board, int p_max_page_width) {
this.bounds = p_board.bounding_box;
double length = bounds.ur.x - bounds.ll.x;
double height = bounds.ur.y - bounds.ll.y;
this.COLUMN_COUNT = (int) Math.ceil(length / p_max_page_width);
- this.ROW_COUNT = (int) Math.ceil(height/ p_max_page_width);
+ this.ROW_COUNT = (int) Math.ceil(height / p_max_page_width);
this.PAGE_WIDTH = (int) Math.ceil(length / COLUMN_COUNT);
this.PAGE_HEIGHT = (int) Math.ceil(height / ROW_COUNT);
- this.page_arr = new DrillPage[ROW_COUNT] [COLUMN_COUNT];
- for (int j = 0; j < this.ROW_COUNT; ++j)
- {
- for (int i = 0; i < this.COLUMN_COUNT; ++i)
- {
+ this.page_arr = new DrillPage[ROW_COUNT][COLUMN_COUNT];
+ for (int j = 0; j < this.ROW_COUNT; ++j) {
+ for (int i = 0; i < this.COLUMN_COUNT; ++i) {
int ll_x = bounds.ll.x + i * PAGE_WIDTH;
int ur_x;
- if (i == COLUMN_COUNT - 1)
- {
+ if (i == COLUMN_COUNT - 1) {
ur_x = bounds.ur.x;
- }
- else
- {
+ } else {
ur_x = ll_x + PAGE_WIDTH;
}
int ll_y = bounds.ll.y + j * PAGE_HEIGHT;
int ur_y;
- if (j == ROW_COUNT - 1)
- {
+ if (j == ROW_COUNT - 1) {
ur_y = bounds.ur.y;
- }
- else
- {
+ } else {
ur_y = ll_y + PAGE_HEIGHT;
}
- page_arr [j] [i] = new DrillPage(new IntBox(ll_x, ll_y, ur_x, ur_y), p_board);
+ page_arr[j][i] = new DrillPage(new IntBox(ll_x, ll_y, ur_x, ur_y), p_board);
}
}
}
-
+
/**
* Invalidates all drill pages intersecting with p_shape, so the they must be recalculated at the next
* call of get_ddrills()
*/
- public void invalidate(TileShape p_shape)
- {
- Collection overlaps = overlapping_pages( p_shape);
- for (DrillPage curr_page : overlaps)
- {
+ public void invalidate(TileShape p_shape) {
+ Collection overlaps = overlapping_pages(p_shape);
+ for (DrillPage curr_page : overlaps) {
curr_page.invalidate();
}
}
-
+
/**
* Collects all drill pages with a 2-dimensional overlap with p_shape.
*/
- public Collection overlapping_pages(TileShape p_shape)
- {
+ public Collection overlapping_pages(TileShape p_shape) {
Collection result = new LinkedList();
-
+
IntBox shape_box = p_shape.bounding_box().intersection(this.bounds);
-
- int min_j = (int) Math.floor(((double)(shape_box.ll.y - bounds.ll.y))/ (double) PAGE_HEIGHT);
+
+ int min_j = (int) Math.floor(((double) (shape_box.ll.y - bounds.ll.y)) / (double) PAGE_HEIGHT);
double max_j = ((double) (shape_box.ur.y - bounds.ll.y)) / (double) PAGE_HEIGHT;
-
- int min_i = (int) Math.floor(((double) (shape_box.ll.x - bounds.ll.x))/ (double) PAGE_WIDTH );
+
+ int min_i = (int) Math.floor(((double) (shape_box.ll.x - bounds.ll.x)) / (double) PAGE_WIDTH);
double max_i = ((double) (shape_box.ur.x - bounds.ll.x)) / (double) PAGE_WIDTH;
-
- for (int j = min_j; j < max_j; ++j)
- {
- for (int i = min_i; i < max_i; ++i)
- {
- DrillPage curr_page = this.page_arr[j] [i];
+
+ for (int j = min_j; j < max_j; ++j) {
+ for (int i = min_i; i < max_i; ++i) {
+ DrillPage curr_page = this.page_arr[j][i];
TileShape intersection = p_shape.intersection(curr_page.shape);
- if (intersection.dimension() > 1)
- {
- result.add(this.page_arr[j] [i]);
+ if (intersection.dimension() > 1) {
+ result.add(this.page_arr[j][i]);
}
}
}
return result;
}
-
+
/**
* Resets all drill pages for autorouting the next connection.
*/
- public void reset()
- {
- for (int j = 0; j < page_arr.length; ++j)
- {
- DrillPage [] curr_row = page_arr[j];
- for (int i = 0; i < curr_row.length; ++i)
- {
+ public void reset() {
+ for (int j = 0; j < page_arr.length; ++j) {
+ DrillPage[] curr_row = page_arr[j];
+ for (int i = 0; i < curr_row.length; ++i) {
curr_row[i].reset();
}
}
}
-
- /*
- * Test draw of the all drills
- */
- public void draw(java.awt.Graphics p_graphics, boardgraphics.GraphicsContext p_graphics_context, double p_intensity)
- {
- for (int j = 0; j < page_arr.length; ++j)
- {
- DrillPage [] curr_row = page_arr[j];
- for (int i = 0; i < curr_row.length; ++i)
- {
+
+ /*
+ * Test draw of the all drills
+ */
+ public void draw(java.awt.Graphics p_graphics, net.freerouting.boardgraphics.GraphicsContext p_graphics_context, double p_intensity) {
+ for (int j = 0; j < page_arr.length; ++j) {
+ DrillPage[] curr_row = page_arr[j];
+ for (int i = 0; i < curr_row.length; ++i) {
curr_row[i].draw(p_graphics, p_graphics_context, p_intensity);
}
}
}
-
- private final IntBox bounds;
-
- /**
- * The number of colums in the array.
- */
- private final int COLUMN_COUNT;
-
- /**
- * The number of rows in the array.
- */
- private final int ROW_COUNT;
-
- /**
- * The width of a single page in this array.
- */
- private final int PAGE_WIDTH;
-
- /**
- * The height of a single page in this array.
- */
- private final int PAGE_HEIGHT;
-
- private final DrillPage [][] page_arr;
}
diff --git a/autoroute/ExpandableObject.java b/src/main/java/net/freerouting/autoroute/ExpandableObject.java
similarity index 84%
rename from autoroute/ExpandableObject.java
rename to src/main/java/net/freerouting/autoroute/ExpandableObject.java
index d798b220..1c571de8 100644
--- a/autoroute/ExpandableObject.java
+++ b/src/main/java/net/freerouting/autoroute/ExpandableObject.java
@@ -17,17 +17,16 @@
*
* Created on 6. April 2004, 07:30
*/
-package autoroute;
+package net.freerouting.autoroute;
-import geometry.planar.TileShape;
+import net.freerouting.geometry.planar.TileShape;
/**
* An object, which can be expanded by the maze expansion algorithm.
*
- * @author alfons
+ * @author alfons
*/
-public interface ExpandableObject
-{
+public interface ExpandableObject {
/**
* Calculates the intersection of the shapes of the 2 objecta belonging to this door.
@@ -46,12 +45,12 @@ public interface ExpandableObject
CompleteExpansionRoom other_room(CompleteExpansionRoom p_room);
/**
- * Returns the count of MazeSearchElements in this expandable object
+ * Returns the count of MazeSearchElements in this expandable object
*/
int maze_search_element_count();
/**
- * Returns the p_no-th MazeSearchElements in this expandable object
+ * Returns the p_no-th MazeSearchElements in this expandable object
*/
MazeSearchElement get_maze_search_element(int p_no);
diff --git a/autoroute/ExpansionDoor.java b/src/main/java/net/freerouting/autoroute/ExpansionDoor.java
similarity index 71%
rename from autoroute/ExpansionDoor.java
rename to src/main/java/net/freerouting/autoroute/ExpansionDoor.java
index 47d1b404..281272ab 100644
--- a/autoroute/ExpansionDoor.java
+++ b/src/main/java/net/freerouting/autoroute/ExpansionDoor.java
@@ -17,33 +17,50 @@
*
* Created on 6. Januar 2004, 07:23
*/
-package autoroute;
+package net.freerouting.autoroute;
-import geometry.planar.TileShape;
-import geometry.planar.FloatPoint;
-import geometry.planar.FloatLine;
-import geometry.planar.Point;
+import net.freerouting.geometry.planar.FloatLine;
+import net.freerouting.geometry.planar.FloatPoint;
+import net.freerouting.geometry.planar.Point;
+import net.freerouting.geometry.planar.TileShape;
/**
* An ExpansionDoor is a common edge between two ExpansionRooms
*
- *
* @author Alfons Wirtz
*/
-public class ExpansionDoor implements ExpandableObject
-{
+public class ExpansionDoor implements ExpandableObject {
- /** Creates a new instance of ExpansionDoor */
- public ExpansionDoor(ExpansionRoom p_first_room, ExpansionRoom p_second_room, int p_dimension)
- {
+ /**
+ * The first room of this door.
+ */
+ public final ExpansionRoom first_room;
+ /**
+ * The second room of this door.
+ */
+ public final ExpansionRoom second_room;
+ /**
+ * The dimension of a door may be 1 or 2.
+ */
+ public final int dimension;
+ /**
+ * each section of the following arrray can be expanded seperately by the maze search algorithm
+ */
+ MazeSearchElement[] section_arr = null;
+
+ /**
+ * Creates a new instance of ExpansionDoor
+ */
+ public ExpansionDoor(ExpansionRoom p_first_room, ExpansionRoom p_second_room, int p_dimension) {
first_room = p_first_room;
second_room = p_second_room;
dimension = p_dimension;
}
- /** Creates a new instance of ExpansionDoor */
- public ExpansionDoor(ExpansionRoom p_first_room, ExpansionRoom p_second_room)
- {
+ /**
+ * Creates a new instance of ExpansionDoor
+ */
+ public ExpansionDoor(ExpansionRoom p_first_room, ExpansionRoom p_second_room) {
first_room = p_first_room;
second_room = p_second_room;
dimension = first_room.get_shape().intersection(second_room.get_shape()).dimension();
@@ -52,8 +69,7 @@ public ExpansionDoor(ExpansionRoom p_first_room, ExpansionRoom p_second_room)
/**
* Calculates the intersection of the shapes of the 2 rooms belonging to this door.
*/
- public TileShape get_shape()
- {
+ public TileShape get_shape() {
TileShape first_shape = first_room.get_shape();
TileShape second_shape = second_room.get_shape();
return first_shape.intersection(second_shape);
@@ -63,8 +79,7 @@ public TileShape get_shape()
* The dimension of a door may be 1 or 2.
* 2-dimensional doors can only exist between ObstacleExpansionRooms
*/
- public int get_dimension()
- {
+ public int get_dimension() {
return this.dimension;
}
@@ -72,19 +87,13 @@ public int get_dimension()
* Returns the other room of this door, or null, if p_roon
* is neither equal to this.first_room nor to this.second_room.
*/
- public ExpansionRoom other_room(ExpansionRoom p_room)
- {
+ public ExpansionRoom other_room(ExpansionRoom p_room) {
ExpansionRoom result;
- if (p_room == first_room)
- {
+ if (p_room == first_room) {
result = second_room;
- }
- else if (p_room == second_room)
- {
+ } else if (p_room == second_room) {
result = first_room;
- }
- else
- {
+ } else {
result = null;
}
return result;
@@ -95,77 +104,59 @@ else if (p_room == second_room)
* is neither equal to this.first_room nor to this.second_room,
* or if the other room is not a CompleteExpansionRoom.
*/
- public CompleteExpansionRoom other_room(CompleteExpansionRoom p_room)
- {
+ public CompleteExpansionRoom other_room(CompleteExpansionRoom p_room) {
ExpansionRoom result;
- if (p_room == first_room)
- {
+ if (p_room == first_room) {
result = second_room;
- }
- else if (p_room == second_room)
- {
+ } else if (p_room == second_room) {
result = first_room;
- }
- else
- {
+ } else {
result = null;
}
- if (!(result instanceof CompleteExpansionRoom))
- {
+ if (!(result instanceof CompleteExpansionRoom)) {
result = null;
}
return (CompleteExpansionRoom) result;
}
- public int maze_search_element_count()
- {
+ public int maze_search_element_count() {
return this.section_arr.length;
}
- public MazeSearchElement get_maze_search_element(int p_no)
- {
+ public MazeSearchElement get_maze_search_element(int p_no) {
return this.section_arr[p_no];
}
/**
* Calculates the Line segments of the sections of this door.
*/
- public FloatLine[] get_section_segments(double p_offset)
- {
+ public FloatLine[] get_section_segments(double p_offset) {
double offset = p_offset + AutorouteEngine.TRACE_WIDTH_TOLERANCE;
TileShape door_shape = this.get_shape();
{
- if (door_shape.is_empty())
- {
+ if (door_shape.is_empty()) {
return new FloatLine[0];
}
}
FloatLine door_line_segment;
FloatLine shrinked_line_segment;
- if (this.dimension == 1)
- {
+ if (this.dimension == 1) {
door_line_segment = door_shape.diagonal_corner_segment();
shrinked_line_segment = door_line_segment.shrink_segment(offset);
- }
- else if (this.dimension == 2 && this.first_room instanceof CompleteFreeSpaceExpansionRoom && this.second_room instanceof CompleteFreeSpaceExpansionRoom)
- {
+ } else if (this.dimension == 2 && this.first_room instanceof CompleteFreeSpaceExpansionRoom && this.second_room instanceof CompleteFreeSpaceExpansionRoom) {
// Overlapping doors at a corner possible in case of 90- or 45-degree routing.
// In case of freeangle routing the corners are cut off.
door_line_segment = calc_door_line_segment(door_shape);
- if (door_line_segment == null)
- {
+ if (door_line_segment == null) {
// CompleteFreeSpaceExpansionRoom inside other room
return new FloatLine[0];
}
- if (door_line_segment.b.distance_square(door_line_segment.a) < 4 * offset * offset)
- {
+ if (door_line_segment.b.distance_square(door_line_segment.a) < 4 * offset * offset) {
// door is small, 2 dimensional small doors are not yet expanded.
return new FloatLine[0];
}
shrinked_line_segment = door_line_segment.shrink_segment(offset);
- }
- else
- {
+ } else {
FloatPoint gravity_point = door_shape.centre_of_gravity();
door_line_segment = new FloatLine(gravity_point, gravity_point);
shrinked_line_segment = door_line_segment;
@@ -181,32 +172,25 @@ else if (this.dimension == 2 && this.first_room instanceof CompleteFreeSpaceExpa
* Calculates a diagonal line of the 2-dimensional p_door_shape which represents the restraint line
* between the shapes of this.first_room and this.second_room.
*/
- private FloatLine calc_door_line_segment(TileShape p_door_shape)
- {
+ private FloatLine calc_door_line_segment(TileShape p_door_shape) {
TileShape first_room_shape = this.first_room.get_shape();
TileShape second_room_shape = this.second_room.get_shape();
Point first_corner = null;
Point second_corner = null;
int corner_count = p_door_shape.border_line_count();
- for (int i = 0; i < corner_count; ++i)
- {
+ for (int i = 0; i < corner_count; ++i) {
Point curr_corner = p_door_shape.corner(i);
- if (!first_room_shape.contains_inside(curr_corner) && !second_room_shape.contains_inside(curr_corner))
- {
+ if (!first_room_shape.contains_inside(curr_corner) && !second_room_shape.contains_inside(curr_corner)) {
// curr_corner is on the border of both room shapes.
- if (first_corner == null)
- {
+ if (first_corner == null) {
first_corner = curr_corner;
- }
- else if (second_corner == null && !first_corner.equals(curr_corner))
- {
+ } else if (second_corner == null && !first_corner.equals(curr_corner)) {
second_corner = curr_corner;
break;
}
}
}
- if (first_corner == null || second_corner == null)
- {
+ if (first_corner == null || second_corner == null) {
return null;
}
return new FloatLine(first_corner.to_float(), second_corner.to_float());
@@ -215,38 +199,24 @@ else if (second_corner == null && !first_corner.equals(curr_corner))
/**
* Resets this ExpandableObject for autorouting the next connection.
*/
- public void reset()
- {
- if (section_arr != null)
- {
- for (MazeSearchElement curr_section : section_arr)
- {
+ public void reset() {
+ if (section_arr != null) {
+ for (MazeSearchElement curr_section : section_arr) {
curr_section.reset();
}
}
}
- /** allocates and initialises p_section_count sections */
- void allocate_sections(int p_section_count)
- {
- if (section_arr != null && section_arr.length == p_section_count)
- {
+ /**
+ * allocates and initialises p_section_count sections
+ */
+ void allocate_sections(int p_section_count) {
+ if (section_arr != null && section_arr.length == p_section_count) {
return; // already allocated
}
section_arr = new MazeSearchElement[p_section_count];
- for (int i = 0; i < section_arr.length; ++i)
- {
+ for (int i = 0; i < section_arr.length; ++i) {
section_arr[i] = new MazeSearchElement();
}
}
- /** each section of the following arrray can be expanded seperately by the maze search algorithm */
- MazeSearchElement[] section_arr = null;
- /** The first room of this door. */
- public final ExpansionRoom first_room;
- /** The second room of this door. */
- public final ExpansionRoom second_room;
- /**
- * The dimension of a door may be 1 or 2.
- */
- public final int dimension;
}
diff --git a/autoroute/ExpansionDrill.java b/src/main/java/net/freerouting/autoroute/ExpansionDrill.java
similarity index 73%
rename from autoroute/ExpansionDrill.java
rename to src/main/java/net/freerouting/autoroute/ExpansionDrill.java
index 82e60337..14a7b822 100644
--- a/autoroute/ExpansionDrill.java
+++ b/src/main/java/net/freerouting/autoroute/ExpansionDrill.java
@@ -17,10 +17,10 @@
*
* Created on 19. April 2004, 08:00
*/
-package autoroute;
+package net.freerouting.autoroute;
-import geometry.planar.Point;
-import geometry.planar.TileShape;
+import net.freerouting.geometry.planar.Point;
+import net.freerouting.geometry.planar.TileShape;
import java.util.Collection;
import java.util.Iterator;
@@ -28,14 +28,36 @@
/**
* Layer change expansion object in the maze search algorithm.
*
- * @author alfons
+ * @author alfons
*/
-public class ExpansionDrill implements ExpandableObject
-{
+public class ExpansionDrill implements ExpandableObject {
- /** Creates a new instance of Drill */
- public ExpansionDrill(TileShape p_shape, Point p_location, int p_first_layer, int p_last_layer)
- {
+ /**
+ * The location, where the drill is checked.
+ */
+ public final Point location;
+ /**
+ * The first layer of the drill
+ */
+ public final int first_layer;
+ /**
+ * The last layer of the drill
+ */
+ public final int last_layer;
+ /**
+ * Array of dimension last_layer - first_layer + 1.
+ */
+ public final CompleteExpansionRoom[] room_arr;
+ private final MazeSearchElement[] maze_search_info_arr;
+ /**
+ * The shape of the drill.
+ */
+ private final TileShape shape;
+
+ /**
+ * Creates a new instance of Drill
+ */
+ public ExpansionDrill(TileShape p_shape, Point p_location, int p_first_layer, int p_last_layer) {
shape = p_shape;
location = p_location;
first_layer = p_first_layer;
@@ -43,8 +65,7 @@ public ExpansionDrill(TileShape p_shape, Point p_location, int p_first_layer, in
int layer_count = p_last_layer - p_first_layer + 1;
room_arr = new CompleteExpansionRoom[layer_count];
maze_search_info_arr = new MazeSearchElement[layer_count];
- for (int i = 0; i < maze_search_info_arr.length; ++i)
- {
+ for (int i = 0; i < maze_search_info_arr.length; ++i) {
maze_search_info_arr[i] = new MazeSearchElement();
}
}
@@ -55,45 +76,37 @@ public ExpansionDrill(TileShape p_shape, Point p_location, int p_first_layer, in
* Returns false, if that was not possible because of an obstacle at this.location
* on some layer in the compensated search tree.
*/
- public boolean calculate_expansion_rooms(AutorouteEngine p_autoroute_engine)
- {
+ public boolean calculate_expansion_rooms(AutorouteEngine p_autoroute_engine) {
TileShape search_shape = TileShape.get_instance(location);
- Collection overlaps =
+ Collection overlaps =
p_autoroute_engine.autoroute_search_tree.overlapping_objects(search_shape, -1);
- for (int i = this.first_layer; i <= this.last_layer; ++i)
- {
+ for (int i = this.first_layer; i <= this.last_layer; ++i) {
CompleteExpansionRoom found_room = null;
- Iterator it = overlaps.iterator();
- while (it.hasNext())
- {
- board.SearchTreeObject curr_ob = it.next();
- if (!(curr_ob instanceof CompleteExpansionRoom))
- {
+ Iterator it = overlaps.iterator();
+ while (it.hasNext()) {
+ net.freerouting.board.SearchTreeObject curr_ob = it.next();
+ if (!(curr_ob instanceof CompleteExpansionRoom)) {
it.remove();
continue;
}
CompleteExpansionRoom curr_room = (CompleteExpansionRoom) curr_ob;
- if (curr_room.get_layer() == i)
- {
+ if (curr_room.get_layer() == i) {
found_room = curr_room;
it.remove();
break;
}
}
- if (found_room == null)
- {
+ if (found_room == null) {
// create a new expansion romm on this layer
IncompleteFreeSpaceExpansionRoom new_incomplete_room =
new IncompleteFreeSpaceExpansionRoom(null, i, search_shape);
Collection new_rooms = p_autoroute_engine.complete_expansion_room(new_incomplete_room);
- if (new_rooms.size() != 1)
- {
+ if (new_rooms.size() != 1) {
// the size may be 0 because of an obstacle in the compensated tree at this.location
return false;
}
Iterator it2 = new_rooms.iterator();
- if (it2.hasNext())
- {
+ if (it2.hasNext()) {
found_room = it2.next();
}
}
@@ -102,35 +115,28 @@ public boolean calculate_expansion_rooms(AutorouteEngine p_autoroute_engine)
return true;
}
- public TileShape get_shape()
- {
+ public TileShape get_shape() {
return this.shape;
}
- public int get_dimension()
- {
+ public int get_dimension() {
return 2;
}
- public CompleteExpansionRoom other_room(CompleteExpansionRoom p_room)
- {
+ public CompleteExpansionRoom other_room(CompleteExpansionRoom p_room) {
return null;
}
- public int maze_search_element_count()
- {
+ public int maze_search_element_count() {
return this.maze_search_info_arr.length;
}
- public MazeSearchElement get_maze_search_element(int p_no)
- {
+ public MazeSearchElement get_maze_search_element(int p_no) {
return this.maze_search_info_arr[p_no];
}
- public void reset()
- {
- for (MazeSearchElement curr_info : maze_search_info_arr)
- {
+ public void reset() {
+ for (MazeSearchElement curr_info : maze_search_info_arr) {
curr_info.reset();
}
}
@@ -139,21 +145,9 @@ public void reset()
* Test draw of the the shape of this drill.
*/
public void draw(java.awt.Graphics p_graphics,
- boardgraphics.GraphicsContext p_graphics_context, double p_intensity)
- {
+ net.freerouting.boardgraphics.GraphicsContext p_graphics_context, double p_intensity) {
java.awt.Color draw_color = p_graphics_context.get_hilight_color();
p_graphics_context.fill_area(this.shape, p_graphics, draw_color, p_intensity);
p_graphics_context.draw_boundary(this.shape, 0, draw_color, p_graphics, 1);
}
- private final MazeSearchElement[] maze_search_info_arr;
- /** The shape of the drill. */
- private final TileShape shape;
- /** The location, where the drill is checked. */
- public final Point location;
- /** The first layer of the drill */
- public final int first_layer;
- /** The last layer of the drill */
- public final int last_layer;
- /** Array of dimension last_layer - first_layer + 1. */
- public final CompleteExpansionRoom[] room_arr;
}
diff --git a/autoroute/ExpansionRoom.java b/src/main/java/net/freerouting/autoroute/ExpansionRoom.java
similarity index 90%
rename from autoroute/ExpansionRoom.java
rename to src/main/java/net/freerouting/autoroute/ExpansionRoom.java
index 54bd0de9..acb8a9cd 100644
--- a/autoroute/ExpansionRoom.java
+++ b/src/main/java/net/freerouting/autoroute/ExpansionRoom.java
@@ -19,54 +19,52 @@
*
*/
-package autoroute;
+package net.freerouting.autoroute;
-import java.util.List;
+import net.freerouting.geometry.planar.TileShape;
-import geometry.planar.TileShape;
+import java.util.List;
/**
- *
* @author alfons
*/
-public interface ExpansionRoom
-{
+public interface ExpansionRoom {
/**
* Adds p_door to the list of doors of this room.
*/
void add_door(ExpansionDoor p_door);
-
+
/**
* Returns the list of doors of this room to neighbour expansion rooms
*/
List get_doors();
-
+
/**
* Removes all doors from this room.
*/
void clear_doors();
-
+
/**
* Clears the autorouting info of all doors for routing the next connection.
*/
void reset_doors();
-
+
/**
* Checks, if this room has already a door to p_other
*/
boolean door_exists(ExpansionRoom p_other);
-
+
/**
* Removes p_door from this room.
* Returns false, if p_room did not contain p_door.
*/
- boolean remove_door (ExpandableObject p_door);
-
+ boolean remove_door(ExpandableObject p_door);
+
/**
* Gets the shape of this room.
*/
TileShape get_shape();
-
+
/**
* Returns the layer of this expansion room.
*/
diff --git a/autoroute/FreeSpaceExpansionRoom.java b/src/main/java/net/freerouting/autoroute/FreeSpaceExpansionRoom.java
similarity index 74%
rename from autoroute/FreeSpaceExpansionRoom.java
rename to src/main/java/net/freerouting/autoroute/FreeSpaceExpansionRoom.java
index 48a79412..b03dd6a6 100644
--- a/autoroute/FreeSpaceExpansionRoom.java
+++ b/src/main/java/net/freerouting/autoroute/FreeSpaceExpansionRoom.java
@@ -18,27 +18,35 @@
* Created on 29. Dezember 2003, 08:37
*/
-package autoroute;
-
-import geometry.planar.TileShape;
+package net.freerouting.autoroute;
+import net.freerouting.geometry.planar.TileShape;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-
-
-
/**
* Expansion Areas used by the maze search algorithm.
*
- * @author Alfons Wirtz
+ * @author Alfons Wirtz
*/
-public abstract class FreeSpaceExpansionRoom implements ExpansionRoom
-{
-
+public abstract class FreeSpaceExpansionRoom implements ExpansionRoom {
+
+ /**
+ * The layer of this room
+ */
+ private final int layer;
+ /**
+ * The shape of this room
+ */
+ private TileShape shape;
+ /**
+ * The list of doors to neighbour expansion rooms
+ */
+ private List doors;
+
/**
* Creates a new instance of FreeSpaceExpansionRoom.
* The shape is normally unbounded at construction time of this room.
@@ -46,98 +54,75 @@ public abstract class FreeSpaceExpansionRoom implements ExpansionRoom
* does not overlap with any obstacle, and is as big as possible.
* p_contained_points will remain contained in the shape, after it is completed.
*/
- public FreeSpaceExpansionRoom(TileShape p_shape, int p_layer)
- {
+ public FreeSpaceExpansionRoom(TileShape p_shape, int p_layer) {
shape = p_shape;
layer = p_layer;
doors = new LinkedList();
}
-
+
/**
* Adds p_door to the list of doors of this room.
*/
- public void add_door(ExpansionDoor p_door)
- {
+ public void add_door(ExpansionDoor p_door) {
this.doors.add(p_door);
}
-
+
/**
* Returns the list of doors of this room to neighbour expansion rooms
*/
- public List get_doors()
- {
+ public List get_doors() {
return this.doors;
}
-
+
/**
* Removes all doors from this room.
*/
- public void clear_doors()
- {
+ public void clear_doors() {
this.doors = new LinkedList();
}
-
- public void reset_doors()
- {
- for (ExpandableObject curr_door : this.doors)
- {
+
+ public void reset_doors() {
+ for (ExpandableObject curr_door : this.doors) {
curr_door.reset();
}
}
-
- public boolean remove_door(ExpandableObject p_door)
- {
+
+ public boolean remove_door(ExpandableObject p_door) {
return this.doors.remove(p_door);
}
-
+
/**
* Gets the shape of this room
*/
- public TileShape get_shape()
- {
+ public TileShape get_shape() {
return this.shape;
}
-
+
/**
* sets the shape of this room
*/
- public void set_shape(TileShape p_shape)
- {
+ public void set_shape(TileShape p_shape) {
this.shape = p_shape;
}
-
- public int get_layer()
- {
+
+ public int get_layer() {
return this.layer;
}
-
+
/**
* Checks, if this room has already a door to p_other
*/
- public boolean door_exists(ExpansionRoom p_other)
- {
- if (doors == null)
- {
+ public boolean door_exists(ExpansionRoom p_other) {
+ if (doors == null) {
return false;
}
Iterator it = doors.iterator();
- while (it.hasNext())
- {
+ while (it.hasNext()) {
ExpansionDoor curr_door = it.next();
- if (curr_door.first_room == p_other || curr_door.second_room == p_other)
- {
+ if (curr_door.first_room == p_other || curr_door.second_room == p_other) {
return true;
}
}
return false;
}
-
- /** The layer of this room */
- private final int layer;
-
- /** The shape of this room */
- private TileShape shape;
-
- /** The list of doors to neighbour expansion rooms */
- private List doors;
}
diff --git a/autoroute/IncompleteFreeSpaceExpansionRoom.java b/src/main/java/net/freerouting/autoroute/IncompleteFreeSpaceExpansionRoom.java
similarity index 80%
rename from autoroute/IncompleteFreeSpaceExpansionRoom.java
rename to src/main/java/net/freerouting/autoroute/IncompleteFreeSpaceExpansionRoom.java
index bf979318..54b62528 100644
--- a/autoroute/IncompleteFreeSpaceExpansionRoom.java
+++ b/src/main/java/net/freerouting/autoroute/IncompleteFreeSpaceExpansionRoom.java
@@ -18,46 +18,43 @@
* Created on 10. Februar 2004, 10:13
*/
-package autoroute;
+package net.freerouting.autoroute;
-import java.util.Collection;
+import net.freerouting.geometry.planar.TileShape;
-import geometry.planar.TileShape;
+import java.util.Collection;
/**
* An expansion room, whose shape is not yet completely calculated.
*
- * @author Alfons Wirtz
+ * @author Alfons Wirtz
*/
-public class IncompleteFreeSpaceExpansionRoom extends FreeSpaceExpansionRoom
-{
-
+public class IncompleteFreeSpaceExpansionRoom extends FreeSpaceExpansionRoom {
+
+ /**
+ * A shape which should be contained in the completed shape.
+ */
+ private TileShape contained_shape;
+
/**
* Creates a new instance of IncompleteFreeSpaceExpansionRoom.
* If p_shape == null means p_shape is the whole plane.
*/
- public IncompleteFreeSpaceExpansionRoom(TileShape p_shape, int p_layer, TileShape p_contained_shape)
- {
+ public IncompleteFreeSpaceExpansionRoom(TileShape p_shape, int p_layer, TileShape p_contained_shape) {
super(p_shape, p_layer);
contained_shape = p_contained_shape;
}
-
- public TileShape get_contained_shape()
- {
+
+ public TileShape get_contained_shape() {
return this.contained_shape;
}
-
- public void set_contained_shape(TileShape p_shape)
- {
+
+ public void set_contained_shape(TileShape p_shape) {
this.contained_shape = p_shape;
}
-
- public Collection get_target_doors()
- {
+
+ public Collection get_target_doors() {
return new java.util.LinkedList();
}
-
- /** A shape which should be contained in the completed shape. */
- private TileShape contained_shape;
}
diff --git a/autoroute/InsertFoundConnectionAlgo.java b/src/main/java/net/freerouting/autoroute/InsertFoundConnectionAlgo.java
similarity index 77%
rename from autoroute/InsertFoundConnectionAlgo.java
rename to src/main/java/net/freerouting/autoroute/InsertFoundConnectionAlgo.java
index e36ca3c5..6ad7cefc 100644
--- a/autoroute/InsertFoundConnectionAlgo.java
+++ b/src/main/java/net/freerouting/autoroute/InsertFoundConnectionAlgo.java
@@ -17,78 +17,73 @@
*
* Created on 23. Februar 2004, 08:18
*/
-package autoroute;
+package net.freerouting.autoroute;
-import geometry.planar.IntPoint;
-import geometry.planar.Point;
-import geometry.planar.FloatPoint;
-import geometry.planar.Polyline;
+import net.freerouting.board.*;
+import net.freerouting.geometry.planar.FloatPoint;
+import net.freerouting.geometry.planar.IntPoint;
+import net.freerouting.geometry.planar.Point;
+import net.freerouting.geometry.planar.Polyline;
+import net.freerouting.library.Padstack;
+import net.freerouting.rules.ViaInfo;
import java.util.Iterator;
import java.util.Set;
-import library.Padstack;
-import rules.ViaInfo;
-
-import board.ForcedViaAlgo;
-import board.PolylineTrace;
-import board.Trace;
-import board.Item;
-import board.RoutingBoard;
-import board.ItemSelectionFilter;
-import board.TestLevel;
-
/**
* Inserts the traces and vias of the connection found by the autoroute algorithm.
*
- * @author Alfons Wirtz
+ * @author Alfons Wirtz
*/
-public class InsertFoundConnectionAlgo
-{
+public class InsertFoundConnectionAlgo {
+
+ private final RoutingBoard board;
+ private final AutorouteControl ctrl;
+ private IntPoint last_corner = null;
+ private IntPoint first_corner = null;
+
+ /**
+ * Creates a new instance of InsertFoundConnectionAlgo
+ */
+ private InsertFoundConnectionAlgo(RoutingBoard p_board, AutorouteControl p_ctrl) {
+ this.board = p_board;
+ this.ctrl = p_ctrl;
+ }
/**
* Creates a new instance of InsertFoundConnectionAlgo .
* Returns null, if the insertion did not succeed.
*/
public static InsertFoundConnectionAlgo get_instance(LocateFoundConnectionAlgo p_connection,
- RoutingBoard p_board, AutorouteControl p_ctrl)
- {
- if (p_connection == null || p_connection.connection_items == null)
- {
+ RoutingBoard p_board, AutorouteControl p_ctrl) {
+ if (p_connection == null || p_connection.connection_items == null) {
return null;
}
int curr_layer = p_connection.target_layer;
InsertFoundConnectionAlgo new_instance = new InsertFoundConnectionAlgo(p_board, p_ctrl);
Iterator it = p_connection.connection_items.iterator();
- while (it.hasNext())
- {
+ while (it.hasNext()) {
LocateFoundConnectionAlgoAnyAngle.ResultItem curr_new_item = it.next();
- if (!new_instance.insert_via(curr_new_item.corners[0], curr_layer, curr_new_item.layer))
- {
+ if (!new_instance.insert_via(curr_new_item.corners[0], curr_layer, curr_new_item.layer)) {
return null;
}
curr_layer = curr_new_item.layer;
- if (!new_instance.insert_trace(curr_new_item))
- {
- if (p_board.get_test_level().ordinal() >= TestLevel.CRITICAL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (!new_instance.insert_trace(curr_new_item)) {
+ if (p_board.get_test_level().ordinal() >= TestLevel.CRITICAL_DEBUGGING_OUTPUT.ordinal()) {
System.out.print("InsertFoundConnectionAlgo: insert trace failed for net ");
System.out.println(p_ctrl.net_no);
}
return null;
}
}
- if (!new_instance.insert_via(new_instance.last_corner, curr_layer, p_connection.start_layer))
- {
+ if (!new_instance.insert_via(new_instance.last_corner, curr_layer, p_connection.start_layer)) {
return null;
}
- if (p_connection.target_item instanceof PolylineTrace)
- {
+ if (p_connection.target_item instanceof PolylineTrace) {
PolylineTrace to_trace = (PolylineTrace) p_connection.target_item;
p_board.connect_to_trace(new_instance.first_corner, to_trace, p_ctrl.trace_half_width[p_connection.start_layer], p_ctrl.trace_clearance_class_no);
}
- if (p_connection.start_item instanceof PolylineTrace)
- {
+ if (p_connection.start_item instanceof PolylineTrace) {
PolylineTrace to_trace = (PolylineTrace) p_connection.start_item;
p_board.connect_to_trace(new_instance.last_corner, to_trace, p_ctrl.trace_half_width[p_connection.target_layer], p_ctrl.trace_clearance_class_no);
}
@@ -96,21 +91,12 @@ public static InsertFoundConnectionAlgo get_instance(LocateFoundConnectionAlgo p
return new_instance;
}
- /** Creates a new instance of InsertFoundConnectionAlgo */
- private InsertFoundConnectionAlgo(RoutingBoard p_board, AutorouteControl p_ctrl)
- {
- this.board = p_board;
- this.ctrl = p_ctrl;
- }
-
/**
* Inserts the trace by shoving aside obstacle traces and vias.
* Returns false, that was not possible for the whole trace.
*/
- private boolean insert_trace(LocateFoundConnectionAlgoAnyAngle.ResultItem p_trace)
- {
- if (p_trace.corners.length == 1)
- {
+ private boolean insert_trace(LocateFoundConnectionAlgoAnyAngle.ResultItem p_trace) {
+ if (p_trace.corners.length == 1) {
this.last_corner = p_trace.corners[0];
return true;
}
@@ -121,26 +107,19 @@ private boolean insert_trace(LocateFoundConnectionAlgoAnyAngle.ResultItem p_trac
board.rules.set_pin_edge_to_turn_dist(-1);
// Look for pins att the start and the end of p_trace in case that neckdown is necessecary.
- board.Pin start_pin = null;
- board.Pin end_pin = null;
- if (ctrl.with_neckdown)
- {
+ net.freerouting.board.Pin start_pin = null;
+ net.freerouting.board.Pin end_pin = null;
+ if (ctrl.with_neckdown) {
ItemSelectionFilter item_filter = new ItemSelectionFilter(ItemSelectionFilter.SelectableChoices.PINS);
Point curr_end_corner = p_trace.corners[0];
- for (int i = 0; i < 2; ++i)
- {
+ for (int i = 0; i < 2; ++i) {
Set
- picked_items = this.board.pick_items(curr_end_corner, p_trace.layer, item_filter);
- for (Item curr_item : picked_items)
- {
- board.Pin curr_pin = (board.Pin) curr_item;
- if (curr_pin.contains_net(ctrl.net_no) && curr_pin.get_center().equals(curr_end_corner))
- {
- if (i == 0)
- {
+ for (Item curr_item : picked_items) {
+ net.freerouting.board.Pin curr_pin = (net.freerouting.board.Pin) curr_item;
+ if (curr_pin.contains_net(ctrl.net_no) && curr_pin.get_center().equals(curr_end_corner)) {
+ if (i == 0) {
start_pin = curr_pin;
- }
- else
- {
+ } else {
end_pin = curr_pin;
}
}
@@ -152,11 +131,9 @@ private boolean insert_trace(LocateFoundConnectionAlgoAnyAngle.ResultItem p_trac
net_no_arr[0] = ctrl.net_no;
int from_corner_no = 0;
- for (int i = 1; i < p_trace.corners.length; ++i)
- {
+ for (int i = 1; i < p_trace.corners.length; ++i) {
Point[] curr_corner_arr = new Point[i - from_corner_no + 1];
- for (int j = from_corner_no; j <= i; ++j)
- {
+ for (int j = from_corner_no; j <= i; ++j) {
curr_corner_arr[j - from_corner_no] = p_trace.corners[j];
}
Polyline insert_polyline = new Polyline(curr_corner_arr);
@@ -165,86 +142,66 @@ private boolean insert_trace(LocateFoundConnectionAlgoAnyAngle.ResultItem p_trac
ctrl.max_shove_trace_recursion_depth, ctrl.max_shove_via_recursion_depth,
ctrl.max_spring_over_recursion_depth, Integer.MAX_VALUE, ctrl.pull_tight_accuracy, true, null);
boolean neckdown_inserted = false;
- if (ok_point != null && ok_point != insert_polyline.last_corner() && ctrl.with_neckdown && curr_corner_arr.length == 2)
- {
+ if (ok_point != null && ok_point != insert_polyline.last_corner() && ctrl.with_neckdown && curr_corner_arr.length == 2) {
neckdown_inserted = insert_neckdown(ok_point, curr_corner_arr[1], p_trace.layer, start_pin, end_pin);
}
- if (ok_point == insert_polyline.last_corner() || neckdown_inserted)
- {
+ if (ok_point == insert_polyline.last_corner() || neckdown_inserted) {
from_corner_no = i;
- }
- else if (ok_point == insert_polyline.first_corner() && i != p_trace.corners.length - 1)
- {
+ } else if (ok_point == insert_polyline.first_corner() && i != p_trace.corners.length - 1) {
// if ok_point == insert_polyline.first_corner() the spring over may have failed.
// Spring over may correct the situation because an insertion, which is ok with clearance compensation
// may cause violations without clearance compensation.
// In this case repeating the insertion with more distant corners may allow the spring_over to correct the situation.
- if (from_corner_no > 0)
- {
+ if (from_corner_no > 0) {
// p_trace.corners[i] may be inside the offset for the substitute trace around
// a spring_over obstacle (if clearance compensation is off).
- if (curr_corner_arr.length < 3)
- {
+ if (curr_corner_arr.length < 3) {
// first correction
--from_corner_no;
}
}
- if (board.get_test_level().ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (board.get_test_level().ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("InsertFoundConnectionAlgo: violation corrected");
}
- }
- else
- {
+ } else {
result = false;
break;
}
}
- if (board.get_test_level().ordinal() < TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
- for (int i = 0; i < p_trace.corners.length - 1; ++i)
- {
+ if (board.get_test_level().ordinal() < TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
+ for (int i = 0; i < p_trace.corners.length - 1; ++i) {
Trace trace_stub = board.get_trace_tail(p_trace.corners[i], p_trace.layer, net_no_arr);
- if (trace_stub != null)
- {
+ if (trace_stub != null) {
board.remove_item(trace_stub);
}
}
}
board.rules.set_pin_edge_to_turn_dist(saved_edge_to_turn_dist);
- if (this.first_corner == null)
- {
+ if (this.first_corner == null) {
this.first_corner = p_trace.corners[0];
}
this.last_corner = p_trace.corners[p_trace.corners.length - 1];
return result;
}
- boolean insert_neckdown(Point p_from_corner, Point p_to_corner, int p_layer, board.Pin p_start_pin, board.Pin p_end_pin)
- {
- if (p_start_pin != null)
- {
+ boolean insert_neckdown(Point p_from_corner, Point p_to_corner, int p_layer, net.freerouting.board.Pin p_start_pin, net.freerouting.board.Pin p_end_pin) {
+ if (p_start_pin != null) {
Point ok_point = try_neck_down(p_to_corner, p_from_corner, p_layer, p_start_pin, true);
- if (ok_point == p_from_corner)
- {
+ if (ok_point == p_from_corner) {
return true;
}
}
- if (p_end_pin != null)
- {
+ if (p_end_pin != null) {
Point ok_point = try_neck_down(p_from_corner, p_to_corner, p_layer, p_end_pin, false);
- if (ok_point == p_to_corner)
- {
+ if (ok_point == p_to_corner) {
return true;
}
}
return false;
}
- private Point try_neck_down(Point p_from_corner, Point p_to_corner, int p_layer, board.Pin p_pin, boolean p_at_start)
- {
- if (!p_pin.is_on_layer(p_layer))
- {
+ private Point try_neck_down(Point p_from_corner, Point p_to_corner, int p_layer, net.freerouting.board.Pin p_pin, boolean p_at_start) {
+ if (!p_pin.is_on_layer(p_layer)) {
return null;
}
FloatPoint pin_center = p_pin.get_center().to_float();
@@ -252,14 +209,12 @@ private Point try_neck_down(Point p_from_corner, Point p_to_corner, int p_layer,
this.board.rules.clearance_matrix.value(ctrl.trace_clearance_class_no, p_pin.clearance_class_no(), p_layer);
double pin_neck_down_distance =
2 * (0.5 * p_pin.get_max_width(p_layer) + curr_clearance);
- if (pin_center.distance(p_to_corner.to_float()) >= pin_neck_down_distance)
- {
+ if (pin_center.distance(p_to_corner.to_float()) >= pin_neck_down_distance) {
return null;
}
int neck_down_halfwidth = p_pin.get_trace_neckdown_halfwidth(p_layer);
- if (neck_down_halfwidth >= ctrl.trace_half_width[p_layer])
- {
+ if (neck_down_halfwidth >= ctrl.trace_half_width[p_layer]) {
return null;
}
@@ -273,34 +228,29 @@ private Point try_neck_down(Point p_from_corner, Point p_to_corner, int p_layer,
double ok_length = board.check_trace_segment(p_from_corner, p_to_corner, p_layer, net_no_arr,
ctrl.trace_half_width[p_layer], ctrl.trace_clearance_class_no, true);
- if (ok_length >= Integer.MAX_VALUE)
- {
+ if (ok_length >= Integer.MAX_VALUE) {
return p_from_corner;
}
ok_length -= TOLERANCE;
Point neck_down_end_point;
- if (ok_length <= TOLERANCE)
- {
+ if (ok_length <= TOLERANCE) {
neck_down_end_point = p_from_corner;
- }
- else
- {
+ } else {
FloatPoint float_neck_down_end_point = float_from_corner.change_length(float_to_corner, ok_length);
neck_down_end_point = float_neck_down_end_point.round();
// add a corner in case neck_down_end_point is not exactly on the line from p_from_corner to p_to_corner
boolean horizontal_first =
Math.abs(float_from_corner.x - float_neck_down_end_point.x) >=
- Math.abs(float_from_corner.y - float_neck_down_end_point.y);
+ Math.abs(float_from_corner.y - float_neck_down_end_point.y);
IntPoint add_corner =
LocateFoundConnectionAlgo.calculate_additional_corner(float_from_corner, float_neck_down_end_point,
- horizontal_first, board.rules.get_trace_angle_restriction()).round();
+ horizontal_first, board.rules.get_trace_angle_restriction()).round();
Point curr_ok_point = board.insert_forced_trace_segment(p_from_corner,
add_corner, ctrl.trace_half_width[p_layer], p_layer, net_no_arr, ctrl.trace_clearance_class_no,
ctrl.max_shove_trace_recursion_depth,
ctrl.max_shove_via_recursion_depth, ctrl.max_spring_over_recursion_depth, Integer.MAX_VALUE,
ctrl.pull_tight_accuracy, true, null);
- if (curr_ok_point != add_corner)
- {
+ if (curr_ok_point != add_corner) {
return p_from_corner;
}
curr_ok_point = board.insert_forced_trace_segment(add_corner,
@@ -308,22 +258,19 @@ private Point try_neck_down(Point p_from_corner, Point p_to_corner, int p_layer,
ctrl.max_shove_trace_recursion_depth,
ctrl.max_shove_via_recursion_depth, ctrl.max_spring_over_recursion_depth, Integer.MAX_VALUE,
ctrl.pull_tight_accuracy, true, null);
- if (curr_ok_point != neck_down_end_point)
- {
+ if (curr_ok_point != neck_down_end_point) {
return p_from_corner;
}
add_corner =
LocateFoundConnectionAlgo.calculate_additional_corner(float_neck_down_end_point, float_to_corner,
- !horizontal_first, board.rules.get_trace_angle_restriction()).round();
- if (!add_corner.equals(p_to_corner))
- {
+ !horizontal_first, board.rules.get_trace_angle_restriction()).round();
+ if (!add_corner.equals(p_to_corner)) {
curr_ok_point = board.insert_forced_trace_segment(neck_down_end_point, add_corner,
ctrl.trace_half_width[p_layer], p_layer, net_no_arr, ctrl.trace_clearance_class_no,
ctrl.max_shove_trace_recursion_depth,
ctrl.max_shove_via_recursion_depth, ctrl.max_spring_over_recursion_depth, Integer.MAX_VALUE,
ctrl.pull_tight_accuracy, true, null);
- if (curr_ok_point != add_corner)
- {
+ if (curr_ok_point != add_corner) {
return p_from_corner;
}
neck_down_end_point = add_corner;
@@ -343,47 +290,37 @@ private Point try_neck_down(Point p_from_corner, Point p_to_corner, int p_layer,
* is possible at p_location with this mask and inserts the via.
* Returns false, if no suitable via mmask was found or if the algorithm failed.
*/
- private boolean insert_via(Point p_location, int p_from_layer, int p_to_layer)
- {
- if (p_from_layer == p_to_layer)
- {
+ private boolean insert_via(Point p_location, int p_from_layer, int p_to_layer) {
+ if (p_from_layer == p_to_layer) {
return true; // no via necessary
}
int from_layer;
int to_layer;
// sort the input layers
- if (p_from_layer < p_to_layer)
- {
+ if (p_from_layer < p_to_layer) {
from_layer = p_from_layer;
to_layer = p_to_layer;
- }
- else
- {
+ } else {
from_layer = p_to_layer;
to_layer = p_from_layer;
}
int[] net_no_arr = new int[1];
net_no_arr[0] = ctrl.net_no;
ViaInfo via_info = null;
- for (int i = 0; i < this.ctrl.via_rule.via_count(); ++i)
- {
+ for (int i = 0; i < this.ctrl.via_rule.via_count(); ++i) {
ViaInfo curr_via_info = this.ctrl.via_rule.get_via(i);
Padstack curr_via_padstack = curr_via_info.get_padstack();
- if (curr_via_padstack.from_layer() > from_layer || curr_via_padstack.to_layer() < to_layer)
- {
+ if (curr_via_padstack.from_layer() > from_layer || curr_via_padstack.to_layer() < to_layer) {
continue;
}
if (ForcedViaAlgo.check(curr_via_info, p_location, net_no_arr,
- this.ctrl.max_shove_trace_recursion_depth, this.ctrl.max_shove_via_recursion_depth, this.board))
- {
+ this.ctrl.max_shove_trace_recursion_depth, this.ctrl.max_shove_via_recursion_depth, this.board)) {
via_info = curr_via_info;
break;
}
}
- if (via_info == null)
- {
- if (this.board.get_test_level().ordinal() >= TestLevel.CRITICAL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (via_info == null) {
+ if (this.board.get_test_level().ordinal() >= TestLevel.CRITICAL_DEBUGGING_OUTPUT.ordinal()) {
System.out.print("InsertFoundConnectionAlgo: via mask not found for net ");
System.out.println(ctrl.net_no);
}
@@ -392,10 +329,8 @@ private boolean insert_via(Point p_location, int p_from_layer, int p_to_layer)
// insert the via
if (!ForcedViaAlgo.insert(via_info, p_location, net_no_arr,
this.ctrl.trace_clearance_class_no, this.ctrl.trace_half_width,
- this.ctrl.max_shove_trace_recursion_depth, this.ctrl.max_shove_via_recursion_depth, this.board))
- {
- if (this.board.get_test_level().ordinal() >= TestLevel.CRITICAL_DEBUGGING_OUTPUT.ordinal())
- {
+ this.ctrl.max_shove_trace_recursion_depth, this.ctrl.max_shove_via_recursion_depth, this.board)) {
+ if (this.board.get_test_level().ordinal() >= TestLevel.CRITICAL_DEBUGGING_OUTPUT.ordinal()) {
System.out.print("InsertFoundConnectionAlgo: forced via failed for net ");
System.out.println(ctrl.net_no);
}
@@ -403,8 +338,4 @@ private boolean insert_via(Point p_location, int p_from_layer, int p_to_layer)
}
return true;
}
- private final RoutingBoard board;
- private final AutorouteControl ctrl;
- private IntPoint last_corner = null;
- private IntPoint first_corner = null;
}
diff --git a/autoroute/ItemAutorouteInfo.java b/src/main/java/net/freerouting/autoroute/ItemAutorouteInfo.java
similarity index 69%
rename from autoroute/ItemAutorouteInfo.java
rename to src/main/java/net/freerouting/autoroute/ItemAutorouteInfo.java
index 32199443..8042718c 100644
--- a/autoroute/ItemAutorouteInfo.java
+++ b/src/main/java/net/freerouting/autoroute/ItemAutorouteInfo.java
@@ -18,130 +18,109 @@
* Created on 22. Februar 2004, 12:09
*/
-package autoroute;
+package net.freerouting.autoroute;
-import board.ShapeSearchTree;
-
-import board.Item;
+import net.freerouting.board.Item;
+import net.freerouting.board.ShapeSearchTree;
/**
* Temporary data stored in board Items used in the autoroute algorithm
*
- * @author Alfons Wirtz
+ * @author Alfons Wirtz
*/
-public class ItemAutorouteInfo
-{
- public ItemAutorouteInfo(Item p_item)
- {
+public class ItemAutorouteInfo {
+ private final Item item;
+ /**
+ * Defines, if this item belongs to the start or destination set of
+ * the maze search algorithm
+ */
+ private boolean start_info;
+ private Connection precalculated_connnection = null;
+ /**
+ * ExpansionRoom for pushing or ripping the this object for each tree shape.
+ */
+ private ObstacleExpansionRoom[] expansion_room_arr;
+
+ public ItemAutorouteInfo(Item p_item) {
this.item = p_item;
}
+
/**
* Looks, if the corresponding item belongs to the start or destination set of the autoroute algorithm.
* Only used, if the item belongs to the net, which will be currently routed.
*/
- public boolean is_start_info()
- {
+ public boolean is_start_info() {
return start_info;
}
-
+
/**
* Sets, if the corresponding item belongs to the start or destination set of the autoroute algorithm.
* Only used, if the item belongs to the net, which will be currently routed.
*/
- public void set_start_info(boolean p_value)
- {
+ public void set_start_info(boolean p_value) {
start_info = p_value;
}
-
+
/**
- * Returns the precalculated connection of this item
- * or null, if it is not yet precalculated.
+ * Returns the precalculated connection of this item
+ * or null, if it is not yet precalculated.
*/
- public Connection get_precalculated_connection()
- {
+ public Connection get_precalculated_connection() {
return this.precalculated_connnection;
}
-
+
/**
- * Sets the precalculated connnection of this item.
+ * Sets the precalculated connnection of this item.
*/
- public void set_precalculated_connection(Connection p_connection)
- {
+ public void set_precalculated_connection(Connection p_connection) {
this.precalculated_connnection = p_connection;
}
-
+
/**
* Gets the ExpansionRoom of of index p_index.
* Creates it, if it is not yet existing.
*/
- public ObstacleExpansionRoom get_expansion_room(int p_index, ShapeSearchTree p_autoroute_tree)
- {
- if (expansion_room_arr == null)
- {
+ public ObstacleExpansionRoom get_expansion_room(int p_index, ShapeSearchTree p_autoroute_tree) {
+ if (expansion_room_arr == null) {
expansion_room_arr = new ObstacleExpansionRoom[this.item.tree_shape_count(p_autoroute_tree)];
}
- if (p_index < 0 || p_index >= expansion_room_arr.length)
- {
+ if (p_index < 0 || p_index >= expansion_room_arr.length) {
System.out.println("ItemAutorouteInfo.get_expansion_room: p_index out of range");
return null;
}
- if (expansion_room_arr[p_index] == null)
- {
- expansion_room_arr[p_index] = new ObstacleExpansionRoom(this.item, p_index, p_autoroute_tree);
+ if (expansion_room_arr[p_index] == null) {
+ expansion_room_arr[p_index] = new ObstacleExpansionRoom(this.item, p_index, p_autoroute_tree);
}
return expansion_room_arr[p_index];
}
-
+
/**
* Resets the expansion rooms for autorouting the next connnection.
*/
- public void reset_doors()
- {
- if (expansion_room_arr != null)
- {
- for (ObstacleExpansionRoom curr_room: expansion_room_arr)
- {
- if (curr_room != null)
- {
+ public void reset_doors() {
+ if (expansion_room_arr != null) {
+ for (ObstacleExpansionRoom curr_room : expansion_room_arr) {
+ if (curr_room != null) {
curr_room.reset_doors();
}
}
}
}
-
+
/**
* Draws the shapes of the expansion rooms of this info for testing purposes.
*/
- public void draw(java.awt.Graphics p_graphics, boardgraphics.GraphicsContext p_graphics_context, double p_intensity)
- {
- if (expansion_room_arr == null)
- {
+ public void draw(java.awt.Graphics p_graphics, net.freerouting.boardgraphics.GraphicsContext p_graphics_context, double p_intensity) {
+ if (expansion_room_arr == null) {
return;
}
- for (ObstacleExpansionRoom curr_room : expansion_room_arr)
- {
- if (curr_room != null)
- {
+ for (ObstacleExpansionRoom curr_room : expansion_room_arr) {
+ if (curr_room != null) {
curr_room.draw(p_graphics, p_graphics_context, p_intensity);
}
}
}
-
- /**
- * Defines, if this item belongs to the start or destination set of
- * the maze search algorithm
- */
- private boolean start_info;
-
- private final Item item;
-
- private Connection precalculated_connnection = null;
-
- /**
- * ExpansionRoom for pushing or ripping the this object for each tree shape.
- */
- private ObstacleExpansionRoom[] expansion_room_arr;
}
diff --git a/autoroute/LocateFoundConnectionAlgo.java b/src/main/java/net/freerouting/autoroute/LocateFoundConnectionAlgo.java
similarity index 76%
rename from autoroute/LocateFoundConnectionAlgo.java
rename to src/main/java/net/freerouting/autoroute/LocateFoundConnectionAlgo.java
index 2c797774..e0c6db11 100644
--- a/autoroute/LocateFoundConnectionAlgo.java
+++ b/src/main/java/net/freerouting/autoroute/LocateFoundConnectionAlgo.java
@@ -18,73 +18,76 @@
* Created on 31. Januar 2006, 08:20
*
*/
-package autoroute;
+package net.freerouting.autoroute;
+
+import net.freerouting.board.*;
+import net.freerouting.geometry.planar.FloatPoint;
+import net.freerouting.geometry.planar.IntPoint;
+import net.freerouting.geometry.planar.TileShape;
import java.util.Collection;
-import java.util.SortedSet;
-import java.util.LinkedList;
import java.util.Iterator;
-
-import geometry.planar.IntPoint;
-import geometry.planar.FloatPoint;
-import geometry.planar.TileShape;
-
-import board.Connectable;
-import board.Item;
-import board.AngleRestriction;
-import board.ShapeSearchTree;
-import board.TestLevel;
+import java.util.LinkedList;
+import java.util.SortedSet;
/**
- *
* @author Alfons Wirtz
*/
-public abstract class LocateFoundConnectionAlgo
-{
+public abstract class LocateFoundConnectionAlgo {
/**
- * Returns a new Instance of LocateFoundConnectionAlgo or null,
- * if p_destination_door is null.
+ * The new items implementing the found connection
+ */
+ public final Collection connection_items;
+ /**
+ * The start item of the new routed connection
+ */
+ public final Item start_item;
+ /**
+ * The layer of the connection to the start item
+ */
+ public final int start_layer;
+ /**
+ * The destination item of the new routed connection
+ */
+ public final Item target_item;
+ /**
+ * The layer of the connection to the target item
+ */
+ public final int target_layer;
+ /**
+ * The array of backtrack doors from the destination to the start of a found
+ * connection of the maze search algorithm.
+ */
+ protected final BacktrackElement[] backtrack_array;
+ protected final AutorouteControl ctrl;
+ protected final AngleRestriction angle_restriction;
+ protected final TestLevel test_level;
+ protected final TargetItemExpansionDoor start_door;
+ protected FloatPoint current_from_point;
+ protected FloatPoint previous_from_point;
+ protected int current_trace_layer;
+ protected int current_from_door_index;
+ protected int current_to_door_index;
+ protected int current_target_door_index;
+ protected TileShape current_target_shape;
+ /**
+ * Creates a new instance of LocateFoundConnectionAlgo
*/
- public static LocateFoundConnectionAlgo get_instance(MazeSearchAlgo.Result p_maze_search_result, AutorouteControl p_ctrl,
- ShapeSearchTree p_search_tree, AngleRestriction p_angle_restriction, SortedSet
- p_ripped_item_list, TestLevel p_test_level)
- {
- if (p_maze_search_result == null)
- {
- return null;
- }
- LocateFoundConnectionAlgo result;
- if (p_angle_restriction == AngleRestriction.NINETY_DEGREE || p_angle_restriction == AngleRestriction.FORTYFIVE_DEGREE)
- {
- result = new LocateFoundConnectionAlgo45Degree(p_maze_search_result, p_ctrl, p_search_tree, p_angle_restriction,
- p_ripped_item_list, p_test_level);
- }
- else
- {
- result = new LocateFoundConnectionAlgoAnyAngle(p_maze_search_result, p_ctrl, p_search_tree, p_angle_restriction,
- p_ripped_item_list, p_test_level);
- }
- return result;
- }
-
- /** Creates a new instance of LocateFoundConnectionAlgo */
protected LocateFoundConnectionAlgo(MazeSearchAlgo.Result p_maze_search_result, AutorouteControl p_ctrl,
- ShapeSearchTree p_search_tree, AngleRestriction p_angle_restriction, SortedSet
- p_ripped_item_list, TestLevel p_test_level)
- {
+ ShapeSearchTree p_search_tree, AngleRestriction p_angle_restriction, SortedSet
- p_ripped_item_list, TestLevel p_test_level) {
this.ctrl = p_ctrl;
this.angle_restriction = p_angle_restriction;
this.test_level = p_test_level;
Collection backtrack_list = backtrack(p_maze_search_result, p_ripped_item_list);
this.backtrack_array = new BacktrackElement[backtrack_list.size()];
Iterator it = backtrack_list.iterator();
- for (int i = 0; i < backtrack_array.length; ++i)
- {
+ for (int i = 0; i < backtrack_array.length; ++i) {
this.backtrack_array[i] = it.next();
}
this.connection_items = new LinkedList();
BacktrackElement start_info = this.backtrack_array[backtrack_array.length - 1];
- if (!(start_info.door instanceof TargetItemExpansionDoor))
- {
+ if (!(start_info.door instanceof TargetItemExpansionDoor)) {
System.out.println("LocateFoundConnectionAlgo: ItemExpansionDoor expected for start_info.door");
this.start_item = null;
this.start_layer = 0;
@@ -98,25 +101,20 @@ protected LocateFoundConnectionAlgo(MazeSearchAlgo.Result p_maze_search_result,
this.start_layer = start_door.room.get_layer();
this.current_from_door_index = 0;
boolean at_fanout_end = false;
- if (p_maze_search_result.destination_door instanceof TargetItemExpansionDoor)
- {
+ if (p_maze_search_result.destination_door instanceof TargetItemExpansionDoor) {
TargetItemExpansionDoor curr_destination_door = (TargetItemExpansionDoor) p_maze_search_result.destination_door;
this.target_item = curr_destination_door.item;
this.target_layer = curr_destination_door.room.get_layer();
this.current_from_point = calculate_starting_point(curr_destination_door, p_search_tree);
- }
- else if (p_maze_search_result.destination_door instanceof ExpansionDrill)
- {
+ } else if (p_maze_search_result.destination_door instanceof ExpansionDrill) {
// may happen only in case of fanout
this.target_item = null;
ExpansionDrill curr_drill = (ExpansionDrill) p_maze_search_result.destination_door;
this.current_from_point = curr_drill.location.to_float();
this.target_layer = curr_drill.first_layer + p_maze_search_result.section_no_of_door;
at_fanout_end = true;
- }
- else
- {
+ } else {
System.out.println("LocateFoundConnectionAlgo: unexpected type of destination_door");
this.target_item = null;
this.target_layer = 0;
@@ -127,50 +125,37 @@ else if (p_maze_search_result.destination_door instanceof ExpansionDrill)
boolean connection_done = false;
- while (!connection_done)
- {
+ while (!connection_done) {
boolean layer_changed = false;
- if (at_fanout_end)
- {
+ if (at_fanout_end) {
// do not increase this.current_target_door_index
layer_changed = true;
- }
- else
- {
+ } else {
this.current_target_door_index = this.current_from_door_index + 1;
- while (current_target_door_index < this.backtrack_array.length && !layer_changed)
- {
- if (this.backtrack_array[this.current_target_door_index].door instanceof ExpansionDrill)
- {
+ while (current_target_door_index < this.backtrack_array.length && !layer_changed) {
+ if (this.backtrack_array[this.current_target_door_index].door instanceof ExpansionDrill) {
layer_changed = true;
- }
- else
- {
+ } else {
++this.current_target_door_index;
}
}
}
- if (layer_changed)
- {
+ if (layer_changed) {
// the next trace leads to a via
ExpansionDrill current_target_drill = (ExpansionDrill) this.backtrack_array[this.current_target_door_index].door;
this.current_target_shape = TileShape.get_instance(current_target_drill.location);
- }
- else
- {
+ } else {
// the next trace leads to the final target
connection_done = true;
this.current_target_door_index = this.backtrack_array.length - 1;
TileShape target_shape = ((Connectable) start_item).get_trace_connection_shape(p_search_tree, start_door.tree_entry_no);
this.current_target_shape = target_shape.intersection(start_door.room.get_shape());
- if (this.current_target_shape.dimension() >= 2)
- {
+ if (this.current_target_shape.dimension() >= 2) {
// the target is a conduction area, make a save connection
// by shrinking the shape by the trace halfwidth.
double trace_half_width = this.ctrl.compensated_trace_half_width[start_door.room.get_layer()];
TileShape shrinked_shape = (TileShape) this.current_target_shape.offset(-trace_half_width);
- if (!shrinked_shape.is_empty())
- {
+ if (!shrinked_shape.is_empty()) {
this.current_target_shape = shrinked_shape;
}
}
@@ -183,116 +168,31 @@ else if (p_maze_search_result.destination_door instanceof ExpansionDrill)
}
/**
- * Calclates the next trace trace of the connection under construction.
- * Returns null, if all traces are returned.
+ * Returns a new Instance of LocateFoundConnectionAlgo or null,
+ * if p_destination_door is null.
*/
- private ResultItem calculate_next_trace(boolean p_layer_changed, boolean p_at_fanout_end)
- {
- Collection corner_list = new LinkedList();
- corner_list.add(this.current_from_point);
- if (!p_at_fanout_end)
- {
- FloatPoint adjusted_start_corner = this.adjust_start_corner();
- if (adjusted_start_corner != this.current_from_point)
- {
- FloatPoint add_corner = calculate_additional_corner(this.current_from_point, adjusted_start_corner,
- true, this.angle_restriction);
- corner_list.add(add_corner);
- corner_list.add(adjusted_start_corner);
- this.previous_from_point = this.current_from_point;
- this.current_from_point = adjusted_start_corner;
- }
- }
- FloatPoint prev_corner = this.current_from_point;
- for (;;)
- {
- Collection next_corners = calculate_next_trace_corners();
- if (next_corners.isEmpty())
- {
- break;
- }
- Iterator it = next_corners.iterator();
- while (it.hasNext())
- {
- FloatPoint curr_next_corner = it.next();
- if (curr_next_corner != prev_corner)
- {
- corner_list.add(curr_next_corner);
- this.previous_from_point = this.current_from_point;
- this.current_from_point = curr_next_corner;
- prev_corner = curr_next_corner;
- }
- }
- }
-
- int next_layer = this.current_trace_layer;
- if (p_layer_changed)
- {
- this.current_from_door_index = this.current_target_door_index + 1;
- CompleteExpansionRoom next_room = this.backtrack_array[this.current_from_door_index].next_room;
- if (next_room != null)
- {
- next_layer = next_room.get_layer();
- }
- }
-
- // Round the new trace corners to Integer.
- Collection rounded_corner_list = new LinkedList();
- Iterator it = corner_list.iterator();
- IntPoint prev_point = null;
- while (it.hasNext())
- {
- IntPoint curr_point = (it.next()).round();
- if (!curr_point.equals(prev_point))
- {
- rounded_corner_list.add(curr_point);
- prev_point = curr_point;
- }
+ public static LocateFoundConnectionAlgo get_instance(MazeSearchAlgo.Result p_maze_search_result, AutorouteControl p_ctrl,
+ ShapeSearchTree p_search_tree, AngleRestriction p_angle_restriction, SortedSet
- p_ripped_item_list, TestLevel p_test_level) {
+ if (p_maze_search_result == null) {
+ return null;
}
-
- // Construct the result item
- IntPoint[] corner_arr = new IntPoint[rounded_corner_list.size()];
- Iterator it2 = rounded_corner_list.iterator();
- for (int i = 0; i < corner_arr.length; ++i)
- {
- corner_arr[i] = it2.next();
+ LocateFoundConnectionAlgo result;
+ if (p_angle_restriction == AngleRestriction.NINETY_DEGREE || p_angle_restriction == AngleRestriction.FORTYFIVE_DEGREE) {
+ result = new LocateFoundConnectionAlgo45Degree(p_maze_search_result, p_ctrl, p_search_tree, p_angle_restriction,
+ p_ripped_item_list, p_test_level);
+ } else {
+ result = new LocateFoundConnectionAlgoAnyAngle(p_maze_search_result, p_ctrl, p_search_tree, p_angle_restriction,
+ p_ripped_item_list, p_test_level);
}
- ResultItem result = new ResultItem(corner_arr, this.current_trace_layer);
- this.current_trace_layer = next_layer;
return result;
}
- /**
- * Returns the next list of corners for the construction of the trace
- * in calculate_next_trace. If the result is emppty, the trace is already completed.
- */
- protected abstract Collection calculate_next_trace_corners();
-
- /** Test display of the baktrack rooms. */
- public void draw(java.awt.Graphics p_graphics, boardgraphics.GraphicsContext p_graphics_context)
- {
- for (int i = 0; i < backtrack_array.length; ++i)
- {
- CompleteExpansionRoom next_room = backtrack_array[i].next_room;
- if (next_room != null)
- {
- next_room.draw(p_graphics, p_graphics_context, 0.2);
- }
- ExpandableObject next_door = backtrack_array[i].door;
- if (next_door instanceof ExpansionDrill)
- {
- ((ExpansionDrill) next_door).draw(p_graphics, p_graphics_context, 0.2);
- }
- }
- }
-
/**
* Calculates the starting point of the next trace on p_from_door.item.
* The implementation is not yet optimal for starting points on traces
* or areas.
*/
- private static FloatPoint calculate_starting_point(TargetItemExpansionDoor p_from_door, ShapeSearchTree p_search_tree)
- {
+ private static FloatPoint calculate_starting_point(TargetItemExpansionDoor p_from_door, ShapeSearchTree p_search_tree) {
TileShape connection_shape =
((Connectable) p_from_door.item).get_trace_connection_shape(p_search_tree, p_from_door.tree_entry_no);
connection_shape = connection_shape.intersection(p_from_door.room.get_shape());
@@ -304,65 +204,49 @@ private static FloatPoint calculate_starting_point(TargetItemExpansionDoor p_fro
* the start door.
* Returns null, if p_destination_door is null.
*/
- private static Collection backtrack(MazeSearchAlgo.Result p_maze_search_result, SortedSet
- p_ripped_item_list)
- {
- if (p_maze_search_result == null)
- {
+ private static Collection backtrack(MazeSearchAlgo.Result p_maze_search_result, SortedSet
- p_ripped_item_list) {
+ if (p_maze_search_result == null) {
return null;
}
Collection result = new LinkedList();
CompleteExpansionRoom curr_next_room = null;
ExpandableObject curr_backtrack_door = p_maze_search_result.destination_door;
MazeSearchElement curr_maze_search_element = curr_backtrack_door.get_maze_search_element(p_maze_search_result.section_no_of_door);
- if (curr_backtrack_door instanceof TargetItemExpansionDoor)
- {
+ if (curr_backtrack_door instanceof TargetItemExpansionDoor) {
curr_next_room = ((TargetItemExpansionDoor) curr_backtrack_door).room;
- }
- else if (curr_backtrack_door instanceof ExpansionDrill)
- {
+ } else if (curr_backtrack_door instanceof ExpansionDrill) {
ExpansionDrill curr_drill = (ExpansionDrill) curr_backtrack_door;
curr_next_room = curr_drill.room_arr[curr_drill.first_layer + p_maze_search_result.section_no_of_door];
- if (curr_maze_search_element.room_ripped)
- {
- for (CompleteExpansionRoom tmp_room : curr_drill.room_arr)
- {
- if (tmp_room instanceof ObstacleExpansionRoom)
- {
+ if (curr_maze_search_element.room_ripped) {
+ for (CompleteExpansionRoom tmp_room : curr_drill.room_arr) {
+ if (tmp_room instanceof ObstacleExpansionRoom) {
p_ripped_item_list.add(((ObstacleExpansionRoom) tmp_room).get_item());
}
}
}
}
BacktrackElement curr_backtrack_element = new BacktrackElement(curr_backtrack_door, p_maze_search_result.section_no_of_door, curr_next_room);
- for (;;)
- {
+ for (; ; ) {
result.add(curr_backtrack_element);
curr_backtrack_door = curr_maze_search_element.backtrack_door;
- if (curr_backtrack_door == null)
- {
+ if (curr_backtrack_door == null) {
break;
}
int curr_section_no = curr_maze_search_element.section_no_of_backtrack_door;
- if (curr_section_no >= curr_backtrack_door.maze_search_element_count())
- {
+ if (curr_section_no >= curr_backtrack_door.maze_search_element_count()) {
System.out.println("LocateFoundConnectionAlgo: curr_section_no to big");
curr_section_no = curr_backtrack_door.maze_search_element_count() - 1;
}
- if (curr_backtrack_door instanceof ExpansionDrill)
- {
+ if (curr_backtrack_door instanceof ExpansionDrill) {
ExpansionDrill curr_drill = (ExpansionDrill) curr_backtrack_door;
curr_next_room = curr_drill.room_arr[curr_section_no];
- }
- else
- {
+ } else {
curr_next_room = curr_backtrack_door.other_room(curr_next_room);
}
curr_maze_search_element = curr_backtrack_door.get_maze_search_element(curr_section_no);
curr_backtrack_element = new BacktrackElement(curr_backtrack_door, curr_section_no, curr_next_room);
- if (curr_maze_search_element.room_ripped)
- {
- if (curr_next_room instanceof ObstacleExpansionRoom)
- {
+ if (curr_maze_search_element.room_ripped) {
+ if (curr_next_room instanceof ObstacleExpansionRoom) {
p_ripped_item_list.add(((ObstacleExpansionRoom) curr_next_room).get_item());
}
}
@@ -370,42 +254,14 @@ else if (curr_backtrack_door instanceof ExpansionDrill)
return result;
}
- /**
- * Adjusts the start corner, so that a trace starting at this corner is completely
- * contained in the start room.
- */
- private FloatPoint adjust_start_corner()
- {
- if (this.current_from_door_index < 0)
- {
- return this.current_from_point;
- }
- BacktrackElement curr_from_info = this.backtrack_array[this.current_from_door_index];
- if (curr_from_info.next_room == null)
- {
- return this.current_from_point;
- }
- double trace_half_width = this.ctrl.compensated_trace_half_width[this.current_trace_layer];
- TileShape shrinked_room_shape = (TileShape) curr_from_info.next_room.get_shape().offset(-trace_half_width);
- if (shrinked_room_shape.is_empty() || shrinked_room_shape.contains(this.current_from_point))
- {
- return this.current_from_point;
- }
- return shrinked_room_shape.nearest_point_approx(this.current_from_point).round().to_float();
- }
-
private static FloatPoint ninety_degree_corner(FloatPoint p_from_point, FloatPoint p_to_point,
- boolean p_horizontal_first)
- {
+ boolean p_horizontal_first) {
double x;
double y;
- if (p_horizontal_first)
- {
+ if (p_horizontal_first) {
x = p_to_point.x;
y = p_from_point.y;
- }
- else
- {
+ } else {
x = p_from_point.x;
y = p_to_point.y;
}
@@ -413,63 +269,41 @@ private static FloatPoint ninety_degree_corner(FloatPoint p_from_point, FloatPoi
}
private static FloatPoint fortyfive_degree_corner(FloatPoint p_from_point, FloatPoint p_to_point,
- boolean p_horizontal_first)
- {
+ boolean p_horizontal_first) {
double abs_dx = Math.abs(p_to_point.x - p_from_point.x);
double abs_dy = Math.abs(p_to_point.y - p_from_point.y);
double x;
double y;
- if (abs_dx <= abs_dy)
- {
- if (p_horizontal_first)
- {
+ if (abs_dx <= abs_dy) {
+ if (p_horizontal_first) {
x = p_to_point.x;
- if (p_to_point.y >= p_from_point.y)
- {
+ if (p_to_point.y >= p_from_point.y) {
y = p_from_point.y + abs_dx;
- }
- else
- {
+ } else {
y = p_from_point.y - abs_dx;
}
- }
- else
- {
+ } else {
x = p_from_point.x;
- if (p_to_point.y > p_from_point.y)
- {
+ if (p_to_point.y > p_from_point.y) {
y = p_to_point.y - abs_dx;
- }
- else
- {
+ } else {
y = p_to_point.y + abs_dx;
}
}
- }
- else
- {
- if (p_horizontal_first)
- {
+ } else {
+ if (p_horizontal_first) {
y = p_from_point.y;
- if (p_to_point.x > p_from_point.x)
- {
+ if (p_to_point.x > p_from_point.x) {
x = p_to_point.x - abs_dy;
- }
- else
- {
+ } else {
x = p_to_point.x + abs_dy;
}
- }
- else
- {
+ } else {
y = p_to_point.y;
- if (p_to_point.x > p_from_point.x)
- {
+ if (p_to_point.x > p_from_point.x) {
x = p_from_point.x + abs_dy;
- }
- else
- {
+ } else {
x = p_from_point.x - abs_dy;
}
}
@@ -482,64 +316,140 @@ private static FloatPoint fortyfive_degree_corner(FloatPoint p_from_point, Float
* and from the result corner to p_to_point p_angle_restriction is fulfilled.
*/
static FloatPoint calculate_additional_corner(FloatPoint p_from_point, FloatPoint p_to_point,
- boolean p_horizontal_first, AngleRestriction p_angle_restriction)
- {
+ boolean p_horizontal_first, AngleRestriction p_angle_restriction) {
FloatPoint result;
- if (p_angle_restriction == AngleRestriction.NINETY_DEGREE)
- {
+ if (p_angle_restriction == AngleRestriction.NINETY_DEGREE) {
result = ninety_degree_corner(p_from_point, p_to_point, p_horizontal_first);
- }
- else if (p_angle_restriction == AngleRestriction.FORTYFIVE_DEGREE)
- {
+ } else if (p_angle_restriction == AngleRestriction.FORTYFIVE_DEGREE) {
result = fortyfive_degree_corner(p_from_point, p_to_point, p_horizontal_first);
- }
- else
- {
+ } else {
result = p_to_point;
}
return result;
}
- /** The new items implementing the found connection */
- public final Collection connection_items;
- /** The start item of the new routed connection */
- public final Item start_item;
- /** The layer of the connection to the start item */
- public final int start_layer;
- /** The destination item of the new routed connection */
- public final Item target_item;
- /** The layer of the connection to the target item */
- public final int target_layer;
+
/**
- * The array of backtrack doors from the destination to the start of a found
- * connection of the maze search algorithm.
+ * Calclates the next trace trace of the connection under construction.
+ * Returns null, if all traces are returned.
*/
- protected final BacktrackElement[] backtrack_array;
- protected final AutorouteControl ctrl;
- protected final AngleRestriction angle_restriction;
- protected final TestLevel test_level;
- protected final TargetItemExpansionDoor start_door;
- protected FloatPoint current_from_point;
- protected FloatPoint previous_from_point;
- protected int current_trace_layer;
- protected int current_from_door_index;
- protected int current_to_door_index;
- protected int current_target_door_index;
- protected TileShape current_target_shape;
+ private ResultItem calculate_next_trace(boolean p_layer_changed, boolean p_at_fanout_end) {
+ Collection corner_list = new LinkedList();
+ corner_list.add(this.current_from_point);
+ if (!p_at_fanout_end) {
+ FloatPoint adjusted_start_corner = this.adjust_start_corner();
+ if (adjusted_start_corner != this.current_from_point) {
+ FloatPoint add_corner = calculate_additional_corner(this.current_from_point, adjusted_start_corner,
+ true, this.angle_restriction);
+ corner_list.add(add_corner);
+ corner_list.add(adjusted_start_corner);
+ this.previous_from_point = this.current_from_point;
+ this.current_from_point = adjusted_start_corner;
+ }
+ }
+ FloatPoint prev_corner = this.current_from_point;
+ for (; ; ) {
+ Collection next_corners = calculate_next_trace_corners();
+ if (next_corners.isEmpty()) {
+ break;
+ }
+ Iterator it = next_corners.iterator();
+ while (it.hasNext()) {
+ FloatPoint curr_next_corner = it.next();
+ if (curr_next_corner != prev_corner) {
+ corner_list.add(curr_next_corner);
+ this.previous_from_point = this.current_from_point;
+ this.current_from_point = curr_next_corner;
+ prev_corner = curr_next_corner;
+ }
+ }
+ }
+
+ int next_layer = this.current_trace_layer;
+ if (p_layer_changed) {
+ this.current_from_door_index = this.current_target_door_index + 1;
+ CompleteExpansionRoom next_room = this.backtrack_array[this.current_from_door_index].next_room;
+ if (next_room != null) {
+ next_layer = next_room.get_layer();
+ }
+ }
+
+ // Round the new trace corners to Integer.
+ Collection rounded_corner_list = new LinkedList();
+ Iterator it = corner_list.iterator();
+ IntPoint prev_point = null;
+ while (it.hasNext()) {
+ IntPoint curr_point = (it.next()).round();
+ if (!curr_point.equals(prev_point)) {
+ rounded_corner_list.add(curr_point);
+ prev_point = curr_point;
+ }
+ }
+
+ // Construct the result item
+ IntPoint[] corner_arr = new IntPoint[rounded_corner_list.size()];
+ Iterator it2 = rounded_corner_list.iterator();
+ for (int i = 0; i < corner_arr.length; ++i) {
+ corner_arr[i] = it2.next();
+ }
+ ResultItem result = new ResultItem(corner_arr, this.current_trace_layer);
+ this.current_trace_layer = next_layer;
+ return result;
+ }
+
+ /**
+ * Returns the next list of corners for the construction of the trace
+ * in calculate_next_trace. If the result is emppty, the trace is already completed.
+ */
+ protected abstract Collection calculate_next_trace_corners();
+
+ /**
+ * Test display of the baktrack rooms.
+ */
+ public void draw(java.awt.Graphics p_graphics, net.freerouting.boardgraphics.GraphicsContext p_graphics_context) {
+ for (int i = 0; i < backtrack_array.length; ++i) {
+ CompleteExpansionRoom next_room = backtrack_array[i].next_room;
+ if (next_room != null) {
+ next_room.draw(p_graphics, p_graphics_context, 0.2);
+ }
+ ExpandableObject next_door = backtrack_array[i].door;
+ if (next_door instanceof ExpansionDrill) {
+ ((ExpansionDrill) next_door).draw(p_graphics, p_graphics_context, 0.2);
+ }
+ }
+ }
+
+ /**
+ * Adjusts the start corner, so that a trace starting at this corner is completely
+ * contained in the start room.
+ */
+ private FloatPoint adjust_start_corner() {
+ if (this.current_from_door_index < 0) {
+ return this.current_from_point;
+ }
+ BacktrackElement curr_from_info = this.backtrack_array[this.current_from_door_index];
+ if (curr_from_info.next_room == null) {
+ return this.current_from_point;
+ }
+ double trace_half_width = this.ctrl.compensated_trace_half_width[this.current_trace_layer];
+ TileShape shrinked_room_shape = (TileShape) curr_from_info.next_room.get_shape().offset(-trace_half_width);
+ if (shrinked_room_shape.is_empty() || shrinked_room_shape.contains(this.current_from_point)) {
+ return this.current_from_point;
+ }
+ return shrinked_room_shape.nearest_point_approx(this.current_from_point).round().to_float();
+ }
/**
* Type of a single item in the result list connection_items.
* Used to create a new PolylineTrace.
*/
- protected static class ResultItem
- {
+ protected static class ResultItem {
- public ResultItem(IntPoint[] p_corners, int p_layer)
- {
+ public final IntPoint[] corners;
+ public final int layer;
+ public ResultItem(IntPoint[] p_corners, int p_layer) {
corners = p_corners;
layer = p_layer;
}
- public final IntPoint[] corners;
- public final int layer;
}
/**
@@ -547,17 +457,15 @@ public ResultItem(IntPoint[] p_corners, int p_layer)
* Next_room is the common room of the current door and the next
* door in the backtrack list.
*/
- protected static class BacktrackElement
- {
+ protected static class BacktrackElement {
- private BacktrackElement(ExpandableObject p_door, int p_section_no_of_door, CompleteExpansionRoom p_room)
- {
+ public final ExpandableObject door;
+ public final int section_no_of_door;
+ public final CompleteExpansionRoom next_room;
+ private BacktrackElement(ExpandableObject p_door, int p_section_no_of_door, CompleteExpansionRoom p_room) {
door = p_door;
section_no_of_door = p_section_no_of_door;
next_room = p_room;
}
- public final ExpandableObject door;
- public final int section_no_of_door;
- public final CompleteExpansionRoom next_room;
}
}
diff --git a/autoroute/LocateFoundConnectionAlgo45Degree.java b/src/main/java/net/freerouting/autoroute/LocateFoundConnectionAlgo45Degree.java
similarity index 75%
rename from autoroute/LocateFoundConnectionAlgo45Degree.java
rename to src/main/java/net/freerouting/autoroute/LocateFoundConnectionAlgo45Degree.java
index 051ea30f..6b7b138a 100644
--- a/autoroute/LocateFoundConnectionAlgo45Degree.java
+++ b/src/main/java/net/freerouting/autoroute/LocateFoundConnectionAlgo45Degree.java
@@ -19,77 +19,123 @@
*
*/
-package autoroute;
+package net.freerouting.autoroute;
+
+import net.freerouting.board.AngleRestriction;
+import net.freerouting.board.Item;
+import net.freerouting.board.ShapeSearchTree;
+import net.freerouting.board.TestLevel;
+import net.freerouting.datastructures.Signum;
+import net.freerouting.geometry.planar.*;
import java.util.Collection;
import java.util.LinkedList;
import java.util.SortedSet;
-import datastructures.Signum;
-
-import geometry.planar.FloatPoint;
-import geometry.planar.FloatLine;
-import geometry.planar.TileShape;
-import geometry.planar.IntBox;
-import geometry.planar.Simplex;
-
-import board.ShapeSearchTree;
-import board.AngleRestriction;
-import board.Item;
-import board.TestLevel;
-
/**
- *
* @author Alfons Wirtz
*/
-public class LocateFoundConnectionAlgo45Degree extends LocateFoundConnectionAlgo
-{
-
+public class LocateFoundConnectionAlgo45Degree extends LocateFoundConnectionAlgo {
+
/**
* Creates a new instance of LocateFoundConnectionAlgo45Degree
*/
public LocateFoundConnectionAlgo45Degree(MazeSearchAlgo.Result p_maze_search_result,
- AutorouteControl p_ctrl, ShapeSearchTree p_search_tree, AngleRestriction p_angle_restriction,
- SortedSet
- p_ripped_item_list, TestLevel p_test_level)
- {
+ AutorouteControl p_ctrl, ShapeSearchTree p_search_tree, AngleRestriction p_angle_restriction,
+ SortedSet
- p_ripped_item_list, TestLevel p_test_level) {
super(p_maze_search_result, p_ctrl, p_search_tree, p_angle_restriction, p_ripped_item_list, p_test_level);
}
-
- protected Collection calculate_next_trace_corners()
- {
- Collection result = new LinkedList();
-
- if (this.current_to_door_index > this.current_target_door_index)
- {
+
+ private static FloatPoint round_to_integer(FloatPoint p_point) {
+ return p_point.round().to_float();
+ }
+
+ /**
+ * Calculates, if the next 45-degree angle should be horizontal first when coming fromm
+ * p_from_point on p_from_door.
+ */
+ private static boolean calc_horizontal_first_from_door(ExpandableObject p_from_door,
+ FloatPoint p_from_point, FloatPoint p_to_point) {
+ TileShape door_shape = p_from_door.get_shape();
+ IntBox from_door_box = door_shape.bounding_box();
+ if (p_from_door.get_dimension() != 1) {
+ return from_door_box.height() >= from_door_box.width();
+ }
+
+ FloatLine door_line_segment = door_shape.diagonal_corner_segment();
+ FloatPoint left_corner;
+ FloatPoint right_corner;
+ if (door_line_segment.a.x < door_line_segment.b.x || door_line_segment.a.x == door_line_segment.b.x
+ && door_line_segment.a.y <= door_line_segment.b.y) {
+ left_corner = door_line_segment.a;
+ right_corner = door_line_segment.b;
+ } else {
+ left_corner = door_line_segment.b;
+ right_corner = door_line_segment.a;
+ }
+ double door_dx = right_corner.x - left_corner.x;
+ double door_dy = right_corner.y - left_corner.y;
+ double abs_door_dy = Math.abs(door_dy);
+ double door_max_width = Math.max(door_dx, abs_door_dy);
+ boolean result;
+ double door_half_max_width = 0.5 * door_max_width;
+ if (from_door_box.width() <= door_half_max_width) {
+ // door is about vertical
+ result = true;
+ } else if (from_door_box.height() <= door_half_max_width) {
+ // door is about horizontal
+ result = false;
+ } else {
+ double dx = p_to_point.x - p_from_point.x;
+ double dy = p_to_point.y - p_from_point.y;
+ if (left_corner.y < right_corner.y) {
+ // door is about right diagonal
+ if (Signum.of(dx) == Signum.of(dy)) {
+ result = Math.abs(dx) > Math.abs(dy);
+ } else {
+ result = Math.abs(dx) < Math.abs(dy);
+ }
+
+ } else {
+ // door is about left diagonal
+ if (Signum.of(dx) == Signum.of(dy)) {
+ result = Math.abs(dx) < Math.abs(dy);
+ } else {
+ result = Math.abs(dx) > Math.abs(dy);
+ }
+ }
+ }
+ return result;
+ }
+
+ protected Collection calculate_next_trace_corners() {
+ Collection result = new LinkedList();
+
+ if (this.current_to_door_index > this.current_target_door_index) {
return result;
}
-
+
BacktrackElement curr_from_info = this.backtrack_array[this.current_to_door_index - 1];
-
- if (curr_from_info.next_room == null)
- {
+
+ if (curr_from_info.next_room == null) {
System.out.println("LocateFoundConnectionAlgo45Degree.calculate_next_trace_corners: next_room is null");
return result;
}
-
+
TileShape room_shape = curr_from_info.next_room.get_shape();
-
+
int trace_halfwidth = this.ctrl.compensated_trace_half_width[this.current_trace_layer];
int trace_halfwidth_add = trace_halfwidth + AutorouteEngine.TRACE_WIDTH_TOLERANCE; // add some tolerance for free space expansion rooms.
int shrink_offset;
- if (curr_from_info.next_room instanceof ObstacleExpansionRoom)
- {
-
+ if (curr_from_info.next_room instanceof ObstacleExpansionRoom) {
+
shrink_offset = trace_halfwidth;
- }
- else
- {
+ } else {
shrink_offset = trace_halfwidth_add;
}
-
+
TileShape shrinked_room_shape = (TileShape) room_shape.offset(-shrink_offset);
- if (!shrinked_room_shape.is_empty())
- {
+ if (!shrinked_room_shape.is_empty()) {
// enter the shrinked room shape by a 45 degree angle first
FloatPoint nearest_room_point = shrinked_room_shape.nearest_point_approx(this.current_from_point);
boolean horizontal_first =
@@ -99,19 +145,15 @@ protected Collection calculate_next_trace_corners()
horizontal_first, this.angle_restriction));
result.add(nearest_room_point);
this.current_from_point = nearest_room_point;
- }
- else
- {
+ } else {
shrinked_room_shape = room_shape;
}
-
- if (this.current_to_door_index == this.current_target_door_index)
- {
+
+ if (this.current_to_door_index == this.current_target_door_index) {
FloatPoint nearest_point = this.current_target_shape.nearest_point_approx(this.current_from_point);
nearest_point = round_to_integer(nearest_point);
FloatPoint add_corner = calculate_additional_corner(this.current_from_point, nearest_point, true, this.angle_restriction);
- if (!shrinked_room_shape.contains(add_corner))
- {
+ if (!shrinked_room_shape.contains(add_corner)) {
add_corner = calculate_additional_corner(this.current_from_point, nearest_point, false, this.angle_restriction);
}
result.add(add_corner);
@@ -119,53 +161,45 @@ protected Collection calculate_next_trace_corners()
++this.current_to_door_index;
return result;
}
-
+
BacktrackElement curr_to_info = this.backtrack_array[this.current_to_door_index];
- if (!(curr_to_info.door instanceof ExpansionDoor))
- {
+ if (!(curr_to_info.door instanceof ExpansionDoor)) {
System.out.println("LocateFoundConnectionAlgo45Degree.calculate_next_trace_corners: ExpansionDoor expected");
return result;
}
ExpansionDoor curr_to_door = (ExpansionDoor) curr_to_info.door;
-
-
+
+
FloatPoint nearest_to_door_point;
- if (curr_to_door.dimension == 2)
- {
+ if (curr_to_door.dimension == 2) {
// May not happen in free angle routing mode because then corners are cut off.
TileShape to_door_shape = curr_to_door.get_shape();
-
+
TileShape shrinked_to_door_shape = (TileShape) to_door_shape.shrink(shrink_offset);
nearest_to_door_point = shrinked_to_door_shape.nearest_point_approx(this.current_from_point);
nearest_to_door_point = round_to_integer(nearest_to_door_point);
- }
- else
- {
+ } else {
FloatLine[] line_sections = curr_to_door.get_section_segments(trace_halfwidth);
- if (curr_to_info.section_no_of_door >= line_sections.length)
- {
+ if (curr_to_info.section_no_of_door >= line_sections.length) {
System.out.println("LocateFoundConnectionAlgo45Degree.calculate_next_trace_corners: line_sections inconsistent");
return result;
}
FloatLine curr_line_section = line_sections[curr_to_info.section_no_of_door];
- nearest_to_door_point = curr_line_section.nearest_segment_point(this.current_from_point);
-
+ nearest_to_door_point = curr_line_section.nearest_segment_point(this.current_from_point);
+
boolean nearest_to_door_point_ok = true;
- if (curr_to_info.next_room != null)
- {
+ if (curr_to_info.next_room != null) {
Simplex next_room_shape = curr_to_info.next_room.get_shape().to_Simplex();
// with IntBox or IntOctagon the next calculation will not work, because they have
// border lines of lenght 0.
FloatPoint[] nearest_points = next_room_shape.nearest_border_points_approx(nearest_to_door_point, 2);
- if (nearest_points.length >= 2)
- {
+ if (nearest_points.length >= 2) {
nearest_to_door_point_ok = nearest_points[1].distance(nearest_to_door_point) >= trace_halfwidth_add;
}
}
- if (!nearest_to_door_point_ok)
- {
+ if (!nearest_to_door_point_ok) {
// may be the room has an acute (45 degree) angle at a corner of the door
- nearest_to_door_point = curr_line_section.a.middle_point(curr_line_section.b);
+ nearest_to_door_point = curr_line_section.a.middle_point(curr_line_section.b);
}
}
nearest_to_door_point = round_to_integer(nearest_to_door_point);
@@ -177,163 +211,62 @@ protected Collection calculate_next_trace_corners()
++this.current_to_door_index;
return result;
}
-
- private static FloatPoint round_to_integer(FloatPoint p_point)
- {
- return p_point.round().to_float();
- }
-
- /**
- * Calculates, if the next 45-degree angle should be horizontal first when coming fromm
- * p_from_point on p_from_door.
- */
- private static boolean calc_horizontal_first_from_door(ExpandableObject p_from_door,
- FloatPoint p_from_point, FloatPoint p_to_point)
- {
- TileShape door_shape = p_from_door.get_shape();
- IntBox from_door_box = door_shape.bounding_box();
- if (p_from_door.get_dimension() != 1)
- {
- return from_door_box.height() >= from_door_box.width();
- }
-
- FloatLine door_line_segment = door_shape.diagonal_corner_segment();
- FloatPoint left_corner;
- FloatPoint right_corner;
- if (door_line_segment.a.x < door_line_segment.b.x || door_line_segment.a.x == door_line_segment.b.x
- && door_line_segment.a.y <= door_line_segment.b.y)
- {
- left_corner = door_line_segment.a;
- right_corner = door_line_segment.b;
- }
- else
- {
- left_corner = door_line_segment.b;
- right_corner = door_line_segment.a;
- }
- double door_dx = right_corner.x - left_corner.x;
- double door_dy = right_corner.y - left_corner.y;
- double abs_door_dy = Math.abs(door_dy);
- double door_max_width = Math.max(door_dx, abs_door_dy);
- boolean result;
- double door_half_max_width = 0.5 * door_max_width;
- if (from_door_box.width() <= door_half_max_width)
- {
- // door is about vertical
- result = true;
- }
- else if (from_door_box.height() <= door_half_max_width)
- {
- // door is about horizontal
- result = false;
- }
- else
- {
- double dx = p_to_point.x - p_from_point.x;
- double dy = p_to_point.y - p_from_point.y;
- if (left_corner.y < right_corner.y)
- {
- // door is about right diagonal
- if (Signum.of(dx) == Signum.of(dy))
- {
- result = Math.abs(dx) > Math.abs(dy);
- }
- else
- {
- result = Math.abs(dx) < Math.abs(dy);
- }
-
- }
- else
- {
- // door is about left diagonal
- if (Signum.of(dx) == Signum.of(dy))
- {
- result = Math.abs(dx) < Math.abs(dy);
- }
- else
- {
- result = Math.abs(dx) > Math.abs(dy);
- }
- }
- }
- return result;
- }
-
+
/**
* Calculates, if the 45-degree angle to the next door shape should be horizontal first when coming fromm
* p_from_point.
*/
private boolean calc_horizontal_first_to_door(ExpandableObject p_to_door,
- FloatPoint p_from_point, FloatPoint p_to_point)
- {
+ FloatPoint p_from_point, FloatPoint p_to_point) {
TileShape door_shape = p_to_door.get_shape();
IntBox from_door_box = door_shape.bounding_box();
- if (p_to_door.get_dimension() != 1)
- {
+ if (p_to_door.get_dimension() != 1) {
return from_door_box.height() <= from_door_box.width();
}
FloatLine door_line_segment = door_shape.diagonal_corner_segment();
FloatPoint left_corner;
FloatPoint right_corner;
if (door_line_segment.a.x < door_line_segment.b.x || door_line_segment.a.x == door_line_segment.b.x
- && door_line_segment.a.y <= door_line_segment.b.y)
- {
+ && door_line_segment.a.y <= door_line_segment.b.y) {
left_corner = door_line_segment.a;
right_corner = door_line_segment.b;
- }
- else
- {
+ } else {
left_corner = door_line_segment.b;
right_corner = door_line_segment.a;
}
double door_dx = right_corner.x - left_corner.x;
double door_dy = right_corner.y - left_corner.y;
- double abs_door_dy = Math.abs(door_dy);
+ double abs_door_dy = Math.abs(door_dy);
double door_max_width = Math.max(door_dx, abs_door_dy);
boolean result;
double door_half_max_width = 0.5 * door_max_width;
- if (from_door_box.width() <= door_half_max_width)
- {
+ if (from_door_box.width() <= door_half_max_width) {
// door is about vertical
result = false;
- }
- else if (from_door_box.height() <= door_half_max_width)
- {
+ } else if (from_door_box.height() <= door_half_max_width) {
// door is about horizontal
result = true;
- }
- else
- {
+ } else {
double dx = p_to_point.x - p_from_point.x;
double dy = p_to_point.y - p_from_point.y;
- if (left_corner.y < right_corner.y)
- {
+ if (left_corner.y < right_corner.y) {
// door is about right diagonal
- if (Signum.of(dx) == Signum.of(dy))
- {
+ if (Signum.of(dx) == Signum.of(dy)) {
result = Math.abs(dx) < Math.abs(dy);
- }
- else
- {
+ } else {
result = Math.abs(dx) > Math.abs(dy);
}
-
- }
- else
- {
+
+ } else {
// door is about left diagonal
- if (Signum.of(dx) == Signum.of(dy))
- {
+ if (Signum.of(dx) == Signum.of(dy)) {
result = Math.abs(dx) > Math.abs(dy);
- }
- else
- {
+ } else {
result = Math.abs(dx) < Math.abs(dy);
}
}
}
return result;
}
-
+
}
diff --git a/autoroute/LocateFoundConnectionAlgoAnyAngle.java b/src/main/java/net/freerouting/autoroute/LocateFoundConnectionAlgoAnyAngle.java
similarity index 76%
rename from autoroute/LocateFoundConnectionAlgoAnyAngle.java
rename to src/main/java/net/freerouting/autoroute/LocateFoundConnectionAlgoAnyAngle.java
index e907d2a1..0b5c1a2b 100644
--- a/autoroute/LocateFoundConnectionAlgoAnyAngle.java
+++ b/src/main/java/net/freerouting/autoroute/LocateFoundConnectionAlgoAnyAngle.java
@@ -18,171 +18,174 @@
* Created on 14. Februar 2004, 07:55
*/
-package autoroute;
+package net.freerouting.autoroute;
-import geometry.planar.FloatLine;
-import geometry.planar.FloatPoint;
-import geometry.planar.Side;
-import geometry.planar.TileShape;
+import net.freerouting.board.AngleRestriction;
+import net.freerouting.board.Item;
+import net.freerouting.board.ShapeSearchTree;
+import net.freerouting.board.TestLevel;
+import net.freerouting.geometry.planar.FloatLine;
+import net.freerouting.geometry.planar.FloatPoint;
+import net.freerouting.geometry.planar.Side;
+import net.freerouting.geometry.planar.TileShape;
import java.util.Collection;
-import java.util.SortedSet;
import java.util.LinkedList;
-
-import board.ShapeSearchTree;
-import board.AngleRestriction;
-import board.Item;
-import board.TestLevel;
+import java.util.SortedSet;
/**
* Calculates from the backtrack list the location of the traces and vias,
* which realize a connection found by the maze search algorithm.
*
- * @author Alfons Wirtz
+ * @author Alfons Wirtz
*/
-class LocateFoundConnectionAlgoAnyAngle extends LocateFoundConnectionAlgo
-{
-
- /** Creates a new instance of LocateFoundConnectionAlgo */
+class LocateFoundConnectionAlgoAnyAngle extends LocateFoundConnectionAlgo {
+
+ static private final double c_tolerance = 1.0;
+
+ /**
+ * Creates a new instance of LocateFoundConnectionAlgo
+ */
protected LocateFoundConnectionAlgoAnyAngle(MazeSearchAlgo.Result p_maze_search_result, AutorouteControl p_ctrl,
- ShapeSearchTree p_search_tree, AngleRestriction p_angle_restriction,
- SortedSet
- p_ripped_item_list, TestLevel p_test_level)
- {
+ ShapeSearchTree p_search_tree, AngleRestriction p_angle_restriction,
+ SortedSet
- p_ripped_item_list, TestLevel p_test_level) {
super(p_maze_search_result, p_ctrl, p_search_tree, p_angle_restriction, p_ripped_item_list, p_test_level);
}
-
+
+ /**
+ * Calculates the left most corner of the shape of p_to_info.door
+ * seen from the center of the common room with the previous door.
+ */
+ private static FloatPoint calc_door_left_corner(BacktrackElement p_to_info) {
+ CompleteExpansionRoom from_room = p_to_info.door.other_room(p_to_info.next_room);
+ FloatPoint pole = from_room.get_shape().centre_of_gravity();
+ TileShape curr_to_door_shape = p_to_info.door.get_shape();
+ int left_most_corner_no = curr_to_door_shape.index_of_left_most_corner(pole);
+ return curr_to_door_shape.corner_approx(left_most_corner_no);
+ }
+
+ /**
+ * Calculates the right most corner of the shape of p_to_info.door
+ * seen from the center of the common room with the previous door.
+ */
+ private static FloatPoint calc_door_right_corner(BacktrackElement p_to_info) {
+ CompleteExpansionRoom from_room = p_to_info.door.other_room(p_to_info.next_room);
+ FloatPoint pole = from_room.get_shape().centre_of_gravity();
+ TileShape curr_to_door_shape = p_to_info.door.get_shape();
+ int right_most_corner_no = curr_to_door_shape.index_of_right_most_corner(pole);
+ return curr_to_door_shape.corner_approx(right_most_corner_no);
+ }
+
/**
* Calculates a list with the next point of the trace under construction.
* If the trace is completed, the result list will be empty.
*/
- protected Collection calculate_next_trace_corners()
- {
+ protected Collection calculate_next_trace_corners() {
Collection result = new LinkedList();
- if (this.current_to_door_index >= this.current_target_door_index)
- {
- if (this.current_to_door_index == this.current_target_door_index)
- {
+ if (this.current_to_door_index >= this.current_target_door_index) {
+ if (this.current_to_door_index == this.current_target_door_index) {
FloatPoint nearest_point = this.current_target_shape.nearest_point(this.current_from_point.round()).to_float();
++this.current_to_door_index;
result.add(nearest_point);
}
return result;
}
-
+
double trace_halfwidth_exact = this.ctrl.compensated_trace_half_width[this.current_trace_layer];
double trace_halfwidth_max = trace_halfwidth_exact + AutorouteEngine.TRACE_WIDTH_TOLERANCE;
double trace_halfwidth_middle = trace_halfwidth_exact + c_tolerance;
-
+
BacktrackElement curr_to_info = this.backtrack_array[this.current_to_door_index];
FloatPoint door_left_corner = calc_door_left_corner(curr_to_info);
FloatPoint door_right_corner = calc_door_right_corner(curr_to_info);
- if (this.current_from_point.side_of(door_left_corner, door_right_corner) != Side.ON_THE_RIGHT)
- {
+ if (this.current_from_point.side_of(door_left_corner, door_right_corner) != Side.ON_THE_RIGHT) {
// the door is already crossed at this.from_point
- if (this.current_from_point.scalar_product(this.previous_from_point, door_left_corner) >= 0)
- {
+ if (this.current_from_point.scalar_product(this.previous_from_point, door_left_corner) >= 0) {
// Also the left corner of the door is passed.
// That may not be the case if the door line is crossed almost parallel.
door_left_corner = null;
}
- if(this.current_from_point.scalar_product(this.previous_from_point, door_right_corner) >= 0)
- {
+ if (this.current_from_point.scalar_product(this.previous_from_point, door_right_corner) >= 0) {
// Also the right corner of the door is passed.
door_right_corner = null;
}
- if (door_left_corner == null && door_right_corner == null)
- {
+ if (door_left_corner == null && door_right_corner == null) {
// The door is completely passed.
++this.current_to_door_index;
result.add(this.current_from_point);
return result;
}
}
-
+
// Calculate the visibility range for a trace line from current_from_point
// through the interval from left_most_visible_point to right_most_visible_point,
// by advancing the door index as far as possible, so that still somthing is visible.
-
+
boolean end_of_trace = false;
FloatPoint left_tangent_point = null;
FloatPoint right_tangent_point = null;
int new_door_ind = this.current_to_door_index;
int left_ind = new_door_ind;
int right_ind = new_door_ind;
- int curr_door_ind = this.current_to_door_index + 1;
+ int curr_door_ind = this.current_to_door_index + 1;
FloatPoint result_corner = null;
-
+
// construct a maximum lenght straight line through the doors
-
- for (;;)
- {
+
+ for (; ; ) {
left_tangent_point = this.current_from_point.right_tangential_point(door_left_corner, trace_halfwidth_max);
- if (door_left_corner != null && left_tangent_point == null)
- {
- if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (door_left_corner != null && left_tangent_point == null) {
+ if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("LocateFoundConnectionAlgo.calculate_next_trace_corner: left tangent point is null");
}
left_tangent_point = door_left_corner;
}
right_tangent_point = this.current_from_point.left_tangential_point(door_right_corner, trace_halfwidth_max);
- if (door_right_corner != null && right_tangent_point == null)
- {
- if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (door_right_corner != null && right_tangent_point == null) {
+ if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("LocateFoundConnectionAlgo.calculate_next_trace_corner: right tangent point is null");
}
right_tangent_point = door_right_corner;
}
if (left_tangent_point != null && right_tangent_point != null &&
- right_tangent_point.side_of(this.current_from_point, left_tangent_point) != Side.ON_THE_RIGHT)
- {
+ right_tangent_point.side_of(this.current_from_point, left_tangent_point) != Side.ON_THE_RIGHT) {
// The gap between left_most_visible_point and right_most_visible_point ist to small
// for a trace with the current half width.
-
+
double left_corner_distance = door_left_corner.distance(this.current_from_point);
double right_corner_distance = door_right_corner.distance(this.current_from_point);
- if ( left_corner_distance <= right_corner_distance)
- {
+ if (left_corner_distance <= right_corner_distance) {
new_door_ind = left_ind;
result_corner = left_turn_next_corner(this.current_from_point, trace_halfwidth_max, door_left_corner, door_right_corner);
- }
- else
- {
+ } else {
new_door_ind = right_ind;
result_corner = right_turn_next_corner(this.current_from_point, trace_halfwidth_max, door_right_corner, door_left_corner);
}
break;
}
- if (curr_door_ind >= this.current_target_door_index)
- {
+ if (curr_door_ind >= this.current_target_door_index) {
end_of_trace = true;
break;
}
BacktrackElement next_to_info = this.backtrack_array[curr_door_ind];
FloatPoint next_left_corner = calc_door_left_corner(next_to_info);
FloatPoint next_right_corner = calc_door_right_corner(next_to_info);
- if (this.current_from_point.side_of(next_left_corner, next_right_corner) != Side.ON_THE_RIGHT)
- {
+ if (this.current_from_point.side_of(next_left_corner, next_right_corner) != Side.ON_THE_RIGHT) {
// the door may be already crossed at this.from_point
- if (door_left_corner == null && this.current_from_point.scalar_product(this.previous_from_point, next_left_corner) >= 0)
- {
+ if (door_left_corner == null && this.current_from_point.scalar_product(this.previous_from_point, next_left_corner) >= 0) {
// Also the left corner of the door is passed.
// That may not be the case if the door line is crossed almost parallel.
next_left_corner = null;
}
- if(door_right_corner == null && this.current_from_point.scalar_product(this.previous_from_point, next_right_corner) >= 0)
- {
+ if (door_right_corner == null && this.current_from_point.scalar_product(this.previous_from_point, next_right_corner) >= 0) {
// Also the right corner of the door is passed.
next_right_corner = null;
}
- if (next_left_corner == null && next_right_corner == null)
- {
+ if (next_left_corner == null && next_right_corner == null) {
// The door is completely passed.
// Should not happen because the previous door was not passed compledtely.
- if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("LocateFoundConnectionAlgo.calculate_next_trace_corner: next door passed unexpected");
}
++this.current_to_door_index;
@@ -191,19 +194,17 @@ protected Collection calculate_next_trace_corners()
}
}
if (door_left_corner != null && door_right_corner != null)
- // otherwise the following side_of conditions may not be correct
- // even if all parameter points are defined
+ // otherwise the following side_of conditions may not be correct
+ // even if all parameter points are defined
{
- if (next_left_corner.side_of(this.current_from_point, door_right_corner) == Side.ON_THE_RIGHT)
- {
+ if (next_left_corner.side_of(this.current_from_point, door_right_corner) == Side.ON_THE_RIGHT) {
// bend to the right
new_door_ind = right_ind + 1;
result_corner = right_turn_next_corner(this.current_from_point, trace_halfwidth_max, door_right_corner, next_left_corner);
break;
}
-
- if (next_right_corner.side_of(this.current_from_point, door_left_corner) == Side.ON_THE_LEFT)
- {
+
+ if (next_right_corner.side_of(this.current_from_point, door_left_corner) == Side.ON_THE_LEFT) {
// bend to the left
new_door_ind = left_ind + 1;
result_corner = left_turn_next_corner(this.current_from_point, trace_halfwidth_max, door_left_corner, next_right_corner);
@@ -211,99 +212,80 @@ protected Collection calculate_next_trace_corners()
}
}
boolean visability_range_gets_smaller_on_the_right_side = (door_right_corner == null);
- if (door_right_corner != null && next_right_corner.side_of(this.current_from_point, door_right_corner) != Side.ON_THE_RIGHT)
- {
+ if (door_right_corner != null && next_right_corner.side_of(this.current_from_point, door_right_corner) != Side.ON_THE_RIGHT) {
FloatPoint curr_tangential_point = this.current_from_point.left_tangential_point(next_right_corner, trace_halfwidth_max);
- if (curr_tangential_point != null)
- {
+ if (curr_tangential_point != null) {
FloatLine check_line = new FloatLine(this.current_from_point, curr_tangential_point);
- if ( check_line.segment_distance(door_right_corner) >= trace_halfwidth_max)
- {
+ if (check_line.segment_distance(door_right_corner) >= trace_halfwidth_max) {
visability_range_gets_smaller_on_the_right_side = true;
}
}
}
- if (visability_range_gets_smaller_on_the_right_side)
- {
+ if (visability_range_gets_smaller_on_the_right_side) {
// The visibility range gets smaller on the right side.
door_right_corner = next_right_corner;
right_ind = curr_door_ind;
}
boolean visability_range_gets_smaller_on_the_left_side = (door_left_corner == null);
- if (door_left_corner != null && next_left_corner.side_of(this.current_from_point, door_left_corner) != Side.ON_THE_LEFT)
- {
+ if (door_left_corner != null && next_left_corner.side_of(this.current_from_point, door_left_corner) != Side.ON_THE_LEFT) {
FloatPoint curr_tangential_point = this.current_from_point.right_tangential_point(next_left_corner, trace_halfwidth_max);
- if (curr_tangential_point != null)
- {
+ if (curr_tangential_point != null) {
FloatLine check_line = new FloatLine(this.current_from_point, curr_tangential_point);
- if ( check_line.segment_distance(door_left_corner) >= trace_halfwidth_max)
- {
+ if (check_line.segment_distance(door_left_corner) >= trace_halfwidth_max) {
visability_range_gets_smaller_on_the_left_side = true;
}
}
}
- if (visability_range_gets_smaller_on_the_left_side)
- {
+ if (visability_range_gets_smaller_on_the_left_side) {
// The visibility range gets smaller on the left side.
door_left_corner = next_left_corner;
left_ind = curr_door_ind;
}
++curr_door_ind;
}
-
- if (end_of_trace)
- {
+
+ if (end_of_trace) {
FloatPoint nearest_point = this.current_target_shape.nearest_point(this.current_from_point.round()).to_float();
result_corner = nearest_point;
- if (left_tangent_point != null && nearest_point.side_of(this.current_from_point, left_tangent_point) == Side.ON_THE_LEFT)
- {
+ if (left_tangent_point != null && nearest_point.side_of(this.current_from_point, left_tangent_point) == Side.ON_THE_LEFT) {
// The nearest target point is to the left of the visible range, add another corner
new_door_ind = left_ind + 1;
FloatPoint target_right_corner = this.current_target_shape.corner_approx(this.current_target_shape.index_of_right_most_corner(this.current_from_point));
- FloatPoint curr_corner = right_left_tangential_point(this.current_from_point, target_right_corner, door_left_corner, trace_halfwidth_max);
- if (curr_corner != null)
- {
+ FloatPoint curr_corner = right_left_tangential_point(this.current_from_point, target_right_corner, door_left_corner, trace_halfwidth_max);
+ if (curr_corner != null) {
result_corner = curr_corner;
end_of_trace = false;
}
- }
- else if (right_tangent_point != null && nearest_point.side_of(this.current_from_point, right_tangent_point) == Side.ON_THE_RIGHT)
- {
+ } else if (right_tangent_point != null && nearest_point.side_of(this.current_from_point, right_tangent_point) == Side.ON_THE_RIGHT) {
// The nearest target point is to the right of the visible range, add another corner
FloatPoint target_left_corner = this.current_target_shape.corner_approx(this.current_target_shape.index_of_left_most_corner(this.current_from_point));
new_door_ind = right_ind + 1;
- FloatPoint curr_corner = left_right_tangential_point(this.current_from_point, target_left_corner, door_right_corner, trace_halfwidth_max);
- if (curr_corner != null)
- {
+ FloatPoint curr_corner = left_right_tangential_point(this.current_from_point, target_left_corner, door_right_corner, trace_halfwidth_max);
+ if (curr_corner != null) {
result_corner = curr_corner;
end_of_trace = false;
}
}
}
- if (end_of_trace)
- {
+ if (end_of_trace) {
new_door_ind = this.current_target_door_index;
}
-
+
// Check clearance violation with the previous door shapes
// and correct them in this case.
-
+
FloatLine check_line = new FloatLine(this.current_from_point, result_corner);
- int check_from_door_index = Math.max( this.current_to_door_index - 5 , this.current_from_door_index + 1);
+ int check_from_door_index = Math.max(this.current_to_door_index - 5, this.current_from_door_index + 1);
FloatPoint corrected_result = null;
int corrected_door_ind = 0;
- for (int i = check_from_door_index; i < new_door_ind; ++i)
- {
+ for (int i = check_from_door_index; i < new_door_ind; ++i) {
FloatPoint curr_left_corner = calc_door_left_corner(this.backtrack_array[i]);
double curr_dist = check_line.segment_distance(curr_left_corner);
- if (Math.abs(curr_dist) < trace_halfwidth_middle)
- {
- FloatPoint curr_corrected_result = right_left_tangential_point(check_line.a, check_line.b, curr_left_corner, trace_halfwidth_max);
- if (curr_corrected_result != null)
- {
- if(corrected_result == null ||
- curr_corrected_result.side_of(this.current_from_point, corrected_result) == Side.ON_THE_RIGHT)
- {
+ if (Math.abs(curr_dist) < trace_halfwidth_middle) {
+ FloatPoint curr_corrected_result = right_left_tangential_point(check_line.a, check_line.b, curr_left_corner, trace_halfwidth_max);
+ if (curr_corrected_result != null) {
+ if (corrected_result == null ||
+ curr_corrected_result.side_of(this.current_from_point, corrected_result) == Side.ON_THE_RIGHT) {
corrected_door_ind = i;
corrected_result = curr_corrected_result;
}
@@ -311,61 +293,29 @@ else if (right_tangent_point != null && nearest_point.side_of(this.current_from_
}
FloatPoint curr_right_corner = calc_door_right_corner(this.backtrack_array[i]);
curr_dist = check_line.segment_distance(curr_right_corner);
- if (Math.abs(curr_dist) < trace_halfwidth_middle)
- {
- FloatPoint curr_corrected_result = left_right_tangential_point(check_line.a, check_line.b, curr_right_corner, trace_halfwidth_max);
- if (curr_corrected_result != null)
- {
- if(corrected_result == null ||
- curr_corrected_result.side_of(this.current_from_point, corrected_result) == Side.ON_THE_LEFT)
- {
+ if (Math.abs(curr_dist) < trace_halfwidth_middle) {
+ FloatPoint curr_corrected_result = left_right_tangential_point(check_line.a, check_line.b, curr_right_corner, trace_halfwidth_max);
+ if (curr_corrected_result != null) {
+ if (corrected_result == null ||
+ curr_corrected_result.side_of(this.current_from_point, corrected_result) == Side.ON_THE_LEFT) {
corrected_door_ind = i;
corrected_result = curr_corrected_result;
}
}
}
}
- if (corrected_result != null)
- {
+ if (corrected_result != null) {
result_corner = corrected_result;
new_door_ind = Math.max(corrected_door_ind, this.current_to_door_index);
}
-
+
this.current_to_door_index = new_door_ind;
- if(result_corner != null && result_corner != this.current_from_point)
- {
+ if (result_corner != null && result_corner != this.current_from_point) {
result.add(result_corner);
}
return result;
}
-
-
- /**
- * Calculates the left most corner of the shape of p_to_info.door
- * seen from the center of the common room with the previous door.
- */
- private static FloatPoint calc_door_left_corner(BacktrackElement p_to_info)
- {
- CompleteExpansionRoom from_room = p_to_info.door.other_room(p_to_info.next_room);
- FloatPoint pole = from_room.get_shape().centre_of_gravity();
- TileShape curr_to_door_shape = p_to_info.door.get_shape();
- int left_most_corner_no = curr_to_door_shape.index_of_left_most_corner(pole);
- return curr_to_door_shape.corner_approx(left_most_corner_no);
- }
-
- /**
- * Calculates the right most corner of the shape of p_to_info.door
- * seen from the center of the common room with the previous door.
- */
- private static FloatPoint calc_door_right_corner(BacktrackElement p_to_info)
- {
- CompleteExpansionRoom from_room = p_to_info.door.other_room(p_to_info.next_room);
- FloatPoint pole = from_room.get_shape().centre_of_gravity();
- TileShape curr_to_door_shape = p_to_info.door.get_shape();
- int right_most_corner_no = curr_to_door_shape.index_of_right_most_corner(pole);
- return curr_to_door_shape.corner_approx(right_most_corner_no);
- }
-
+
/**
* Calculates as first line the left side tangent from p_from_corner to
* the circle with center p_to_corner and radius p_dist.
@@ -374,23 +324,18 @@ private static FloatPoint calc_door_right_corner(BacktrackElement p_to_info)
* The second line is than translated by the distance p_dist to the left.
* Returned is the intersection of the first and the second line.
*/
- private FloatPoint right_turn_next_corner(FloatPoint p_from_corner, double p_dist, FloatPoint p_to_corner, FloatPoint p_next_corner)
- {
+ private FloatPoint right_turn_next_corner(FloatPoint p_from_corner, double p_dist, FloatPoint p_to_corner, FloatPoint p_next_corner) {
FloatPoint curr_tangential_point = p_from_corner.left_tangential_point(p_to_corner, p_dist);
- if (curr_tangential_point == null)
- {
- if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (curr_tangential_point == null) {
+ if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("LocateFoundConnectionAlgo.right_turn_next_corner: left tangential point is null");
}
return p_from_corner;
}
FloatLine first_line = new FloatLine(p_from_corner, curr_tangential_point);
curr_tangential_point = p_to_corner.right_tangential_point(p_next_corner, 2 * p_dist + c_tolerance);
- if (curr_tangential_point == null)
- {
- if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (curr_tangential_point == null) {
+ if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("LocateFoundConnectionAlgo.right_turn_next_corner: right tangential point is null");
}
return p_from_corner;
@@ -399,7 +344,7 @@ private FloatPoint right_turn_next_corner(FloatPoint p_from_corner, double p_dis
second_line = second_line.translate(p_dist);
return first_line.intersection(second_line);
}
-
+
/**
* Calculates as first line the right side tangent from p_from_corner to
* the circle with center p_to_corner and radius p_dist.
@@ -408,23 +353,18 @@ private FloatPoint right_turn_next_corner(FloatPoint p_from_corner, double p_dis
* The second line is than translated by the distance p_dist to the right.
* Returned is the intersection of the first and the second line.
*/
- private FloatPoint left_turn_next_corner(FloatPoint p_from_corner, double p_dist, FloatPoint p_to_corner, FloatPoint p_next_corner)
- {
+ private FloatPoint left_turn_next_corner(FloatPoint p_from_corner, double p_dist, FloatPoint p_to_corner, FloatPoint p_next_corner) {
FloatPoint curr_tangential_point = p_from_corner.right_tangential_point(p_to_corner, p_dist);
- if (curr_tangential_point == null)
- {
- if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (curr_tangential_point == null) {
+ if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("LocateFoundConnectionAlgo.left_turn_next_corner: right tangential point is null");
}
return p_from_corner;
}
- FloatLine first_line = new FloatLine( p_from_corner, curr_tangential_point);
+ FloatLine first_line = new FloatLine(p_from_corner, curr_tangential_point);
curr_tangential_point = p_to_corner.left_tangential_point(p_next_corner, 2 * p_dist + c_tolerance);
- if (curr_tangential_point == null)
- {
- if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (curr_tangential_point == null) {
+ if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("LocateFoundConnectionAlgo.left_turn_next_corner: left tangential point is null");
}
return p_from_corner;
@@ -433,30 +373,25 @@ private FloatPoint left_turn_next_corner(FloatPoint p_from_corner, double p_dist
second_line = second_line.translate(-p_dist);
return first_line.intersection(second_line);
}
-
+
/**
* Calculates the right tangential line from p_from_point and the
* left tangential line from p_to_point to the circle
* with center p_center and radius p_dist.
* Returns the intersection of the 2 lines.
*/
- private FloatPoint right_left_tangential_point(FloatPoint p_from_point, FloatPoint p_to_point, FloatPoint p_center, double p_dist)
- {
+ private FloatPoint right_left_tangential_point(FloatPoint p_from_point, FloatPoint p_to_point, FloatPoint p_center, double p_dist) {
FloatPoint curr_tangential_point = p_from_point.right_tangential_point(p_center, p_dist);
- if (curr_tangential_point == null)
- {
- if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (curr_tangential_point == null) {
+ if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("LocateFoundConnectionAlgo. right_left_tangential_point: right tangential point is null");
}
return null;
}
FloatLine first_line = new FloatLine(p_from_point, curr_tangential_point);
curr_tangential_point = p_to_point.left_tangential_point(p_center, p_dist);
- if (curr_tangential_point == null)
- {
- if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (curr_tangential_point == null) {
+ if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("LocateFoundConnectionAlgo. right_left_tangential_point: left tangential point is null");
}
return null;
@@ -464,30 +399,25 @@ private FloatPoint right_left_tangential_point(FloatPoint p_from_point, FloatPoi
FloatLine second_line = new FloatLine(p_to_point, curr_tangential_point);
return first_line.intersection(second_line);
}
-
+
/**
* Calculates the left tangential line from p_from_point and the
* right tangential line from p_to_point to the circle
* with center p_center and radius p_dist.
* Returns the intersection of the 2 lines.
*/
- private FloatPoint left_right_tangential_point(FloatPoint p_from_point, FloatPoint p_to_point, FloatPoint p_center, double p_dist)
- {
+ private FloatPoint left_right_tangential_point(FloatPoint p_from_point, FloatPoint p_to_point, FloatPoint p_center, double p_dist) {
FloatPoint curr_tangential_point = p_from_point.left_tangential_point(p_center, p_dist);
- if (curr_tangential_point == null)
- {
- if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (curr_tangential_point == null) {
+ if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("LocateFoundConnectionAlgo. left_right_tangential_point: left tangential point is null");
}
return null;
}
FloatLine first_line = new FloatLine(p_from_point, curr_tangential_point);
curr_tangential_point = p_to_point.right_tangential_point(p_center, p_dist);
- if (curr_tangential_point == null)
- {
- if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (curr_tangential_point == null) {
+ if (this.test_level.ordinal() >= TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("LocateFoundConnectionAlgo. left_right_tangential_point: right tangential point is null");
}
return null;
@@ -495,7 +425,5 @@ private FloatPoint left_right_tangential_point(FloatPoint p_from_point, FloatPoi
FloatLine second_line = new FloatLine(p_to_point, curr_tangential_point);
return first_line.intersection(second_line);
}
-
- static private final double c_tolerance = 1.0;
-
+
}
diff --git a/autoroute/MazeListElement.java b/src/main/java/net/freerouting/autoroute/MazeListElement.java
similarity index 68%
rename from autoroute/MazeListElement.java
rename to src/main/java/net/freerouting/autoroute/MazeListElement.java
index 46527c66..b3b9827a 100644
--- a/autoroute/MazeListElement.java
+++ b/src/main/java/net/freerouting/autoroute/MazeListElement.java
@@ -18,26 +18,64 @@
* Created on 25. Januar 2004, 08:21
*/
-package autoroute;
+package net.freerouting.autoroute;
-import geometry.planar.FloatLine;
+import net.freerouting.geometry.planar.FloatLine;
/**
* Information for the maze expand Algorithm contained in expansion doors and drills
* while the maze expanding algorithm is in progress.
*
- * @author Alfons Wirtz
+ * @author Alfons Wirtz
*/
-public class MazeListElement implements Comparable
-{
-
- /** Creates a new instance of ExpansionInfo */
+public class MazeListElement implements Comparable {
+
+ /**
+ * The door or drill belonging to this MazeListElement
+ */
+ final ExpandableObject door;
+ /**
+ * The section number of the door (or the layer of the drill)
+ */
+ final int section_no_of_door;
+ /**
+ * The door, from which this door was expanded
+ */
+ final ExpandableObject backtrack_door;
+ /**
+ * The section number of the backtrack door
+ */
+ final int section_no_of_backtrack_door;
+ /**
+ * The wheighted distance to the start of the expansion
+ */
+ final double expansion_value;
+ /**
+ * The expansion value plus the shortest distance to a destination.
+ * The list is sorted in ascending order by this value.
+ */
+ final double sorting_value;
+ /**
+ * The the next room, which will be expanded from this maze search element
+ */
+ final CompleteExpansionRoom next_room;
+ /**
+ * Point of the region of the expansion door,
+ * which has the shortest distance to the backtrack door.
+ */
+ final FloatLine shape_entry;
+ final boolean room_ripped;
+ final MazeSearchElement.Adjustment adjustment;
+ final boolean already_checked;
+
+ /**
+ * Creates a new instance of ExpansionInfo
+ */
public MazeListElement(ExpandableObject p_door, int p_section_no_of_door,
- ExpandableObject p_backtrack_door, int p_section_no_of_backtrack_door,
- double p_expansion_value, double p_sorting_value,
- CompleteExpansionRoom p_next_room, FloatLine p_shape_entry,
- boolean p_room_ripped, MazeSearchElement.Adjustment p_adjustment, boolean p_already_checked)
- {
+ ExpandableObject p_backtrack_door, int p_section_no_of_backtrack_door,
+ double p_expansion_value, double p_sorting_value,
+ CompleteExpansionRoom p_next_room, FloatLine p_shape_entry,
+ boolean p_room_ripped, MazeSearchElement.Adjustment p_adjustment, boolean p_already_checked) {
door = p_door;
section_no_of_door = p_section_no_of_door;
backtrack_door = p_backtrack_door;
@@ -50,57 +88,17 @@ public MazeListElement(ExpandableObject p_door, int p_section_no_of_door,
adjustment = p_adjustment;
already_checked = p_already_checked;
}
-
- public int compareTo(MazeListElement p_other)
- {
+
+ public int compareTo(MazeListElement p_other) {
double compare_value = (this.sorting_value - p_other.sorting_value);
// make shure, that the result cannot be 0, so that no element in the set is
// skipped because of equal size.
int result;
- if (compare_value >= 0)
- {
+ if (compare_value >= 0) {
result = 1;
- }
- else
- {
+ } else {
result = -1;
}
return result;
}
-
- /** The door or drill belonging to this MazeListElement */
- final ExpandableObject door;
-
- /** The section number of the door (or the layer of the drill) */
- final int section_no_of_door;
-
- /** The door, from which this door was expanded */
- final ExpandableObject backtrack_door;
-
- /** The section number of the backtrack door */
- final int section_no_of_backtrack_door;
-
- /** The wheighted distance to the start of the expansion */
- final double expansion_value;
-
- /**
- * The expansion value plus the shortest distance to a destination.
- * The list is sorted in ascending order by this value.
- */
- final double sorting_value;
-
- /** The the next room, which will be expanded from this maze search element */
- final CompleteExpansionRoom next_room;
-
- /**
- * Point of the region of the expansion door,
- * which has the shortest distance to the backtrack door.
- */
- final FloatLine shape_entry;
-
- final boolean room_ripped;
-
- final MazeSearchElement.Adjustment adjustment;
-
- final boolean already_checked;
}
diff --git a/autoroute/MazeSearchAlgo.java b/src/main/java/net/freerouting/autoroute/MazeSearchAlgo.java
similarity index 73%
rename from autoroute/MazeSearchAlgo.java
rename to src/main/java/net/freerouting/autoroute/MazeSearchAlgo.java
index 56c1452a..4b60546e 100644
--- a/autoroute/MazeSearchAlgo.java
+++ b/src/main/java/net/freerouting/autoroute/MazeSearchAlgo.java
@@ -17,41 +17,59 @@
*
* Created on 25. Januar 2004, 13:24
*/
-package autoroute;
-
-import geometry.planar.ConvexShape;
-import geometry.planar.FloatLine;
-import geometry.planar.FloatPoint;
-import geometry.planar.IntPoint;
-import geometry.planar.Point;
-import geometry.planar.Polyline;
-import geometry.planar.TileShape;
-import geometry.planar.IntBox;
-import geometry.planar.IntOctagon;
-import geometry.planar.Line;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.TreeSet;
-import java.util.Set;
-
-import board.Connectable;
-import board.ForcedViaAlgo;
-import board.Item;
-import board.PolylineTrace;
-import board.ShapeSearchTree;
-import board.AngleRestriction;
-import board.SearchTreeObject;
-import board.ItemSelectionFilter;
+package net.freerouting.autoroute;
+
+import net.freerouting.board.*;
+import net.freerouting.geometry.planar.*;
+
+import java.util.*;
/**
* Class for autorouting an incomplete connection via a maze search algorithm.
*
- * @author Alfons Wirtz
+ * @author Alfons Wirtz
*/
-public class MazeSearchAlgo
-{
+public class MazeSearchAlgo {
+
+ private static final int ALREADY_RIPPED_COSTS = 1;
+ /**
+ * The autoroute engine of this expansion algorithm.
+ */
+ public final AutorouteEngine autoroute_engine;
+ final AutorouteControl ctrl;
+ /**
+ * The queue of of expanded elements used in this search algorithm.
+ */
+ final java.util.SortedSet maze_expansion_list;
+ /**
+ * Used for calculating of a good lower bound for the distance between a new MazeExpansionElement
+ * and the destination set of the expansion.
+ */
+ final DestinationDistance destination_distance;
+ /**
+ * The seach tree for expanding. It is the tree compensated for the current net.
+ */
+ private final ShapeSearchTree search_tree;
+ private final java.util.Random random_generator = new java.util.Random();
+ /**
+ * The destination door found by the expanding algorithm.
+ */
+ private ExpandableObject destination_door = null;
+ private int section_no_of_destination_door = 0;
+
+ /**
+ * Creates a new instance of MazeSearchAlgo
+ */
+ MazeSearchAlgo(AutorouteEngine p_autoroute_engine, AutorouteControl p_ctrl) {
+ autoroute_engine = p_autoroute_engine;
+ ctrl = p_ctrl;
+ random_generator.setSeed(p_ctrl.ripup_costs); // To get reproducable random numbers in the ripup algorithm.
+ this.search_tree = p_autoroute_engine.autoroute_search_tree;
+ maze_expansion_list = new TreeSet();
+ destination_distance =
+ new DestinationDistance(ctrl.trace_costs, ctrl.layer_active,
+ ctrl.min_normal_via_cost, ctrl.min_cheap_via_cost);
+ }
/**
* Initializes a new instance of MazeSearchAlgo for secrching a connection
@@ -59,32 +77,109 @@ public class MazeSearchAlgo
* Returns null, if the initialisation failed.
*/
public static MazeSearchAlgo get_instance(Set
- p_start_items,
- Set
- p_destination_items, AutorouteEngine p_autoroute_database, AutorouteControl p_ctrl)
- {
+ Set
- p_destination_items, AutorouteEngine p_autoroute_database, AutorouteControl p_ctrl) {
MazeSearchAlgo new_instance = new MazeSearchAlgo(p_autoroute_database, p_ctrl);
MazeSearchAlgo result;
- if (new_instance.init(p_start_items, p_destination_items))
- {
+ if (new_instance.init(p_start_items, p_destination_items)) {
result = new_instance;
- }
- else
- {
+ } else {
result = null;
}
return result;
}
- /** Creates a new instance of MazeSearchAlgo */
- MazeSearchAlgo(AutorouteEngine p_autoroute_engine, AutorouteControl p_ctrl)
- {
- autoroute_engine = p_autoroute_engine;
- ctrl = p_ctrl;
- random_generator.setSeed(p_ctrl.ripup_costs); // To get reproducable random numbers in the ripup algorithm.
- this.search_tree = p_autoroute_engine.autoroute_search_tree;
- maze_expansion_list = new TreeSet();
- destination_distance =
- new DestinationDistance(ctrl.trace_costs, ctrl.layer_active,
- ctrl.min_normal_via_cost, ctrl.min_cheap_via_cost);
+ /**
+ * Looks for pins with more than 1 nets and reduces shapes of thraces of foreign nets,
+ * which are already connected to such a pin, so that the pin center is not blocked for connection.
+ */
+ private static void reduce_trace_shapes_at_tie_pins(Collection
- p_item_list, int p_own_net_no, ShapeSearchTree p_autoroute_tree) {
+ for (Item curr_item : p_item_list) {
+ if ((curr_item instanceof net.freerouting.board.Pin) && curr_item.net_count() > 1) {
+ Collection
- pin_contacts = curr_item.get_normal_contacts();
+ net.freerouting.board.Pin curr_tie_pin = (net.freerouting.board.Pin) curr_item;
+ for (Item curr_contact : pin_contacts) {
+ if (!(curr_contact instanceof net.freerouting.board.PolylineTrace) || curr_contact.contains_net(p_own_net_no)) {
+ continue;
+ }
+ p_autoroute_tree.reduce_trace_shape_at_tie_pin(curr_tie_pin, (net.freerouting.board.PolylineTrace) curr_contact);
+ }
+ }
+ }
+ }
+
+ /**
+ * Return the addditional cost factor for ripping the trace, if it is connected to a fanout via
+ * or 1, if no fanout via was found.
+ */
+ private static double calc_fanout_via_ripup_cost_factor(net.freerouting.board.Trace p_trace) {
+ final double FANOUT_COST_CONST = 20000;
+ Collection
- curr_end_contacts;
+ for (int i = 0; i < 2; ++i) {
+ if (i == 0) {
+ curr_end_contacts = p_trace.get_start_contacts();
+ } else {
+ curr_end_contacts = p_trace.get_end_contacts();
+ }
+ if (curr_end_contacts.size() != 1) {
+ continue;
+ }
+ Item curr_trace_contact = curr_end_contacts.iterator().next();
+ boolean protect_fanout_via = false;
+ if (curr_trace_contact instanceof net.freerouting.board.Pin && curr_trace_contact.first_layer() == curr_trace_contact.last_layer()) {
+ protect_fanout_via = true;
+ } else if (curr_trace_contact instanceof PolylineTrace && curr_trace_contact.get_fixed_state() == net.freerouting.board.FixedState.SHOVE_FIXED) {
+ // look for shove fixed exit traces of SMD-pins
+ PolylineTrace contact_trace = (PolylineTrace) curr_trace_contact;
+ if (contact_trace.corner_count() == 2) {
+ protect_fanout_via = true;
+ }
+ }
+
+
+ if (protect_fanout_via) {
+ double fanout_via_cost_factor = p_trace.get_half_width() / p_trace.get_length();
+ fanout_via_cost_factor *= fanout_via_cost_factor;
+ fanout_via_cost_factor *= FANOUT_COST_CONST;
+ fanout_via_cost_factor = Math.max(fanout_via_cost_factor, 1);
+ return fanout_via_cost_factor;
+ }
+ }
+ return 1;
+ }
+
+ /**
+ * Returns the perpendicular projection of p_from_segment onto p_to_segment.
+ * Returns null, if the projection is empty.
+ */
+ private static FloatLine segment_projection(FloatLine p_from_segment, FloatLine p_to_segment) {
+ FloatLine check_segment = p_from_segment.adjust_direction(p_to_segment);
+ FloatLine first_projection = p_to_segment.segment_projection(check_segment);
+ FloatLine second_projection = p_to_segment.segment_projection_2(check_segment);
+ FloatLine result;
+ if (first_projection != null && second_projection != null) {
+ FloatPoint result_a;
+ if (first_projection.a == p_to_segment.a || second_projection.a == p_to_segment.a) {
+ result_a = p_to_segment.a;
+ } else if (first_projection.a.distance_square(p_to_segment.a) <= second_projection.a.distance_square(p_to_segment.a)) {
+ result_a = first_projection.a;
+ } else {
+ result_a = second_projection.a;
+ }
+ FloatPoint result_b;
+ if (first_projection.b == p_to_segment.b || second_projection.b == p_to_segment.b) {
+ result_b = p_to_segment.b;
+ } else if (first_projection.b.distance_square(p_to_segment.b) <= second_projection.b.distance_square(p_to_segment.b)) {
+ result_b = first_projection.b;
+ } else {
+ result_b = second_projection.b;
+ }
+ result = new FloatLine(result_a, result_b);
+ } else if (first_projection != null) {
+ result = first_projection;
+ } else {
+ result = second_projection;
+ }
+ return result;
}
/**
@@ -93,13 +188,10 @@ public static MazeSearchAlgo get_instance(Set
- p_start_items,
* the found destination is returned, from where the whole found connection
* can be backtracked. Otherwise the return value will be null.
*/
- public Result find_connection()
- {
- while (occupy_next_element())
- {
+ public Result find_connection() {
+ while (occupy_next_element()) {
}
- if (this.destination_door == null)
- {
+ if (this.destination_door == null) {
return null;
}
return new Result(this.destination_door, this.section_no_of_destination_door);
@@ -109,20 +201,16 @@ public Result find_connection()
* Expands the next element in the maze expansion list.
* Returns false, if the expansion list is exhausted or the destination is reached.
*/
- public boolean occupy_next_element()
- {
- if (this.destination_door != null)
- {
+ public boolean occupy_next_element() {
+ if (this.destination_door != null) {
return false; // destination already reached
}
MazeListElement list_element = null;
MazeSearchElement curr_door_section = null;
// Search the next element, which is not yet expanded.
boolean next_element_found = false;
- while (!maze_expansion_list.isEmpty())
- {
- if (this.autoroute_engine.is_stop_requested())
- {
+ while (!maze_expansion_list.isEmpty()) {
+ if (this.autoroute_engine.is_stop_requested()) {
return false;
}
Iterator it = maze_expansion_list.iterator();
@@ -130,14 +218,12 @@ public boolean occupy_next_element()
int curr_section_no = list_element.section_no_of_door;
curr_door_section = list_element.door.get_maze_search_element(curr_section_no);
it.remove();
- if (!curr_door_section.is_occupied)
- {
+ if (!curr_door_section.is_occupied) {
next_element_found = true;
break;
}
}
- if (!next_element_found)
- {
+ if (!next_element_found) {
return false;
}
curr_door_section.backtrack_door = list_element.backtrack_door;
@@ -145,40 +231,33 @@ public boolean occupy_next_element()
curr_door_section.room_ripped = list_element.room_ripped;
curr_door_section.adjustment = list_element.adjustment;
- if (list_element.door instanceof DrillPage)
- {
+ if (list_element.door instanceof DrillPage) {
expand_to_drills_of_page(list_element);
return true;
}
- if (list_element.door instanceof TargetItemExpansionDoor)
- {
+ if (list_element.door instanceof TargetItemExpansionDoor) {
TargetItemExpansionDoor curr_door = (TargetItemExpansionDoor) list_element.door;
- if (curr_door.is_destination_door())
- {
+ if (curr_door.is_destination_door()) {
// The destination is reached.
this.destination_door = curr_door;
this.section_no_of_destination_door = list_element.section_no_of_door;
return false;
}
}
- if (ctrl.is_fanout && list_element.door instanceof ExpansionDrill && list_element.backtrack_door instanceof ExpansionDrill)
- {
+ if (ctrl.is_fanout && list_element.door instanceof ExpansionDrill && list_element.backtrack_door instanceof ExpansionDrill) {
// algorithm completed after the first drill;
this.destination_door = list_element.door;
this.section_no_of_destination_door = list_element.section_no_of_door;
return false;
}
if (ctrl.vias_allowed && list_element.door instanceof ExpansionDrill
- && !(list_element.backtrack_door instanceof ExpansionDrill))
- {
+ && !(list_element.backtrack_door instanceof ExpansionDrill)) {
expand_to_other_layers(list_element);
}
- if (list_element.next_room != null)
- {
- if (!expand_to_room_doors(list_element))
- {
+ if (list_element.next_room != null) {
+ if (!expand_to_room_doors(list_element)) {
return true; // occupation by ripup is delayed or nothing was expanded
// In case nothing was expanded allow the section to be occupied from
// somewhere else, if the next room is thin.
@@ -193,34 +272,28 @@ public boolean occupy_next_element()
* Returns true, if the from door section has to be occupied,
* and false, if the occupation for is delayed.
*/
- private boolean expand_to_room_doors(MazeListElement p_list_element)
- {
+ private boolean expand_to_room_doors(MazeListElement p_list_element) {
// Complete the neigbour rooms to make shure, that the
// doors of this room will not change later on.
int layer_no = p_list_element.next_room.get_layer();
boolean layer_active = ctrl.layer_active[layer_no];
- if (!layer_active)
- {
- if (autoroute_engine.board.layer_structure.arr[layer_no].is_signal)
- {
+ if (!layer_active) {
+ if (autoroute_engine.board.layer_structure.arr[layer_no].is_signal) {
return true;
}
}
double half_width = ctrl.compensated_trace_half_width[layer_no];
boolean curr_door_is_small = false;
- if (p_list_element.door instanceof ExpansionDoor)
- {
+ if (p_list_element.door instanceof ExpansionDoor) {
double half_width_add = half_width + AutorouteEngine.TRACE_WIDTH_TOLERANCE;
ExpansionDoor curr_door = (ExpansionDoor) p_list_element.door;
- if (this.ctrl.with_neckdown)
- {
+ if (this.ctrl.with_neckdown) {
// try evtl. neckdown at a destination pin
double neck_down_half_width = check_neck_down_at_dest_pin(p_list_element.next_room);
- if (neck_down_half_width > 0)
- {
+ if (neck_down_half_width > 0) {
half_width_add = Math.min(half_width_add, neck_down_half_width);
half_width = half_width_add;
}
@@ -232,15 +305,12 @@ private boolean expand_to_room_doors(MazeListElement p_list_element)
FloatPoint shape_entry_middle = p_list_element.shape_entry.a.middle_point(p_list_element.shape_entry.b);
- if (this.ctrl.with_neckdown && p_list_element.door instanceof TargetItemExpansionDoor)
- {
+ if (this.ctrl.with_neckdown && p_list_element.door instanceof TargetItemExpansionDoor) {
// try evtl. neckdown at a start pin
Item start_item = ((TargetItemExpansionDoor) p_list_element.door).item;
- if (start_item instanceof board.Pin)
- {
- double neckdown_half_width = ((board.Pin) start_item).get_trace_neckdown_halfwidth(layer_no);
- if (neckdown_half_width > 0)
- {
+ if (start_item instanceof net.freerouting.board.Pin) {
+ double neckdown_half_width = ((net.freerouting.board.Pin) start_item).get_trace_neckdown_halfwidth(layer_no);
+ if (neckdown_half_width > 0) {
half_width = Math.min(half_width, neckdown_half_width);
}
}
@@ -248,159 +318,122 @@ private boolean expand_to_room_doors(MazeListElement p_list_element)
}
boolean next_room_is_thick = true;
- if (p_list_element.next_room instanceof ObstacleExpansionRoom)
- {
+ if (p_list_element.next_room instanceof ObstacleExpansionRoom) {
next_room_is_thick = room_shape_is_thick((ObstacleExpansionRoom) p_list_element.next_room);
- }
- else
- {
+ } else {
TileShape next_room_shape = p_list_element.next_room.get_shape();
- if (next_room_shape.min_width() < 2 * half_width)
- {
+ if (next_room_shape.min_width() < 2 * half_width) {
next_room_is_thick = false; // to prevent probles with the opposite side
- }
- else if (!p_list_element.already_checked && p_list_element.door.get_dimension() == 1 && !curr_door_is_small)
- {
+ } else if (!p_list_element.already_checked && p_list_element.door.get_dimension() == 1 && !curr_door_is_small) {
// The algorithm below works only, if p_location is on the border of p_room_shape.
// That is only the case for 1 dimensional doors.
// For small doors the check is done in check_leaving_via below.
FloatPoint[] nearest_points = next_room_shape.nearest_border_points_approx(shape_entry_middle, 2);
- if (nearest_points.length < 2)
- {
+ if (nearest_points.length < 2) {
System.out.println("MazeSearchAlgo.expand_to_room_doors: nearest_points.length == 2 expected");
next_room_is_thick = false;
- }
- else
- {
+ } else {
double curr_dist = nearest_points[1].distance(shape_entry_middle);
next_room_is_thick = (curr_dist > half_width + 1);
}
}
}
- if (!layer_active && p_list_element.door instanceof ExpansionDrill)
- {
+ if (!layer_active && p_list_element.door instanceof ExpansionDrill) {
// check for drill to a foreign conduction area on split plane.
Point drill_location = ((ExpansionDrill) p_list_element.door).location;
ItemSelectionFilter filter = new ItemSelectionFilter(ItemSelectionFilter.SelectableChoices.CONDUCTION);
Set
- picked_items = autoroute_engine.board.pick_items(drill_location, layer_no, filter);
- for (Item curr_item : picked_items)
- {
- if (!curr_item.contains_net(ctrl.net_no))
- {
+ for (Item curr_item : picked_items) {
+ if (!curr_item.contains_net(ctrl.net_no)) {
return true;
}
}
}
boolean something_expanded = false;
- if (expand_to_target_doors(p_list_element, next_room_is_thick, curr_door_is_small, shape_entry_middle))
- {
+ if (expand_to_target_doors(p_list_element, next_room_is_thick, curr_door_is_small, shape_entry_middle)) {
something_expanded = true;
}
- if (!layer_active)
- {
+ if (!layer_active) {
return true;
}
int ripup_costs = 0;
- if (p_list_element.next_room instanceof FreeSpaceExpansionRoom)
- {
- if (!p_list_element.already_checked)
- {
- if (curr_door_is_small)
- {
+ if (p_list_element.next_room instanceof FreeSpaceExpansionRoom) {
+ if (!p_list_element.already_checked) {
+ if (curr_door_is_small) {
boolean enter_through_small_door = false;
- if (next_room_is_thick)
- {
+ if (next_room_is_thick) {
// check to enter the thick room from a ripped item through a small door (after ripup)
enter_through_small_door = check_leaving_ripped_item(p_list_element);
}
- if (!enter_through_small_door)
- {
+ if (!enter_through_small_door) {
return something_expanded;
}
}
}
- }
- else if (p_list_element.next_room instanceof ObstacleExpansionRoom)
- {
+ } else if (p_list_element.next_room instanceof ObstacleExpansionRoom) {
ObstacleExpansionRoom obstacle_room = (ObstacleExpansionRoom) p_list_element.next_room;
- if (!p_list_element.already_checked)
- {
+ if (!p_list_element.already_checked) {
boolean room_rippable = false;
- if (this.ctrl.ripup_allowed)
- {
+ if (this.ctrl.ripup_allowed) {
ripup_costs = check_ripup(p_list_element, obstacle_room.get_item(), curr_door_is_small);
room_rippable = (ripup_costs >= 0);
}
- if (ripup_costs != ALREADY_RIPPED_COSTS && next_room_is_thick)
- {
+ if (ripup_costs != ALREADY_RIPPED_COSTS && next_room_is_thick) {
Item obstacle_item = obstacle_room.get_item();
- if (!curr_door_is_small && this.ctrl.max_shove_trace_recursion_depth > 0 && obstacle_item instanceof board.PolylineTrace)
- {
- if (!shove_trace_room(p_list_element, obstacle_room))
- {
- if (ripup_costs > 0)
- {
+ if (!curr_door_is_small && this.ctrl.max_shove_trace_recursion_depth > 0 && obstacle_item instanceof net.freerouting.board.PolylineTrace) {
+ if (!shove_trace_room(p_list_element, obstacle_room)) {
+ if (ripup_costs > 0) {
// delay the occupation by ripup to allow shoving the room by another door sections.
MazeListElement new_element =
new MazeListElement(p_list_element.door, p_list_element.section_no_of_door,
- p_list_element.backtrack_door, p_list_element.section_no_of_backtrack_door,
- p_list_element.expansion_value + ripup_costs, p_list_element.sorting_value + ripup_costs,
- p_list_element.next_room, p_list_element.shape_entry, true,
- p_list_element.adjustment, true);
+ p_list_element.backtrack_door, p_list_element.section_no_of_backtrack_door,
+ p_list_element.expansion_value + ripup_costs, p_list_element.sorting_value + ripup_costs,
+ p_list_element.next_room, p_list_element.shape_entry, true,
+ p_list_element.adjustment, true);
this.maze_expansion_list.add(new_element);
}
return something_expanded;
}
}
}
- if (!room_rippable)
- {
+ if (!room_rippable) {
return true;
}
}
}
- for (ExpansionDoor to_door : p_list_element.next_room.get_doors())
- {
- if (to_door == p_list_element.door)
- {
+ for (ExpansionDoor to_door : p_list_element.next_room.get_doors()) {
+ if (to_door == p_list_element.door) {
continue;
}
- if (expand_to_door(to_door, p_list_element, ripup_costs, next_room_is_thick, MazeSearchElement.Adjustment.NONE))
- {
+ if (expand_to_door(to_door, p_list_element, ripup_costs, next_room_is_thick, MazeSearchElement.Adjustment.NONE)) {
something_expanded = true;
}
}
// Expand also the drill pages intersecting the room.
- if (ctrl.vias_allowed && !(p_list_element.door instanceof ExpansionDrill))
- {
- if ((something_expanded || next_room_is_thick) && p_list_element.next_room instanceof CompleteFreeSpaceExpansionRoom)
- {
+ if (ctrl.vias_allowed && !(p_list_element.door instanceof ExpansionDrill)) {
+ if ((something_expanded || next_room_is_thick) && p_list_element.next_room instanceof CompleteFreeSpaceExpansionRoom) {
// avoid setting something_expanded to true when next_room is thin to allow occupying by different sections of the door
Collection overlapping_drill_pages =
this.autoroute_engine.drill_page_array.overlapping_pages(p_list_element.next_room.get_shape());
{
- for (DrillPage to_drill_page : overlapping_drill_pages)
- {
+ for (DrillPage to_drill_page : overlapping_drill_pages) {
expand_to_drill_page(to_drill_page, p_list_element);
something_expanded = true;
}
}
- }
- else if (p_list_element.next_room instanceof ObstacleExpansionRoom)
- {
+ } else if (p_list_element.next_room instanceof ObstacleExpansionRoom) {
Item curr_obstacle_item = ((ObstacleExpansionRoom) p_list_element.next_room).get_item();
- if (curr_obstacle_item instanceof board.Via)
- {
- board.Via curr_via = (board.Via) curr_obstacle_item;
+ if (curr_obstacle_item instanceof net.freerouting.board.Via) {
+ net.freerouting.board.Via curr_via = (net.freerouting.board.Via) curr_obstacle_item;
ExpansionDrill via_drill_info = curr_via.get_autoroute_drill_info(this.autoroute_engine.autoroute_search_tree);
expand_to_drill(via_drill_info, p_list_element, ripup_costs);
}
@@ -410,39 +443,33 @@ else if (p_list_element.next_room instanceof ObstacleExpansionRoom)
return something_expanded;
}
- /** Expand the target doors of the room. Returns true, if at leat 1 target door was expanded */
+ /**
+ * Expand the target doors of the room. Returns true, if at leat 1 target door was expanded
+ */
private boolean expand_to_target_doors(MazeListElement p_list_element,
- boolean p_next_room_is_thick, boolean p_curr_door_is_small, FloatPoint p_shape_entry_middle)
- {
- if (p_curr_door_is_small)
- {
+ boolean p_next_room_is_thick, boolean p_curr_door_is_small, FloatPoint p_shape_entry_middle) {
+ if (p_curr_door_is_small) {
boolean enter_through_small_door = false;
- if (p_list_element.door instanceof ExpansionDoor)
- {
+ if (p_list_element.door instanceof ExpansionDoor) {
CompleteExpansionRoom from_room = ((ExpansionDoor) p_list_element.door).other_room(p_list_element.next_room);
- if (from_room instanceof ObstacleExpansionRoom)
- {
+ if (from_room instanceof ObstacleExpansionRoom) {
// otherwise entering through the small door may fail, because it was not checked.
enter_through_small_door = true;
}
}
- if (!enter_through_small_door)
- {
+ if (!enter_through_small_door) {
return false;
}
}
boolean result = false;
- for (TargetItemExpansionDoor to_door : p_list_element.next_room.get_target_doors())
- {
- if (to_door == p_list_element.door)
- {
+ for (TargetItemExpansionDoor to_door : p_list_element.next_room.get_target_doors()) {
+ if (to_door == p_list_element.door) {
continue;
}
TileShape target_shape = ((Connectable) to_door.item).get_trace_connection_shape(this.autoroute_engine.autoroute_search_tree,
to_door.tree_entry_no);
FloatPoint connection_point = target_shape.nearest_point_approx(p_shape_entry_middle);
- if (!p_next_room_is_thick)
- {
+ if (!p_next_room_is_thick) {
// check the line from p_shape_entry_middle to the nearest point.
int[] curr_net_no_arr = new int[1];
curr_net_no_arr[0] = this.ctrl.net_no;
@@ -450,15 +477,13 @@ private boolean expand_to_target_doors(MazeListElement p_list_element,
IntPoint[] check_points = new IntPoint[2];
check_points[0] = p_shape_entry_middle.round();
check_points[1] = connection_point.round();
- if (!check_points[0].equals(check_points[1]))
- {
+ if (!check_points[0].equals(check_points[1])) {
Polyline check_polyline = new Polyline(check_points);
boolean check_ok = autoroute_engine.board.check_forced_trace_polyline(check_polyline,
ctrl.trace_half_width[curr_layer], curr_layer, curr_net_no_arr, ctrl.trace_clearance_class_no,
ctrl.max_shove_trace_recursion_depth, ctrl.max_shove_via_recursion_depth,
ctrl.max_spring_over_recursion_depth);
- if (!check_ok)
- {
+ if (!check_ok) {
continue;
}
}
@@ -467,8 +492,7 @@ private boolean expand_to_target_doors(MazeListElement p_list_element,
FloatLine new_shape_entry = new FloatLine(connection_point, connection_point);
if (expand_to_door_section(to_door, 0, new_shape_entry, p_list_element,
- 0, MazeSearchElement.Adjustment.NONE))
- {
+ 0, MazeSearchElement.Adjustment.NONE)) {
result = true;
}
}
@@ -479,56 +503,44 @@ private boolean expand_to_target_doors(MazeListElement p_list_element,
* Return true, if at least 1 door ection was expanded.
*/
private boolean expand_to_door(ExpansionDoor p_to_door, MazeListElement p_list_element, int p_add_costs,
- boolean p_next_room_is_thick, MazeSearchElement.Adjustment p_adjustment)
- {
+ boolean p_next_room_is_thick, MazeSearchElement.Adjustment p_adjustment) {
double half_width = ctrl.compensated_trace_half_width[p_list_element.next_room.get_layer()];
boolean something_expanded = false;
FloatLine[] line_sections = p_to_door.get_section_segments(half_width);
- for (int i = 0; i < line_sections.length; ++i)
- {
- if (p_to_door.section_arr[i].is_occupied)
- {
+ for (int i = 0; i < line_sections.length; ++i) {
+ if (p_to_door.section_arr[i].is_occupied) {
continue;
}
FloatLine new_shape_entry;
- if (p_next_room_is_thick)
- {
+ if (p_next_room_is_thick) {
new_shape_entry = line_sections[i];
- if (p_to_door.dimension == 1 && line_sections.length == 1 && p_to_door.first_room instanceof CompleteFreeSpaceExpansionRoom && p_to_door.second_room instanceof CompleteFreeSpaceExpansionRoom)
- {
+ if (p_to_door.dimension == 1 && line_sections.length == 1 && p_to_door.first_room instanceof CompleteFreeSpaceExpansionRoom && p_to_door.second_room instanceof CompleteFreeSpaceExpansionRoom) {
// check entering the p_to_door at an acute corner of the shape of p_list_element.next_room
FloatPoint shape_entry_middle = new_shape_entry.a.middle_point(new_shape_entry.b);
TileShape room_shape = p_list_element.next_room.get_shape();
- if (room_shape.min_width() < 2 * half_width)
- {
+ if (room_shape.min_width() < 2 * half_width) {
return false;
}
FloatPoint[] nearest_points = room_shape.nearest_border_points_approx(shape_entry_middle, 2);
- if (nearest_points.length < 2 || nearest_points[1].distance(shape_entry_middle) <= half_width + 1)
- {
+ if (nearest_points.length < 2 || nearest_points[1].distance(shape_entry_middle) <= half_width + 1) {
return false;
}
}
- }
- else
- {
+ } else {
// expand only doors on the opposite side of the room from the shape_entry.
- if (p_to_door.dimension == 1 && i == 0 && line_sections[0].b.distance_square(line_sections[0].a) < 1)
- {
+ if (p_to_door.dimension == 1 && i == 0 && line_sections[0].b.distance_square(line_sections[0].a) < 1) {
// p_to_door is small belonging to a via or thin room
continue;
}
new_shape_entry = segment_projection(p_list_element.shape_entry, line_sections[i]);
- if (new_shape_entry == null)
- {
+ if (new_shape_entry == null) {
continue;
}
}
if (expand_to_door_section(p_to_door, i, new_shape_entry, p_list_element,
- p_add_costs, p_adjustment))
- {
+ p_add_costs, p_adjustment)) {
something_expanded = true;
}
}
@@ -538,15 +550,11 @@ private boolean expand_to_door(ExpansionDoor p_to_door, MazeListElement p_list_e
/**
* Checks, if the width p_door is big enough for a trace with width p_trace_width.
*/
- private boolean door_is_small(ExpansionDoor p_door, double p_trace_width)
- {
- if (p_door.dimension == 1 || p_door.first_room instanceof CompleteFreeSpaceExpansionRoom && p_door.second_room instanceof CompleteFreeSpaceExpansionRoom)
- {
+ private boolean door_is_small(ExpansionDoor p_door, double p_trace_width) {
+ if (p_door.dimension == 1 || p_door.first_room instanceof CompleteFreeSpaceExpansionRoom && p_door.second_room instanceof CompleteFreeSpaceExpansionRoom) {
TileShape door_shape = p_door.get_shape();
- if (door_shape.is_empty())
- {
- if (this.autoroute_engine.board.get_test_level().ordinal() >= board.TestLevel.ALL_DEBUGGING_OUTPUT.ordinal())
- {
+ if (door_shape.is_empty()) {
+ if (this.autoroute_engine.board.get_test_level().ordinal() >= net.freerouting.board.TestLevel.ALL_DEBUGGING_OUTPUT.ordinal()) {
System.out.println("MazeSearchAlgo:check_door_width door_shape is empty");
}
return true;
@@ -554,23 +562,17 @@ private boolean door_is_small(ExpansionDoor p_door, double p_trace_width)
double door_length;
AngleRestriction angle_restriction = autoroute_engine.board.rules.get_trace_angle_restriction();
- if (angle_restriction == AngleRestriction.NINETY_DEGREE)
- {
+ if (angle_restriction == AngleRestriction.NINETY_DEGREE) {
IntBox door_box = door_shape.bounding_box();
door_length = door_box.max_width();
- }
- else if (angle_restriction == AngleRestriction.FORTYFIVE_DEGREE)
- {
+ } else if (angle_restriction == AngleRestriction.FORTYFIVE_DEGREE) {
IntOctagon door_oct = door_shape.bounding_octagon();
door_length = door_oct.max_width();
- }
- else
- {
+ } else {
FloatLine door_line_segment = door_shape.diagonal_corner_segment();
door_length = door_line_segment.b.distance(door_line_segment.a);
}
- if (door_length < p_trace_width)
- {
+ if (door_length < p_trace_width) {
return true;
}
}
@@ -582,10 +584,8 @@ else if (angle_restriction == AngleRestriction.FORTYFIVE_DEGREE)
*/
private boolean expand_to_door_section(ExpandableObject p_door, int p_section_no,
FloatLine p_shape_entry, MazeListElement p_from_element,
- int p_add_costs, MazeSearchElement.Adjustment p_adjustment)
- {
- if (p_door.get_maze_search_element(p_section_no).is_occupied || p_shape_entry == null)
- {
+ int p_add_costs, MazeSearchElement.Adjustment p_adjustment) {
+ if (p_door.get_maze_search_element(p_section_no).is_occupied || p_shape_entry == null) {
return false;
}
CompleteExpansionRoom next_room = p_door.other_room(p_from_element.next_room);
@@ -599,23 +599,20 @@ private boolean expand_to_door_section(ExpandableObject p_door, int p_section_no
MazeListElement new_element =
new MazeListElement(p_door, p_section_no, p_from_element.door, p_from_element.section_no_of_door,
- expansion_value, sorting_value, next_room, p_shape_entry, room_ripped, p_adjustment, false);
+ expansion_value, sorting_value, next_room, p_shape_entry, room_ripped, p_adjustment, false);
this.maze_expansion_list.add(new_element);
return true;
}
- private void expand_to_drill(ExpansionDrill p_drill, MazeListElement p_from_element, int p_add_costs)
- {
+ private void expand_to_drill(ExpansionDrill p_drill, MazeListElement p_from_element, int p_add_costs) {
int layer = p_from_element.next_room.get_layer();
int trace_half_width = this.ctrl.compensated_trace_half_width[layer];
boolean room_shape_is_thin =
p_from_element.next_room.get_shape().min_width() < 2 * trace_half_width;
- if (room_shape_is_thin)
- {
+ if (room_shape_is_thin) {
// expand only drills intersecting the backtrack door
- if (p_from_element.backtrack_door == null || !p_drill.get_shape().intersects(p_from_element.backtrack_door.get_shape()))
- {
+ if (p_from_element.backtrack_door == null || !p_drill.get_shape().intersects(p_from_element.backtrack_door.get_shape())) {
return;
}
}
@@ -623,16 +620,13 @@ private void expand_to_drill(ExpansionDrill p_drill, MazeListElement p_from_elem
double via_radius = ctrl.via_radius_arr[layer];
ConvexShape shrinked_drill_shape = p_drill.get_shape().shrink(via_radius);
FloatPoint compare_corner = p_from_element.shape_entry.a.middle_point(p_from_element.shape_entry.b);
- if (p_from_element.door instanceof DrillPage && p_from_element.backtrack_door instanceof TargetItemExpansionDoor)
- {
+ if (p_from_element.door instanceof DrillPage && p_from_element.backtrack_door instanceof TargetItemExpansionDoor) {
// If expansion comes from a pin with trace exit directions the eapansion_value is calculated
// from the nearest trace exit point instead from the center olf the pin.
Item from_item = ((TargetItemExpansionDoor) p_from_element.backtrack_door).item;
- if (from_item instanceof board.Pin)
- {
- FloatPoint nearest_exit_corner = ((board.Pin) from_item).nearest_trace_exit_corner(p_drill.location.to_float(), trace_half_width, layer);
- if (nearest_exit_corner != null)
- {
+ if (from_item instanceof net.freerouting.board.Pin) {
+ FloatPoint nearest_exit_corner = ((net.freerouting.board.Pin) from_item).nearest_trace_exit_corner(p_drill.location.to_float(), trace_half_width, layer);
+ if (nearest_exit_corner != null) {
compare_corner = nearest_exit_corner;
}
}
@@ -646,13 +640,10 @@ private void expand_to_drill(ExpansionDrill p_drill, MazeListElement p_from_elem
ctrl.trace_costs[layer].horizontal, ctrl.trace_costs[layer].vertical);
ExpandableObject new_backtrack_door;
int new_section_no_of_backtrack_door;
- if (p_from_element.door instanceof DrillPage)
- {
+ if (p_from_element.door instanceof DrillPage) {
new_backtrack_door = p_from_element.backtrack_door;
new_section_no_of_backtrack_door = p_from_element.section_no_of_backtrack_door;
- }
- else
- {
+ } else {
// Expanded directly through already existing via
// The step expand_to_drill_page is skipped
new_backtrack_door = p_from_element.door;
@@ -662,8 +653,8 @@ private void expand_to_drill(ExpansionDrill p_drill, MazeListElement p_from_elem
double sorting_value = expansion_value + this.destination_distance.calculate(nearest_point, layer);
MazeListElement new_element =
new MazeListElement(p_drill, section_no, new_backtrack_door,
- new_section_no_of_backtrack_door, expansion_value, sorting_value, null, shape_entry,
- p_from_element.room_ripped, MazeSearchElement.Adjustment.NONE, false);
+ new_section_no_of_backtrack_door, expansion_value, sorting_value, null, shape_entry,
+ p_from_element.room_ripped, MazeSearchElement.Adjustment.NONE, false);
this.maze_expansion_list.add(new_element);
}
@@ -671,8 +662,7 @@ private void expand_to_drill(ExpansionDrill p_drill, MazeListElement p_from_elem
* A drill page is inserted between an expansion roomm and the drill to expand
* in order to prevent performance problems with rooms with big shapes containing many drills.
*/
- private void expand_to_drill_page(DrillPage p_drill_page, MazeListElement p_from_element)
- {
+ private void expand_to_drill_page(DrillPage p_drill_page, MazeListElement p_from_element) {
int layer = p_from_element.next_room.get_layer();
FloatPoint from_element_shape_entry_middle = p_from_element.shape_entry.a.middle_point(p_from_element.shape_entry.b);
@@ -681,28 +671,24 @@ private void expand_to_drill_page(DrillPage p_drill_page, MazeListElement p_from
double expansion_value = p_from_element.expansion_value + ctrl.min_normal_via_cost;
double sorting_value =
expansion_value + nearest_point.weighted_distance(from_element_shape_entry_middle,
- ctrl.trace_costs[layer].horizontal, ctrl.trace_costs[layer].vertical) + this.destination_distance.calculate(nearest_point, layer);
+ ctrl.trace_costs[layer].horizontal, ctrl.trace_costs[layer].vertical) + this.destination_distance.calculate(nearest_point, layer);
MazeListElement new_element =
new MazeListElement(p_drill_page, layer, p_from_element.door, p_from_element.section_no_of_door,
- expansion_value, sorting_value, p_from_element.next_room, p_from_element.shape_entry,
- p_from_element.room_ripped, MazeSearchElement.Adjustment.NONE, false);
+ expansion_value, sorting_value, p_from_element.next_room, p_from_element.shape_entry,
+ p_from_element.room_ripped, MazeSearchElement.Adjustment.NONE, false);
this.maze_expansion_list.add(new_element);
}
- private void expand_to_drills_of_page(MazeListElement p_from_element)
- {
+ private void expand_to_drills_of_page(MazeListElement p_from_element) {
int from_room_layer = p_from_element.section_no_of_door;
DrillPage drill_page = (DrillPage) p_from_element.door;
Collection drill_list = drill_page.get_drills(this.autoroute_engine, this.ctrl.attach_smd_allowed);
- for (ExpansionDrill curr_drill : drill_list)
- {
+ for (ExpansionDrill curr_drill : drill_list) {
int section_no = from_room_layer - curr_drill.first_layer;
- if (section_no < 0 || section_no >= curr_drill.room_arr.length)
- {
+ if (section_no < 0 || section_no >= curr_drill.room_arr.length) {
continue;
}
- if (curr_drill.room_arr[section_no] == p_from_element.next_room && !curr_drill.get_maze_search_element(section_no).is_occupied)
- {
+ if (curr_drill.room_arr[section_no] == p_from_element.next_room && !curr_drill.get_maze_search_element(section_no).is_occupied) {
expand_to_drill(curr_drill, p_from_element, 0);
}
}
@@ -711,8 +697,7 @@ private void expand_to_drills_of_page(MazeListElement p_from_element)
/**
* Tries to expand other layers by inserting a via.
*/
- private void expand_to_other_layers(MazeListElement p_list_element)
- {
+ private void expand_to_other_layers(MazeListElement p_list_element) {
int via_lower_bound = 0;
int via_upper_bound = -1;
ExpansionDrill curr_drill = (ExpansionDrill) p_list_element.door;
@@ -720,30 +705,24 @@ private void expand_to_other_layers(MazeListElement p_list_element)
boolean smd_attached_on_component_side = false;
boolean smd_attached_on_solder_side = false;
boolean room_ripped;
- if (curr_drill.room_arr[p_list_element.section_no_of_door] instanceof ObstacleExpansionRoom)
- {
+ if (curr_drill.room_arr[p_list_element.section_no_of_door] instanceof ObstacleExpansionRoom) {
// check ripup of an existing via
- if (!this.ctrl.ripup_allowed)
- {
+ if (!this.ctrl.ripup_allowed) {
return;
}
Item curr_obstacle_item =
((ObstacleExpansionRoom) curr_drill.room_arr[p_list_element.section_no_of_door]).get_item();
- if (!(curr_obstacle_item instanceof board.Via))
- {
+ if (!(curr_obstacle_item instanceof net.freerouting.board.Via)) {
return;
}
- library.Padstack curr_obstacle_padstack = ((board.Via) curr_obstacle_item).get_padstack();
- if (!this.ctrl.via_rule.contains_padstack(curr_obstacle_padstack) || curr_obstacle_item.clearance_class_no() != this.ctrl.via_clearance_class)
- {
+ net.freerouting.library.Padstack curr_obstacle_padstack = ((net.freerouting.board.Via) curr_obstacle_item).get_padstack();
+ if (!this.ctrl.via_rule.contains_padstack(curr_obstacle_padstack) || curr_obstacle_item.clearance_class_no() != this.ctrl.via_clearance_class) {
return;
}
via_lower_bound = curr_obstacle_padstack.from_layer();
via_upper_bound = curr_obstacle_padstack.to_layer();
room_ripped = true;
- }
- else
- {
+ } else {
int[] net_no_arr = new int[1];
net_no_arr[0] = ctrl.net_no;
@@ -752,117 +731,90 @@ private void expand_to_other_layers(MazeListElement p_list_element)
int via_upper_limit = Math.min(curr_drill.last_layer, ctrl.via_upper_bound);
// Calculate the lower bound of possible vias.
int curr_layer = from_layer;
- for (;;)
- {
+ for (; ; ) {
TileShape curr_room_shape = curr_drill.room_arr[curr_layer - curr_drill.first_layer].get_shape();
- board.ForcedPadAlgo.CheckDrillResult drill_result =
+ net.freerouting.board.ForcedPadAlgo.CheckDrillResult drill_result =
ForcedViaAlgo.check_layer(ctrl.via_radius_arr[curr_layer], ctrl.via_clearance_class,
- ctrl.attach_smd_allowed, curr_room_shape, curr_drill.location, curr_layer, net_no_arr,
- ctrl.max_shove_trace_recursion_depth, 0, autoroute_engine.board);
- if (drill_result == board.ForcedPadAlgo.CheckDrillResult.NOT_DRILLABLE)
- {
+ ctrl.attach_smd_allowed, curr_room_shape, curr_drill.location, curr_layer, net_no_arr,
+ ctrl.max_shove_trace_recursion_depth, 0, autoroute_engine.board);
+ if (drill_result == net.freerouting.board.ForcedPadAlgo.CheckDrillResult.NOT_DRILLABLE) {
via_lower_bound = curr_layer + 1;
break;
- }
- else if (drill_result == board.ForcedPadAlgo.CheckDrillResult.DRILLABLE_WITH_ATTACH_SMD)
- {
- if (curr_layer == 0)
- {
+ } else if (drill_result == net.freerouting.board.ForcedPadAlgo.CheckDrillResult.DRILLABLE_WITH_ATTACH_SMD) {
+ if (curr_layer == 0) {
smd_attached_on_component_side = true;
- }
- else if (curr_layer == ctrl.layer_count - 1)
- {
+ } else if (curr_layer == ctrl.layer_count - 1) {
smd_attached_on_solder_side = true;
}
}
- if (curr_layer <= via_lower_limit)
- {
+ if (curr_layer <= via_lower_limit) {
via_lower_bound = via_lower_limit;
break;
}
--curr_layer;
}
- if (via_lower_bound > curr_drill.first_layer)
- {
+ if (via_lower_bound > curr_drill.first_layer) {
return;
}
curr_layer = from_layer + 1;
- for (;;)
- {
- if (curr_layer > via_upper_limit)
- {
+ for (; ; ) {
+ if (curr_layer > via_upper_limit) {
via_upper_bound = via_upper_limit;
break;
}
TileShape curr_room_shape = curr_drill.room_arr[curr_layer - curr_drill.first_layer].get_shape();
- board.ForcedPadAlgo.CheckDrillResult drill_result =
+ net.freerouting.board.ForcedPadAlgo.CheckDrillResult drill_result =
ForcedViaAlgo.check_layer(ctrl.via_radius_arr[curr_layer], ctrl.via_clearance_class, ctrl.attach_smd_allowed,
- curr_room_shape, curr_drill.location, curr_layer, net_no_arr,
- ctrl.max_shove_trace_recursion_depth, 0, autoroute_engine.board);
- if (drill_result == board.ForcedPadAlgo.CheckDrillResult.NOT_DRILLABLE)
- {
+ curr_room_shape, curr_drill.location, curr_layer, net_no_arr,
+ ctrl.max_shove_trace_recursion_depth, 0, autoroute_engine.board);
+ if (drill_result == net.freerouting.board.ForcedPadAlgo.CheckDrillResult.NOT_DRILLABLE) {
via_upper_bound = curr_layer - 1;
break;
- }
- else if (drill_result == board.ForcedPadAlgo.CheckDrillResult.DRILLABLE_WITH_ATTACH_SMD)
- {
- if (curr_layer == ctrl.layer_count - 1)
- {
+ } else if (drill_result == net.freerouting.board.ForcedPadAlgo.CheckDrillResult.DRILLABLE_WITH_ATTACH_SMD) {
+ if (curr_layer == ctrl.layer_count - 1) {
smd_attached_on_solder_side = true;
}
}
++curr_layer;
}
- if (via_upper_bound < curr_drill.last_layer)
- {
+ if (via_upper_bound < curr_drill.last_layer) {
return;
}
}
- for (int to_layer = via_lower_bound; to_layer <= via_upper_bound; ++to_layer)
- {
- if (to_layer == from_layer)
- {
+ for (int to_layer = via_lower_bound; to_layer <= via_upper_bound; ++to_layer) {
+ if (to_layer == from_layer) {
continue;
}
// check, there there is a fitting via mask.
int curr_first_layer;
int curr_last_layer;
- if (to_layer < from_layer)
- {
+ if (to_layer < from_layer) {
curr_first_layer = to_layer;
curr_last_layer = from_layer;
- }
- else
- {
+ } else {
curr_first_layer = from_layer;
curr_last_layer = to_layer;
}
boolean mask_found = false;
- for (int i = 0; i < ctrl.via_info_arr.length; ++i)
- {
+ for (int i = 0; i < ctrl.via_info_arr.length; ++i) {
AutorouteControl.ViaMask curr_via_info = ctrl.via_info_arr[i];
- if (curr_first_layer >= curr_via_info.from_layer && curr_last_layer <= curr_via_info.to_layer && curr_via_info.from_layer >= via_lower_bound && curr_via_info.to_layer <= via_upper_bound)
- {
+ if (curr_first_layer >= curr_via_info.from_layer && curr_last_layer <= curr_via_info.to_layer && curr_via_info.from_layer >= via_lower_bound && curr_via_info.to_layer <= via_upper_bound) {
boolean mask_ok = true;
- if (curr_via_info.from_layer == 0 && smd_attached_on_component_side || curr_via_info.to_layer == ctrl.layer_count - 1 && smd_attached_on_solder_side)
- {
+ if (curr_via_info.from_layer == 0 && smd_attached_on_component_side || curr_via_info.to_layer == ctrl.layer_count - 1 && smd_attached_on_solder_side) {
mask_ok = curr_via_info.attach_smd_allowed;
}
- if (mask_ok)
- {
+ if (mask_ok) {
mask_found = true;
break;
}
}
}
- if (!mask_found)
- {
+ if (!mask_found) {
continue;
}
MazeSearchElement curr_drill_layer_info = curr_drill.get_maze_search_element(to_layer - curr_drill.first_layer);
- if (curr_drill_layer_info.is_occupied)
- {
+ if (curr_drill_layer_info.is_occupied) {
continue;
}
double expansion_value = p_list_element.expansion_value + ctrl.add_via_costs[from_layer].to_layer[to_layer];
@@ -871,8 +823,8 @@ else if (drill_result == board.ForcedPadAlgo.CheckDrillResult.DRILLABLE_WITH_ATT
int curr_room_index = to_layer - curr_drill.first_layer;
MazeListElement new_element =
new MazeListElement(curr_drill, curr_room_index, curr_drill, p_list_element.section_no_of_door,
- expansion_value, sorting_value, curr_drill.room_arr[curr_room_index], p_list_element.shape_entry,
- room_ripped, MazeSearchElement.Adjustment.NONE, false);
+ expansion_value, sorting_value, curr_drill.room_arr[curr_room_index], p_list_element.shape_entry,
+ room_ripped, MazeSearchElement.Adjustment.NONE, false);
this.maze_expansion_list.add(new_element);
}
}
@@ -881,34 +833,28 @@ else if (drill_result == board.ForcedPadAlgo.CheckDrillResult.DRILLABLE_WITH_ATT
* Initializes the maze search algorithm.
* Returns false if the initialisation failed.
*/
- private boolean init(Set
- p_start_items, Set
- p_destination_items)
- {
+ private boolean init(Set
- p_start_items, Set
- p_destination_items) {
reduce_trace_shapes_at_tie_pins(p_start_items, this.ctrl.net_no, this.search_tree);
reduce_trace_shapes_at_tie_pins(p_destination_items, this.ctrl.net_no, this.search_tree);
// process the destination items
boolean destination_ok = false;
Iterator
- it = p_destination_items.iterator();
- while (it.hasNext())
- {
- if (this.autoroute_engine.is_stop_requested())
- {
+ while (it.hasNext()) {
+ if (this.autoroute_engine.is_stop_requested()) {
return false;
}
Item curr_item = it.next();
ItemAutorouteInfo curr_info = curr_item.get_autoroute_info();
curr_info.set_start_info(false);
- for (int i = 0; i < curr_item.tree_shape_count(this.search_tree); ++i)
- {
+ for (int i = 0; i < curr_item.tree_shape_count(this.search_tree); ++i) {
TileShape curr_tree_shape = curr_item.get_tree_shape(this.search_tree, i);
- if (curr_tree_shape != null)
- {
+ if (curr_tree_shape != null) {
destination_distance.join(curr_tree_shape.bounding_box(), curr_item.shape_layer(i));
}
}
destination_ok = true;
}
- if (!destination_ok && this.ctrl.is_fanout)
- {
+ if (!destination_ok && this.ctrl.is_fanout) {
// detination set is not needed for fanout
IntBox board_bounding_box = this.autoroute_engine.board.bounding_box;
destination_distance.join(board_bounding_box, 0);
@@ -916,26 +862,21 @@ private boolean init(Set
- p_start_items, Set
- p_destination_items)
destination_ok = true;
}
- if (!destination_ok)
- {
+ if (!destination_ok) {
return false;
}
// process the start items
Collection start_rooms = new LinkedList();
it = p_start_items.iterator();
- while (it.hasNext())
- {
- if (this.autoroute_engine.is_stop_requested())
- {
+ while (it.hasNext()) {
+ if (this.autoroute_engine.is_stop_requested()) {
return false;
}
Item curr_item = it.next();
ItemAutorouteInfo curr_info = curr_item.get_autoroute_info();
curr_info.set_start_info(true);
- if (curr_item instanceof Connectable)
- {
- for (int i = 0; i < curr_item.tree_shape_count(search_tree); ++i)
- {
+ if (curr_item instanceof Connectable) {
+ for (int i = 0; i < curr_item.tree_shape_count(search_tree); ++i) {
TileShape contained_shape =
((Connectable) curr_item).get_trace_connection_shape(search_tree, i);
IncompleteFreeSpaceExpansionRoom new_start_room = autoroute_engine.add_incomplete_expansion_room(null, curr_item.shape_layer(i), contained_shape);
@@ -948,16 +889,13 @@ private boolean init(Set
- p_start_items, Set
- p_destination_items)
Collection completed_start_rooms = new LinkedList();
- if (this.autoroute_engine.maintain_database)
- {
+ if (this.autoroute_engine.maintain_database) {
// add the completed start rooms carried over from the last autoroute to the start rooms.
completed_start_rooms.addAll(this.autoroute_engine.get_rooms_with_target_items(p_start_items));
}
- for (IncompleteFreeSpaceExpansionRoom curr_room : start_rooms)
- {
- if (this.autoroute_engine.is_stop_requested())
- {
+ for (IncompleteFreeSpaceExpansionRoom curr_room : start_rooms) {
+ if (this.autoroute_engine.is_stop_requested()) {
return false;
}
Collection curr_completed_rooms =
@@ -968,18 +906,14 @@ private boolean init(Set
- p_start_items, Set
- p_destination_items)
// Put the ItemExpansionDoors of the completed start rooms into
// the maze_expansion_list.
boolean start_ok = false;
- for (CompleteFreeSpaceExpansionRoom curr_room : completed_start_rooms)
- {
+ for (CompleteFreeSpaceExpansionRoom curr_room : completed_start_rooms) {
Iterator it2 = curr_room.get_target_doors().iterator();
- while (it2.hasNext())
- {
- if (this.autoroute_engine.is_stop_requested())
- {
+ while (it2.hasNext()) {
+ if (this.autoroute_engine.is_stop_requested()) {
return false;
}
TargetItemExpansionDoor curr_door = it2.next();
- if (curr_door.is_destination_door())
- {
+ if (curr_door.is_destination_door()) {
continue;
}
TileShape connection_shape = ((Connectable) curr_door.item).get_trace_connection_shape(search_tree, curr_door.tree_entry_no);
@@ -989,7 +923,7 @@ private boolean init(Set
- p_start_items, Set
- p_destination_items)
double sorting_value = this.destination_distance.calculate(curr_center, curr_room.get_layer());
MazeListElement new_list_element =
new MazeListElement(curr_door, 0, null, 0, 0, sorting_value, curr_room, shape_entry, false,
- MazeSearchElement.Adjustment.NONE, false);
+ MazeSearchElement.Adjustment.NONE, false);
maze_expansion_list.add(new_list_element);
start_ok = true;
}
@@ -997,72 +931,39 @@ private boolean init(Set
- p_start_items, Set
- p_destination_items)
return start_ok;
}
- /**
- * Looks for pins with more than 1 nets and reduces shapes of thraces of foreign nets,
- * which are already connected to such a pin, so that the pin center is not blocked for connection.
- */
- private static void reduce_trace_shapes_at_tie_pins(Collection
- p_item_list, int p_own_net_no, ShapeSearchTree p_autoroute_tree)
- {
- for (Item curr_item : p_item_list)
- {
- if ((curr_item instanceof board.Pin) && curr_item.net_count() > 1)
- {
- Collection
- pin_contacts = curr_item.get_normal_contacts();
- board.Pin curr_tie_pin = (board.Pin) curr_item;
- for (Item curr_contact : pin_contacts)
- {
- if (!(curr_contact instanceof board.PolylineTrace) || curr_contact.contains_net(p_own_net_no))
- {
- continue;
- }
- p_autoroute_tree.reduce_trace_shape_at_tie_pin(curr_tie_pin, (board.PolylineTrace) curr_contact);
- }
- }
- }
- }
-
- private boolean room_shape_is_thick(ObstacleExpansionRoom p_obstacle_room)
- {
+ private boolean room_shape_is_thick(ObstacleExpansionRoom p_obstacle_room) {
Item obstacle_item = p_obstacle_room.get_item();
int layer = p_obstacle_room.get_layer();
double obstacle_half_width;
- if (obstacle_item instanceof board.Trace)
- {
- obstacle_half_width = ((board.Trace) obstacle_item).get_half_width()
+ if (obstacle_item instanceof net.freerouting.board.Trace) {
+ obstacle_half_width = ((net.freerouting.board.Trace) obstacle_item).get_half_width()
+ this.search_tree.clearance_compensation_value(obstacle_item.clearance_class_no(), layer);
- }
- else if (obstacle_item instanceof board.Via)
- {
- TileShape via_shape = ((board.Via) obstacle_item).get_tree_shape_on_layer(this.search_tree, layer);
+ } else if (obstacle_item instanceof net.freerouting.board.Via) {
+ TileShape via_shape = ((net.freerouting.board.Via) obstacle_item).get_tree_shape_on_layer(this.search_tree, layer);
obstacle_half_width = 0.5 * via_shape.max_width();
- }
- else
- {
+ } else {
System.out.println("MazeSearchAlgo. room_shape_is_thick: unexpected obstacle item");
obstacle_half_width = 0;
}
return obstacle_half_width >= this.ctrl.compensated_trace_half_width[layer];
}
- /** Checks, if the room can be ripped and returns the rip up costs,
+ /**
+ * Checks, if the room can be ripped and returns the rip up costs,
* which are > 0, if the room is ripped and -1, if no ripup was possible.
* If the previous room was also ripped and contained the same item
* or an item of the same connection, the result will be
* equal to ALREADY_RIPPED_COSTS
*/
- private int check_ripup(MazeListElement p_list_element, Item p_obstacle_item, boolean p_door_is_small)
- {
- if (!p_obstacle_item.is_route())
- {
+ private int check_ripup(MazeListElement p_list_element, Item p_obstacle_item, boolean p_door_is_small) {
+ if (!p_obstacle_item.is_route()) {
return -1;
}
- if (p_door_is_small)
- {
+ if (p_door_is_small) {
// allow entering a via or trace, if its corresponding border segment is smaller than the current trace width
- if (!enter_through_small_door(p_list_element, p_obstacle_item))
- {
+ if (!enter_through_small_door(p_list_element, p_obstacle_item)) {
return -1;
}
@@ -1070,61 +971,47 @@ private int check_ripup(MazeListElement p_list_element, Item p_obstacle_item, bo
CompleteExpansionRoom previous_room = p_list_element.door.other_room(p_list_element.next_room);
boolean room_was_shoved = p_list_element.adjustment != MazeSearchElement.Adjustment.NONE;
Item previous_item = null;
- if (previous_room != null && previous_room instanceof ObstacleExpansionRoom)
- {
+ if (previous_room != null && previous_room instanceof ObstacleExpansionRoom) {
previous_item = ((ObstacleExpansionRoom) previous_room).get_item();
}
- if (room_was_shoved)
- {
- if (previous_item != null && previous_item != p_obstacle_item && previous_item.shares_net(p_obstacle_item))
- {
+ if (room_was_shoved) {
+ if (previous_item != null && previous_item != p_obstacle_item && previous_item.shares_net(p_obstacle_item)) {
// The ripped trace may start at a fork.
return -1;
}
- }
- else if (previous_item == p_obstacle_item)
- {
+ } else if (previous_item == p_obstacle_item) {
return ALREADY_RIPPED_COSTS;
}
double fanout_via_cost_factor = 1.0;
double cost_factor = 1;
- if (p_obstacle_item instanceof board.Trace)
- {
- board.Trace obstacle_trace = (board.Trace) p_obstacle_item;
+ if (p_obstacle_item instanceof net.freerouting.board.Trace) {
+ net.freerouting.board.Trace obstacle_trace = (net.freerouting.board.Trace) p_obstacle_item;
cost_factor = obstacle_trace.get_half_width();
- if (!this.ctrl.remove_unconnected_vias)
- {
+ if (!this.ctrl.remove_unconnected_vias) {
// protect traces between SMD-pins and fanout vias
fanout_via_cost_factor = calc_fanout_via_ripup_cost_factor(obstacle_trace);
}
- }
- else if (p_obstacle_item instanceof board.Via)
- {
+ } else if (p_obstacle_item instanceof net.freerouting.board.Via) {
boolean look_if_fanout_via = !this.ctrl.remove_unconnected_vias;
Collection
- contact_list = p_obstacle_item.get_normal_contacts();
int contact_count = 0;
- for (Item curr_contact : contact_list)
- {
- if (!(curr_contact instanceof board.Trace) || curr_contact.is_user_fixed())
- {
+ for (Item curr_contact : contact_list) {
+ if (!(curr_contact instanceof net.freerouting.board.Trace) || curr_contact.is_user_fixed()) {
return -1;
}
++contact_count;
- board.Trace obstacle_trace = (board.Trace) curr_contact;
+ net.freerouting.board.Trace obstacle_trace = (net.freerouting.board.Trace) curr_contact;
cost_factor = Math.max(cost_factor, obstacle_trace.get_half_width());
- if (look_if_fanout_via)
- {
+ if (look_if_fanout_via) {
double curr_fanout_via_cost_factor = calc_fanout_via_ripup_cost_factor(obstacle_trace);
- if (curr_fanout_via_cost_factor > 1)
- {
+ if (curr_fanout_via_cost_factor > 1) {
fanout_via_cost_factor = curr_fanout_via_cost_factor;
look_if_fanout_via = false;
}
}
}
- if (fanout_via_cost_factor <= 1)
- {
+ if (fanout_via_cost_factor <= 1) {
// not a fanout via
cost_factor *= 0.5 * Math.max(contact_count - 1, 0);
}
@@ -1135,14 +1022,12 @@ else if (p_obstacle_item instanceof board.Via)
if (fanout_via_cost_factor <= 1) // p_obstacle_item does not belong to a fanout
{
Connection obstacle_connection = Connection.get(p_obstacle_item);
- if (obstacle_connection != null)
- {
+ if (obstacle_connection != null) {
detour = obstacle_connection.get_detour();
}
}
boolean randomize = this.ctrl.ripup_pass_no >= 4 && this.ctrl.ripup_pass_no % 3 != 0;
- if (randomize)
- {
+ if (randomize) {
// shuffle the result to avoid repetitive loops
double random_number = this.random_generator.nextDouble();
double random_factor = 0.5 + random_number * random_number;
@@ -1156,91 +1041,32 @@ else if (p_obstacle_item instanceof board.Via)
return Math.min(result, MAX_RIPUP_COSTS);
}
- /**
- * Return the addditional cost factor for ripping the trace, if it is connected to a fanout via
- * or 1, if no fanout via was found.
- */
- private static double calc_fanout_via_ripup_cost_factor(board.Trace p_trace)
- {
- final double FANOUT_COST_CONST = 20000;
- Collection