Re: gEDA-user: [PATCH 1/2] gnetlist: Add access to all attributes from components with multiple symbol instances.

2011-01-04 Thread Patrick Bernaud
Hi Kai-Martin,

Kai-Martin Knaak writes:
  [...]
  However, a less severe wart remains: In case of multiple values for the
  same attribute, the output still depends on the order the symbols were
  added to the schematics.

This behaviour is intentional. But you can change it locally.

Regards,


Patrick


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


gEDA-user: [PATCH 1/2] gnetlist: Add access to all attributes from components with multiple symbol instances.

2011-01-03 Thread Patrick Bernaud
This commit introduces 'gnetlist:get-all-package-attributes' to
retrieve every first attribute value for package consisting of
multiple symbol instances.

'gnetlist:get-package-attribute' gets redefined to use the above
procedure. To preserve backward compatibility, it returns the first
value found in file order and warns when detecting different, possibly
conflicting values. This behavior is configurable.

Derived from patch #3071482, C code by Sebastian Gieltjes.
---

 gnetlist/include/prototype.h |2 +-
 gnetlist/scheme/gnetlist.scm |   41 ++
 gnetlist/src/g_netlist.c |   45 +-
 gnetlist/src/g_register.c|2 +-
 4 files changed, 70 insertions(+), 20 deletions(-)

diff --git a/gnetlist/include/prototype.h b/gnetlist/include/prototype.h
index d37d397..3a976c2 100644
--- a/gnetlist/include/prototype.h
+++ b/gnetlist/include/prototype.h
@@ -11,7 +11,7 @@ SCM g_get_all_unique_nets(SCM scm_level);
 SCM g_get_all_connections(SCM scm_netname);
 SCM g_get_nets(SCM scm_uref, SCM scm_pin);
 SCM g_get_pins_nets(SCM scm_uref);
-SCM g_get_package_attribute(SCM scm_uref, SCM scm_wanted_attrib);
+SCM g_get_all_package_attributes(SCM scm_uref, SCM scm_wanted_attrib);
 SCM g_get_attribute_by_pinseq(SCM scm_uref, SCM scm_pinseq, SCM 
scm_wanted_attrib);
 SCM g_get_attribute_by_pinnumber(SCM scm_uref, SCM scm_pin, SCM 
scm_wanted_attrib);
 SCM g_get_toplevel_attribute(SCM scm_wanted_attrib);
diff --git a/gnetlist/scheme/gnetlist.scm b/gnetlist/scheme/gnetlist.scm
index d798259..a58ec79 100644
--- a/gnetlist/scheme/gnetlist.scm
+++ b/gnetlist/scheme/gnetlist.scm
@@ -17,6 +17,8 @@
 ;;; along with this program; if not, write to the Free Software
 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
+(use-modules (srfi srfi-1))
+
 ;;--
 ;; The below functions added by SDB in Sept 2003 to support command-line flag
 ;; processing.
@@ -94,6 +96,45 @@
   )
 )
 
