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