You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
2.9 KiB

  1. #!/bin/sh
  2. BASEDIR=/tmp/eeschema-lib
  3. CATEGORIES="lions tigers kitties"
  4. PARTS="eyes ears feet"
  5. REVS="rev1 rev5 rev10"
  6. REFERENCE="
  7. (reference U?
  8. (effects (at 12 13 180)(font (size 7 10))(visible yes))
  9. )"
  10. LINE="
  11. (line
  12. (pts (xy 12 13)(xy 12 20))(stroke 1.5)
  13. )"
  14. RECT="
  15. (rectangle
  16. (start 4 5)(end 6 8)(stroke 2.3)(fill transparent)
  17. )"
  18. CIRCLE="
  19. (circle
  20. (center 1 0)(radius 5)(stroke 2.1)(fill none)
  21. )"
  22. ARC="
  23. (arc
  24. (pos 22 33)(radius 12)(start 2 4)(end 13 33)(stroke 2.3)(fill filled)
  25. )"
  26. BEZIER="
  27. (bezier
  28. (fill none)(stroke 2.0)(pts (xy 0 1)(xy 2 4))
  29. )"
  30. TEXT="
  31. (text (at 23 23 90.0) \"This is some text\" (justify left bottom)(visible yes)(fill filled)
  32. (font arial (size 8 12))
  33. )"
  34. PIN1="
  35. (pin out line (at 7 8 90)
  36. (signal #WE (font (size 8 10) bold)(visible no))
  37. (pad A23 (font (size 9 11) italic bold))
  38. )"
  39. PIN2="
  40. (pin in line (at 8 8)(visible yes)
  41. (signal #WAIT (visible yes))
  42. (pad A24 (visible yes))
  43. )"
  44. PIN3="
  45. (pin (pad A25))"
  46. PINS="
  47. (pin (pad Z12))(pin (pad Y14))(pin (pad Z13))(pin (pad Y15))"
  48. PIN_SWAP="
  49. (pin_swap A23 A24)"
  50. PIN_RENUM="
  51. (pin_renum A24 B24)"
  52. PIN_RENAME="
  53. (pin_rename B24 LED)"
  54. PIN_DELETE="
  55. (pin_del B24)"
  56. PIN_MERGE="(pin_merge A23 (pads Z12 Y14))(pin_merge A25 (pads Z13 Y15))"
  57. PROP1="
  58. (property mWatts 12
  59. (effects (at 1 34 270)(font (size 5 9) italic bold)(visible no))
  60. )"
  61. KEYWORDS="
  62. (keywords varistor batcave einstein)"
  63. ALTERNATES="
  64. (alternates 7400/7400_b 7400/7400_c)"
  65. for C in ${CATEGORIES}; do
  66. mkdir -p $BASEDIR/$C
  67. for P in ${PARTS}; do
  68. for R in ${REVS}; do
  69. echo "(part $C/$P (value 22)(footprint SM0805)(model Airplane)(datasheet http://favorite.pdf)
  70. $REFERENCE
  71. $LINE
  72. $RECT
  73. $CIRCLE
  74. $ARC
  75. $BEZIER
  76. $TEXT
  77. $PIN1
  78. $PIN2
  79. $PIN3
  80. $PINS
  81. $PROP1
  82. $KEYWORDS
  83. $ALTERNATES
  84. $PIN_SWAP
  85. $PIN_RENUM
  86. $PIN_RENAME
  87. $PIN_DELETE
  88. $PIN_MERGE
  89. )" > $BASEDIR/$C/$P.part.$R
  90. done
  91. # also make the part without a rev:
  92. echo "(part $C/$P (value 22)(footprint SM0805)(model Airplane)(datasheet http://favorite.pdf)
  93. $REFERENCE
  94. $LINE
  95. $RECT
  96. $CIRCLE
  97. $ARC
  98. $BEZIER
  99. $TEXT
  100. $PIN1
  101. $PIN2
  102. $PIN3
  103. $PINS
  104. $PROP1
  105. $KEYWORDS
  106. $ALTERNATES
  107. $PIN_SWAP
  108. $PIN_RENUM
  109. $PIN_RENAME
  110. $PIN_DELETE
  111. $PIN_MERGE
  112. )" > $BASEDIR/$C/$P.part
  113. done
  114. done