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

Re: gEDA-user: gschem usage: rotate symbol, leave text alone



Hi,
the algorithm is configurable, so you can define attributes and defaults
positions as you want.

I have some questions regarding your desired behaviour:
  - what's the difference between "180º" and "mirror", so why do you
place the attributes on the top left or on the bottom left?
  - same for 90º and 270º. what's the reason behind placing the
attributes on the right or on the left?

Attached is a scheme file with the a close configuration to your
preferences. It's not exactly as you want, because it places the
attributes always in the (middle,top)-left of the symbol.

Load it when running gschem, placing in your gschemrc:
(load "path-to-this-file/attrib-positions.scm")

I told you the algorithm checks if the autoplaced attribute overlaps a
pin connection. This is disabled with this configuration, because it
doesn't work quite well with stacked attributes (currently it only moves
the overlapping attribute, not all the stack, so you will get
overlapping attributes).

Check if this is closer to the behaviour you want. I'll try to improve
the algorithm for stacked attributes when I have some time.

Regards,

Carlos

El lun, 02-02-2009 a las 07:14 +0100, Kai-Martin escribió:
> On 02/01/2009 01:36:15 PM, Carlos Nieves Ónega wrote:
> 
> > you can try attribute autoplacement.
> 
> I tried, but it makes things worse. I like to have attributes stacked with 
> refdes on top, value in the middle and footprint on bottom. Like this:
> 
>   C12
>  100n
>  0805 ||
> ------||------   
>       ||
> 
> In addition, I don't want vertical text, even if the symbol is rotated. This 
> is why I am not happy with the default config of gschem. Autoplace avoids 
> vertical text. However, it mixes the stack of attributes in various ways. It 
> seems to ignore the footprint attribute. Consequently, the other attributes in 
> some cases overlap with the footprint attribute.
> The "comple-place-changed-hook" keeps all attrbutes seperated. But it places 
> vertical text at 90° and at 270°.
> 
> See the attached test (PDF).
> 
> ---<(kaimartin)>---
(define default-position-of-text-attributes
  (list 
   (list 
    "pinlabel"  ">"  (list "OBJ_TYPE" (char2str OBJ_PIN))
      50      0       "Lower Right"   "Lower Left"     0      "^"   0)
   (list
    "pinlabel"  "<"  (list "OBJ_TYPE" (char2str OBJ_PIN))
     -50      0       "Lower Left"    "Lower Right"    0      "^"   0)
   (list
    "pinlabel"  "^"  (list "OBJ_TYPE" (char2str OBJ_PIN))
       0     50       "Upper Middle"  "Lower Left"    90      "^"   0)
   (list
    "pinlabel"  "v"  (list "OBJ_TYPE" (char2str OBJ_PIN))
       0    -50       "Lower Middle"  "Lower Right"   90      "^"   0)
   (list
    "pinnumber" ">"  (list "OBJ_TYPE" (char2str OBJ_PIN))
    -100     50       "Lower Right"   "Lower Right"    0      "^"   0)
   (list
    "pinnumber" "<"  (list "OBJ_TYPE" (char2str OBJ_PIN))
     100     50       "Lower Left"    "Lower Left"     0      "^"   0)
   (list
    "pinnumber" "^"  (list "OBJ_TYPE" (char2str OBJ_PIN))
     -50   -100       "Upper Middle"  "Lower Right"   90      "^"   0)
   (list 
    "pinnumber" "v"  (list "OBJ_TYPE" (char2str OBJ_PIN))
     -50    100       "Lower Middle"  "Lower Left"    90      "^"   0)
   
     ; Component attributes
     ;   One direction
   (list 
    "refdes"    "<"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    450       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "value"     "<"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    250       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "footprint"    "<"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50     50       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "refdes"    ">"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    450       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "value"     ">"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    250       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "footprint"    ">"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50     50       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "refdes"    ""  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    200       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "value"     ""  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    250       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "footprint"    ""  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50     50       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "refdes"    "v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    450       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "value"     "v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    250       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "footprint"    "v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50     50       "Middle Left"  "Lower Right"   0      ""   0)
	;   Two directions
   (list 
    "refdes"    "<>"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    450       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "value"     "<>"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    250       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "footprint"    "<>"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50     50       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "refdes"    "^v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    450       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "value"     "^v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    250       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "footprint"    "^v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50     50       "Middle Left"  "Lower Right"   0      ""   0)
	;   Three directions
   (list 
    "refdes"    "<^v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    450       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "value"     "<^v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    250       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "footprint"    "<^v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50     50       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "refdes"    ">^v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    450       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "value"     ">^v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    250       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "footprint"    ">^v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50     50       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "refdes"    "<>^"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    450       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "value"     "<>^"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    250       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "footprint"    "<>^"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50     50       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "refdes"    "<>v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    450       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "value"     "<>v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    250       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "footprint"    "<>v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50     50       "Middle Left"  "Lower Right"   0      ""   0)
	;   Four directions
   (list 
    "refdes"    "<>^v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    450       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "value"     "<>^v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50    250       "Middle Left"  "Lower Right"   0      ""   0)
   (list 
    "footprint"    "<>^v"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
     -50     50       "Middle Left"  "Lower Right"   0      ""   0)
   
     ; Net attributes
     ;   Two directions
   (list 
    "netname" "<>" (list "OBJ_TYPE" (char2str OBJ_NET))
       0     50       "Upper Middle"  "Lower Middle"   0      ""   0)
   (list 
    "netname" "^v" (list "OBJ_TYPE" (char2str OBJ_NET))
     -50      0       "Middle Middle" "Lower Middle"  90      ""   0)
     ; Bus attributes
     ;   Two directions
   (list 
    "netname" "<>" (list "OBJ_TYPE" (char2str OBJ_BUS))
       0     50       "Upper Middle"  "Lower Middle"   0      ""   0)
   (list 
    "netname" "^v" (list "OBJ_TYPE" (char2str OBJ_BUS))
     -50      0       "Middle Middle" "Lower Middle"  90      ""   0)
   ))


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