Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Multiple GND symbols #16

Open
kiavash-at-work opened this issue Apr 16, 2019 · 2 comments
Open

Multiple GND symbols #16

kiavash-at-work opened this issue Apr 16, 2019 · 2 comments
Labels
feature request New feature, request or enhancement svg Stuff related to the svg output

Comments

@kiavash-at-work
Copy link
Contributor

Generated SVG treats all nets with GND in it the same GND symbol, however it would be better to have different symbols for AGND and GND.

@kiavash-at-work kiavash-at-work added feature request New feature, request or enhancement svg Stuff related to the svg output labels Apr 16, 2019
@kiavash-at-work
Copy link
Contributor Author

diff --git a/lib/analog.svg b/lib/analog.svg
index c73f649..a5fc479 100644
--- a/lib/analog.svg
+++ b/lib/analog.svg
@@ -59,6 +59,13 @@ text {
   <g s:x="10" s:y="-30" s:pid="A" s:position="bottom"/>
 </g>
 
+<g s:type="agnd" s:width="20" s:height="30" transform="translate(120,35)">
+  <s:alias val="agnd" />
+  <text x="10" y="10" class="nodelabel $cell_id" s:attribute="name">AGND</text>
+  <path d="M0,-15 H20 L10,0 Z M10,-15 V-30" class="$cell_id"/>
+  <g s:x="10" s:y="-30" s:pid="A" s:position="bottom"/>
+</g>
+
 <g s:type="gnd" s:width="20" s:height="30" transform="translate(80,35)">
   <s:alias val="gnd"/>
   <path d="M0,0 H20 M3,5 H17 M7,10 H13 M10,0 V-15" class="$cell_id"/>

and

diff --git a/pcbdl/netlistsvg.py b/pcbdl/netlistsvg.py
index 956284c..2f8a915 100644
--- a/pcbdl/netlistsvg.py
+++ b/pcbdl/netlistsvg.py
@@ -111,12 +111,19 @@ class SVGPart(object):
				name_attribute = net.name
				if len(name_attribute) > 10:
						name_attribute = name_attribute.replace("PP","")
-                       name_attribute = name_attribute.replace("_VREF","")
-
+                       name_attribute = name_attribute.replace("_VREF","")     
+                       
+               if net.name == "GND":
+                       part_type = "gnd"
+               elif net.is_gnd:
+                       part_type = "agnd"
+               elif net.is_power:
+                       part_type = "vcc"
+               
				power_symbol = {
						"connections": {"A": [net_node_number]},
						"attributes": {"value": name_attribute},
-                       "type": "gnd" if net.is_gnd else "vcc",
+                       "type": part_type,
				}
 
				self.schematic_page.parts_dict[name] = power_symbol

@amstan
Copy link
Contributor

amstan commented May 29, 2019

New behavior now!

Every GND net that's not named GND will just have the text displaying so.

9337831#diff-526fb11c69a6225770197dff49f9efeaR120

So:

  • GND -> just the normal symbol, no text
  • AGND -> same normal symbol with the "AGND" label

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request New feature, request or enhancement svg Stuff related to the svg output
Projects
None yet
Development

No branches or pull requests

2 participants