00001
00023 #include "register_functions.c"
00024 #include "dip.h"
00025
00026
00033 int
00034 dip_create_element ()
00035 {
00036 gdouble xmax;
00037 gdouble xmin;
00038 gdouble ymax;
00039 gdouble ymin;
00040 gdouble x_text;
00041 gdouble y_text;
00042 gdouble dx;
00043 gint pin_number;
00044 gchar *pin_pad_name = g_strdup ("");
00045 gint i;
00046 FlagType pad_flag;
00047 ElementTypePtr element;
00048
00049 if (!element)
00050 {
00051 if (verbose)
00052 g_log ("", G_LOG_LEVEL_WARNING,
00053 _("could not create a valid element pointer for a %s package."),
00054 footprint_type);
00055 return (EXIT_FAILURE);
00056 }
00057
00058
00059 element->MarkX = 0;
00060 element->MarkY = 0;
00061
00062
00063 xmin = multiplier *
00064 (
00065 (-pitch_x / 2.0) -
00066 (((pad_diameter > pad_length) ? pad_diameter : pad_length) / 2.0) -
00067 pad_solder_mask_clearance
00068 );
00069 xmax = multiplier *
00070 (
00071 (pitch_x / 2.0) +
00072 (((pad_diameter > pad_length) ? pad_diameter : pad_length) / 2.0) +
00073 pad_solder_mask_clearance
00074 );
00075 ymin = multiplier *
00076 (
00077 ((((-count_y - 1) / 2.0) + 1) * pitch_y) -
00078 (((pad_diameter > pad_width) ? pad_diameter : pad_width) / 2.0) -
00079 pad_solder_mask_clearance
00080 );
00081 ymax = multiplier *
00082 (
00083 (((count_y - 1) / 2.0) * pitch_y) +
00084 (((pad_diameter > pad_width) ? pad_diameter : pad_width) / 2.0) +
00085 pad_solder_mask_clearance
00086 );
00087
00088
00089 if ((multiplier * ((-package_body_length / 2.0) - courtyard_clearance_with_package)) < xmin)
00090 xmin = (multiplier * ((-package_body_length / 2.0) - courtyard_clearance_with_package));
00091 if ((multiplier * ((package_body_length / 2.0) + courtyard_clearance_with_package)) > xmax)
00092 xmax = (multiplier * ((package_body_length / 2.0) + courtyard_clearance_with_package));
00093 if ((multiplier * ((-package_body_width / 2.0) - courtyard_clearance_with_package)) < ymin)
00094 ymin = (multiplier * ((-package_body_width / 2.0) - courtyard_clearance_with_package));
00095 if ((multiplier * ((package_body_width / 2.0) + courtyard_clearance_with_package)) > ymax)
00096 ymax = (multiplier * ((package_body_width / 2.0) + courtyard_clearance_with_package));
00097
00098 if (multiplier * (-courtyard_length / 2.0) < xmin)
00099 xmin = multiplier * (-courtyard_length / 2.0);
00100 if (multiplier * (courtyard_length / 2.0) > xmax)
00101 xmax = multiplier * (courtyard_length / 2.0);
00102 if (multiplier * (-courtyard_width / 2.0) < ymin)
00103 ymin = multiplier * (-courtyard_width / 2.0);
00104 if (multiplier * (courtyard_width / 2.0) > ymax)
00105 ymax = multiplier * (courtyard_width / 2.0);
00106
00107 element->Name[1].Scale = 100;
00108 element->Name[1].X = 0.0 ;
00109 element->Name[1].Y = (ymin - 10000.0);
00110 element->Name[1].TextString = footprint_name;
00111 element->Name[1].Element = element;
00112 element->Name[1].Direction = EAST;
00113 element->Name[1].ID = ID++;
00114
00115 element->Name[2].Scale = 100;
00116 element->Name[2].X = 0.0 ;
00117 element->Name[2].Y = (ymin - 10000.0);
00118 element->Name[2].TextString = footprint_refdes;
00119 element->Name[2].Element = element;
00120 element->Name[2].Direction = EAST;
00121 element->Name[2].ID = ID++;
00122
00123 element->Name[3].Scale = 100;
00124 element->Name[3].X = 0.0 ;
00125 element->Name[3].Y = (ymin - 10000.0);
00126 element->Name[3].TextString = footprint_value;
00127 element->Name[3].Element = element;
00128 element->Name[3].Direction = EAST;
00129 element->Name[3].ID = ID++;
00130
00131 for (i = 0; (i < count_y); i++)
00132 {
00133 pin_number = 1 + i;
00134 if (pin1_square && (pin_number == 1))
00135 pad_flag.f = SQUARE;
00136 else
00137 pad_flag.f = CLEAR;
00138 create_new_pin
00139 (
00140 element,
00141 (int) (multiplier * (-pitch_x / 2.0)),
00142 (int) (multiplier * ((((-count_y - 1) / 2.0) +1 + i) * pitch_y)),
00143 (int) (multiplier * pad_diameter),
00144 (int) (multiplier * pad_clearance),
00145 (int) (multiplier * (pad_diameter + pad_solder_mask_clearance)),
00146 (int) (multiplier * pin_drill_diameter),
00147 pin_pad_name,
00148 g_strdup_printf ("%d", pin_number),
00149 pad_flag
00150 );
00151 if (!strcmp (pad_shape, "rounded pad, elongated"))
00152 {
00153 pad_flag.f = ONSOLDER;
00154 create_new_pad
00155 (
00156 element,
00157 (int) (multiplier * (-pitch_x + pad_length - pad_width) / 2.0),
00158 (int) (multiplier * ((((-count_y - 1) / 2.0) + 1 + i) * pitch_y)),
00159 (int) (multiplier * (-pitch_x - pad_length + pad_width) / 2.0),
00160 (int) (multiplier * ((((-count_y - 1) / 2.0) + 1 + i) * pitch_y)),
00161 (int) (multiplier * pad_width),
00162 (int) (multiplier * pad_clearance),
00163 (int) (multiplier * (pad_width + (2 * pad_solder_mask_clearance))),
00164 pin_pad_name,
00165 g_strdup_printf ("%d", pin_number),
00166 pad_flag
00167 );
00168 }
00169 pin_number = (number_of_columns * count_y) - i;
00170 if (pin1_square && (pin_number == 1))
00171 pad_flag.f = SQUARE;
00172 else
00173 pad_flag.f = CLEAR;
00174 create_new_pin
00175 (
00176 element,
00177 (int) (multiplier * pitch_x / 2.0),
00178 (int) (multiplier * ((((-count_y - 1) / 2.0) + 1 + i) * pitch_y)),
00179 (int) (multiplier * pad_diameter),
00180 (int) (multiplier * pad_clearance),
00181 (int) (multiplier * (pad_diameter + pad_solder_mask_clearance)),
00182 (int) (multiplier * pin_drill_diameter),
00183 pin_pad_name,
00184 g_strdup_printf ("%d", pin_number),
00185 pad_flag
00186 );
00187 if (!strcmp (pad_shape, "rounded pad, elongated"))
00188 {
00189 pad_flag.f = ONSOLDER;
00190 create_new_pad
00191 (
00192 element,
00193 (int) (multiplier * (pitch_x - pad_length + pad_width) / 2.0),
00194 (int) (multiplier * ((((-count_y - 1) / 2.0) + 1 + i) * pitch_y)),
00195 (int) (multiplier * (pitch_x + pad_length - pad_width) / 2.0),
00196 (int) (multiplier * ((((-count_y - 1) / 2.0) + 1 + i) * pitch_y)),
00197 (int) (multiplier * pad_width),
00198 (int) (multiplier * pad_clearance),
00199 (int) (multiplier * (pad_width + (2 * pad_solder_mask_clearance))),
00200 pin_pad_name,
00201 g_strdup_printf ("%d", pin_number),
00202 pad_flag
00203 );
00204 }
00205 }
00206
00207 if (silkscreen_package_outline)
00208 {
00209 create_new_line
00210 (
00211 element,
00212 (int) (multiplier * (((-pitch_x + pad_diameter + silkscreen_line_width) / 2) + pad_solder_mask_clearance)),
00213 (int) ymin,
00214 (int) (multiplier * (((-pitch_x + pad_diameter + silkscreen_line_width) / 2) + pad_solder_mask_clearance)),
00215 (int) ymax,
00216 (int) (multiplier * silkscreen_line_width)
00217 );
00218 create_new_line
00219 (
00220 element,
00221 (int) (multiplier * (((-pitch_x + pad_diameter + silkscreen_line_width) / 2) + pad_solder_mask_clearance)),
00222 (int) ymax,
00223 (int) (multiplier * (((pitch_x - pad_diameter - silkscreen_line_width) / 2) - pad_solder_mask_clearance)),
00224 (int) ymax,
00225 (int) (multiplier * silkscreen_line_width)
00226 );
00227 create_new_line
00228 (
00229 element,
00230 (int) (multiplier * (((pitch_x - pad_diameter - silkscreen_line_width) / 2) - pad_solder_mask_clearance)),
00231 (int) ymax,
00232 (int) (multiplier * (((pitch_x - pad_diameter - silkscreen_line_width) / 2) - pad_solder_mask_clearance)),
00233 (int) ymin,
00234 (int) (multiplier * silkscreen_line_width)
00235 );
00236 create_new_line
00237 (
00238 element,
00239 (int) (multiplier * (((-pitch_x + pad_diameter + silkscreen_line_width) / 2) + pad_solder_mask_clearance)),
00240 (int) ymin,
00241 (int) (multiplier * (((pitch_x - pad_diameter - silkscreen_line_width) / 2) - pad_solder_mask_clearance)),
00242 (int) ymin,
00243 (int) (multiplier * silkscreen_line_width)
00244 );
00245 }
00246
00247 if (silkscreen_indicate_1)
00248 {
00249 create_new_arc
00250 (
00251 element,
00252 (int) (0.0),
00253 (int) ymin,
00254 (int) (multiplier * (pitch_x / 8)),
00255 (int) (multiplier * (pitch_x / 8)),
00256 0,
00257 180,
00258 (int) (multiplier * silkscreen_line_width)
00259 );
00260 }
00261
00262 if (courtyard)
00263 {
00264 create_new_line
00265 (
00266 element,
00267 (int) (xmin),
00268 (int) (ymin),
00269 (int) (xmin),
00270 (int) (ymax),
00271 (int) (multiplier * courtyard_line_width)
00272 );
00273 create_new_line
00274 (
00275 element,
00276 (int) (xmax),
00277 (int) (ymin),
00278 (int) (xmax),
00279 (int) (ymax),
00280 (int) (multiplier * courtyard_line_width)
00281 );
00282 create_new_line
00283 (
00284 element,
00285 (int) (xmin),
00286 (int) (ymin),
00287 (int) (xmax),
00288 (int) (ymin),
00289 (int) (multiplier * courtyard_line_width)
00290 );
00291 create_new_line
00292 (
00293 element,
00294 (int) (xmax),
00295 (int) (ymax),
00296 (int) (xmin),
00297 (int) (ymax),
00298 (int) (multiplier * courtyard_line_width)
00299 );
00300 }
00301
00302 if (attributes_in_footprint)
00303 element = create_attributes_in_element (element);
00304
00305 if (verbose)
00306 g_log ("", G_LOG_LEVEL_INFO,
00307 _("created an element for a %s package: %s."),
00308 footprint_type,
00309 footprint_filename);
00310 current_element = (ElementTypePtr) &element;
00311 return (EXIT_SUCCESS);
00312 }
00313
00314
00324 int
00325 dip_create_packages_list ()
00326 {
00327 g_list_free (packages_list);
00328 packages_list = g_list_append (packages_list, "DIP04300");
00329 packages_list = g_list_append (packages_list, "DIP06300");
00330 packages_list = g_list_append (packages_list, "DIP08300");
00331 packages_list = g_list_append (packages_list, "DIP08400");
00332 packages_list = g_list_append (packages_list, "DIP10300");
00333 packages_list = g_list_append (packages_list, "DIP14300");
00334 packages_list = g_list_append (packages_list, "DIP14400");
00335 packages_list = g_list_append (packages_list, "DIP16300");
00336 packages_list = g_list_append (packages_list, "DIP16400");
00337 packages_list = g_list_append (packages_list, "DIP18300");
00338 packages_list = g_list_append (packages_list, "DIP18400");
00339 packages_list = g_list_append (packages_list, "DIP20300");
00340 packages_list = g_list_append (packages_list, "DIP20400");
00341 packages_list = g_list_append (packages_list, "DIP22300");
00342 packages_list = g_list_append (packages_list, "DIP22400");
00343 packages_list = g_list_append (packages_list, "DIP24300");
00344 packages_list = g_list_append (packages_list, "DIP24400");
00345 packages_list = g_list_append (packages_list, "DIP24600");
00346 packages_list = g_list_append (packages_list, "DIP28300");
00347 packages_list = g_list_append (packages_list, "DIP28400");
00348 packages_list = g_list_append (packages_list, "DIP28600");
00349 packages_list = g_list_append (packages_list, "DIP32300");
00350 packages_list = g_list_append (packages_list, "DIP32600");
00351 packages_list = g_list_append (packages_list, "DIP36600");
00352 packages_list = g_list_append (packages_list, "DIP38600");
00353 packages_list = g_list_append (packages_list, "DIP40600");
00354 packages_list = g_list_append (packages_list, "DIP42600");
00355 packages_list = g_list_append (packages_list, "DIP48600");
00356 packages_list = g_list_append (packages_list, "DIP50900");
00357 packages_list = g_list_append (packages_list, "DIP52600");
00358 packages_list = g_list_append (packages_list, "DIP64900");
00359 return (EXIT_SUCCESS);
00360 }
00361
00362
00394 int
00395 dip_drc ()
00396 {
00397 int result = EXIT_SUCCESS;
00398 if (verbose)
00399 {
00400 g_log ("", G_LOG_LEVEL_INFO,
00401 (_("[%s] DRC Check: checking package %s.")),
00402 footprint_type, footprint_name);
00403 }
00404
00405 switch (pad_shapes_type)
00406 {
00407 case NO_SHAPE:
00408 {
00409 if (verbose)
00410 {
00411 g_log ("", G_LOG_LEVEL_WARNING,
00412 (_("[%s] DRC Error: NO_SHAPE specified for check for allowed pad shapes.")),
00413 footprint_type);
00414 }
00415 result = EXIT_FAILURE;
00416 break;
00417 }
00418 case ROUND:
00419 {
00420 break;
00421 }
00422 case SQUARE:
00423 {
00424 break;
00425 }
00426 case OCTAGONAL:
00427 {
00428 break;
00429 }
00430 case ROUND_ELONGATED:
00431 {
00432 break;
00433 }
00434 default:
00435 {
00436 if (verbose)
00437 {
00438 g_log ("", G_LOG_LEVEL_WARNING,
00439 (_("[%s] DRC Error: no valid pad shape type specified.")),
00440 footprint_type);
00441 }
00442 result = EXIT_FAILURE;
00443 break;
00444 }
00445 }
00446
00447 if (package_body_length <= 0.0)
00448 {
00449 if (verbose)
00450 {
00451 g_log ("", G_LOG_LEVEL_WARNING,
00452 (_("[%s] DRC Error: check for package body length is <= 0.0.")),
00453 footprint_type);
00454 }
00455 result = EXIT_FAILURE;
00456 }
00457 if (package_body_width <= 0.0)
00458 {
00459 if (verbose)
00460 {
00461 g_log ("", G_LOG_LEVEL_WARNING,
00462 (_("[%s] DRC Error: check for package body width is <= 0.0.")),
00463 footprint_type);
00464 }
00465 result = EXIT_FAILURE;
00466 }
00467 if (package_body_height <= 0.0)
00468 {
00469 if (verbose)
00470 {
00471 g_log ("", G_LOG_LEVEL_WARNING,
00472 (_("[%s] DRC Error: check for package body height is <= 0.0.")),
00473 footprint_type);
00474 }
00475 result = EXIT_FAILURE;
00476 }
00477
00478 if (courtyard_length <= 0.0)
00479 {
00480 if (verbose)
00481 {
00482 g_log ("", G_LOG_LEVEL_WARNING,
00483 (_("[%s] DRC Error: check for courtyard length is <= 0.0.")),
00484 footprint_type);
00485 }
00486 result = EXIT_FAILURE;
00487 }
00488 if (courtyard_width <= 0.0)
00489 {
00490 if (verbose)
00491 {
00492 g_log ("", G_LOG_LEVEL_WARNING,
00493 (_("[%s] DRC Error: check for courtyard width is <= 0.0.")),
00494 footprint_type);
00495 }
00496 result = EXIT_FAILURE;
00497 }
00498
00499 if ((pitch_x - pad_diameter < pad_clearance) || (pitch_x - pad_length < pad_clearance))
00500 {
00501 if (verbose)
00502 {
00503 g_log ("", G_LOG_LEVEL_WARNING,
00504 (_("[%s] DRC Error: check for minimum clearance between copper (X-direction).")),
00505 footprint_type);
00506 }
00507 result = EXIT_FAILURE;
00508 }
00509
00510 if ((pitch_y - pad_diameter < pad_clearance) || (pitch_y - pad_width < pad_clearance))
00511 {
00512 if (verbose)
00513 {
00514 g_log ("", G_LOG_LEVEL_WARNING,
00515 (_("[%s] DRC Error: check for minimum clearance between copper (Y-direction).")),
00516 footprint_type);
00517 }
00518 result = EXIT_FAILURE;
00519 }
00526 if (fiducial)
00527 {
00528
00529 if (fiducial_pad_diameter == 0.0)
00530 {
00531 if (verbose)
00532 {
00533 g_log ("", G_LOG_LEVEL_WARNING,
00534 (_("[%s] DRC Error: check for zero width fiducial pad.")),
00535 footprint_type);
00536 }
00537 result = EXIT_FAILURE;
00538 }
00539
00540 if (fiducial_pad_solder_mask_clearance == 0.0)
00541 {
00542 if (verbose)
00543 {
00544 g_log ("", G_LOG_LEVEL_WARNING,
00545 (_("[%s] DRC Error: check for zero width solder mask clearance.")),
00546 footprint_type);
00547 }
00548 result = EXIT_FAILURE;
00549 }
00550
00551
00552 #if 0
00553
00555 if ()
00556 {
00557 if (verbose)
00558 {
00559 g_log ("", G_LOG_LEVEL_WARNING,
00560 (_("[%s] DRC Error: check for distance between fiducial and nearest pad.")),
00561 footprint_type);
00562 }
00563 result = EXIT_FAILURE;
00564 }
00565 #endif
00566 }
00567
00568
00569 if (package_body_length - courtyard_length < courtyard_clearance_with_package)
00570 {
00571 if (verbose)
00572 {
00573 g_log ("", G_LOG_LEVEL_WARNING,
00574 (_("[%s] DRC Error: check for clearance of the package length with regard to the courtyard dimensions.")),
00575 footprint_type);
00576 }
00577 result = EXIT_FAILURE;
00578 }
00579
00580
00581 if (package_body_width - courtyard_width < courtyard_clearance_with_package)
00582 {
00583 if (verbose)
00584 {
00585 g_log ("", G_LOG_LEVEL_WARNING,
00586 (_("[%s] DRC Error: check for clearance of the package width with regard to the courtyard dimensions.")),
00587 footprint_type);
00588 }
00589 result = EXIT_FAILURE;
00590 }
00596
00597 if (silkscreen_package_outline && (silkscreen_line_width == 0.0))
00598 {
00599 if (verbose)
00600 {
00601 g_log ("", G_LOG_LEVEL_WARNING,
00602 (_("[%s] DRC Error: line width 0.0 specified for check for a reasonable silk line width.")),
00603 footprint_type);
00604 }
00605 result = EXIT_FAILURE;
00606 }
00607 switch (units_type)
00608 {
00609 case NO_UNITS:
00610 {
00611 if (verbose)
00612 {
00613 g_log ("", G_LOG_LEVEL_WARNING,
00614 (_("[%s] DRC Error: no units specified for check for a reasonable silk line width.")),
00615 footprint_type);
00616 }
00617 result = EXIT_FAILURE;
00618 break;
00619 }
00620 case MIL:
00621 if (silkscreen_package_outline && (silkscreen_line_width > 40.0))
00622 {
00623 if (verbose)
00624 {
00625 g_log ("", G_LOG_LEVEL_WARNING,
00626 (_("[%s] DRC Error: line width > 40.0 mil specified check for a reasonable silk line width.")),
00627 footprint_type);
00628 }
00629 result = EXIT_FAILURE;
00630 break;
00631 }
00632 case MIL_100:
00633 if (silkscreen_package_outline && (silkscreen_line_width > 4000.0))
00634 {
00635 if (verbose)
00636 {
00637 g_log ("", G_LOG_LEVEL_WARNING,
00638 (_("[%s] DRC Error: line width > 40.0 mil specified check for a reasonable silk line width.")),
00639 footprint_type);
00640 }
00641 result = EXIT_FAILURE;
00642 break;
00643 }
00644 case MM:
00645 if (silkscreen_package_outline && (silkscreen_line_width > 1.0))
00646 {
00647 if (verbose)
00648 {
00649 g_log ("", G_LOG_LEVEL_WARNING,
00650 (_("[%s] DRC Error: line width > 1.0 mm specified check for a reasonable silk line width.")),
00651 footprint_type);
00652 }
00653 result = EXIT_FAILURE;
00654 break;
00655 }
00656 default:
00657 {
00658 if (verbose)
00659 {
00660 g_log ("", G_LOG_LEVEL_WARNING,
00661 (_("[%s] DRC Error: no valid units type specified for check for a reasonable silk line width.")),
00662 footprint_type);
00663 }
00664 result = EXIT_FAILURE;
00665 break;
00666 }
00667 }
00668
00669 if (verbose && (result == EXIT_SUCCESS))
00670 {
00671 g_log ("", G_LOG_LEVEL_INFO,
00672 (_("[%s] DRC Check: no errors while checking package %s.")),
00673 footprint_type, footprint_name);
00674 }
00675 return (result);
00676 }
00677
00678
00724 int
00725 dip_get_default_footprint_values ()
00726 {
00727 if (!strcmp (footprint_name, "?DIP04300"))
00728 {
00729 footprint_units = g_strdup ("mil");
00730 number_of_pins = 4;
00731 package_body_width = 300;
00732 package_body_length = 200;
00733 package_body_height = 200;
00734 package_is_radial = FALSE;
00735 number_of_columns = 2;
00736 number_of_rows = 0;
00737 pitch_x = 300;
00738 pitch_y = 100;
00739 count_x = 0;
00740 count_y = 2;
00741 pad_shape = g_strdup ("circular pad");
00742 pad_shapes_type = ROUND;
00743 pin_drill_diameter = 28;
00744 pad_diameter = 60;
00745 pad_clearance = 15;
00746 pad_solder_mask_clearance = 6;
00747 thermal = FALSE;
00748 thermal_length = 0.0;
00749 thermal_width = 0.0;
00750 fiducial = FALSE;
00751 fiducial_pad_diameter = 0.0;
00752 fiducial_pad_solder_mask_clearance = 0.0;
00753 silkscreen_line_width = 8;
00754 courtyard_line_width = 2;
00755 g_free (footprint_name);
00756 footprint_name = g_strdup ("DIP04300");
00757 return (EXIT_SUCCESS);
00758 }
00759 else if (!strcmp (footprint_name, "?DIP06300"))
00760 {
00761 footprint_units = g_strdup ("mil");
00762 number_of_pins = 6;
00763 package_body_width = 300;
00764 package_body_length = 300;
00765 package_body_height = 200;
00766 package_is_radial = FALSE;
00767 number_of_columns = 2;
00768 number_of_rows = 0;
00769 pitch_x = 300;
00770 pitch_y = 100;
00771 count_x = 0;
00772 count_y = 3;
00773 pad_shape = g_strdup ("circular pad");
00774 pad_shapes_type = ROUND;
00775 pin_drill_diameter = 28;
00776 pad_diameter = 60;
00777 pad_clearance = 15;
00778 pad_solder_mask_clearance = 6;
00779 thermal = FALSE;
00780 thermal_length = 0.0;
00781 thermal_width = 0.0;
00782 fiducial = FALSE;
00783 fiducial_pad_diameter = 0.0;
00784 fiducial_pad_solder_mask_clearance = 0.0;
00785 silkscreen_line_width = 8;
00786 courtyard_line_width = 2;
00787 g_free (footprint_name);
00788 footprint_name = g_strdup ("DIP06300");
00789 return (EXIT_SUCCESS);
00790 }
00791 else if (!strcmp (footprint_name, "?DIP08300"))
00792 {
00793 footprint_units = g_strdup ("mil");
00794 number_of_pins = 8;
00795 package_body_width = 300;
00796 package_body_length = 400;
00797 package_body_height = 200;
00798 package_is_radial = FALSE;
00799 number_of_columns = 2;
00800 number_of_rows = 0;
00801 pitch_x = 300;
00802 pitch_y = 100;
00803 count_x = 0;
00804 count_y = 4;
00805 pad_shape = g_strdup ("circular pad");
00806 pad_shapes_type = ROUND;
00807 pin_drill_diameter = 28;
00808 pad_diameter = 60;
00809 pad_clearance = 15;
00810 pad_solder_mask_clearance = 6;
00811 thermal = FALSE;
00812 thermal_length = 0.0;
00813 thermal_width = 0.0;
00814 fiducial = FALSE;
00815 fiducial_pad_diameter = 0.0;
00816 fiducial_pad_solder_mask_clearance = 0.0;
00817 silkscreen_line_width = 8;
00818 courtyard_line_width = 2;
00819 g_free (footprint_name);
00820 footprint_name = g_strdup ("DIP08300");
00821 return (EXIT_SUCCESS);
00822 }
00823 else if (!strcmp (footprint_name, "?DIP08400"))
00824 {
00825 footprint_units = g_strdup ("mil");
00826 number_of_pins = 8;
00827 package_body_width = 400;
00828 package_body_length = 400;
00829 package_body_height = 220;
00830 package_is_radial = FALSE;
00831 number_of_columns = 2;
00832 number_of_rows = 0;
00833 pitch_x = 400;
00834 pitch_y = 100;
00835 count_x = 0;
00836 count_y = 4;
00837 pad_shape = g_strdup ("circular pad");
00838 pad_shapes_type = ROUND;
00839 pin_drill_diameter = 28;
00840 pad_diameter = 60;
00841 pad_clearance = 15;
00842 pad_solder_mask_clearance = 6;
00843 thermal = FALSE;
00844 thermal_length = 0.0;
00845 thermal_width = 0.0;
00846 fiducial = FALSE;
00847 fiducial_pad_diameter = 0.0;
00848 fiducial_pad_solder_mask_clearance = 0.0;
00849 silkscreen_line_width = 8;
00850 courtyard_line_width = 2;
00851 g_free (footprint_name);
00852 footprint_name = g_strdup ("DIP08400");
00853 return (EXIT_SUCCESS);
00854 }
00855 else if (!strcmp (footprint_name, "?DIP10300"))
00856 {
00857 footprint_units = g_strdup ("mil");
00858 number_of_pins = 10;
00859 package_body_width = 300;
00860 package_body_length = 500;
00861 package_body_height = 200;
00862 package_is_radial = FALSE;
00863 number_of_columns = 2;
00864 number_of_rows = 0;
00865 pitch_x = 300;
00866 pitch_y = 100;
00867 count_x = 0;
00868 count_y = 5;
00869 pad_shape = g_strdup ("circular pad");
00870 pad_shapes_type = ROUND;
00871 pin_drill_diameter = 28;
00872 pad_diameter = 60;
00873 pad_clearance = 15;
00874 pad_solder_mask_clearance = 6;
00875 thermal = FALSE;
00876 thermal_length = 0.0;
00877 thermal_width = 0.0;
00878 fiducial = FALSE;
00879 fiducial_pad_diameter = 0.0;
00880 fiducial_pad_solder_mask_clearance = 0.0;
00881 silkscreen_line_width = 8;
00882 courtyard_line_width = 2;
00883 g_free (footprint_name);
00884 footprint_name = g_strdup ("DIP10300");
00885 return (EXIT_SUCCESS);
00886 }
00887 else if (!strcmp (footprint_name, "?DIP14300"))
00888 {
00889 footprint_units = g_strdup ("mil");
00890 number_of_pins = 14;
00891 package_body_width = 300;
00892 package_body_length = 700;
00893 package_body_height = 200;
00894 package_is_radial = FALSE;
00895 number_of_columns = 2;
00896 number_of_rows = 0;
00897 pitch_x = 300;
00898 pitch_y = 100;
00899 count_x = 0;
00900 count_y = 7;
00901 pad_shape = g_strdup ("circular pad");
00902 pad_shapes_type = ROUND;
00903 pin_drill_diameter = 28;
00904 pad_diameter = 60;
00905 pad_clearance = 15;
00906 pad_solder_mask_clearance = 6;
00907 thermal = FALSE;
00908 thermal_length = 0.0;
00909 thermal_width = 0.0;
00910 fiducial = FALSE;
00911 fiducial_pad_diameter = 0.0;
00912 fiducial_pad_solder_mask_clearance = 0.0;
00913 silkscreen_line_width = 8;
00914 courtyard_line_width = 2;
00915 g_free (footprint_name);
00916 footprint_name = g_strdup ("DIP14300");
00917 return (EXIT_SUCCESS);
00918 }
00919 else if (!strcmp (footprint_name, "?DIP14400"))
00920 {
00921 footprint_units = g_strdup ("mil");
00922 number_of_pins = 8;
00923 package_body_width = 400;
00924 package_body_length = 700;
00925 package_is_radial = FALSE;
00926 number_of_columns = 2;
00927 number_of_rows = 0;
00928 pitch_x = 400;
00929 pitch_y = 100;
00930 count_x = 0;
00931 count_y = 7;
00932 pad_shape = g_strdup ("circular pad");
00933 pad_shapes_type = ROUND;
00934 pin_drill_diameter = 28;
00935 pad_diameter = 60;
00936 pad_clearance = 15;
00937 pad_solder_mask_clearance = 6;
00938 thermal = FALSE;
00939 thermal_length = 0.0;
00940 thermal_width = 0.0;
00941 fiducial = FALSE;
00942 fiducial_pad_diameter = 0.0;
00943 fiducial_pad_solder_mask_clearance = 0.0;
00944 silkscreen_line_width = 8;
00945 courtyard_line_width = 2;
00946 g_free (footprint_name);
00947 footprint_name = g_strdup ("DIP14400");
00948 return (EXIT_SUCCESS);
00949 }
00950 else if (!strcmp (footprint_name, "?DIP16300"))
00951 {
00952 footprint_units = g_strdup ("mil");
00953 number_of_pins = 16;
00954 package_body_width = 300;
00955 package_body_length = 800;
00956 package_body_height = 200;
00957 package_is_radial = FALSE;
00958 number_of_columns = 2;
00959 number_of_rows = 0;
00960 pitch_x = 300;
00961 pitch_y = 100;
00962 count_x = 0;
00963 count_y = 8;
00964 pad_shape = g_strdup ("circular pad");
00965 pad_shapes_type = ROUND;
00966 pin_drill_diameter = 28;
00967 pad_diameter = 60;
00968 pad_clearance = 15;
00969 pad_solder_mask_clearance = 6;
00970 thermal = FALSE;
00971 thermal_length = 0.0;
00972 thermal_width = 0.0;
00973 fiducial = FALSE;
00974 fiducial_pad_diameter = 0.0;
00975 fiducial_pad_solder_mask_clearance = 0.0;
00976 silkscreen_line_width = 8;
00977 courtyard_line_width = 2;
00978 g_free (footprint_name);
00979 footprint_name = g_strdup ("DIP16300");
00980 return (EXIT_SUCCESS);
00981 }
00982 else if (!strcmp (footprint_name, "?DIP16400"))
00983 {
00984 footprint_units = g_strdup ("mil");
00985 number_of_pins = 16;
00986 package_body_width = 400;
00987 package_body_length = 400;
00988 package_is_radial = FALSE;
00989 number_of_columns = 2;
00990 number_of_rows = 0;
00991 pitch_x = 400;
00992 pitch_y = 100;
00993 count_x = 0;
00994 count_y = 8;
00995 pad_shape = g_strdup ("circular pad");
00996 pad_shapes_type = ROUND;
00997 pin_drill_diameter = 28;
00998 pad_diameter = 60;
00999 pad_clearance = 15;
01000 pad_solder_mask_clearance = 6;
01001 thermal = FALSE;
01002 thermal_length = 0.0;
01003 thermal_width = 0.0;
01004 fiducial = FALSE;
01005 fiducial_pad_diameter = 0.0;
01006 fiducial_pad_solder_mask_clearance = 0.0;
01007 silkscreen_line_width = 8;
01008 courtyard_line_width = 2;
01009 g_free (footprint_name);
01010 footprint_name = g_strdup ("DIP16400");
01011 return (EXIT_SUCCESS);
01012 }
01013 else if (!strcmp (footprint_name, "?DIP18300"))
01014 {
01015 footprint_units = g_strdup ("mil");
01016 number_of_pins = 18;
01017 package_body_width = 300;
01018 package_body_length = 900;
01019 package_body_height = 200;
01020 package_is_radial = FALSE;
01021 number_of_columns = 2;
01022 number_of_rows = 0;
01023 pitch_x = 300;
01024 pitch_y = 100;
01025 count_x = 0;
01026 count_y = 9;
01027 pad_shape = g_strdup ("circular pad");
01028 pad_shapes_type = ROUND;
01029 pin_drill_diameter = 28;
01030 pad_diameter = 60;
01031 pad_clearance = 15;
01032 pad_solder_mask_clearance = 6;
01033 thermal = FALSE;
01034 thermal_length = 0.0;
01035 thermal_width = 0.0;
01036 fiducial = FALSE;
01037 fiducial_pad_diameter = 0.0;
01038 fiducial_pad_solder_mask_clearance = 0.0;
01039 silkscreen_line_width = 8;
01040 courtyard_line_width = 2;
01041 g_free (footprint_name);
01042 footprint_name = g_strdup ("DIP18300");
01043 return (EXIT_SUCCESS);
01044 }
01045 else if (!strcmp (footprint_name, "?DIP18400"))
01046 {
01047 footprint_units = g_strdup ("mil");
01048 number_of_pins = 18;
01049 package_body_width = 400;
01050 package_body_length = 900;
01051 package_body_height = 200;
01052 package_is_radial = FALSE;
01053 number_of_columns = 2;
01054 number_of_rows = 0;
01055 pitch_x = 400;
01056 pitch_y = 100;
01057 count_x = 0;
01058 count_y = 9;
01059 pad_shape = g_strdup ("circular pad");
01060 pad_shapes_type = ROUND;
01061 pin_drill_diameter = 28;
01062 pad_diameter = 60;
01063 pad_clearance = 15;
01064 pad_solder_mask_clearance = 6;
01065 thermal = FALSE;
01066 thermal_length = 0.0;
01067 thermal_width = 0.0;
01068 fiducial = FALSE;
01069 fiducial_pad_diameter = 0.0;
01070 fiducial_pad_solder_mask_clearance = 0.0;
01071 silkscreen_line_width = 8;
01072 courtyard_line_width = 2;
01073 g_free (footprint_name);
01074 footprint_name = g_strdup ("DIP18400");
01075 return (EXIT_SUCCESS);
01076 }
01077 else if (!strcmp (footprint_name, "?DIP20300"))
01078 {
01079 footprint_units = g_strdup ("mil");
01080 number_of_pins = 20;
01081 package_body_width = 300;
01082 package_body_length = 1000;
01083 package_body_height = 200;
01084 package_is_radial = FALSE;
01085 number_of_columns = 2;
01086 number_of_rows = 0;
01087 pitch_x = 300;
01088 pitch_y = 100;
01089 count_x = 0;
01090 count_y = 10;
01091 pad_shape = g_strdup ("circular pad");
01092 pad_shapes_type = ROUND;
01093 pin_drill_diameter = 28;
01094 pad_diameter = 60;
01095 pad_clearance = 15;
01096 pad_solder_mask_clearance = 6;
01097 thermal = FALSE;
01098 thermal_length = 0.0;
01099 thermal_width = 0.0;
01100 fiducial = FALSE;
01101 fiducial_pad_diameter = 0.0;
01102 fiducial_pad_solder_mask_clearance = 0.0;
01103 silkscreen_line_width = 8;
01104 courtyard_line_width = 2;
01105 g_free (footprint_name);
01106 footprint_name = g_strdup ("DIP20300");
01107 return (EXIT_SUCCESS);
01108 }
01109 else if (!strcmp (footprint_name, "?DIP20400"))
01110 {
01111 footprint_units = g_strdup ("mil");
01112 number_of_pins = 20;
01113 package_body_width = 400;
01114 package_body_length = 1000;
01115 package_is_radial = FALSE;
01116 number_of_columns = 2;
01117 number_of_rows = 0;
01118 pitch_x = 400;
01119 pitch_y = 100;
01120 count_x = 0;
01121 count_y = 10;
01122 pad_shape = g_strdup ("circular pad");
01123 pad_shapes_type = ROUND;
01124 pin_drill_diameter = 28;
01125 pad_diameter = 60;
01126 pad_clearance = 15;
01127 pad_solder_mask_clearance = 6;
01128 thermal = FALSE;
01129 thermal_length = 0.0;
01130 thermal_width = 0.0;
01131 fiducial = FALSE;
01132 fiducial_pad_diameter = 0.0;
01133 fiducial_pad_solder_mask_clearance = 0.0;
01134 silkscreen_line_width = 8;
01135 courtyard_line_width = 2;
01136 g_free (footprint_name);
01137 footprint_name = g_strdup ("DIP20400");
01138 return (EXIT_SUCCESS);
01139 }
01140 else if (!strcmp (footprint_name, "?DIP22300"))
01141 {
01142 footprint_units = g_strdup ("mil");
01143 number_of_pins = 22;
01144 package_body_width = 300;
01145 package_body_length = 1100;
01146 package_body_height = 200;
01147 package_is_radial = FALSE;
01148 number_of_columns = 2;
01149 number_of_rows = 0;
01150 pitch_x = 300;
01151 pitch_y = 100;
01152 count_x = 0;
01153 count_y = 11;
01154 pad_shape = g_strdup ("circular pad");
01155 pad_shapes_type = ROUND;
01156 pin_drill_diameter = 28;
01157 pad_diameter = 60;
01158 pad_clearance = 15;
01159 pad_solder_mask_clearance = 6;
01160 thermal = FALSE;
01161 thermal_length = 0.0;
01162 thermal_width = 0.0;
01163 fiducial = FALSE;
01164 fiducial_pad_diameter = 0.0;
01165 fiducial_pad_solder_mask_clearance = 0.0;
01166 silkscreen_line_width = 8;
01167 courtyard_line_width = 2;
01168 g_free (footprint_name);
01169 footprint_name = g_strdup ("DIP22300");
01170 return (EXIT_SUCCESS);
01171 }
01172 else if (!strcmp (footprint_name, "?DIP22400"))
01173 {
01174 footprint_units = g_strdup ("mil");
01175 number_of_pins = 22;
01176 package_body_width = 400;
01177 package_body_length = 1100;
01178 package_is_radial = FALSE;
01179 number_of_columns = 2;
01180 number_of_rows = 0;
01181 pitch_x = 400;
01182 pitch_y = 100;
01183 count_x = 0;
01184 count_y = 11;
01185 pad_shape = g_strdup ("circular pad");
01186 pad_shapes_type = ROUND;
01187 pin_drill_diameter = 28;
01188 pad_diameter = 60;
01189 pad_clearance = 15;
01190 pad_solder_mask_clearance = 6;
01191 thermal = FALSE;
01192 thermal_length = 0.0;
01193 thermal_width = 0.0;
01194 fiducial = FALSE;
01195 fiducial_pad_diameter = 0.0;
01196 fiducial_pad_solder_mask_clearance = 0.0;
01197 silkscreen_line_width = 8;
01198 courtyard_line_width = 2;
01199 g_free (footprint_name);
01200 footprint_name = g_strdup ("DIP22400");
01201 return (EXIT_SUCCESS);
01202 }
01203 else if (!strcmp (footprint_name, "?DIP24300"))
01204 {
01205 footprint_units = g_strdup ("mil");
01206 number_of_pins = 24;
01207 package_body_width = 300;
01208 package_body_length = 1200;
01209 package_body_height = 200;
01210 package_is_radial = FALSE;
01211 number_of_columns = 2;
01212 number_of_rows = 0;
01213 pitch_x = 300;
01214 pitch_y = 100;
01215 count_x = 0;
01216 count_y = 12;
01217 pad_shape = g_strdup ("circular pad");
01218 pad_shapes_type = ROUND;
01219 pin_drill_diameter = 28;
01220 pad_diameter = 60;
01221 pad_clearance = 15;
01222 pad_solder_mask_clearance = 6;
01223 thermal = FALSE;
01224 thermal_length = 0.0;
01225 thermal_width = 0.0;
01226 fiducial = FALSE;
01227 fiducial_pad_diameter = 0.0;
01228 fiducial_pad_solder_mask_clearance = 0.0;
01229 silkscreen_line_width = 8;
01230 courtyard_line_width = 2;
01231 g_free (footprint_name);
01232 footprint_name = g_strdup ("DIP24300");
01233 return (EXIT_SUCCESS);
01234 }
01235 else if (!strcmp (footprint_name, "?DIP24400"))
01236 {
01237 footprint_units = g_strdup ("mil");
01238 number_of_pins = 24;
01239 package_body_width = 400;
01240 package_body_length = 1200;
01241 package_body_height = 200;
01242 package_is_radial = FALSE;
01243 number_of_columns = 2;
01244 number_of_rows = 0;
01245 pitch_x = 400;
01246 pitch_y = 100;
01247 count_x = 0;
01248 count_y = 12;
01249 pad_shape = g_strdup ("circular pad");
01250 pad_shapes_type = ROUND;
01251 pin_drill_diameter = 28;
01252 pad_diameter = 60;
01253 pad_clearance = 15;
01254 pad_solder_mask_clearance = 6;
01255 thermal = FALSE;
01256 thermal_length = 0.0;
01257 thermal_width = 0.0;
01258 fiducial = FALSE;
01259 fiducial_pad_diameter = 0.0;
01260 fiducial_pad_solder_mask_clearance = 0.0;
01261 silkscreen_line_width = 8;
01262 courtyard_line_width = 2;
01263 g_free (footprint_name);
01264 footprint_name = g_strdup ("DIP24400");
01265 return (EXIT_SUCCESS);
01266 }
01267 else if (!strcmp (footprint_name, "?DIP24600"))
01268 {
01269 footprint_units = g_strdup ("mil");
01270 number_of_pins = 24;
01271 package_body_width = 600;
01272 package_body_length = 1200;
01273 package_body_height = 200;
01274 package_is_radial = FALSE;
01275 number_of_columns = 2;
01276 number_of_rows = 0;
01277 pitch_x = 600;
01278 pitch_y = 100;
01279 count_x = 0;
01280 count_y = 12;
01281 pad_shape = g_strdup ("circular pad");
01282 pad_shapes_type = ROUND;
01283 pin_drill_diameter = 28;
01284 pad_diameter = 60;
01285 pad_clearance = 15;
01286 pad_solder_mask_clearance = 6;
01287 thermal = FALSE;
01288 thermal_length = 0.0;
01289 thermal_width = 0.0;
01290 fiducial = FALSE;
01291 fiducial_pad_diameter = 0.0;
01292 fiducial_pad_solder_mask_clearance = 0.0;
01293 silkscreen_line_width = 8;
01294 courtyard_line_width = 2;
01295 g_free (footprint_name);
01296 footprint_name = g_strdup ("DIP24600");
01297 return (EXIT_SUCCESS);
01298 }
01299 else if (!strcmp (footprint_name, "?DIP28300"))
01300 {
01301 footprint_units = g_strdup ("mil");
01302 number_of_pins = 28;
01303 package_body_width = 300;
01304 package_body_length = 1400;
01305 package_body_height = 200;
01306 package_is_radial = FALSE;
01307 number_of_columns = 2;
01308 number_of_rows = 0;
01309 pitch_x = 300;
01310 pitch_y = 100;
01311 count_x = 0;
01312 count_y = 14;
01313 pad_shape = g_strdup ("circular pad");
01314 pad_shapes_type = ROUND;
01315 pin_drill_diameter = 28;
01316 pad_diameter = 60;
01317 pad_clearance = 15;
01318 pad_solder_mask_clearance = 6;
01319 thermal = FALSE;
01320 thermal_length = 0.0;
01321 thermal_width = 0.0;
01322 fiducial = FALSE;
01323 fiducial_pad_diameter = 0.0;
01324 fiducial_pad_solder_mask_clearance = 0.0;
01325 silkscreen_line_width = 8;
01326 courtyard_line_width = 2;
01327 g_free (footprint_name);
01328 footprint_name = g_strdup ("DIP28300");
01329 return (EXIT_SUCCESS);
01330 }
01331 else if (!strcmp (footprint_name, "?DIP28400"))
01332 {
01333 footprint_units = g_strdup ("mil");
01334 number_of_pins = 28;
01335 package_body_width = 400;
01336 package_body_length = 1400;
01337 package_is_radial = FALSE;
01338 number_of_columns = 2;
01339 number_of_rows = 0;
01340 pitch_x = 400;
01341 pitch_y = 100;
01342 count_x = 0;
01343 count_y = 14;
01344 pad_shape = g_strdup ("circular pad");
01345 pad_shapes_type = ROUND;
01346 pin_drill_diameter = 28;
01347 pad_diameter = 60;
01348 pad_clearance = 15;
01349 pad_solder_mask_clearance = 6;
01350 thermal = FALSE;
01351 thermal_length = 0.0;
01352 thermal_width = 0.0;
01353 fiducial = FALSE;
01354 fiducial_pad_diameter = 0.0;
01355 fiducial_pad_solder_mask_clearance = 0.0;
01356 silkscreen_line_width = 8;
01357 courtyard_line_width = 2;
01358 g_free (footprint_name);
01359 footprint_name = g_strdup ("DIP28400");
01360 return (EXIT_SUCCESS);
01361 }
01362 else if (!strcmp (footprint_name, "?DIP28600"))
01363 {
01364 footprint_units = g_strdup ("mil");
01365 number_of_pins = 28;
01366 package_body_width = 600;
01367 package_body_length = 1400;
01368 package_body_height = 200;
01369 package_is_radial = FALSE;
01370 number_of_columns = 2;
01371 number_of_rows = 0;
01372 pitch_x = 600;
01373 pitch_y = 100;
01374 count_x = 0;
01375 count_y = 14;
01376 pad_shape = g_strdup ("circular pad");
01377 pad_shapes_type = ROUND;
01378 pin_drill_diameter = 28;
01379 pad_diameter = 60;
01380 pad_clearance = 15;
01381 pad_solder_mask_clearance = 6;
01382 thermal = FALSE;
01383 thermal_length = 0.0;
01384 thermal_width = 0.0;
01385 fiducial = FALSE;
01386 fiducial_pad_diameter = 0.0;
01387 fiducial_pad_solder_mask_clearance = 0.0;
01388 silkscreen_line_width = 8;
01389 courtyard_line_width = 2;
01390 g_free (footprint_name);
01391 footprint_name = g_strdup ("DIP28600");
01392 return (EXIT_SUCCESS);
01393 }
01394 else if (!strcmp (footprint_name, "?DIP32300"))
01395 {
01396 footprint_units = g_strdup ("mil");
01397 number_of_pins = 32;
01398 package_body_width = 300;
01399 package_body_length = 1600;
01400 package_body_height = 200;
01401 package_is_radial = FALSE;
01402 number_of_columns = 2;
01403 number_of_rows = 0;
01404 pitch_x = 300;
01405 pitch_y = 100;
01406 count_x = 0;
01407 count_y = 16;
01408 pad_shape = g_strdup ("circular pad");
01409 pad_shapes_type = ROUND;
01410 pin_drill_diameter = 28;
01411 pad_diameter = 60;
01412 pad_clearance = 15;
01413 pad_solder_mask_clearance = 6;
01414 thermal = FALSE;
01415 thermal_length = 0.0;
01416 thermal_width = 0.0;
01417 fiducial = FALSE;
01418 fiducial_pad_diameter = 0.0;
01419 fiducial_pad_solder_mask_clearance = 0.0;
01420 silkscreen_line_width = 8;
01421 courtyard_line_width = 2;
01422 g_free (footprint_name);
01423 footprint_name = g_strdup ("DIP32300");
01424 return (EXIT_SUCCESS);
01425 }
01426 else if (!strcmp (footprint_name, "?DIP32600"))
01427 {
01428 footprint_units = g_strdup ("mil");
01429 number_of_pins = 32;
01430 package_body_width = 600;
01431 package_body_length = 1600;
01432 package_body_height = 200;
01433 package_is_radial = FALSE;
01434 number_of_columns = 2;
01435 number_of_rows = 0;
01436 pitch_x = 600;
01437 pitch_y = 100;
01438 count_x = 0;
01439 count_y = 16;
01440 pad_shape = g_strdup ("circular pad");
01441 pad_shapes_type = ROUND;
01442 pin_drill_diameter = 28;
01443 pad_diameter = 60;
01444 pad_clearance = 15;
01445 pad_solder_mask_clearance = 6;
01446 thermal = FALSE;
01447 thermal_length = 0.0;
01448 thermal_width = 0.0;
01449 fiducial = FALSE;
01450 fiducial_pad_diameter = 0.0;
01451 fiducial_pad_solder_mask_clearance = 0.0;
01452 silkscreen_line_width = 8;
01453 courtyard_line_width = 2;
01454 g_free (footprint_name);
01455 footprint_name = g_strdup ("DIP32600");
01456 return (EXIT_SUCCESS);
01457 }
01458 else if (!strcmp (footprint_name, "?DIP36600"))
01459 {
01460 footprint_units = g_strdup ("mil");
01461 number_of_pins = 36;
01462 package_body_width = 600;
01463 package_body_length = 1800;
01464 package_is_radial = FALSE;
01465 number_of_columns = 2;
01466 number_of_rows = 0;
01467 pitch_x = 600;
01468 pitch_y = 100;
01469 count_x = 0;
01470 count_y = 18;
01471 pad_shape = g_strdup ("circular pad");
01472 pad_shapes_type = ROUND;
01473 pin_drill_diameter = 28;
01474 pad_diameter = 60;
01475 pad_clearance = 15;
01476 pad_solder_mask_clearance = 6;
01477 thermal = FALSE;
01478 thermal_length = 0.0;
01479 thermal_width = 0.0;
01480 fiducial = FALSE;
01481 fiducial_pad_diameter = 0.0;
01482 fiducial_pad_solder_mask_clearance = 0.0;
01483 silkscreen_line_width = 8;
01484 courtyard_line_width = 2;
01485 g_free (footprint_name);
01486 footprint_name = g_strdup ("DIP36600");
01487 return (EXIT_SUCCESS);
01488 }
01489 else if (!strcmp (footprint_name, "?DIP38600"))
01490 {
01491 footprint_units = g_strdup ("mil");
01492 number_of_pins = 38;
01493 package_body_width = 600;
01494 package_body_length = 1900;
01495 package_is_radial = FALSE;
01496 number_of_columns = 2;
01497 number_of_rows = 0;
01498 pitch_x = 600;
01499 pitch_y = 100;
01500 count_x = 0;
01501 count_y = 19;
01502 pad_shape = g_strdup ("circular pad");
01503 pad_shapes_type = ROUND;
01504 pin_drill_diameter = 28;
01505 pad_diameter = 60;
01506 pad_clearance = 15;
01507 pad_solder_mask_clearance = 6;
01508 thermal = FALSE;
01509 thermal_length = 0.0;
01510 thermal_width = 0.0;
01511 fiducial = FALSE;
01512 fiducial_pad_diameter = 0.0;
01513 fiducial_pad_solder_mask_clearance = 0.0;
01514 silkscreen_line_width = 8;
01515 courtyard_line_width = 2;
01516 g_free (footprint_name);
01517 footprint_name = g_strdup ("DIP38600");
01518 return (EXIT_SUCCESS);
01519 }
01520 else if (!strcmp (footprint_name, "?DIP40600"))
01521 {
01522 footprint_units = g_strdup ("mil");
01523 number_of_pins = 40;
01524 package_body_width = 600;
01525 package_body_length = 2000;
01526 package_body_height = 200;
01527 package_is_radial = FALSE;
01528 number_of_columns = 2;
01529 number_of_rows = 0;
01530 pitch_x = 600;
01531 pitch_y = 100;
01532 count_x = 0;
01533 count_y = 20;
01534 pad_shape = g_strdup ("circular pad");
01535 pad_shapes_type = ROUND;
01536 pin_drill_diameter = 28;
01537 pad_diameter = 60;
01538 pad_clearance = 15;
01539 pad_solder_mask_clearance = 6;
01540 thermal = FALSE;
01541 thermal_length = 0.0;
01542 thermal_width = 0.0;
01543 fiducial = FALSE;
01544 fiducial_pad_diameter = 0.0;
01545 fiducial_pad_solder_mask_clearance = 0.0;
01546 silkscreen_line_width = 8;
01547 courtyard_line_width = 2;
01548 g_free (footprint_name);
01549 footprint_name = g_strdup ("DIP40600");
01550 return (EXIT_SUCCESS);
01551 }
01552 else if (!strcmp (footprint_name, "?DIP42600"))
01553 {
01554 footprint_units = g_strdup ("mil");
01555 number_of_pins = 42;
01556 package_body_width = 600;
01557 package_body_length = 2100;
01558 package_is_radial = FALSE;
01559 number_of_columns = 2;
01560 number_of_rows = 0;
01561 pitch_x = 600;
01562 pitch_y = 100;
01563 count_x = 0;
01564 count_y = 21;
01565 pad_shape = g_strdup ("circular pad");
01566 pad_shapes_type = ROUND;
01567 pin_drill_diameter = 28;
01568 pad_diameter = 60;
01569 pad_clearance = 15;
01570 pad_solder_mask_clearance = 6;
01571 thermal = FALSE;
01572 thermal_length = 0.0;
01573 thermal_width = 0.0;
01574 fiducial = FALSE;
01575 fiducial_pad_diameter = 0.0;
01576 fiducial_pad_solder_mask_clearance = 0.0;
01577 silkscreen_line_width = 8;
01578 courtyard_line_width = 2;
01579 g_free (footprint_name);
01580 footprint_name = g_strdup ("DIP42600");
01581 return (EXIT_SUCCESS);
01582 }
01583 else if (!strcmp (footprint_name, "?DIP48600"))
01584 {
01585 footprint_units = g_strdup ("mil");
01586 number_of_pins = 48;
01587 package_body_width = 600;
01588 package_body_length = 2400;
01589 package_body_height = 200;
01590 package_is_radial = FALSE;
01591 number_of_columns = 2;
01592 number_of_rows = 0;
01593 pitch_x = 600;
01594 pitch_y = 100;
01595 count_x = 0;
01596 count_y = 24;
01597 pad_shape = g_strdup ("circular pad");
01598 pad_shapes_type = ROUND;
01599 pin_drill_diameter = 28;
01600 pad_diameter = 60;
01601 pad_clearance = 15;
01602 pad_solder_mask_clearance = 6;
01603 thermal = FALSE;
01604 thermal_length = 0.0;
01605 thermal_width = 0.0;
01606 fiducial = FALSE;
01607 fiducial_pad_diameter = 0.0;
01608 fiducial_pad_solder_mask_clearance = 0.0;
01609 silkscreen_line_width = 8;
01610 courtyard_line_width = 2;
01611 g_free (footprint_name);
01612 footprint_name = g_strdup ("DIP48600");
01613 return (EXIT_SUCCESS);
01614 }
01615 else if (!strcmp (footprint_name, "?DIP50900"))
01616 {
01617 footprint_units = g_strdup ("mil");
01618 number_of_pins = 50;
01619 package_body_width = 900;
01620 package_body_length = 2500;
01621 package_is_radial = FALSE;
01622 number_of_columns = 2;
01623 number_of_rows = 0;
01624 pitch_x = 900;
01625 pitch_y = 100;
01626 count_x = 0;
01627 count_y = 25;
01628 pad_shape = g_strdup ("circular pad");
01629 pad_shapes_type = ROUND;
01630 pin_drill_diameter = 28;
01631 pad_diameter = 60;
01632 pad_clearance = 15;
01633 pad_solder_mask_clearance = 6;
01634 thermal = FALSE;
01635 thermal_length = 0.0;
01636 thermal_width = 0.0;
01637 fiducial = FALSE;
01638 fiducial_pad_diameter = 0.0;
01639 fiducial_pad_solder_mask_clearance = 0.0;
01640 silkscreen_line_width = 8;
01641 courtyard_line_width = 2;
01642 g_free (footprint_name);
01643 footprint_name = g_strdup ("DIP50900");
01644 return (EXIT_SUCCESS);
01645 }
01646 else if (!strcmp (footprint_name, "?DIP52600"))
01647 {
01648 footprint_units = g_strdup ("mil");
01649 number_of_pins = 52;
01650 package_body_width = 600;
01651 package_body_length = 2600;
01652 package_is_radial = FALSE;
01653 number_of_columns = 2;
01654 number_of_rows = 0;
01655 pitch_x = 600;
01656 pitch_y = 100;
01657 count_x = 0;
01658 count_y = 26;
01659 pad_shape = g_strdup ("circular pad");
01660 pad_shapes_type = ROUND;
01661 pin_drill_diameter = 28;
01662 pad_diameter = 60;
01663 pad_clearance = 15;
01664 pad_solder_mask_clearance = 6;
01665 thermal = FALSE;
01666 thermal_length = 0.0;
01667 thermal_width = 0.0;
01668 fiducial = FALSE;
01669 fiducial_pad_diameter = 0.0;
01670 fiducial_pad_solder_mask_clearance = 0.0;
01671 silkscreen_line_width = 8;
01672 courtyard_line_width = 2;
01673 g_free (footprint_name);
01674 footprint_name = g_strdup ("DIP52600");
01675 return (EXIT_SUCCESS);
01676 }
01677 else if (!strcmp (footprint_name, "?DIP64900"))
01678 {
01679 footprint_units = g_strdup ("mil");
01680 number_of_pins = 64;
01681 package_body_width = 900;
01682 package_body_length = 3200;
01683 package_is_radial = FALSE;
01684 number_of_columns = 2;
01685 number_of_rows = 0;
01686 pitch_x = 900;
01687 pitch_y = 100;
01688 count_x = 0;
01689 count_y = 32;
01690 pad_shape = g_strdup ("circular pad");
01691 pad_shapes_type = ROUND;
01692 pin_drill_diameter = 28;
01693 pad_diameter = 60;
01694 pad_clearance = 15;
01695 pad_solder_mask_clearance = 6;
01696 thermal = FALSE;
01697 thermal_length = 0.0;
01698 thermal_width = 0.0;
01699 fiducial = FALSE;
01700 fiducial_pad_diameter = 0.0;
01701 fiducial_pad_solder_mask_clearance = 0.0;
01702 silkscreen_line_width = 8;
01703 courtyard_line_width = 2;
01704 g_free (footprint_name);
01705 footprint_name = g_strdup ("DIP64900");
01706 return (EXIT_SUCCESS);
01707 }
01708 else
01709 {
01710 fprintf (stderr,
01711 _("WARNING: default values for footprint %s not found.\n"),
01712 footprint_name);
01713 return (EXIT_FAILURE);
01714 }
01715 }
01716
01717
01725 #if GUI
01726 int
01727 dip_set_gui_constraints ()
01728 {
01729
01730 GtkWidget *package_is_radial_checkbutton = lookup_widget (GTK_WIDGET (widget),
01731 "package_is_radial_checkbutton");
01732 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (package_is_radial_checkbutton), FALSE);
01733 gtk_widget_set_sensitive (package_is_radial_checkbutton, FALSE);
01734
01735
01736 GtkWidget *number_of_columns_entry = lookup_widget (GTK_WIDGET (widget),
01737 "number_of_columns_entry");
01738 gtk_entry_set_text (GTK_ENTRY (number_of_columns_entry), "2");
01739 gtk_widget_set_sensitive (number_of_columns_entry, FALSE);
01740 GtkWidget *number_of_rows_entry = lookup_widget (GTK_WIDGET (widget),
01741 "number_of_rows_entry");
01742 gtk_entry_set_text (GTK_ENTRY (number_of_rows_entry), "");
01743 gtk_widget_set_sensitive (number_of_rows_entry, FALSE);
01744 GtkWidget *count_x_entry = lookup_widget (GTK_WIDGET (widget),
01745 "count_x_entry");
01746 gtk_entry_set_text (GTK_ENTRY (count_x_entry), "");
01747 gtk_widget_set_sensitive (count_x_entry, FALSE);
01748 GtkWidget *count_y_entry = lookup_widget (GTK_WIDGET (widget),
01749 "count_y_entry");
01750 gtk_entry_set_text (GTK_ENTRY (count_y_entry), "");
01751 gtk_widget_set_sensitive (count_y_entry, TRUE);
01752 GtkWidget *number_1_position_entry = lookup_widget (GTK_WIDGET (widget),
01753 "number_1_position_entry");
01754 gtk_combo_box_set_active (GTK_COMBO_BOX (number_1_position_entry), UPPER_LEFT);
01755 gtk_widget_set_sensitive (number_1_position_entry, FALSE);
01756
01757
01758 gui_constraints_disable_thermal_tab_widgets (widget);
01759
01760
01761 gui_constraints_disable_heel_and_toe_goals_tab_widgets (widget);
01762 }
01763 #endif
01764
01765
01774 int
01775 dip_write_footprint ()
01776 {
01777 gdouble xmax;
01778 gdouble xmin;
01779 gdouble ymax;
01780 gdouble ymin;
01781 gdouble x_text;
01782 gdouble y_text;
01783 gint pin_number;
01784 gchar *pin_pad_name = g_strdup ("");
01785 gchar *pin_pad_flags = g_strdup ("");
01786 gint i;
01787
01788
01789 fp = fopen (footprint_filename, "w");
01790 if (!fp)
01791 {
01792 g_log ("", G_LOG_LEVEL_WARNING,
01793 _("could not open file for %s footprint: %s."),
01794 footprint_type, footprint_filename);
01795 fclose (fp);
01796 return (EXIT_FAILURE);
01797 }
01798
01799 if (license_in_footprint)
01800 {
01801 write_license ();
01802 }
01803
01804
01805 xmin = multiplier *
01806 (
01807 (-pitch_x / 2.0) -
01808 (((pad_diameter > pad_length) ? pad_diameter : pad_length) / 2.0) -
01809 pad_solder_mask_clearance
01810 );
01811 xmax = multiplier *
01812 (
01813 (pitch_x / 2.0) +
01814 (((pad_diameter > pad_length) ? pad_diameter : pad_length) / 2.0) +
01815 pad_solder_mask_clearance
01816 );
01817 ymin = multiplier *
01818 (
01819 ((((-count_y - 1) / 2.0) + 1) * pitch_y) -
01820 (((pad_diameter > pad_width) ? pad_diameter : pad_width) / 2.0) -
01821 pad_solder_mask_clearance
01822 );
01823 ymax = multiplier *
01824 (
01825 (((count_y - 1) / 2.0) * pitch_y) +
01826 (((pad_diameter > pad_width) ? pad_diameter : pad_width) / 2.0) +
01827 pad_solder_mask_clearance
01828 );
01829
01830
01831 if ((multiplier * ((-package_body_length / 2.0) - courtyard_clearance_with_package)) < xmin)
01832 xmin = (multiplier * ((-package_body_length / 2.0) - courtyard_clearance_with_package));
01833 if ((multiplier * ((package_body_length / 2.0) + courtyard_clearance_with_package)) > xmax)
01834 xmax = (multiplier * ((package_body_length / 2.0) + courtyard_clearance_with_package));
01835 if ((multiplier * ((-package_body_width / 2.0) - courtyard_clearance_with_package)) < ymin)
01836 ymin = (multiplier * ((-package_body_width / 2.0) - courtyard_clearance_with_package));
01837 if ((multiplier * ((package_body_width / 2.0) + courtyard_clearance_with_package)) > ymax)
01838 ymax = (multiplier * ((package_body_width / 2.0) + courtyard_clearance_with_package));
01839
01840 if (multiplier * (-courtyard_length / 2.0) < xmin)
01841 xmin = multiplier * (-courtyard_length / 2.0);
01842 if (multiplier * (courtyard_length / 2.0) > xmax)
01843 xmax = multiplier * (courtyard_length / 2.0);
01844 if (multiplier * (-courtyard_width / 2.0) < ymin)
01845 ymin = multiplier * (-courtyard_width / 2.0);
01846 if (multiplier * (courtyard_width / 2.0) > ymax)
01847 ymax = multiplier * (courtyard_width / 2.0);
01848
01849
01850 x_text = 0.0 ;
01851 y_text = (ymin - 10000.0);
01852 write_element_header (x_text, y_text);
01853
01854 for (i = 0; (i < count_y); i++)
01855 {
01856 pin_number = 1 + i;
01857 if (pin1_square && (pin_number == 1))
01858 pin_pad_flags = g_strdup ("square");
01859 else
01860 pin_pad_flags = g_strdup ("");
01861 write_pin
01862 (
01863 pin_number,
01864 pin_pad_name,
01865 multiplier * (-pitch_x / 2.0),
01866 multiplier * ((((-count_y - 1) / 2.0) +1 + i) * pitch_y),
01867 multiplier * pad_diameter,
01868 multiplier * pad_clearance,
01869 multiplier * (pad_diameter + pad_solder_mask_clearance),
01870 multiplier * pin_drill_diameter,
01871 pin_pad_flags
01872 );
01873 if (!strcmp (pad_shape, "rounded pad, elongated"))
01874 {
01875 if (!strcmp (pin_pad_flags, ""))
01876 pin_pad_flags = g_strconcat (pin_pad_flags, "onsolder", NULL);
01877 else
01878 pin_pad_flags = g_strconcat (pin_pad_flags, ",onsolder", NULL);
01879 write_pad
01880 (
01881 pin_number,
01882 pin_pad_name,
01883 multiplier * (-pitch_x + pad_length - pad_width) / 2.0,
01884 multiplier * ((((-count_y - 1) / 2.0) + 1 + i) * pitch_y),
01885 multiplier * (-pitch_x - pad_length + pad_width) / 2.0,
01886 multiplier * ((((-count_y - 1) / 2.0) + 1 + i) * pitch_y),
01887 multiplier * pad_width,
01888 multiplier * pad_clearance,
01889 multiplier * (pad_width + (2 * pad_solder_mask_clearance)),
01890 pin_pad_flags
01891 );
01892 }
01893 pin_number = (number_of_columns * count_y) - i;
01894 if (pin1_square && (pin_number == 1))
01895 pin_pad_flags = g_strdup ("square");
01896 else
01897 pin_pad_flags = g_strdup ("");
01898 write_pin
01899 (
01900 pin_number,
01901 pin_pad_name,
01902 multiplier * pitch_x / 2.0,
01903 multiplier * ((((-count_y - 1) / 2.0) + 1 + i) * pitch_y),
01904 multiplier * pad_diameter,
01905 multiplier * pad_clearance,
01906 multiplier * (pad_diameter + pad_solder_mask_clearance),
01907 multiplier * pin_drill_diameter,
01908 pin_pad_flags
01909 );
01910 if (!strcmp (pad_shape, "rounded pad, elongated"))
01911 {
01912 if (!strcmp (pin_pad_flags, ""))
01913 pin_pad_flags = g_strconcat (pin_pad_flags, "onsolder", NULL);
01914 else
01915 pin_pad_flags = g_strconcat (pin_pad_flags, ",onsolder", NULL);
01916 write_pad
01917 (
01918 pin_number,
01919 pin_pad_name,
01920 multiplier * (pitch_x - pad_length + pad_width) / 2.0,
01921 multiplier * ((((-count_y - 1) / 2.0) + 1 + i) * pitch_y),
01922 multiplier * (pitch_x + pad_length - pad_width) / 2.0,
01923 multiplier * ((((-count_y - 1) / 2.0) + 1 + i) * pitch_y),
01924 multiplier * pad_width,
01925 multiplier * pad_clearance,
01926 multiplier * (pad_width + (2 * pad_solder_mask_clearance)),
01927 pin_pad_flags
01928 );
01929 }
01930 }
01931
01932 if (silkscreen_package_outline)
01933 {
01934 fprintf (fp, "# Write a package body on the silkscreen\n");
01935 write_rectangle
01936 (
01937 multiplier * (((-pitch_x + pad_diameter + silkscreen_line_width) / 2) + pad_solder_mask_clearance) ,
01938 ymin,
01939 multiplier * (((pitch_x - pad_diameter - silkscreen_line_width) / 2) - pad_solder_mask_clearance) ,
01940 ymax,
01941 multiplier * silkscreen_line_width
01942 );
01943 }
01944
01945 if (silkscreen_indicate_1)
01946 {
01947 fprintf (fp, "# Write a pin 1 marker on the silkscreen\n");
01948 write_element_arc
01949 (
01950 (0.0),
01951 ymin,
01952 multiplier * (pitch_x / 8),
01953 multiplier * (pitch_x / 8),
01954 0,
01955 180,
01956 multiplier * silkscreen_line_width
01957 );
01958 }
01959
01960 if (courtyard)
01961 {
01962 fprintf (fp, "# Write a courtyard on the silkscreen\n");
01963 write_rectangle
01964 (
01965 xmin,
01966 ymin,
01967 xmax,
01968 ymax,
01969 multiplier * courtyard_line_width
01970 );
01971 }
01972
01973 if (attributes_in_footprint)
01974 {
01975 write_attributes ();
01976 }
01977
01978 fprintf (fp, "\n");
01979 fprintf (fp, ")\n");
01980 fclose (fp);
01981
01982 if (verbose)
01983 {
01984 g_log ("", G_LOG_LEVEL_INFO,
01985 _("wrote a footprint for a %s package: %s."),
01986 footprint_type,
01987 footprint_filename);
01988 }
01989 return (EXIT_SUCCESS);
01990 }
01991
01992
01996 static fpw_function_t
01997 dip_function_list[] =
01998 {
01999 #if GUI
02000 {
02001 "Set GUI constraints",
02002 dip_set_gui_constraints,
02003 "Set GUI constraints for a DIP package",
02004 NULL
02005 },
02006 #endif
02007 {
02008 "Create Element",
02009 dip_create_element,
02010 "Create a pcb element for a DIP package",
02011 NULL
02012 },
02013 {
02014 "Create Package List",
02015 dip_create_packages_list,
02016 "Create a list of packages with known values",
02017 NULL
02018 },
02019 {
02020 "DRC DIP Element",
02021 dip_drc,
02022 "Design Rule Check for a DIP package",
02023 NULL
02024 },
02025 {
02026 "Default Element Values",
02027 dip_get_default_footprint_values,
02028 "Get default values for a selected DIP package",
02029 NULL
02030 },
02031 {
02032 "Write footprint",
02033 dip_write_footprint,
02034 "Write a footprint for a selected DIP package",
02035 NULL
02036 }
02037 };
02038
02039
02043 REGISTER_FUNCTIONS (dip_function_list)
02044
02045
02046
02053 void
02054 dip_init ()
02055 {
02056 register_dip_function_list ();
02057 }
02058
02059
02060