diff --git a/distribution/ReleaseNotes.txt b/distribution/ReleaseNotes.txt
index f56c74266..c285a3a80 100644
--- a/distribution/ReleaseNotes.txt
+++ b/distribution/ReleaseNotes.txt
@@ -7,6 +7,11 @@ HEAD, planned as v0.20
- The external assembly IDE is able to preload also RAMs with executable code.
The register representing the program counter must be marked as such.
- Allows the pre-loading of program memory if a RAM is used as such.
+- Added a new more flexible shape for embedded circuits.
+- Breaking changes:
+ - In your own DIL circuits you have to reselect the DIL shape in the
+ circuit settings. If you have build a custom shape, you also have to
+ reselect it.
v0.19, released on 14. June 2018
- Added a tabbed pane to the attributes dialog to make it more beginner friendly.
diff --git a/src/main/dig/lib/74xx/arithmetic/74147.dig b/src/main/dig/lib/74xx/arithmetic/74147.dig
index 4d0cb3502..760b13b46 100644
--- a/src/main/dig/lib/74xx/arithmetic/74147.dig
+++ b/src/main/dig/lib/74xx/arithmetic/74147.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/74xx/arithmetic/74148.dig b/src/main/dig/lib/74xx/arithmetic/74148.dig
index a592b6569..6cd59a54d 100644
--- a/src/main/dig/lib/74xx/arithmetic/74148.dig
+++ b/src/main/dig/lib/74xx/arithmetic/74148.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/arithmetic/74181.dig b/src/main/dig/lib/74xx/arithmetic/74181.dig
index 2b9c69615..76cad6ab4 100644
--- a/src/main/dig/lib/74xx/arithmetic/74181.dig
+++ b/src/main/dig/lib/74xx/arithmetic/74181.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/arithmetic/74198.dig b/src/main/dig/lib/74xx/arithmetic/74198.dig
index 39897f545..99c6133d9 100644
--- a/src/main/dig/lib/74xx/arithmetic/74198.dig
+++ b/src/main/dig/lib/74xx/arithmetic/74198.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/arithmetic/74280.dig b/src/main/dig/lib/74xx/arithmetic/74280.dig
index ec0b27d83..f19e4ba46 100644
--- a/src/main/dig/lib/74xx/arithmetic/74280.dig
+++ b/src/main/dig/lib/74xx/arithmetic/74280.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/arithmetic/74283.dig b/src/main/dig/lib/74xx/arithmetic/74283.dig
index 55fc7f82b..1696abf3e 100644
--- a/src/main/dig/lib/74xx/arithmetic/74283.dig
+++ b/src/main/dig/lib/74xx/arithmetic/74283.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/arithmetic/74682.dig b/src/main/dig/lib/74xx/arithmetic/74682.dig
index 28e4d3bda..7dae0623a 100644
--- a/src/main/dig/lib/74xx/arithmetic/74682.dig
+++ b/src/main/dig/lib/74xx/arithmetic/74682.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/arithmetic/74688.dig b/src/main/dig/lib/74xx/arithmetic/74688.dig
index ce32dcd4a..d7dfae382 100644
--- a/src/main/dig/lib/74xx/arithmetic/74688.dig
+++ b/src/main/dig/lib/74xx/arithmetic/74688.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/74xx/arithmetic/7480.dig b/src/main/dig/lib/74xx/arithmetic/7480.dig
index 55e54efe0..52f7328b8 100644
--- a/src/main/dig/lib/74xx/arithmetic/7480.dig
+++ b/src/main/dig/lib/74xx/arithmetic/7480.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/arithmetic/7483.dig b/src/main/dig/lib/74xx/arithmetic/7483.dig
index 29368e9f2..0cecc3047 100644
--- a/src/main/dig/lib/74xx/arithmetic/7483.dig
+++ b/src/main/dig/lib/74xx/arithmetic/7483.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/arithmetic/7483Real.dig b/src/main/dig/lib/74xx/arithmetic/7483Real.dig
index e4ec897b4..e8425de1a 100644
--- a/src/main/dig/lib/74xx/arithmetic/7483Real.dig
+++ b/src/main/dig/lib/74xx/arithmetic/7483Real.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/arithmetic/7485.dig b/src/main/dig/lib/74xx/arithmetic/7485.dig
index 1d1e5527a..c638c2ea2 100644
--- a/src/main/dig/lib/74xx/arithmetic/7485.dig
+++ b/src/main/dig/lib/74xx/arithmetic/7485.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7400.dig b/src/main/dig/lib/74xx/basic/7400.dig
index fa517e966..93429d66a 100644
--- a/src/main/dig/lib/74xx/basic/7400.dig
+++ b/src/main/dig/lib/74xx/basic/7400.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7401.dig b/src/main/dig/lib/74xx/basic/7401.dig
index 45d6d1fae..ef9cbf32e 100644
--- a/src/main/dig/lib/74xx/basic/7401.dig
+++ b/src/main/dig/lib/74xx/basic/7401.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7402.dig b/src/main/dig/lib/74xx/basic/7402.dig
index 0b6f49d65..ff7e6090d 100644
--- a/src/main/dig/lib/74xx/basic/7402.dig
+++ b/src/main/dig/lib/74xx/basic/7402.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7403.dig b/src/main/dig/lib/74xx/basic/7403.dig
index 34cf824dc..d2b053bc5 100644
--- a/src/main/dig/lib/74xx/basic/7403.dig
+++ b/src/main/dig/lib/74xx/basic/7403.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7404.dig b/src/main/dig/lib/74xx/basic/7404.dig
index b6a4ebfc7..979877070 100644
--- a/src/main/dig/lib/74xx/basic/7404.dig
+++ b/src/main/dig/lib/74xx/basic/7404.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7405.dig b/src/main/dig/lib/74xx/basic/7405.dig
index 419d3184f..4e11f7bd6 100644
--- a/src/main/dig/lib/74xx/basic/7405.dig
+++ b/src/main/dig/lib/74xx/basic/7405.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7408.dig b/src/main/dig/lib/74xx/basic/7408.dig
index de9246fc4..584159109 100644
--- a/src/main/dig/lib/74xx/basic/7408.dig
+++ b/src/main/dig/lib/74xx/basic/7408.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7409.dig b/src/main/dig/lib/74xx/basic/7409.dig
index 2387f3f0d..8d0e2a92d 100644
--- a/src/main/dig/lib/74xx/basic/7409.dig
+++ b/src/main/dig/lib/74xx/basic/7409.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7410.dig b/src/main/dig/lib/74xx/basic/7410.dig
index 58c18f356..8c9a5a349 100644
--- a/src/main/dig/lib/74xx/basic/7410.dig
+++ b/src/main/dig/lib/74xx/basic/7410.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7411.dig b/src/main/dig/lib/74xx/basic/7411.dig
index 8eb2a7321..32143f98c 100644
--- a/src/main/dig/lib/74xx/basic/7411.dig
+++ b/src/main/dig/lib/74xx/basic/7411.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7412.dig b/src/main/dig/lib/74xx/basic/7412.dig
index bce6fa726..a4dbbe77b 100644
--- a/src/main/dig/lib/74xx/basic/7412.dig
+++ b/src/main/dig/lib/74xx/basic/7412.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7413.dig b/src/main/dig/lib/74xx/basic/7413.dig
index 70ce64f5c..e2973fa51 100644
--- a/src/main/dig/lib/74xx/basic/7413.dig
+++ b/src/main/dig/lib/74xx/basic/7413.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/74133.dig b/src/main/dig/lib/74xx/basic/74133.dig
index a024a778b..daa4aca6d 100644
--- a/src/main/dig/lib/74xx/basic/74133.dig
+++ b/src/main/dig/lib/74xx/basic/74133.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7414.dig b/src/main/dig/lib/74xx/basic/7414.dig
index 501d713d5..27d6c0448 100644
--- a/src/main/dig/lib/74xx/basic/7414.dig
+++ b/src/main/dig/lib/74xx/basic/7414.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7415.dig b/src/main/dig/lib/74xx/basic/7415.dig
index 13f68fef9..86e78b1f1 100644
--- a/src/main/dig/lib/74xx/basic/7415.dig
+++ b/src/main/dig/lib/74xx/basic/7415.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7420.dig b/src/main/dig/lib/74xx/basic/7420.dig
index 627be8905..90717d008 100644
--- a/src/main/dig/lib/74xx/basic/7420.dig
+++ b/src/main/dig/lib/74xx/basic/7420.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7421.dig b/src/main/dig/lib/74xx/basic/7421.dig
index a67a98332..3b7c095b7 100644
--- a/src/main/dig/lib/74xx/basic/7421.dig
+++ b/src/main/dig/lib/74xx/basic/7421.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7425.dig b/src/main/dig/lib/74xx/basic/7425.dig
index b7a081058..f9e280e0f 100644
--- a/src/main/dig/lib/74xx/basic/7425.dig
+++ b/src/main/dig/lib/74xx/basic/7425.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/74260.dig b/src/main/dig/lib/74xx/basic/74260.dig
index c7cdbd5aa..ad1e8a204 100644
--- a/src/main/dig/lib/74xx/basic/74260.dig
+++ b/src/main/dig/lib/74xx/basic/74260.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/74266.dig b/src/main/dig/lib/74xx/basic/74266.dig
index 3ada30013..f29703602 100644
--- a/src/main/dig/lib/74xx/basic/74266.dig
+++ b/src/main/dig/lib/74xx/basic/74266.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7427.dig b/src/main/dig/lib/74xx/basic/7427.dig
index 072bb12bb..d8a04d397 100644
--- a/src/main/dig/lib/74xx/basic/7427.dig
+++ b/src/main/dig/lib/74xx/basic/7427.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7428.dig b/src/main/dig/lib/74xx/basic/7428.dig
index 22c401c38..bf35edb01 100644
--- a/src/main/dig/lib/74xx/basic/7428.dig
+++ b/src/main/dig/lib/74xx/basic/7428.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7430.dig b/src/main/dig/lib/74xx/basic/7430.dig
index 73f8559c9..dbf579fad 100644
--- a/src/main/dig/lib/74xx/basic/7430.dig
+++ b/src/main/dig/lib/74xx/basic/7430.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/74xx/basic/7432.dig b/src/main/dig/lib/74xx/basic/7432.dig
index beba284ca..6719a8f46 100644
--- a/src/main/dig/lib/74xx/basic/7432.dig
+++ b/src/main/dig/lib/74xx/basic/7432.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7440.dig b/src/main/dig/lib/74xx/basic/7440.dig
index df40bab47..d96316ae7 100644
--- a/src/main/dig/lib/74xx/basic/7440.dig
+++ b/src/main/dig/lib/74xx/basic/7440.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/744075.dig b/src/main/dig/lib/74xx/basic/744075.dig
index fdd14e2bc..448495d07 100644
--- a/src/main/dig/lib/74xx/basic/744075.dig
+++ b/src/main/dig/lib/74xx/basic/744075.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7451.dig b/src/main/dig/lib/74xx/basic/7451.dig
index ca9685c10..fad6238ae 100644
--- a/src/main/dig/lib/74xx/basic/7451.dig
+++ b/src/main/dig/lib/74xx/basic/7451.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7454.dig b/src/main/dig/lib/74xx/basic/7454.dig
index 8d58f7200..1ee94efed 100644
--- a/src/main/dig/lib/74xx/basic/7454.dig
+++ b/src/main/dig/lib/74xx/basic/7454.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7455.dig b/src/main/dig/lib/74xx/basic/7455.dig
index bfd27caa2..59e993d87 100644
--- a/src/main/dig/lib/74xx/basic/7455.dig
+++ b/src/main/dig/lib/74xx/basic/7455.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7458.dig b/src/main/dig/lib/74xx/basic/7458.dig
index 84cd46da8..3b2d73002 100644
--- a/src/main/dig/lib/74xx/basic/7458.dig
+++ b/src/main/dig/lib/74xx/basic/7458.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/basic/7486.dig b/src/main/dig/lib/74xx/basic/7486.dig
index 72202fad6..2aa983982 100644
--- a/src/main/dig/lib/74xx/basic/7486.dig
+++ b/src/main/dig/lib/74xx/basic/7486.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/counter/74160.dig b/src/main/dig/lib/74xx/counter/74160.dig
index 832b8836f..58ea14caa 100644
--- a/src/main/dig/lib/74xx/counter/74160.dig
+++ b/src/main/dig/lib/74xx/counter/74160.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/counter/74161.dig b/src/main/dig/lib/74xx/counter/74161.dig
index f91d4dc3e..4ac0e14c8 100644
--- a/src/main/dig/lib/74xx/counter/74161.dig
+++ b/src/main/dig/lib/74xx/counter/74161.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/counter/74162.dig b/src/main/dig/lib/74xx/counter/74162.dig
index 8bdc4e0af..40e2eaf73 100644
--- a/src/main/dig/lib/74xx/counter/74162.dig
+++ b/src/main/dig/lib/74xx/counter/74162.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/counter/74162Real.dig b/src/main/dig/lib/74xx/counter/74162Real.dig
index a464e6e07..febfc6478 100644
--- a/src/main/dig/lib/74xx/counter/74162Real.dig
+++ b/src/main/dig/lib/74xx/counter/74162Real.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/counter/74163.dig b/src/main/dig/lib/74xx/counter/74163.dig
index f846b70a5..47c99326e 100644
--- a/src/main/dig/lib/74xx/counter/74163.dig
+++ b/src/main/dig/lib/74xx/counter/74163.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/counter/74191.dig b/src/main/dig/lib/74xx/counter/74191.dig
index c34dd87d0..a45210aba 100644
--- a/src/main/dig/lib/74xx/counter/74191.dig
+++ b/src/main/dig/lib/74xx/counter/74191.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/74xx/counter/74590.dig b/src/main/dig/lib/74xx/counter/74590.dig
index 58ee4cb24..170c2c207 100644
--- a/src/main/dig/lib/74xx/counter/74590.dig
+++ b/src/main/dig/lib/74xx/counter/74590.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/counter/74779.dig b/src/main/dig/lib/74xx/counter/74779.dig
index 085f769fb..7965f10e1 100644
--- a/src/main/dig/lib/74xx/counter/74779.dig
+++ b/src/main/dig/lib/74xx/counter/74779.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/74xx/display/7447.dig b/src/main/dig/lib/74xx/display/7447.dig
index d1d9b23de..af4d5a0cf 100644
--- a/src/main/dig/lib/74xx/display/7447.dig
+++ b/src/main/dig/lib/74xx/display/7447.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/display/7448.dig b/src/main/dig/lib/74xx/display/7448.dig
index 4d962b9cd..c9477e2e5 100644
--- a/src/main/dig/lib/74xx/display/7448.dig
+++ b/src/main/dig/lib/74xx/display/7448.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/driver/7406.dig b/src/main/dig/lib/74xx/driver/7406.dig
index 6412e1e74..3ca1102a3 100644
--- a/src/main/dig/lib/74xx/driver/7406.dig
+++ b/src/main/dig/lib/74xx/driver/7406.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/driver/7407.dig b/src/main/dig/lib/74xx/driver/7407.dig
index e8d9f4ed0..181f52f19 100644
--- a/src/main/dig/lib/74xx/driver/7407.dig
+++ b/src/main/dig/lib/74xx/driver/7407.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/driver/7416.dig b/src/main/dig/lib/74xx/driver/7416.dig
index f662c9762..34ad7ebbc 100644
--- a/src/main/dig/lib/74xx/driver/7416.dig
+++ b/src/main/dig/lib/74xx/driver/7416.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/driver/7417.dig b/src/main/dig/lib/74xx/driver/7417.dig
index 2aeaf19df..5f9c93989 100644
--- a/src/main/dig/lib/74xx/driver/7417.dig
+++ b/src/main/dig/lib/74xx/driver/7417.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/driver/74244.dig b/src/main/dig/lib/74xx/driver/74244.dig
index 95c07884a..85237f648 100644
--- a/src/main/dig/lib/74xx/driver/74244.dig
+++ b/src/main/dig/lib/74xx/driver/74244.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/driver/74245.dig b/src/main/dig/lib/74xx/driver/74245.dig
index 5cd21a3e3..29bab7bd7 100644
--- a/src/main/dig/lib/74xx/driver/74245.dig
+++ b/src/main/dig/lib/74xx/driver/74245.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
backgroundColor
diff --git a/src/main/dig/lib/74xx/driver/74540.dig b/src/main/dig/lib/74xx/driver/74540.dig
index 8df228987..8b1f5d0bc 100644
--- a/src/main/dig/lib/74xx/driver/74540.dig
+++ b/src/main/dig/lib/74xx/driver/74540.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/driver/74541.dig b/src/main/dig/lib/74xx/driver/74541.dig
index 0cce87f9e..f0ec49d70 100644
--- a/src/main/dig/lib/74xx/driver/74541.dig
+++ b/src/main/dig/lib/74xx/driver/74541.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/flipflops/74107.dig b/src/main/dig/lib/74xx/flipflops/74107.dig
index 2f128d589..af174086f 100644
--- a/src/main/dig/lib/74xx/flipflops/74107.dig
+++ b/src/main/dig/lib/74xx/flipflops/74107.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/flipflops/74109.dig b/src/main/dig/lib/74xx/flipflops/74109.dig
index 4b606057c..0d5b86804 100644
--- a/src/main/dig/lib/74xx/flipflops/74109.dig
+++ b/src/main/dig/lib/74xx/flipflops/74109.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/74xx/flipflops/74112.dig b/src/main/dig/lib/74xx/flipflops/74112.dig
index 277785ef0..c319a8120 100644
--- a/src/main/dig/lib/74xx/flipflops/74112.dig
+++ b/src/main/dig/lib/74xx/flipflops/74112.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/74xx/flipflops/74116.dig b/src/main/dig/lib/74xx/flipflops/74116.dig
index af6beddff..503af4051 100644
--- a/src/main/dig/lib/74xx/flipflops/74116.dig
+++ b/src/main/dig/lib/74xx/flipflops/74116.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/flipflops/74173.dig b/src/main/dig/lib/74xx/flipflops/74173.dig
index e83833334..394de9089 100644
--- a/src/main/dig/lib/74xx/flipflops/74173.dig
+++ b/src/main/dig/lib/74xx/flipflops/74173.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/flipflops/74174.dig b/src/main/dig/lib/74xx/flipflops/74174.dig
index 8aa1f4851..e89835248 100644
--- a/src/main/dig/lib/74xx/flipflops/74174.dig
+++ b/src/main/dig/lib/74xx/flipflops/74174.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/flipflops/74273.dig b/src/main/dig/lib/74xx/flipflops/74273.dig
index 6db2944f2..74d235599 100644
--- a/src/main/dig/lib/74xx/flipflops/74273.dig
+++ b/src/main/dig/lib/74xx/flipflops/74273.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/74xx/flipflops/74373.dig b/src/main/dig/lib/74xx/flipflops/74373.dig
index f32e323b9..0a9b2ceda 100644
--- a/src/main/dig/lib/74xx/flipflops/74373.dig
+++ b/src/main/dig/lib/74xx/flipflops/74373.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/flipflops/74374.dig b/src/main/dig/lib/74xx/flipflops/74374.dig
index ec15184b3..455ca433a 100644
--- a/src/main/dig/lib/74xx/flipflops/74374.dig
+++ b/src/main/dig/lib/74xx/flipflops/74374.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/flipflops/7474.dig b/src/main/dig/lib/74xx/flipflops/7474.dig
index cd14f79f5..8c0804d33 100644
--- a/src/main/dig/lib/74xx/flipflops/7474.dig
+++ b/src/main/dig/lib/74xx/flipflops/7474.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/flipflops/7476.dig b/src/main/dig/lib/74xx/flipflops/7476.dig
index 1c3ced249..f5a1703b9 100644
--- a/src/main/dig/lib/74xx/flipflops/7476.dig
+++ b/src/main/dig/lib/74xx/flipflops/7476.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/memory/74670.dig b/src/main/dig/lib/74xx/memory/74670.dig
index abfe4e567..2b3821822 100644
--- a/src/main/dig/lib/74xx/memory/74670.dig
+++ b/src/main/dig/lib/74xx/memory/74670.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/memory/7489.dig b/src/main/dig/lib/74xx/memory/7489.dig
index 7accb90f2..905098052 100644
--- a/src/main/dig/lib/74xx/memory/7489.dig
+++ b/src/main/dig/lib/74xx/memory/7489.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/plexers/74138.dig b/src/main/dig/lib/74xx/plexers/74138.dig
index f408614df..06dfa858f 100644
--- a/src/main/dig/lib/74xx/plexers/74138.dig
+++ b/src/main/dig/lib/74xx/plexers/74138.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/plexers/74139.dig b/src/main/dig/lib/74xx/plexers/74139.dig
index eafd6cc93..5d400b948 100644
--- a/src/main/dig/lib/74xx/plexers/74139.dig
+++ b/src/main/dig/lib/74xx/plexers/74139.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/plexers/74150.dig b/src/main/dig/lib/74xx/plexers/74150.dig
index ec2c6d7c4..733639afc 100644
--- a/src/main/dig/lib/74xx/plexers/74150.dig
+++ b/src/main/dig/lib/74xx/plexers/74150.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/plexers/74151.dig b/src/main/dig/lib/74xx/plexers/74151.dig
index a52c77531..9c0f5ff95 100644
--- a/src/main/dig/lib/74xx/plexers/74151.dig
+++ b/src/main/dig/lib/74xx/plexers/74151.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/plexers/74153.dig b/src/main/dig/lib/74xx/plexers/74153.dig
index fcf18d8a3..b76796e33 100644
--- a/src/main/dig/lib/74xx/plexers/74153.dig
+++ b/src/main/dig/lib/74xx/plexers/74153.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/plexers/74154.dig b/src/main/dig/lib/74xx/plexers/74154.dig
index ff248feb9..93ac0ea5f 100644
--- a/src/main/dig/lib/74xx/plexers/74154.dig
+++ b/src/main/dig/lib/74xx/plexers/74154.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/plexers/74157.dig b/src/main/dig/lib/74xx/plexers/74157.dig
index de22f16f6..bc975a672 100644
--- a/src/main/dig/lib/74xx/plexers/74157.dig
+++ b/src/main/dig/lib/74xx/plexers/74157.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/plexers/74238.dig b/src/main/dig/lib/74xx/plexers/74238.dig
index 4a5e306d4..d4fe41221 100644
--- a/src/main/dig/lib/74xx/plexers/74238.dig
+++ b/src/main/dig/lib/74xx/plexers/74238.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/plexers/74253.dig b/src/main/dig/lib/74xx/plexers/74253.dig
index a791168f2..4ce8eb9e3 100644
--- a/src/main/dig/lib/74xx/plexers/74253.dig
+++ b/src/main/dig/lib/74xx/plexers/74253.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/plexers/7442.dig b/src/main/dig/lib/74xx/plexers/7442.dig
index d2114aff1..28e80078f 100644
--- a/src/main/dig/lib/74xx/plexers/7442.dig
+++ b/src/main/dig/lib/74xx/plexers/7442.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/shift register/74164.dig b/src/main/dig/lib/74xx/shift register/74164.dig
index 45b17c5d5..46a886d8c 100644
--- a/src/main/dig/lib/74xx/shift register/74164.dig
+++ b/src/main/dig/lib/74xx/shift register/74164.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/74xx/shift register/74165.dig b/src/main/dig/lib/74xx/shift register/74165.dig
index 6b4686418..ac9d7de86 100644
--- a/src/main/dig/lib/74xx/shift register/74165.dig
+++ b/src/main/dig/lib/74xx/shift register/74165.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/74xx/shift register/74166.dig b/src/main/dig/lib/74xx/shift register/74166.dig
index 60f782bb8..68d1763a4 100644
--- a/src/main/dig/lib/74xx/shift register/74166.dig
+++ b/src/main/dig/lib/74xx/shift register/74166.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
Description
diff --git a/src/main/dig/lib/EPROMs/27c801.dig b/src/main/dig/lib/EPROMs/27c801.dig
index f165b8a3a..383fd0bb9 100644
--- a/src/main/dig/lib/EPROMs/27c801.dig
+++ b/src/main/dig/lib/EPROMs/27c801.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/EPROMs/28c010.dig b/src/main/dig/lib/EPROMs/28c010.dig
index 6136a82b9..8ebf4cf7a 100644
--- a/src/main/dig/lib/EPROMs/28c010.dig
+++ b/src/main/dig/lib/EPROMs/28c010.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/EPROMs/28c16.dig b/src/main/dig/lib/EPROMs/28c16.dig
index 56b36f284..a54ed5c97 100644
--- a/src/main/dig/lib/EPROMs/28c16.dig
+++ b/src/main/dig/lib/EPROMs/28c16.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/EPROMs/28c256.dig b/src/main/dig/lib/EPROMs/28c256.dig
index 104385b08..af0fe3c1d 100644
--- a/src/main/dig/lib/EPROMs/28c256.dig
+++ b/src/main/dig/lib/EPROMs/28c256.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/EPROMs/28c512.dig b/src/main/dig/lib/EPROMs/28c512.dig
index 0a9a5bcce..bab3f5862 100644
--- a/src/main/dig/lib/EPROMs/28c512.dig
+++ b/src/main/dig/lib/EPROMs/28c512.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/lib/EPROMs/28c64.dig b/src/main/dig/lib/EPROMs/28c64.dig
index c98d0236f..0ee753714 100644
--- a/src/main/dig/lib/EPROMs/28c64.dig
+++ b/src/main/dig/lib/EPROMs/28c64.dig
@@ -3,8 +3,8 @@
1
- isDIL
- true
+ shapeType
+ DIL
pinCount
diff --git a/src/main/dig/processor/ALU/ALU.dig b/src/main/dig/processor/ALU/ALU.dig
index 9d4f25c61..8502dd44c 100644
--- a/src/main/dig/processor/ALU/ALU.dig
+++ b/src/main/dig/processor/ALU/ALU.dig
@@ -2,6 +2,10 @@
1
+
+ shapeType
+ CUSTOM
+
Description
Arithmetic Logical unit.
diff --git a/src/main/java/de/neemann/digital/core/element/Key.java b/src/main/java/de/neemann/digital/core/element/Key.java
index 1bd03a72b..7c37b53d4 100644
--- a/src/main/java/de/neemann/digital/core/element/Key.java
+++ b/src/main/java/de/neemann/digital/core/element/Key.java
@@ -20,7 +20,7 @@ public class Key {
private final String langKey;
private boolean groupEditAllowed = false;
private Key dependsOn;
- private boolean dependsOnInvert;
+ private CheckEnabled checkEnabled;
// Both values are always null in digital.
// Both are only used within a custom implemented component.
@@ -157,30 +157,31 @@ public class Key {
/**
* @return true if dependency is inverted
*/
- public boolean isDependsOnInverted() {
- return dependsOnInvert;
+ public CheckEnabled getCheckEnabled() {
+ return checkEnabled;
+ }
+
+ /**
+ * Sets a bool dependency for this key
+ *
+ * @param key the key which this key depends on
+ * @return this for chained calls
+ */
+ public Key setDependsOn(Key key) {
+ return setDependsOn(key, o -> o);
}
/**
* Sets the key this key depends on.
*
- * @param key the key where this key depends on
+ * @param key the key where this key depends on
+ * @param checkEnabled function which determines if the editor is enabled or not
+ * @param type of key which this key depends on
* @return this for chained calls
*/
- public Key setDependsOn(Key key) {
- return setDependsOn(key, false);
- }
-
- /**
- * Sets the key this key depends on.
- *
- * @param key the key where this key depends on
- * @param invert if true dependency is inverted
- * @return this for chained calls
- */
- public Key setDependsOn(Key key, boolean invert) {
+ public Key setDependsOn(Key key, CheckEnabled checkEnabled) {
this.dependsOn = key;
- this.dependsOnInvert = invert;
+ this.checkEnabled = checkEnabled;
return this;
}
@@ -457,4 +458,19 @@ public class Key {
return lineNumbers;
}
}
+
+ /**
+ * Interface to define a dependancy of a key from an other key
+ *
+ * @param the type of the key
+ */
+ public interface CheckEnabled {
+ /**
+ * Returns true if editor is enabled
+ *
+ * @param t the value the editor depends on
+ * @return true if editor is enabled
+ */
+ boolean isEnabled(T t);
+ }
}
diff --git a/src/main/java/de/neemann/digital/core/element/Keys.java b/src/main/java/de/neemann/digital/core/element/Keys.java
index 0ff967265..6cf24d666 100644
--- a/src/main/java/de/neemann/digital/core/element/Keys.java
+++ b/src/main/java/de/neemann/digital/core/element/Keys.java
@@ -17,6 +17,7 @@ import de.neemann.digital.draw.graphics.Orientation;
import de.neemann.digital.draw.graphics.Style;
import de.neemann.digital.draw.library.ElementLibrary;
import de.neemann.digital.draw.model.InverterConfig;
+import de.neemann.digital.draw.shapes.CustomCircuitShapeType;
import de.neemann.digital.draw.shapes.custom.CustomShapeDescription;
import de.neemann.gui.Screen;
import de.neemann.gui.language.Language;
@@ -288,6 +289,21 @@ public final class Keys {
= new Key.KeyInteger("Width", 3)
.setMin(2);
+ /**
+ * defines the shape type of the custom circuit
+ */
+ public static final Key SHAPE_TYPE
+ = new Key.KeyEnum<>("shapeType", CustomCircuitShapeType.DEFAULT, CustomCircuitShapeType.values()).setSecondary();
+
+ /**
+ * the width of an element if it is included as nested element
+ */
+ public static final Key HEIGHT
+ = new Key.KeyInteger("Height", 3)
+ .setMin(2)
+ .setSecondary()
+ .setDependsOn(SHAPE_TYPE, cst -> cst.equals(CustomCircuitShapeType.LAYOUT));
+
/**
* width of the terminal
*/
@@ -527,19 +543,14 @@ public final class Keys {
public static final Key PINNUMBER =
new Key<>("pinNumber", "").setSecondary();
- /**
- * true if shape is a dil shape
- */
- public static final Key IS_DIL
- = new Key<>("isDIL", false).setSecondary();
/**
* the pin count
*/
public static final Key PINCOUNT =
new Key.KeyInteger("pinCount", 0)
.setMin(0)
- .setDependsOn(IS_DIL)
- .setSecondary();
+ .setSecondary()
+ .setDependsOn(SHAPE_TYPE, st -> st.equals(CustomCircuitShapeType.DIL));
/**
@@ -552,8 +563,7 @@ public final class Keys {
* Background Color of nested circuits
*/
public static final Key BACKGROUND_COLOR
- = new Key<>("backgroundColor", new Color(255, 255, 180, 200))
- .setDependsOn(IS_DIL, true);
+ = new Key<>("backgroundColor", new Color(255, 255, 180, 200));
/**
* the screen resolution
@@ -646,17 +656,13 @@ public final class Keys {
public static final Key SETTINGS_NOTOOLTIPS =
new Key<>("noComponentToolTips", false);
- /**
- * Used to show the default shape also if the circuit defines a DIL.
- */
- public static final Key USE_DEFAULT_SHAPE
- = new Key("useDefShape", false);
-
/**
* Shape used to represent a visual element
*/
public static final Key CUSTOM_SHAPE
- = new Key<>("customShape", CustomShapeDescription.EMPTY).setSecondary();
+ = new Key<>("customShape", CustomShapeDescription.EMPTY)
+ .setSecondary()
+ .setDependsOn(SHAPE_TYPE, st -> st.equals(CustomCircuitShapeType.CUSTOM));
/**
* True if a program is loaded to the simulator at startup
@@ -668,6 +674,6 @@ public final class Keys {
* The file to preload as a program at startup
*/
public static final Key PROGRAM_TO_PRELOAD
- = new Key.KeyFile("preloadProgramFile", new File("")).setSecondary();
+ = new Key.KeyFile("preloadProgramFile", new File("")).setSecondary().setDependsOn(PRELOAD_PROGRAM);
}
diff --git a/src/main/java/de/neemann/digital/draw/elements/Circuit.java b/src/main/java/de/neemann/digital/draw/elements/Circuit.java
index c86d6122c..c6cd349d2 100644
--- a/src/main/java/de/neemann/digital/draw/elements/Circuit.java
+++ b/src/main/java/de/neemann/digital/draw/elements/Circuit.java
@@ -24,6 +24,7 @@ import de.neemann.digital.core.wiring.Clock;
import de.neemann.digital.draw.graphics.*;
import de.neemann.digital.draw.graphics.Vector;
import de.neemann.digital.draw.model.InverterConfig;
+import de.neemann.digital.draw.shapes.CustomCircuitShapeType;
import de.neemann.digital.draw.shapes.Drawable;
import de.neemann.digital.draw.shapes.ShapeFactory;
import de.neemann.digital.draw.shapes.custom.CustomShapeDescription;
@@ -97,6 +98,7 @@ public class Circuit {
xStream.alias("poly", CustomShapeDescription.PolygonHolder.class);
xStream.alias("text", CustomShapeDescription.TextHolder.class);
xStream.alias("polygon", Polygon.class);
+ xStream.alias("shapeType", CustomCircuitShapeType.class);
xStream.registerConverter(new PolygonConverter());
return xStream;
}
diff --git a/src/main/java/de/neemann/digital/draw/library/ElementLibrary.java b/src/main/java/de/neemann/digital/draw/library/ElementLibrary.java
index 7ec3902c4..bbb3a75ad 100644
--- a/src/main/java/de/neemann/digital/draw/library/ElementLibrary.java
+++ b/src/main/java/de/neemann/digital/draw/library/ElementLibrary.java
@@ -8,7 +8,10 @@ package de.neemann.digital.draw.library;
import de.neemann.digital.core.arithmetic.*;
import de.neemann.digital.core.arithmetic.Comparator;
import de.neemann.digital.core.basic.*;
-import de.neemann.digital.core.element.*;
+import de.neemann.digital.core.element.ElementAttributes;
+import de.neemann.digital.core.element.ElementFactory;
+import de.neemann.digital.core.element.ElementTypeDescription;
+import de.neemann.digital.core.element.Keys;
import de.neemann.digital.core.extern.External;
import de.neemann.digital.core.flipflops.*;
import de.neemann.digital.core.io.*;
@@ -19,12 +22,10 @@ import de.neemann.digital.core.pld.PullDown;
import de.neemann.digital.core.pld.PullUp;
import de.neemann.digital.core.switching.*;
import de.neemann.digital.core.wiring.*;
-import de.neemann.digital.core.flipflops.Monoflop;
import de.neemann.digital.draw.elements.Circuit;
import de.neemann.digital.draw.elements.PinException;
import de.neemann.digital.draw.elements.Tunnel;
import de.neemann.digital.draw.shapes.ShapeFactory;
-import de.neemann.digital.draw.shapes.custom.CustomShapeDescription;
import de.neemann.digital.gui.Settings;
import de.neemann.digital.gui.components.data.DummyElement;
import de.neemann.digital.gui.components.graphics.GraphicCard;
@@ -602,6 +603,7 @@ public class ElementLibrary implements Iterable
setShortName(file.getName());
addAttribute(Keys.ROTATE);
addAttribute(Keys.LABEL);
+ addAttribute(Keys.SHAPE_TYPE);
}
/**
@@ -645,18 +647,6 @@ public class ElementLibrary implements Iterable
return super.getDescription(elementAttributes);
}
- @Override
- public ArrayList getAttributeList() {
- final ArrayList list = super.getAttributeList();
- if (getAttributes().get(Keys.IS_DIL)
- || getAttributes().get(Keys.CUSTOM_SHAPE) != CustomShapeDescription.EMPTY) {
-
- ArrayList li = new ArrayList<>(list);
- li.add(Keys.USE_DEFAULT_SHAPE);
- return li;
- }
- return list;
- }
}
diff --git a/src/main/java/de/neemann/digital/draw/shapes/CustomCircuitShapeType.java b/src/main/java/de/neemann/digital/draw/shapes/CustomCircuitShapeType.java
new file mode 100644
index 000000000..ab8823d52
--- /dev/null
+++ b/src/main/java/de/neemann/digital/draw/shapes/CustomCircuitShapeType.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2018 Helmut Neemann.
+ * Use of this source code is governed by the GPL v3 license
+ * that can be found in the LICENSE file.
+ */
+package de.neemann.digital.draw.shapes;
+
+/**
+ * Defines the kind of shape used for a embedded circuit
+ */
+public enum CustomCircuitShapeType {
+ /**
+ * Uses the shape specified in the circuit itself
+ */
+ DEFAULT,
+
+ /**
+ * The default shape. inputs at the left, outputs at the right
+ */
+ SIMPLE,
+
+ /**
+ * A DIL shape
+ */
+ DIL,
+
+ /**
+ * Pin positions are dependent on the pin positions in the circuit
+ */
+ LAYOUT,
+
+ /**
+ * Shape is defined in the circuit itself.
+ */
+ CUSTOM
+}
diff --git a/src/main/java/de/neemann/digital/draw/shapes/LayoutShape.java b/src/main/java/de/neemann/digital/draw/shapes/LayoutShape.java
new file mode 100644
index 000000000..abe3503b7
--- /dev/null
+++ b/src/main/java/de/neemann/digital/draw/shapes/LayoutShape.java
@@ -0,0 +1,219 @@
+/*
+ * Copyright (c) 2018 Helmut Neemann.
+ * Use of this source code is governed by the GPL v3 license
+ * that can be found in the LICENSE file.
+ */
+package de.neemann.digital.draw.shapes;
+
+import de.neemann.digital.core.NodeException;
+import de.neemann.digital.core.Observer;
+import de.neemann.digital.core.element.ElementAttributes;
+import de.neemann.digital.core.element.Keys;
+import de.neemann.digital.core.element.PinDescription;
+import de.neemann.digital.core.io.In;
+import de.neemann.digital.core.io.Out;
+import de.neemann.digital.core.wiring.Clock;
+import de.neemann.digital.draw.elements.*;
+import de.neemann.digital.draw.graphics.*;
+import de.neemann.digital.draw.graphics.Polygon;
+import de.neemann.digital.draw.library.ElementLibrary;
+import de.neemann.digital.lang.Lang;
+
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import static de.neemann.digital.draw.shapes.GenericShape.SIZE;
+
+/**
+ * The layout shape.
+ * The pins are ordered in the same way they are placed inside the circuit.
+ * Thus the shape feels like a minimized version of the contained circuit in respect to pin ordering.
+ */
+public class LayoutShape implements Shape {
+
+ private int width;
+ private int height;
+ private final Pins pins;
+ private final Color color;
+ private final String name;
+ private final PinList left;
+ private final PinList right;
+ private final PinList top;
+ private final PinList bottom;
+
+ /**
+ * Creates a new instance
+ *
+ * @param custom the type description
+ * @param elementAttributes the local attributes
+ * @throws NodeException NodeException
+ * @throws PinException PinException
+ */
+ public LayoutShape(ElementLibrary.ElementTypeDescriptionCustom custom, ElementAttributes elementAttributes) throws NodeException, PinException {
+ left = new PinList(false);
+ right = new PinList(false);
+ top = new PinList(true);
+ bottom = new PinList(true);
+
+ for (VisualElement ve : custom.getCircuit().getElements()) {
+ if (ve.equalsDescription(In.DESCRIPTION) || ve.equalsDescription(Clock.DESCRIPTION)) {
+ switch (ve.getRotate()) {
+ case 0:
+ left.add(ve);
+ break;
+ case 1:
+ bottom.add(ve);
+ break;
+ case 2:
+ right.add(ve);
+ break;
+ default:
+ top.add(ve);
+ break;
+ }
+ }
+ if (ve.equalsDescription(Out.DESCRIPTION)) {
+ switch (ve.getRotate()) {
+ case 0:
+ right.add(ve);
+ break;
+ case 1:
+ top.add(ve);
+ break;
+ case 2:
+ left.add(ve);
+ break;
+ default:
+ bottom.add(ve);
+ break;
+ }
+ }
+ }
+
+ height = Math.max(Math.max(right.size(), left.size()) + 1, custom.getAttributes().get(Keys.HEIGHT));
+ width = Math.max(Math.max(top.size(), bottom.size()) + 1, custom.getAttributes().get(Keys.WIDTH));
+
+ HashMap map = new HashMap<>();
+ top.createPosition(map, new Vector(((width - top.size()) / 2 + 1) * SIZE, 0));
+ bottom.createPosition(map, new Vector(((width - bottom.size()) / 2 + 1) * SIZE, SIZE * height));
+ left.createPosition(map, new Vector(0, ((height - left.size()) / 2 + 1) * SIZE));
+ right.createPosition(map, new Vector(SIZE * width, ((height - right.size()) / 2 + 1) * SIZE));
+
+ pins = new Pins();
+ for (PinDescription p : custom.getInputDescription(elementAttributes))
+ pins.add(createPin(map, p));
+ for (PinDescription p : custom.getOutputDescriptions(elementAttributes))
+ pins.add(createPin(map, p));
+
+ color = custom.getCircuit().getAttributes().get(Keys.BACKGROUND_COLOR);
+
+ String l = elementAttributes.getCleanLabel();
+ if (l != null && l.length() > 0)
+ name = l;
+ else
+ name = custom.getShortName();
+ }
+
+ private Pin createPin(HashMap map, PinDescription p) throws PinException {
+ PinPos pinPos = map.get(p.getName());
+ if (pinPos == null)
+ throw new PinException(Lang.get("err_pin_N_notFound", p.getName()));
+ return new Pin(pinPos.pos, p);
+ }
+
+
+ @Override
+ public Pins getPins() {
+ return pins;
+ }
+
+ @Override
+ public InteractorInterface applyStateMonitor(IOState ioState, Observer guiObserver) {
+ return null;
+ }
+
+ @Override
+ public void drawTo(Graphic graphic, Style highLight) {
+ final Polygon poly = new Polygon(true)
+ .add(0, 0)
+ .add(width * SIZE, 0)
+ .add(width * SIZE, height * SIZE)
+ .add(0, height * SIZE);
+ graphic.drawPolygon(poly, Style.NORMAL.deriveFillStyle(color));
+ graphic.drawPolygon(poly, Style.NORMAL);
+
+ if (top.size() == 0)
+ Graphic.drawText(graphic, new Vector(width * SIZE / 2, -4), name, Orientation.CENTERBOTTOM, Style.SHAPE_PIN);
+ else if (bottom.size() == 0)
+ Graphic.drawText(graphic, new Vector(width * SIZE / 2, height * SIZE + 4), name, Orientation.CENTERTOP, Style.SHAPE_PIN);
+ else
+ Graphic.drawText(graphic, new Vector(width * SIZE / 2, height * SIZE /2), name, Orientation.CENTERCENTER, Style.SHAPE_PIN);
+
+ for (PinPos p : left)
+ Graphic.drawText(graphic, p.pos.add(4, 0), p.label, Orientation.LEFTCENTER, Style.SHAPE_PIN);
+ for (PinPos p : right)
+ Graphic.drawText(graphic, p.pos.add(-4, 0), p.label, Orientation.RIGHTCENTER, Style.SHAPE_PIN);
+ for (PinPos p : top)
+ graphic.drawText(p.pos.add(0, 4), p.pos.add(0, 3), p.label, Orientation.RIGHTCENTER, Style.SHAPE_PIN);
+ for (PinPos p : bottom)
+ graphic.drawText(p.pos.add(0, -4), p.pos.add(0, -3), p.label, Orientation.RIGHTCENTER, Style.SHAPE_PIN);
+ }
+
+ private final static class PinPos implements Comparable {
+ private final int orderPos;
+ private final String label;
+ private Vector pos;
+
+ private PinPos(VisualElement ve, boolean horizontal) {
+ if (horizontal)
+ orderPos = ve.getPos().x;
+ else
+ orderPos = ve.getPos().y;
+ label = ve.getElementAttributes().getLabel();
+ }
+
+ @Override
+ public int compareTo(PinPos pinPos) {
+ return orderPos - pinPos.orderPos;
+ }
+
+ }
+
+ private final static class PinList implements Iterable {
+ private final boolean horizontal;
+ private ArrayList pins;
+
+ private PinList(boolean horizontal) {
+ this.horizontal = horizontal;
+ pins = new ArrayList<>();
+ }
+
+ private void add(VisualElement ve) {
+ pins.add(new PinPos(ve, horizontal));
+ }
+
+ private int size() {
+ return pins.size();
+ }
+
+ private void createPosition(HashMap map, Vector pos) {
+ Collections.sort(pins);
+ for (PinPos pp : pins) {
+ map.put(pp.label, pp);
+ pp.pos = pos;
+ if (horizontal)
+ pos = pos.add(SIZE, 0);
+ else
+ pos = pos.add(0, SIZE);
+ }
+ }
+
+ @Override
+ public Iterator iterator() {
+ return pins.iterator();
+ }
+ }
+}
diff --git a/src/main/java/de/neemann/digital/draw/shapes/ShapeFactory.java b/src/main/java/de/neemann/digital/draw/shapes/ShapeFactory.java
index 820bfab3d..337e560a7 100644
--- a/src/main/java/de/neemann/digital/draw/shapes/ShapeFactory.java
+++ b/src/main/java/de/neemann/digital/draw/shapes/ShapeFactory.java
@@ -170,32 +170,39 @@ public final class ShapeFactory {
if (pt instanceof ElementLibrary.ElementTypeDescriptionCustom) {
// Custom component
ElementLibrary.ElementTypeDescriptionCustom customDescr = (ElementLibrary.ElementTypeDescriptionCustom) pt;
- if (!elementAttributes.get(Keys.USE_DEFAULT_SHAPE)) {
- final CustomShapeDescription customShapeDescription = customDescr.getAttributes().get(Keys.CUSTOM_SHAPE);
- if (customShapeDescription != CustomShapeDescription.EMPTY)
- return new CustomShape(customShapeDescription,
- pt.getInputDescription(elementAttributes),
- pt.getOutputDescriptions(elementAttributes));
- else if (customDescr.getAttributes().get(Keys.IS_DIL)) {
+ CustomCircuitShapeType shapeType = customDescr.getAttributes().get(Keys.SHAPE_TYPE);
+ final CustomCircuitShapeType localShapeType = elementAttributes.get(Keys.SHAPE_TYPE);
+ if (!localShapeType.equals(CustomCircuitShapeType.DEFAULT))
+ shapeType = localShapeType;
+
+ switch (shapeType) {
+ case DIL:
return new DILShape(
pt.getShortName(),
pt.getInputDescription(elementAttributes),
pt.getOutputDescriptions(elementAttributes),
elementAttributes.getLabel(),
customDescr.getAttributes());
- }
+ case LAYOUT:
+ return new LayoutShape(customDescr, elementAttributes);
+ case CUSTOM:
+ final CustomShapeDescription customShapeDescription = customDescr.getAttributes().get(Keys.CUSTOM_SHAPE);
+ if (customShapeDescription != CustomShapeDescription.EMPTY)
+ return new CustomShape(customShapeDescription,
+ pt.getInputDescription(elementAttributes),
+ pt.getOutputDescriptions(elementAttributes));
+ default:
+ return new GenericShape(
+ pt.getShortName(),
+ pt.getInputDescription(elementAttributes),
+ pt.getOutputDescriptions(elementAttributes),
+ elementAttributes.getLabel(),
+ true,
+ customDescr.getAttributes().get(Keys.WIDTH))
+ .setColor(customDescr.getAttributes().get(Keys.BACKGROUND_COLOR));
}
- // Neither DIL nor custom shape.
- return new GenericShape(
- pt.getShortName(),
- pt.getInputDescription(elementAttributes),
- pt.getOutputDescriptions(elementAttributes),
- elementAttributes.getLabel(),
- true,
- customDescr.getAttributes().get(Keys.WIDTH))
- .setColor(customDescr.getAttributes().get(Keys.BACKGROUND_COLOR));
} else {
- // Internal component without own shape.
+ // Internal component without it's own shape.
return new GenericShape(
pt.getShortName(),
pt.getInputDescription(elementAttributes),
@@ -207,7 +214,7 @@ public final class ShapeFactory {
}
}
} else {
- // Internal component with own shape.
+ // Internal component with it's own shape.
ElementTypeDescription pt = library.getElementType(elementName);
return cr.create(elementAttributes,
pt.getInputDescription(elementAttributes),
@@ -247,7 +254,7 @@ public final class ShapeFactory {
}
@Override
- public Shape create(ElementAttributes attributes, PinDescriptions inputs, PinDescriptions outputs) throws NodeException {
+ public Shape create(ElementAttributes attributes, PinDescriptions inputs, PinDescriptions outputs) {
return new GenericShape(name, inputs, outputs)
.invert(invers)
.setInverterConfig(attributes.get(Keys.INVERTER_CONFIG));
diff --git a/src/main/java/de/neemann/digital/gui/components/AttributeDialog.java b/src/main/java/de/neemann/digital/gui/components/AttributeDialog.java
index 3e76b08c6..95b0d21db 100644
--- a/src/main/java/de/neemann/digital/gui/components/AttributeDialog.java
+++ b/src/main/java/de/neemann/digital/gui/components/AttributeDialog.java
@@ -134,7 +134,7 @@ public class AttributeDialog extends JDialog {
if (dependsOn != null) {
for (EditorHolder ed : editors) {
if (ed.key.getKey().equals(dependsOn.getKey())) {
- ed.setDependantEditor(e, key.isDependsOnInverted());
+ ed.setDependantEditor(e, key.getCheckEnabled());
}
}
}
@@ -186,7 +186,7 @@ public class AttributeDialog extends JDialog {
* @param list the list a keys
* @return true if two tabs are to be used.
*/
- public boolean enableTwoTabs(List list) {
+ private boolean enableTwoTabs(List list) {
int secCount = 0;
int primCount = 0;
for (Key k : list) {
@@ -213,7 +213,7 @@ public class AttributeDialog extends JDialog {
/**
* @return the keys check boxes
*/
- public HashMap getCheckBoxes() {
+ HashMap getCheckBoxes() {
return checkBoxes;
}
@@ -224,7 +224,7 @@ public class AttributeDialog extends JDialog {
* @param action the action
* @return this for chained calls
*/
- public AttributeDialog addButton(String label, ToolTipAction action) {
+ AttributeDialog addButton(String label, ToolTipAction action) {
panel.add(new JLabel(label), constraints);
panel.add(action.createJButton(), constraints.x(1));
constraints.nextRow();
@@ -237,7 +237,7 @@ public class AttributeDialog extends JDialog {
* @param action the action
* @return this for chained calls
*/
- public AttributeDialog addButton(ToolTipAction action) {
+ AttributeDialog addButton(ToolTipAction action) {
buttonPanel.add(action.createJButton(), 0);
return this;
}
@@ -247,7 +247,7 @@ public class AttributeDialog extends JDialog {
*
* @throws Editor.EditorParseException Editor.EditorParseException
*/
- public void storeEditedValues() throws Editor.EditorParseException {
+ void storeEditedValues() throws Editor.EditorParseException {
for (EditorHolder e : editors)
e.setTo(modifiedAttributes);
}
@@ -257,7 +257,7 @@ public class AttributeDialog extends JDialog {
*
* @throws Editor.EditorParseException Editor.EditorParseException
*/
- public void updateEditedValues() throws Editor.EditorParseException {
+ void updateEditedValues() throws Editor.EditorParseException {
for (EditorHolder e : editors)
e.getFrom(modifiedAttributes);
}
@@ -265,7 +265,7 @@ public class AttributeDialog extends JDialog {
/**
* @return the modified attributes
*/
- public ElementAttributes getModifiedAttributes() {
+ ElementAttributes getModifiedAttributes() {
return modifiedAttributes;
}
@@ -295,7 +295,7 @@ public class AttributeDialog extends JDialog {
/**
* @return the dialogs parent
*/
- public Window getDialogParent() {
+ Window getDialogParent() {
return parent;
}
@@ -303,7 +303,7 @@ public class AttributeDialog extends JDialog {
/**
* @return true if ok is pressed
*/
- public boolean isOkPressed() {
+ boolean isOkPressed() {
return okPressed;
}
@@ -348,19 +348,26 @@ public class AttributeDialog extends JDialog {
attr.set(key, value);
}
- public void getFrom(ElementAttributes attr) throws Editor.EditorParseException {
+ void getFrom(ElementAttributes attr) {
T value = attr.get(key);
e.setValue(value);
}
- void setDependantEditor(Editor editor, boolean inverted) {
- if (key.getValueClass() != Boolean.class)
- throw new RuntimeException("key " + key.getName() + " is not a bool key");
+ void setDependantEditor(Editor editor, Key.CheckEnabled checkEnabled) {
+ try {
+ editor.setEnabled(checkEnabled.isEnabled(e.getValue()));
+ } catch (Editor.EditorParseException e1) {
+ e1.printStackTrace();
+ }
- EditorFactory.BooleanEditor bool = (EditorFactory.BooleanEditor) e;
- editor.setEnabled(bool.getValue() ^ inverted);
-
- bool.getCheckBox().addActionListener(actionEvent -> editor.setEnabled(bool.getValue() ^ inverted));
+ e.addActionListener(actionEvent -> {
+ try {
+ editor.setEnabled(checkEnabled.isEnabled(e.getValue()));
+ } catch (Editor.EditorParseException e1) {
+ e1.printStackTrace();
+ }
+ }
+ );
}
}
diff --git a/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java b/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java
index 2ae7dd335..3608d7a58 100644
--- a/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java
+++ b/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java
@@ -64,11 +64,12 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe
static {
ATTR_LIST.add(Keys.WIDTH);
- ATTR_LIST.add(Keys.IS_DIL);
- ATTR_LIST.add(Keys.PINCOUNT);
- ATTR_LIST.add(Keys.BACKGROUND_COLOR);
+ ATTR_LIST.add(Keys.SHAPE_TYPE);
if (Main.isExperimentalMode())
ATTR_LIST.add(Keys.CUSTOM_SHAPE);
+ ATTR_LIST.add(Keys.HEIGHT);
+ ATTR_LIST.add(Keys.PINCOUNT);
+ ATTR_LIST.add(Keys.BACKGROUND_COLOR);
ATTR_LIST.add(Keys.DESCRIPTION);
ATTR_LIST.add(Keys.LOCKED_MODE);
ATTR_LIST.add(Keys.ROMMANAGER);
diff --git a/src/main/java/de/neemann/digital/gui/components/CustomShapeEditor.java b/src/main/java/de/neemann/digital/gui/components/CustomShapeEditor.java
index 5866d863e..cb5457f64 100644
--- a/src/main/java/de/neemann/digital/gui/components/CustomShapeEditor.java
+++ b/src/main/java/de/neemann/digital/gui/components/CustomShapeEditor.java
@@ -21,6 +21,8 @@ import java.awt.event.ActionEvent;
*/
public class CustomShapeEditor extends EditorFactory.LabelEditor {
private CustomShapeDescription customShapeDescription;
+ private ToolTipAction clear;
+ private ToolTipAction load;
/**
* Creates a new instance
@@ -35,21 +37,30 @@ public class CustomShapeEditor extends EditorFactory.LabelEditor the type of the editor
@@ -46,6 +47,14 @@ public interface Editor {
*/
void setEnabled(boolean enabled);
+ /**
+ * Adds an ectionListener to the component
+ *
+ * @param actionListener the actionListener to add
+ */
+ default void addActionListener(ActionListener actionListener) {
+ }
+
/**
* Indicates a invalid value in a input field
*/
diff --git a/src/main/java/de/neemann/digital/gui/components/EditorFactory.java b/src/main/java/de/neemann/digital/gui/components/EditorFactory.java
index 5588a06d5..3585cb22b 100644
--- a/src/main/java/de/neemann/digital/gui/components/EditorFactory.java
+++ b/src/main/java/de/neemann/digital/gui/components/EditorFactory.java
@@ -22,6 +22,7 @@ import de.neemann.digital.draw.graphics.Orientation;
import de.neemann.digital.draw.library.ElementNotFoundException;
import de.neemann.digital.draw.model.InverterConfig;
import de.neemann.digital.draw.model.ModelCreator;
+import de.neemann.digital.draw.shapes.CustomCircuitShapeType;
import de.neemann.digital.draw.shapes.custom.CustomShapeDescription;
import de.neemann.digital.gui.Main;
import de.neemann.digital.gui.components.table.ShowStringDialog;
@@ -36,6 +37,7 @@ import javax.swing.*;
import javax.swing.text.JTextComponent;
import java.awt.*;
import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.*;
@@ -75,6 +77,7 @@ public final class EditorFactory {
add(ROMManger.class, ROMManagerEditor.class);
add(Application.Type.class, ApplicationTypeEditor.class);
add(CustomShapeDescription.class, CustomShapeEditor.class);
+ add(CustomCircuitShapeType.class, CustomCircuitShapeTypeEditor.class);
}
private void add(Class clazz, Class extends Editor> editor) {
@@ -442,6 +445,11 @@ public final class EditorFactory {
public void setValue(Boolean value) {
bool.setEnabled(value);
}
+
+ @Override
+ public void addActionListener(ActionListener al) {
+ bool.addActionListener(al);
+ }
}
private final static class ColorEditor extends LabelEditor {
@@ -494,6 +502,7 @@ public final class EditorFactory {
private final JPanel panel;
private final JTextField textField;
private final boolean directoryOnly;
+ private final JButton button;
public FileEditor(File value, Key key) {
if (key instanceof Key.KeyFile)
@@ -503,7 +512,7 @@ public final class EditorFactory {
panel = new JPanel(new BorderLayout());
textField = new JTextField(value.getPath(), 20);
- JButton button = new JButton(new AbstractAction("...") {
+ button = new JButton(new AbstractAction("...") {
@Override
public void actionPerformed(ActionEvent e) {
JFileChooser fc = new MyFileChooser(FileEditor.this.getValue());
@@ -531,6 +540,13 @@ public final class EditorFactory {
public void setValue(File value) {
textField.setText(value.getPath());
}
+
+ @Override
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
+ textField.setEnabled(enabled);
+ button.setEnabled(enabled);
+ }
}
private final static class DataFieldEditor extends LabelEditor {
@@ -659,6 +675,11 @@ public final class EditorFactory {
public void setValue(E value) {
comboBox.setSelectedIndex(value.ordinal());
}
+
+ @Override
+ public void addActionListener(ActionListener actionListener) {
+ comboBox.addActionListener(actionListener);
+ }
}
private static final class IntFormatsEditor extends EnumEditor {
@@ -685,6 +706,12 @@ public final class EditorFactory {
}
}
+ private static final class CustomCircuitShapeTypeEditor extends EnumEditor {
+ public CustomCircuitShapeTypeEditor(CustomCircuitShapeType value, Key key) {
+ super(value, key);
+ }
+ }
+
private static final class ApplicationTypeEditor extends EnumEditor {
private final Key key;
private JComboBox combo;
diff --git a/src/main/resources/lang/lang_de.xml b/src/main/resources/lang/lang_de.xml
index 09fd99dc2..128beb124 100644
--- a/src/main/resources/lang/lang_de.xml
+++ b/src/main/resources/lang/lang_de.xml
@@ -1000,6 +1000,8 @@ Sind evtl. die Namen der Variablen nicht eindeutig?
Der Wert der Konstanten.
Breite
Breite des Symbols, wenn diese Schaltung in eine andere eingefügt wird.
+ Höhe
+ Höhe des Symbols, wenn diese Schaltung in eine andere eingefügt wird.
Bei jedem Start automatisch neu laden.
Lädt das HEX-File bei jedem Modelstart neu.
Tausche Selektorposition
@@ -1085,9 +1087,6 @@ Sind evtl. die Namen der Variablen nicht eindeutig?
Adressiert die einzelnen Spalten. Drei Bits bedeuten also acht Spalten.
Bearbeitung gesperrt
Die Schaltung ist für die Bearbeitung gesperrt. Dioden und FG-FETs können jedoch konfiguriert werden.
- DIL-Gehäuse verwenden
- Wird diese Schaltung eingebettet, wird sie in einem DIL-Gehäuse angezeigt.
- Um die Pins korrekt zuordnen zu können, ist an den Eingängen und Ausgängen die Pinnummer anzugeben.
Pinnummer
Nummer dieses Pins. Wird für die Darstellung einer Schaltung als DIL-Gehäuse und die
Pinzuordnung bei der Programmierung eines CPLD verwendet.
@@ -1179,10 +1178,6 @@ Sind evtl. die Namen der Variablen nicht eindeutig?
Benutzerdefinierte Form
Importieren einer SVG-Datei
- Verwende einfache Form
- Verwendet die einfache Form zur Darstellung. Hat nur einen Effekt, wenn die
- Schaltung eine Benutzerdefinierte Form oder eine DIL Form verwendet.
-
Datei beim Start in den Programmspeicher laden.
Wird ein Prozessor simuliert, der einen RAM-Baustein als Programmspeicher
verwendet, ist es schwierig, diesen Prozessor zu starten, da der RAM Inhalt beim Start der Simulation immer mit
@@ -1194,6 +1189,21 @@ Sind evtl. die Namen der Variablen nicht eindeutig?
soll.
+ Form
+ Die Form, welche für die Repräsentation der Schaltung in einer einbettenden
+ Schaltung verwendet werden soll. Bei der Form "Einfach" werden die Eingänge auf der linken und die Ausgänge auf
+ der rechten Seite eines einfachen Rechtecks angezeigt.
+ Bei "Layout" bestimmt die Lage und Orientierung der Ein- und Ausgänge in
+ der Schaltung die Position der Pins. Hier sind auch Pins oben und unten möglich.
+ Bei der Wahl von "DIL-Gehäuse" wird ein DIL-Gehäuse zur Darstellung verwendet. Die Pin-Nummern der Ein- und
+ Ausgänge bestimmen hier die Position der Pins.
+
+ Vorgabe
+ Einfach
+ DIL-Gehäuse
+ Layout
+ Benutzerdefiniert
+
Ausrichtung
Lage der Koordinate relativ zum Text.
links unten
diff --git a/src/main/resources/lang/lang_en.xml b/src/main/resources/lang/lang_en.xml
index c6fe22763..50af0d3c8 100644
--- a/src/main/resources/lang/lang_en.xml
+++ b/src/main/resources/lang/lang_en.xml
@@ -992,6 +992,8 @@
The value of the constant.
Width
With of symbol if this circuit is used as an component in an other circuit.
+ Height
+ Height of symbol if this circuit is used as an component in an other circuit.
Reload at model start
Reloads the hex file every time the model is started.
Flip selector position
@@ -1077,9 +1079,6 @@
Addresses the individual columns. Three bits means eight columns.
Modification locked
The circuit is locked. It is possible to configure diodes and FGF-FETs.
- DIL package
- If set, this circuit is shown in a DIL package.
- To assign the pins correctly, the pin numbers must be set on all inputs and outputs.
Pin number
Number of this pin. Used for the representation of a circuit as a DIL package and
the pin assignment when programming a CPLD.
@@ -1170,9 +1169,6 @@
Custom Shape
Import of a SVG-file
- Use Default Shape
- Use the default shape instead of using the DIL or custom shape configured in the circuit.
-
Preload program memory at startup.
When simulating a processor that uses a RAM device as the program memory,
it is difficult to start this processor because the RAM contents are always initialized with zeros at the start
@@ -1184,6 +1180,20 @@
simulation.
+ Shape
+ The shape to be used for the representation of the circuit in an embedding circuit.
+ In the "Simple" mode, the inputs are displayed on the left and the outputs on the right side of a simple rectangle.
+ With "Layout", the position of the inputs and outputs and and their orientation in the circuit determines
+ the position of the pins. Here are also pins at the top or bottom possible.
+ When selecting "DIL-Chip", a DIL housing is used to display the circuit. The pin numbers of the inputs and outputs
+ determine the position of the pins in this case.
+
+ Default
+ Simple
+ DIL-Chip
+ Layout
+ User defined
+
Orientation
Position of the coordinate relative to the text.
left bottom
diff --git a/src/test/java/de/neemann/digital/integration/TestLib.java b/src/test/java/de/neemann/digital/integration/TestLib.java
index 75679d688..67e6d07ff 100644
--- a/src/test/java/de/neemann/digital/integration/TestLib.java
+++ b/src/test/java/de/neemann/digital/integration/TestLib.java
@@ -16,6 +16,7 @@ import de.neemann.digital.draw.elements.Circuit;
import de.neemann.digital.draw.elements.PinException;
import de.neemann.digital.draw.elements.VisualElement;
import de.neemann.digital.draw.library.ElementNotFoundException;
+import de.neemann.digital.draw.shapes.CustomCircuitShapeType;
import junit.framework.TestCase;
import java.io.File;
@@ -42,11 +43,11 @@ public class TestLib extends TestCase {
boolean is74xx = !dig.getName().endsWith("-inc.dig");
if (is74xx) {
- assertTrue("is not DIL", circuit.getAttributes().get(Keys.IS_DIL));
+ assertEquals("is not DIL", CustomCircuitShapeType.DIL, circuit.getAttributes().get(Keys.SHAPE_TYPE));
count74xx++;
final int w = circuit.getAttributes().get(Keys.WIDTH);
- assertTrue ("chip to small", w>=5);
+ assertTrue("chip to small", w >= 5);
}
assertTrue("is not locked", circuit.getAttributes().get(Keys.LOCKED_MODE));
diff --git a/src/test/resources/dig/MS-JK-DIL.dig b/src/test/resources/dig/MS-JK-DIL.dig
index 0972fbfd0..6dec1de34 100644
--- a/src/test/resources/dig/MS-JK-DIL.dig
+++ b/src/test/resources/dig/MS-JK-DIL.dig
@@ -6,6 +6,14 @@
isDIL
true
+
+ shapeType
+ DIL
+
+
+ Width
+ 6
+
@@ -36,20 +44,24 @@
In
+
+ rotation
+
+
Label
J
pinNumber
- 1
+ 1
Default
1
-
+
In
@@ -60,7 +72,7 @@
pinNumber
- 2
+ 2
@@ -104,7 +116,7 @@
pinNumber
- 7
+ 7
@@ -118,7 +130,7 @@
pinNumber
- 6
+ 6
@@ -126,16 +138,20 @@
In
+
+ rotation
+
+
Label
K
pinNumber
- 3
+ 3
-
+
@@ -159,42 +175,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -223,6 +203,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -235,6 +239,10 @@
+
+
+
+
@@ -263,6 +271,14 @@
+
+
+
+
+
+
+
+
@@ -271,6 +287,14 @@
+
+
+
+
+
+
+
+
@@ -287,6 +311,14 @@
+
+
+
+
+
+
+
+
@@ -295,13 +327,21 @@
+
+
+
+
-
-
+
+
+
+
+
+
@@ -319,22 +359,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/test/resources/dig/shapes.dig b/src/test/resources/dig/shapes.dig
index 6579b717c..7ef590500 100644
--- a/src/test/resources/dig/shapes.dig
+++ b/src/test/resources/dig/shapes.dig
@@ -473,6 +473,16 @@
+
+ MS-JK-DIL.dig
+
+
+ shapeType
+ LAYOUT
+
+
+
+
\ No newline at end of file