[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA: Default pinnumber for net attribute?



Hello!
As now all net= attributes must contain a pinnumber(s) after a semicolon, like
net=VCC:14
in the case of power connection it looks like 
net=VCC:1
This is no problem if the power symbol is not editable, since the attribute is 
made invisible and a separate text VCC is displayed.
But if I try to make the power symbol editable by making the value of the net= 
attribute visible, a pinnumber also appears so the power is now labelled 
VCC:1
this looks strange for some people, who are not familiar with gaf. It would be 
better to have only VCC visible as a power label.
The appended patch makes 1 a default value of pinnumber in net, do
net=VCC
is equal to
net=VCC:1
There is one drawback, this patch removes an error message and a broken 
netlist may be created without warning. It should be good to limit this 
default to devices with only one pin, but I dont know how to make this.

Wojciech Kazubski
--- geda-gnetlist-20040111/src/s_netattrib.c.defnetnumber	2003-10-27 04:07:08.000000000 +0100
+++ geda-gnetlist-20040111/src/s_netattrib.c	2004-03-27 00:18:16.000000000 +0100
@@ -261,9 +261,13 @@
 	if (value) {
 	    char_ptr = strchr(value, ':');
 	    if (char_ptr == NULL) {
+/*
 		fprintf(stderr, "Got an invalid net= attrib [net=%s]\nMissing : in net= attrib\n",
 			value);
 		return (NULL);
+*/
+		strcat(value, ":1");
+	        char_ptr = strchr(value, ':');
 	    }
 
 	    net_name = s_netattrib_extract_netname(value);
@@ -303,9 +307,13 @@
 	if (value) {
 	    char_ptr = strchr(value, ':');
 	    if (char_ptr == NULL) {
+/*
 		fprintf(stderr, "Got an invalid net= attrib [net=%s]\nMissing : in net= attrib\n",
 			value);
 		return (NULL);
+*/
+		strcat(value, ":1");
+	        char_ptr = strchr(value, ':');
 	    }
 
 	    net_name = s_netattrib_extract_netname(value);