+;; Default resolver: returns value associated with first symbol instance
+;; in file order and warns if instances have different values.
+(define (unique-attribute refdes name values)
+(let ((value (car values)))
+  (or (every (lambda (x) (equal? x value)) values)
+  (format (current-error-port) \
+Possible attribute conflict for refdes: ~A
+name: ~A
+values: ~A
+ refdes name values))
+  value))
+
+(define (gnetlist:get-package-attribute refdes name)
+  Return the value associated with attribute NAME on package
+identified by REFDES.
+
+It actually computes a single value from the full list of values
+produced by 'gnetlist:get-all-package-attributes' as that list is
+passed through 'unique-attribute'.
+
+For backward compatibility, the default behavior is to return the
+value associated with the first symbol instance for REFDES. If all
+instances of REFDES do not have the same value for NAME, it prints a
+warning.
+
+This can be modified by redefining 'unique-attribute' that is a
+procedure that gets provided a non-empty list of attribute values, the
+REFDES and the NAME used for the search. It is expected to return a
+single value as a string or #f for an empty or non-existent attribute
+value.
+
+Note that given the current load sequence of gnetlist, this
+customization can only happen in the backend itself or in a file
+loaded after the backend ('-m' option of gnetlist).
+  (let* ((values (gnetlist:get-all-package-attributes refdes name))
+ (value  (and (not (null? values))
+  (unique-attribute refdes name values
+(or value unknown)))
+
 ;;
 ;; Given a uref, returns the device attribute value (unknown if not defined)
 ;;
diff --git a/gnetlist/src/g_netlist.c b/gnetlist/src/g_netlist.c
index 14441cc..ef8d5fe 100644
--- a/gnetlist/src/g_netlist.c
+++ b/gnetlist/src/g_netlist.c
@@ -472,19 +472,34 @@ SCM g_get_pins_nets(SCM scm_uref)
 }
 
 
-SCM g_get_package_attribute(SCM scm_uref, SCM scm_wanted_attrib)
+/*! \brief Get attribute value(s) from a package with given uref.
+ *  \par Function Description
+ *  This function returns the values of a specific attribute type
+ *  attached to the symbol instances with the given refdes.
+ *
+ *  Every first attribute value found is added to the return list. A
+ *  Scheme false value is added if the instance has no such attribute.
+ *
+ *  \note The order of the values in the return list is the order of
+ *  symbol instances within gnetlist (the first element is the value
+ *  associated with the first symbol instance).
+ *
+ *  \param [in] scm_uref   Package reference.
+ *  \param [in] scm_wanted_attrib  Attribute name.
+ *  \return A list of attribute values as strings and #f.
+ */
+SCM g_get_all_package_attributes(SCM scm_uref, SCM scm_wanted_attrib)
 {
-SCM scm_return_value;
+SCM ret = SCM_EOL;
 NETLIST *nl_current;
 char *uref;
 char *wanted_attrib;
-char *return_value = NULL;
 

gEDA-user: [PATCH 2/2] gnetlist: Silence warning in drc2 backend for multiple slot attributes.

2011-01-03 Thread Patrick Bernaud
Slot attributes have different values across symbol instances of a same
package. But 'gnetlist:get-package-attribute' does not like that. So the
value has to get directly extracted from the list returned by
'gnetlist:get-all-package-attributes'.
---

 gnetlist/scheme/gnet-drc2.scm |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/gnetlist/scheme/gnet-drc2.scm b/gnetlist/scheme/gnet-drc2.scm
index a72f2a4..0570ba4 100644
--- a/gnetlist/scheme/gnet-drc2.scm
+++ b/gnetlist/scheme/gnet-drc2.scm
@@ -430,7 +430,9 @@

(let* ( (numslots_string (gnetlist:get-package-attribute uref 
numslots))
(numslots (string-number numslots_string))
-   (slot_string (gnetlist:get-package-attribute uref slot))
+   (slot_string (let ((slots (gnetlist:get-all-package-attributes 
uref slot)))
+   (if (or (null? slots) (not (car slots)))
+   unknown (car slots
(slot (string-number slot_string))
)
  (let ()



___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Resistor values?

2011-01-02 Thread Patrick Bernaud
John Doty writes:
  [...]
  Then there's Patrick Bernaud. Bas Gjeltes and I tried to contribute a patch 
  for the attribute censorship bug, but Patrick grabbed it, unfactored my 
  Guile code, found a problem that broke drc2, and then dropped it. 

Maybe you can elaborate on your last sentence: what did I drop
exactly?


Patrick the gatekeeper


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Resistor values?

2011-01-02 Thread Patrick Bernaud
John Doty writes:
  [...]
  The work-around for the drc2 incompatibility. Where is it?

You remember that I am not the person proposing the initial patch,
only one reviewer?

Beside with the example I proposed, it is not an incompatibility,
but merely a (valid) warning triggered by the new code. 

Of course it has to be addressed and that's why I mentionned it as
part of my review.


Patrick


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Resistor values?

2011-01-02 Thread Patrick Bernaud
John Doty writes:
  [...]
  We agreed it has to be addressed, yes. But who should address it?

Since it was so kindly asked, I did: my full (and final as far as I am
concerned) patch set for this issue follows this message (so our
fellow readers will get a chance to understand what we are talking
about).

Note that the fix in gnet-drc2.scm will not survive long:
'drc2:check-slots' bitterly need to get a full rewrite (as we already
discussed). And I will do that as soon as this issue is
settled. Still, and as a side note, look how much beneficial a change
from unknown to #f (as value for no- or unknown attribute) would be.


Patrick


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


gEDA-user: [PATCH 2/3] gnetlist: Fix memory leak in g_get_package_attribute().

2011-01-02 Thread Patrick Bernaud

---

 gnetlist/src/g_netlist.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gnetlist/src/g_netlist.c b/gnetlist/src/g_netlist.c
index b3af8fa..14441cc 100644
--- a/gnetlist/src/g_netlist.c
+++ b/gnetlist/src/g_netlist.c
@@ -513,6 +513,7 @@ SCM g_get_package_attribute(SCM scm_uref, SCM 
scm_wanted_attrib)
 } else {
   scm_return_value = scm_makfrom0str (unknown);
 }
+g_free (return_value);
 
 free (uref);
 free (wanted_attrib);



___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


gEDA-user: [PATCH 3/3] gnetlist: Add access to attribute from components with multiple symbol instances.

2011-01-02 Thread Patrick Bernaud
This commit introduces 'gnetlist:get-all-package-attributes' to
retrieve every first attribute value for package consisting of
multiple symbol instances.

'gnetlist:get-package-attribute' gets redefined to use the above
procedure. To preserve backward compatibility, it returns the first
value found in file order and warns when detecting different, possibly
conflicting values. This behavior is configurable.

Derived from patch #3071482, C code by Sebastian Gieltjes.
---

 gnetlist/include/prototype.h  |2 +-
 gnetlist/scheme/gnet-drc2.scm |4 +++-
 gnetlist/scheme/gnetlist.scm  |   41 ++
 gnetlist/src/g_netlist.c  |   44 -
 gnetlist/src/g_register.c |2 +-
 5 files changed, 72 insertions(+), 21 deletions(-)

diff --git a/gnetlist/include/prototype.h b/gnetlist/include/prototype.h
index d37d397..3a976c2 100644
--- a/gnetlist/include/prototype.h
+++ b/gnetlist/include/prototype.h
@@ -11,7 +11,7 @@ SCM g_get_all_unique_nets(SCM scm_level);
 SCM g_get_all_connections(SCM scm_netname);
 SCM g_get_nets(SCM scm_uref, SCM scm_pin);
 SCM g_get_pins_nets(SCM scm_uref);
-SCM g_get_package_attribute(SCM scm_uref, SCM scm_wanted_attrib);
+SCM g_get_all_package_attributes(SCM scm_uref, SCM scm_wanted_attrib);
 SCM g_get_attribute_by_pinseq(SCM scm_uref, SCM scm_pinseq, SCM 
scm_wanted_attrib);
 SCM g_get_attribute_by_pinnumber(SCM scm_uref, SCM scm_pin, SCM 
scm_wanted_attrib);
 SCM g_get_toplevel_attribute(SCM scm_wanted_attrib);
diff --git a/gnetlist/scheme/gnet-drc2.scm b/gnetlist/scheme/gnet-drc2.scm
index a72f2a4..0570ba4 100644
--- a/gnetlist/scheme/gnet-drc2.scm
+++ b/gnetlist/scheme/gnet-drc2.scm
@@ -430,7 +430,9 @@

(let* ( (numslots_string (gnetlist:get-package-attribute uref 
numslots))
(numslots (string-number numslots_string))
-   (slot_string (gnetlist:get-package-attribute uref slot))
+   (slot_string (let ((slots (gnetlist:get-all-package-attributes 
uref slot)))
+   (if (or (null? slots) (not (car slots)))
+   unknown (car slots
(slot (string-number slot_string))
)
  (let ()
diff --git a/gnetlist/scheme/gnetlist.scm b/gnetlist/scheme/gnetlist.scm
index d798259..70ae135 100644
--- a/gnetlist/scheme/gnetlist.scm
+++ b/gnetlist/scheme/gnetlist.scm
@@ -17,6 +17,8 @@
 ;;; along with this program; if not, write to the Free Software
 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
+(use-modules (srfi srfi-1))
+
 ;;--
 ;; The below functions added by SDB in Sept 2003 to support command-line flag
 ;; processing.
@@ -94,6 +96,45 @@
   )
 )
 
+;; Default resolver: returns value associated with first symbol instance
+;; in file order and warns if instances have different values.
+(define (unique-attribute refdes name values)
+(let ((value (car values)))
+  (or (every (lambda (x) (equal? x value)) values)
+  (format (current-error-port) \
+Possible attribute conflict for refdes: ~A
+name: ~A
+values: ~A
+ refdes name values))
+  value)))
+
+(define (gnetlist:get-package-attribute refdes name)
+  Return the value associated with attribute NAME on package
+identified by REFDES.
+
+It actually computes a single value from the full list of values
+produced by 'gnetlist:get-all-package-attributes' as that list is
+passed through 'unique-attribute'.
+
+For backward compatibility, the default behavior is to return the
+value associated with the first symbol instance for REFDES. If all
+instances of REFDES do not have the same value for NAME, it prints a
+warning.
+
+This can be modified by redefining 'unique-attribute' that is a
+procedure that gets provided a non-empty list of attribute values, the
+REFDES and the NAME used for the search. It is expected to return a
+single value as a string or #f for an empty or non-existent attribute
+value.
+
+Note that given the current load sequence of gnetlist, this
+customization can only happen in the backend itself or in a file
+loaded after the backend ('-m' option of gnetlist).
+  (let* ((values (gnetlist:get-all-package-attributes refdes name))
+ (value  (and (not (null? values))
+  (unique-attribute refdes name values
+(or value unknown)))
+
 ;;
 ;; Given a uref, returns the device attribute value (unknown if not defined)
 ;;
diff --git a/gnetlist/src/g_netlist.c b/gnetlist/src/g_netlist.c
index 14441cc..3e1bbe0 100644
--- a/gnetlist/src/g_netlist.c
+++ b/gnetlist/src/g_netlist.c
@@ -472,19 +472,33 @@ SCM g_get_pins_nets(SCM scm_uref)
 }
 
 
-SCM g_get_package_attribute(SCM scm_uref, SCM scm_wanted_attrib)
+/*! \brief Get attribute value(s) from a package with given uref.
+ *  \par Function Description
+ *  This function returns the values of a specific attribute type
+ *  attached to the 

gEDA-user: [PATCH 1/3] Quick testcase for patch #3071482.

2011-01-02 Thread Patrick Bernaud

---

 tests/testcase.sch |  128 
 tests/testcase.scm |   41 +
 2 files changed, 169 insertions(+), 0 deletions(-)
 create mode 100644 tests/testcase.sch
 create mode 100644 tests/testcase.scm

diff --git a/tests/testcase.sch b/tests/testcase.sch
new file mode 100644
index 000..b8165ff
--- /dev/null
+++ b/tests/testcase.sch
@@ -0,0 +1,128 @@
+v 20100214 2
+C 4 4 0 0 0 title-bordered-A3.sym
+T 41500 48900 9 30 1 0 0 0 1
+Test file for gnetlist:get-package-attribute, patch #3071482
+T 46400 48200 8 10 1 0 0 0 1
+Do not change the order of the elements in the file.
+C 46700 46800 1 0 0 resistor-1.sym
+{
+T 47000 47200 5 10 0 0 0 0 1
+device=RESISTOR
+T 46900 47100 5 10 1 1 0 0 1
+refdes=R1
+T 46900 46600 5 10 1 1 0 0 1
+value=OK
+}
+C 48000 46800 1 0 0 resistor-1.sym
+{
+T 48300 47200 5 10 0 0 0 0 1
+device=RESISTOR
+T 48200 47100 5 10 1 1 0 0 1
+refdes=R2
+}
+C 48000 46100 1 0 0 resistor-1.sym
+{
+T 48300 46500 5 10 0 0 0 0 1
+device=RESISTOR
+T 48200 46400 5 10 1 1 0 0 1
+refdes=R2
+}
+C 49300 46800 1 0 0 resistor-1.sym
+{
+T 49600 47200 5 10 0 0 0 0 1
+device=RESISTOR
+T 49500 47100 5 10 1 1 0 0 1
+refdes=R3
+T 49500 46600 5 10 1 1 0 0 1
+value=OK
+}
+C 49300 46100 1 0 0 resistor-1.sym
+{
+T 49600 46500 5 10 0 0 0 0 1
+device=RESISTOR
+T 49500 46400 5 10 1 1 0 0 1
+refdes=R3
+T 49500 45900 5 10 1 1 0 0 1
+value=OK
+}
+C 50600 46800 1 0 0 resistor-1.sym
+{
+T 50900 47200 5 10 0 0 0 0 1
+device=RESISTOR
+T 50800 47100 5 10 1 1 0 0 1
+refdes=R4
+T 50800 46600 5 10 1 1 0 0 1
+value=value1
+}
+C 50600 46100 1 0 0 resistor-1.sym
+{
+T 50900 46500 5 10 0 0 0 0 1
+device=RESISTOR
+T 50800 46400 5 10 1 1 0 0 1
+refdes=R4
+T 50800 45900 5 10 1 1 0 0 1
+value=value2
+}
+C 50600 45400 1 0 0 resistor-1.sym
+{
+T 50900 45800 5 10 0 0 0 0 1
+device=RESISTOR
+T 50800 45700 5 10 1 1 0 0 1
+refdes=R4
+T 50800 45200 5 10 1 1 0 0 1
+value=value3
+}
+C 51900 46800 1 0 0 resistor-1.sym
+{
+T 52200 47200 5 10 0 0 0 0 1
+device=RESISTOR
+T 52100 47100 5 10 1 1 0 0 1
+refdes=R5
+}
+C 51900 46100 1 0 0 resistor-1.sym
+{
+T 52200 46500 5 10 0 0 0 0 1
+device=RESISTOR
+T 52100 46400 5 10 1 1 0 0 1
+refdes=R5
+}
+C 51900 45400 1 0 0 resistor-1.sym
+{
+T 52200 45800 5 10 0 0 0 0 1
+device=RESISTOR
+T 52100 45700 5 10 1 1 0 0 1
+refdes=R5
+T 52100 45200 5 10 1 1 0 0 1
+value=OK
+}
+T 43600 44200 9 10 1 0 0 0 3
+multiple instances
+same value
+expected result: OK
+T 43600 43300 9 10 1 0 0 0 3
+multiple instances
+different values
+expected result: value1 with warning
+T 43600 42400 9 10 1 0 0 0 3
+multiple instances
+one instance (not first) with attribute
+expected result: unknown with warning
+T 43600 45100 9 10 1 0 0 0 3
+multiple instances
+no attributes
+expected result: unknown
+T 43600 46000 9 10 1 0 0 0 2
+single instance
+expected result: OK
+L 45400 46200 47100 46200 3 0 0 0 -1 -1
+L 47100 46500 47100 46200 3 0 0 0 -1 -1
+L 45900 45400 48400 45400 3 0 0 0 -1 -1
+L 48400 46000 48400 45400 3 0 0 0 -1 -1
+L 45500 44500 49700 44500 3 0 0 0 -1 -1
+L 49700 45800 49700 44500 3 0 0 0 -1 -1
+L 45500 43600 51100 43600 3 0 0 0 -1 -1
+L 51100 45100 51100 43600 3 0 0 0 -1 -1
+L 52300 45100 52300 42700 3 0 0 0 -1 -1
+L 52300 42700 46800 42700 3 0 0 0 -1 -1
+T 43000 46600 9 10 1 0 0 0 1
+WITH DEFAULT RESOLVER,
diff --git a/tests/testcase.scm b/tests/testcase.scm
new file mode 100644
index 000..2be7205
--- /dev/null
+++ b/tests/testcase.scm
@@ -0,0 +1,41 @@
+(use-modules (ice-9 format))
+
+(define-macro (expect form expected)
+  `(begin
+ (let ((result ,form))
+   (if (equal? result ,expected)
+   (format #t OK~%)
+   (format #t ~%ERROR: evaluating ~s produced: ~a instead of: ~a~%
+   ',form result ,expected)
+
+(display attribute from non-existent package... )
+(expect (gnetlist:get-package-attribute R0 value) unknown)
+(newline)
+
+(display unknown attribute from single symbol package... )
+(expect (gnetlist:get-package-attribute R1 foo) unknown)
+(newline)
+
+(display existing attribute from single symbol package... )
+(expect (gnetlist:get-package-attribute R1 value) OK)
+(newline)
+
+(display attribute value from multi symbol package:\n)
+(display \tno symbol instances with this attribute... )
+(expect (gnetlist:get-package-attribute R2 value) unknown)
+
+(display \tall symbol instances with same attribute value... )
+(expect (gnetlist:get-package-attribute R3 value) OK)
+
+(display \tdifferent attribute value for each symbol instance... )
+;; current behavior, take value from first symbol in file order
+;; should also test for warning
+(expect (gnetlist:get-package-attribute R4 value) value1)
+
+(display \tcustom attribute value resolver... )
+(define (attribute-value-resolver refdes name values)
+  ;; select first existing attribute from symbols in the file order
+  (or (find string? values) unknown))
+(expect (gnetlist:get-package-attribute R5 value) OK)
+
+;(quit)




Re: gEDA-user: [PATCH 3/3] gnetlist: Add access to attribute from components with multiple symbol instances.

2011-01-02 Thread Patrick Bernaud
Hi all,

The patch from the parent message has to be replaced by the one
below. Sorry for the inconvenience.

Patrick



multi-part-attribute-search.patch
Description: Binary data


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: gnetlist crash

2010-11-13 Thread Patrick Bernaud
Hi,

Levente Kovacs writes:
  [...]
  So this is it. I have other hierarchical design, which works just fine. Any
  help to track down the bug, or the error in the schematics would be
  appreciated. 

Could you please post the files of your project (directly to to the
list or in private to the address above if you prefer)?

Regards,


Patrick


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: gnetlist crash

2010-11-13 Thread Patrick Bernaud
Levente Kovacs writes:
  [...]
  Ok, I solved the problem. The problem was that there was an empty value
  attribute attached to one of my symbol. That is bad, but gnetlist should not
  crash.

Have you built gnetlist from release sources (tarballs) or from a git
checkout? The issue with malformed attributes should have been fixed with
commit 019990c.


Patrick


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: gnetlist segmentation fault

2010-09-29 Thread Patrick Bernaud
Hi John,

John Doty writes:
  [...]
  This is a coding error somewhere. There should be nothing wrong with an 
  empty string as an attribute: it's a perfectly good string.

No, actually, an attribute is required to have a value, see
documentation (and code) for o_attrib_string_get_name_value() in
libgeda/src/o_attrib.c.

Regards,


Patrick


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: gnetlist segmentation fault

2010-09-29 Thread Patrick Bernaud
Thomas Dean writes:
  I have an application which causes a seg fault in gnetlist.  I think
  this can be fixed by changing the schematic.  But, Segmentation fault
  is NEVER the proper response.

Your issue is similar to bug #3032626 (a malformed attribute as
Kai-Martin explained). I have proposed a patch that is under review.

Thank you for the report.

Regards,


Patrick


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: (hierarchy-uref-mangle disabled) doesn't seem to work when generting a bom

2010-09-28 Thread Patrick Bernaud
Hi Mike,

Mike Crowe writes:
  [...]
  The separator appears to be important even if it is disabled by 
  (hierarchy-uref-mangle disabled)

Indeed, the hierarchy-uref-separator is ignored when it comes to
separating base uref from full uref with hierarchy. 

The patch below fixes that problem.

Regards,


Patrick



gnetlist-use-uref-with-hierarchy-separator
Description: Binary data


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: gsch2pcb and pcb, paths to footprints

2010-07-13 Thread Patrick Bernaud
Hi Karl,

Karl Hammar writes:
  gsch2pcb:
  
  How can I tell gsch2pcb to search the current directory for footprints?
  
  This
  
   $ cat ~/.gEDA/gnetlistrc
   (component-library .)
   (component-library ${HOME}/git/openhw/share/gschem)

'component-library' is indeed a directive for gnetlist (actually
libgeda) but it has nothing to do with _footprints_. Instead it
instructs gnetlist where to look for _symbols_.

You can specify directories for _footprints_ to gsch2pcb either with a
project file as Stefan explained or with the 'elements-dir' parameter
from the command line.

You will need both.

Regards,


Patrick


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: PCB import schematic

2010-06-26 Thread Patrick Bernaud
Hello Gareth,

Gareth Edwards writes:
  [...]
  More data from the console:
  
  Failed to read pcbfwd scm file
  [/home/gareth/geda/share/gEDA/scheme/gnet-pcbfwd.scm]
  [...]
  I'm thinking my non-standard install location may have thrown the PCB
  installer off-kilter - I'll have a dig.

Indeed it has to do with your setup: gnetlist can not find the
backend script file gnet-pcbfwd.scm at the expected path but still
tries to make use of the backend.

Either re-run configuration of pcb with correct prefix for data dir
(and then make install) or just copy the gnet-pcbfwd.scm file from the
tools/ dir in pcb sources to /home/gareth/geda/share/gEDA/scheme.

Regards,


Patrick


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: BUG: gschem Segmentation fault

2010-06-02 Thread Patrick Bernaud
Hello Robert,

myken writes:
  [...]
  So I took a fresh sheet, removed the titleblock, added sum components
  (include_component_as_individual_objects), added sum nets, then I did
  a symbol translate (=0) and saved my new symbol (rommel.sym -
  attached). 
  
  Then I took a new sheet, included my new symbol and tried to connect a
  net to the one from the included symbol (does not matter which one). I
  can draw the net but as soon as I click once I get a segmentation fault.
  

You should not select the include_component_as_individual_objets
options when drawing your symbol, but instead only when instantiating the
composite symbol (when drawing the schematics).

Still it should not segfault, so you may want to fill in a bug report
if it does not get fixed in a day or two.

Regards,


Patrick


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: PCB won't compile

2010-03-18 Thread Patrick Bernaud
Hello,

Kovacs Levente writes:
  [...]
  hid/lesstif/menu.c: In function ?lesstif_call_action?:
  hid/lesstif/menu.c:856: error: ?x? undeclared (first use in this function)
  hid/lesstif/menu.c:856: error: (Each undeclared identifier is reported only 
  once
  hid/lesstif/menu.c:856: error: for each function it appears in.)
  hid/lesstif/menu.c:856: error: ?y? undeclared (first use in this function)
  

Change the line to read:
ret = current_action-trigger_cb (argc, argv, px, py);
instead of:
ret = current_action-trigger_cb (argc, argv, x, y);

Regards,


Patrick


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Win32 build with native printing support (via Cairo)

2010-01-22 Thread Patrick Bernaud
Kai-Martin Knaak writes:
  On Wed, 20 Jan 2010 12:33:34 -0700, John Doty wrote:
  
   (component-library .)
   
   Seems a simpler way. Would that work in Windows?
  
  [...]
 
  Minor side effect: Unlike the PWD environment variable, the dot is not 
  expanded in the library window of gschem. So the local symbols just show 
  up under . rather than the name of the local directory.

This directive can take a second parameter for the name of the entry
in the library in case you want to override the directory name:

(component-library . Project symbols)


Regards,


Patrick




___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: seg fault when moving group

2008-07-13 Thread Patrick Bernaud
Hi gene and Johannes,

Johannes Bauer writes:
  
  gene schrieb:
   I'm using gschem 1.4.0 and get a consistent segmentation fault when 
   moving a group of parts.
  
  I can confirm the bug with gEDA/gschem Version 1.5.0.20080706.
  

Thank you for the report and the confirmation. 

Indeed there is a problem when moving net segments. I have created a
new bug report (#2017356, see
http://sourceforge.net/tracker/index.php?func=detailaid=2017356group_id=161080atid=818426)
to track the issue and continue the discussion.

Please try to reproduce the bug with the test case and, if you are
compiling gschem from sources, give a try to the patch attached (the
patch is against current head but should work with 1.4.0 too).

Regards,


Patrick



___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: gschem, problem with custum title block

2008-06-28 Thread Patrick Bernaud
Hello Stefan and Kai-Martin,

Stefan Salewski writes:
  [...]
  Is there something wrong with my titleblock?
  (Seems that all attributes are invisible, I used gschem 1.4.0
  

Nothing wrong with your titleblock. The problem is that attribute
promotion is turned off when components are added from guile. And this
is the case with default-titleblock.

If you are building from sources, change the last parameter of
o_complex_add() from FALSE to TRUE in gschem/src/g_add_component.c
(line 730).

Please confirm it does fix your problem and bug #1932474.

Regards,


Patrick Bernaud



___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: gschem symbol search order

2006-12-16 Thread Patrick Bernaud
Carlos Nieves Ónega writes:
  [...]
   So a better way to fix this problem would have been to use
   g_slist_last() on the returned list and not to modify s_clib.c.
  
  Here are the reasons:
   - All the existing code asserts that the first node returned by
  s_clib_search_basename is the first entry to be used. This makes
  sense.

The way it was done the list returned by s_clib_search_basename() was
in the same order as the directories. It seems logival. They are not
anymore. The least you can do is add a note for this fact.

   - It also makes sense to change the search function instead of changing
  every function calling it.

The existing code is wrong. The very problem is that the code you are
mentionning is repeated every where in the code. 

There should be a function that specifically call the
s_clib_search_basename() function and take the first (or last in my
view) of the returned value. 

It should also be responsible for the message informing the user of
more than one symbol with that name.

Ideally it should also take care of asking the user if choosing this
symbol is correct. This has previously been discussed here.

Not only it would have fixed the code and introduced possible future
enhancements but it would have improved the overall quality of the
project.

   - I like to use a double-linked list whenever I need to go forward and
  backwards in a list.

There is no need to go backwards on this list.

   - The penalty of using a GList instead of a GSList is only a pointer
  for each library node. 

True.

   - No user will be using thousands of libraries at the same time so the
  memory consumption won't be increased so much.

True.

   - It makes programmer's life easier.

I am wondering how since all access to the component library is
through functions in s_clib.c. Plus GList and GSList basically share
the same API.



Patrick


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user