summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Mathieu <michael@michael-laptop.(none)>2009-01-10 02:14:23 +0100
committerMichael Mathieu <michael@michael-laptop.(none)>2009-01-10 02:14:23 +0100
commit8ad3692188ddacc664a72ee0c9a8f4bc5c40785f (patch)
tree8c60a21f0d5cf7e8f6735608f6447bdc20795eb0
parent325e33f951b34dd2c68e114024447f4ad9f098d3 (diff)
downloadsysdigit-8ad3692188ddacc664a72ee0c9a8f4bc5c40785f.tar.gz
sysdigit-8ad3692188ddacc664a72ee0c9a8f4bc5c40785f.tar.bz2
[scripts] Added some scripts
-rw-r--r--circuitbuilder/scripts/add-n-components9
-rw-r--r--circuitbuilder/scripts/link-n-to-one5
-rw-r--r--circuitbuilder/scripts/link-one-gate-to-n-gates5
-rw-r--r--circuitbuilder/scripts/link-one-to-one5
4 files changed, 24 insertions, 0 deletions
diff --git a/circuitbuilder/scripts/add-n-components b/circuitbuilder/scripts/add-n-components
new file mode 100644
index 0000000..c3e92d0
--- /dev/null
+++ b/circuitbuilder/scripts/add-n-components
@@ -0,0 +1,9 @@
+n = 16
+comp = "Output"
+component_class = builder.get_component_class(comp)
+for i in range(n):
+ component = component_class()
+ component.x = 1
+ component.y = 1 + i * builder.part_size * 1.01
+ if not builder.add_component(component):
+ print "Couldn't add component" \ No newline at end of file
diff --git a/circuitbuilder/scripts/link-n-to-one b/circuitbuilder/scripts/link-n-to-one
new file mode 100644
index 0000000..46a93d0
--- /dev/null
+++ b/circuitbuilder/scripts/link-n-to-one
@@ -0,0 +1,5 @@
+n = 16
+i0 = 1
+n0 = 33
+for i in range(n):
+ builder.add_link(builder.get_component("g%d"%(i0+i)), 1, builder.get_component("g%d"%(n0)), 1+i)
diff --git a/circuitbuilder/scripts/link-one-gate-to-n-gates b/circuitbuilder/scripts/link-one-gate-to-n-gates
new file mode 100644
index 0000000..e4fe299
--- /dev/null
+++ b/circuitbuilder/scripts/link-one-gate-to-n-gates
@@ -0,0 +1,5 @@
+n = 16
+i0 = 17
+n0 = 18
+for i in range(n):
+ builder.add_link(builder.get_component("g%d"%i0), i+1, builder.get_component("g%d"%(n0+i)), 1)
diff --git a/circuitbuilder/scripts/link-one-to-one b/circuitbuilder/scripts/link-one-to-one
new file mode 100644
index 0000000..dd1d593
--- /dev/null
+++ b/circuitbuilder/scripts/link-one-to-one
@@ -0,0 +1,5 @@
+i0 = 1
+i1 = 32
+n = 32
+for i in range(n):
+ builder.add_link(builder.get_component("g%d"%(i+i0)), 1, builder.get_component("g%d"%(i+i1)), 1)