00001
00025 #include "register_functions.c"
00026 #include "diomelf.h"
00027
00028
00035 int
00036 diomelf_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
00067
00068
00069 if ((multiplier * ((-package_body_length / 2.0) - courtyard_clearance_with_package)) < xmin)
00070 {
00071 xmin = (multiplier * ((-package_body_length / 2.0) - courtyard_clearance_with_package));
00072 }
00073 if ((multiplier * ((package_body_length / 2.0) + courtyard_clearance_with_package)) > xmax)
00074 {
00075 xmax = (multiplier * ((package_body_length / 2.0) + courtyard_clearance_with_package));
00076 }
00077 if ((multiplier * ((-package_body_width / 2.0) - courtyard_clearance_with_package)) < ymin)
00078 {
00079 ymin = (multiplier * ((-package_body_width / 2.0) - courtyard_clearance_with_package));
00080 }
00081 if ((multiplier * ((package_body_width / 2.0) + courtyard_clearance_with_package)) > ymax)
00082 {
00083 ymax = (multiplier * ((package_body_width / 2.0) + courtyard_clearance_with_package));
00084 }
00085
00086 if (multiplier * (-courtyard_length / 2.0) < xmin)
00087 {
00088 xmin = multiplier * (-courtyard_length / 2.0);
00089 }
00090 if (multiplier * (courtyard_length / 2.0) > xmax)
00091 {
00092 xmax = multiplier * (courtyard_length / 2.0);
00093 }
00094 if (multiplier * (-courtyard_width / 2.0) < ymin)
00095 {
00096 ymin = multiplier * (-courtyard_width / 2.0);
00097 }
00098 if (multiplier * (courtyard_width / 2.0) > ymax)
00099 {
00100 ymax = multiplier * (courtyard_width / 2.0);
00101 }
00102
00103 element->Name[1].Scale = 100;
00104 element->Name[1].X = 0.0 ;
00105 element->Name[1].Y = (ymin - 10000.0);
00106 element->Name[1].TextString = footprint_name;
00107 element->Name[1].Element = element;
00108 element->Name[1].Direction = EAST;
00109 element->Name[1].ID = ID++;
00110
00111 element->Name[2].Scale = 100;
00112 element->Name[2].X = 0.0 ;
00113 element->Name[2].Y = (ymin - 10000.0);
00114 element->Name[2].TextString = footprint_refdes;
00115 element->Name[2].Element = element;
00116 element->Name[2].Direction = EAST;
00117 element->Name[2].ID = ID++;
00118
00119 element->Name[3].Scale = 100;
00120 element->Name[3].X = 0.0 ;
00121 element->Name[3].Y = (ymin - 10000.0);
00122 element->Name[3].TextString = footprint_value;
00123 element->Name[3].Element = element;
00124 element->Name[3].Direction = EAST;
00125 element->Name[3].ID = ID++;
00126
00127 if (pad_shapes_type == SQUARE)
00128 {
00129 pad_flag.f = SQUARE;
00130 }
00131 else
00132 {
00133 pad_flag.f = CLEAR;
00134 }
00135 if (pad_length > pad_width)
00136 {
00137
00138 create_new_pad
00139 (
00140 element,
00141 (int) (multiplier * ((pitch_x - pad_length + pad_width) / 2.0)),
00142 0,
00143 (int) (multiplier * ((pitch_x + pad_length - pad_width) / 2.0)),
00144 0,
00145 (int) (multiplier * pad_width),
00146 (int) (multiplier * pad_clearance),
00147 (int) (multiplier * (pad_width + (2 * pad_solder_mask_clearance))),
00148 "A",
00149 "2",
00150 pad_flag
00151 );
00152
00153 if (pin1_square)
00154 {
00155 pad_flag.f = SQUARE;
00156 }
00157
00158 create_new_pad
00159 (
00160 element,
00161 (int) (multiplier * ((-pitch_x - pad_length + pad_width) / 2.0)),
00162 0,
00163 (int) (multiplier * ((-pitch_x + pad_length - pad_width) / 2.0)),
00164 0,
00165 (int) (multiplier * pad_width),
00166 (int) (multiplier * pad_clearance),
00167 (int) (multiplier * (pad_width + (2 * pad_solder_mask_clearance))),
00168 "C",
00169 "1",
00170 pad_flag
00171 );
00172 }
00173 else
00174 {
00175
00176 create_new_pad
00177 (
00178 element,
00179 (int) (multiplier * (pitch_x / 2.0)),
00180 (int) (multiplier * ((pad_width - pad_length) / 2.0)),
00181 (int) (multiplier * (pitch_x / 2.0)),
00182 (int) (multiplier * ((-pad_width + pad_length) / 2.0)),
00183 (int) (multiplier * pad_length),
00184 (int) (multiplier * pad_clearance),
00185 (int) (multiplier * (pad_length + (2 * pad_solder_mask_clearance))),
00186 "A",
00187 "2",
00188 pad_flag
00189 );
00190
00191 if (pin1_square)
00192 {
00193 pad_flag.f = SQUARE;
00194 }
00195
00196 create_new_pad
00197 (
00198 element,
00199 (int) (multiplier * (-pitch_x / 2.0)),
00200 (int) (multiplier * ((pad_width - pad_length) / 2.0)),
00201 (int) (multiplier * (-pitch_x / 2)),
00202 (int) (multiplier * ((-pad_width + pad_length) / 2.0)),
00203 (int) (multiplier * pad_length),
00204 (int) (multiplier * pad_clearance),
00205 (int) (multiplier * (pad_length + (2 * pad_solder_mask_clearance))),
00206 "C",
00207 "1",
00208 pad_flag
00209 );
00210 }
00211
00212 if (silkscreen_package_outline && package_body_width)
00213 {
00214 if (pad_width >= package_body_width)
00215 {
00216 create_new_line
00217 (
00218 element,
00219 (int) (multiplier * (((-pitch_x + pad_length) / 2.0) + pad_solder_mask_clearance + silkscreen_line_width)),
00220 (int) (multiplier * (package_body_width / 2.0)),
00221 (int) (multiplier * (((pitch_x - pad_length) / 2.0) - pad_solder_mask_clearance - silkscreen_line_width)),
00222 (int) (multiplier * (package_body_width / 2.0)),
00223 (int) (multiplier * silkscreen_line_width)
00224 );
00225 create_new_line
00226 (
00227 element,
00228 (int) (multiplier * (((-pitch_x + pad_length) / 2.0) + pad_solder_mask_clearance + silkscreen_line_width)),
00229 (int) (multiplier * (-package_body_width / 2.0)),
00230 (int) (multiplier * (((pitch_x - pad_length) / 2.0) - pad_solder_mask_clearance - silkscreen_line_width)),
00231 (int) (multiplier * (-package_body_width / 2.0)),
00232 (int) (multiplier * silkscreen_line_width)
00233 );
00234 }
00235 else
00236 {
00237
00238 create_new_line
00239 (
00240 element,
00241 (int) (multiplier * (-package_body_length / 2.0)),
00242 (int) (multiplier * (package_body_width / 2.0)),
00243 (int) (multiplier * (package_body_length / 2.0)),
00244 (int) (multiplier * (package_body_width / 2.0)),
00245 (int) (multiplier * silkscreen_line_width)
00246 );
00247 create_new_line
00248 (
00249 element,
00250 (int) (multiplier * (-package_body_length / 2.0)),
00251 (int) (multiplier * (-package_body_width / 2.0)),
00252 (int) (multiplier * (package_body_length / 2.0)),
00253 (int) (multiplier * (-package_body_width / 2.0)),
00254 (int) (multiplier * silkscreen_line_width)
00255 );
00256
00257 create_new_line
00258 (
00259 element,
00260 (int) (multiplier * (-package_body_length / 2.0)),
00261 (int) (multiplier * (-package_body_width / 2.0)),
00262 (int) (multiplier * (-package_body_length / 2.0)),
00263 (int) (multiplier * (((-pad_width - silkscreen_line_width) / 2.0) - pad_solder_mask_clearance)),
00264 (int) (multiplier * silkscreen_line_width)
00265 );
00266 create_new_line
00267 (
00268 element,
00269 (int) (multiplier * (-package_body_length / 2.0)),
00270 (int) (multiplier * (package_body_width / 2.0)),
00271 (int) (multiplier * (-package_body_length / 2.0)),
00272 (int) (multiplier * (((pad_width + silkscreen_line_width) / 2.0) + pad_solder_mask_clearance)),
00273 (int) (multiplier * silkscreen_line_width)
00274 );
00275 create_new_line
00276 (
00277 element,
00278 (int) (multiplier * (package_body_length / 2.0)),
00279 (int) (multiplier * (-package_body_width / 2.0)),
00280 (int) (multiplier * (package_body_length / 2.0)),
00281 (int) (multiplier * (((-pad_width - silkscreen_line_width) / 2.0) - pad_solder_mask_clearance)),
00282 (int) (multiplier * silkscreen_line_width)
00283 );
00284 create_new_line
00285 (
00286 element,
00287 (int) (multiplier * (package_body_length / 2.0)),
00288 (int) (multiplier * (package_body_width / 2.0)),
00289 (int) (multiplier * (package_body_length / 2.0)),
00290 (int) (multiplier * (((pad_width + silkscreen_line_width) / 2.0) + pad_solder_mask_clearance)),
00291 (int) (multiplier * silkscreen_line_width)
00292 );
00293 }
00294 }
00295
00296 if (silkscreen_indicate_1)
00297 {
00298 if (pad_width >= package_body_width)
00299 {
00300 create_new_line
00301 (
00302 element,
00303 (int) (multiplier * (((-pitch_x + pad_length) / 2.0) + pad_solder_mask_clearance + silkscreen_line_width)),
00304 (int) (multiplier * (-package_body_width / 2.0)),
00305 (int) (multiplier * (((-pitch_x + pad_length) / 2.0) + pad_solder_mask_clearance + silkscreen_line_width)),
00306 (int) (multiplier * (package_body_width / 2.0)),
00307 (int) (multiplier * silkscreen_line_width)
00308 );
00309 }
00310 else
00311 {
00312 create_new_arc
00313 (
00314 element,
00315 (int) (multiplier * (((-package_body_length) / 2.0) - 2 * silkscreen_line_width)),
00316 (int) (multiplier * (-package_body_width / 2.0)),
00317 (int) (multiplier * 0.5 * silkscreen_line_width),
00318 (int) (multiplier * 0.5 * silkscreen_line_width),
00319 0,
00320 360,
00321 (int) (multiplier * silkscreen_line_width)
00322 );
00323 }
00324 }
00325
00326 if (courtyard)
00327 {
00328 create_new_line
00329 (
00330 element,
00331 (int) (xmin),
00332 (int) (ymin),
00333 (int) (xmin),
00334 (int) (ymax),
00335 (int) (multiplier * courtyard_line_width)
00336 );
00337 create_new_line
00338 (
00339 element,
00340 (int) (xmax),
00341 (int) (ymin),
00342 (int) (xmax),
00343 (int) (ymax),
00344 (int) (multiplier * courtyard_line_width)
00345 );
00346 create_new_line
00347 (
00348 element,
00349 (int) (xmin),
00350 (int) (ymin),
00351 (int) (xmax),
00352 (int) (ymin),
00353 (int) (multiplier * courtyard_line_width)
00354 );
00355 create_new_line
00356 (
00357 element,
00358 (int) (xmax),
00359 (int) (ymax),
00360 (int) (xmin),
00361 (int) (ymax),
00362 (int) (multiplier * courtyard_line_width)
00363 );
00364 }
00365
00366 if (attributes_in_footprint)
00367 {
00368 element = create_attributes_in_element (element);
00369 }
00370
00371 if (verbose)
00372 {
00373 g_log ("", G_LOG_LEVEL_INFO,
00374 _("created an element for a %s package: %s."),
00375 footprint_type,
00376 footprint_filename);
00377 }
00378 current_element = (ElementTypePtr) &element;
00379 return (EXIT_SUCCESS);
00380 }
00381
00382
00392 int
00393 diomelf_create_packages_list ()
00394 {
00395 g_list_free (packages_list);
00396 packages_list = g_list_append (packages_list, "DIOMELF1911L");
00397 packages_list = g_list_append (packages_list, "DIOMELF1911M");
00398 packages_list = g_list_append (packages_list, "DIOMELF1911N");
00399 packages_list = g_list_append (packages_list, "DIOMELF3414L");
00400 packages_list = g_list_append (packages_list, "DIOMELF3414M");
00401 packages_list = g_list_append (packages_list, "DIOMELF3414N");
00402 packages_list = g_list_append (packages_list, "DIOMELF3515L");
00403 packages_list = g_list_append (packages_list, "DIOMELF3515M");
00404 packages_list = g_list_append (packages_list, "DIOMELF3515N");
00405 packages_list = g_list_append (packages_list, "DIOMELF3516L");
00406 packages_list = g_list_append (packages_list, "DIOMELF3516M");
00407 packages_list = g_list_append (packages_list, "DIOMELF3516N");
00408 packages_list = g_list_append (packages_list, "DIOMELF3520L");
00409 packages_list = g_list_append (packages_list, "DIOMELF3520M");
00410 packages_list = g_list_append (packages_list, "DIOMELF3520N");
00411 return (EXIT_SUCCESS);
00412 }
00413
00414
00438 int
00439 diomelf_drc ()
00440 {
00441 int result = EXIT_SUCCESS;
00442 if (verbose)
00443 {
00444 g_log ("", G_LOG_LEVEL_INFO,
00445 (_("[%s] DRC Check: checking package %s.")),
00446 footprint_type, footprint_name);
00447 }
00448
00449 if (number_of_pins != 2)
00450 {
00451 if (verbose)
00452 {
00453 g_log ("", G_LOG_LEVEL_WARNING,
00454 (_("[%s] DRC Error: check for number of pins/pads <> 2.")),
00455 footprint_type);
00456 }
00457 result = EXIT_FAILURE;
00458 }
00459
00460 switch (pad_shapes_type)
00461 {
00462 case NO_SHAPE:
00463 {
00464 if (verbose)
00465 {
00466 g_log ("", G_LOG_LEVEL_WARNING,
00467 (_("[%s] DRC Error: NO_SHAPE specified for check for allowed pad shapes.")),
00468 footprint_type);
00469 }
00470 result = EXIT_FAILURE;
00471 break;
00472 }
00473 case ROUND:
00474 {
00475 if (verbose)
00476 {
00477 g_log ("", G_LOG_LEVEL_WARNING,
00478 (_("[%s] DRC Error: circular pad shape specified for check for allowed pad shapes.")),
00479 footprint_type);
00480 }
00481 result = EXIT_FAILURE;
00482 break;
00483 }
00484 case SQUARE:
00485 {
00486 break;
00487 }
00488 case OCTAGONAL:
00489 {
00490 if (verbose)
00491 {
00492 g_log ("", G_LOG_LEVEL_WARNING,
00493 (_("[%s] DRC Error: octagonal pad shape specified for check for allowed pad shapes.")),
00494 footprint_type);
00495 }
00496 result = EXIT_FAILURE;
00497 break;
00498 }
00499 case ROUND_ELONGATED:
00500 {
00501 break;
00502 }
00503 default:
00504 {
00505 if (verbose)
00506 {
00507 g_log ("", G_LOG_LEVEL_WARNING,
00508 (_("[%s] DRC Error: no valid pad shape type specified.")),
00509 footprint_type);
00510 }
00511 result = EXIT_FAILURE;
00512 break;
00513 }
00514 }
00515
00516 if (package_body_length <= 0.0)
00517 {
00518 if (verbose)
00519 {
00520 g_log ("", G_LOG_LEVEL_WARNING,
00521 (_("[%s] DRC Error: check for package body length is <= 0.0.")),
00522 footprint_type);
00523 }
00524 result = EXIT_FAILURE;
00525 }
00526 if (package_body_width <= 0.0)
00527 {
00528 if (verbose)
00529 {
00530 g_log ("", G_LOG_LEVEL_WARNING,
00531 (_("[%s] DRC Error: check for package body width is <= 0.0.")),
00532 footprint_type);
00533 }
00534 result = EXIT_FAILURE;
00535 }
00536 if (package_body_height <= 0.0)
00537 {
00538 if (verbose)
00539 {
00540 g_log ("", G_LOG_LEVEL_WARNING,
00541 (_("[%s] DRC Error: check for package body height is <= 0.0.")),
00542 footprint_type);
00543 }
00544 result = EXIT_FAILURE;
00545 }
00546
00547 if (courtyard_length <= 0.0)
00548 {
00549 if (verbose)
00550 {
00551 g_log ("", G_LOG_LEVEL_WARNING,
00552 (_("[%s] DRC Error: check for courtyard length is <= 0.0.")),
00553 footprint_type);
00554 }
00555 result = EXIT_FAILURE;
00556 }
00557 if (courtyard_width <= 0.0)
00558 {
00559 if (verbose)
00560 {
00561 g_log ("", G_LOG_LEVEL_WARNING,
00562 (_("[%s] DRC Error: check for courtyard width is <= 0.0.")),
00563 footprint_type);
00564 }
00565 return (EXIT_FAILURE);
00566 }
00567
00568 if (pitch_x - pad_length < pad_clearance)
00569 {
00570 if (verbose)
00571 {
00572 g_log ("", G_LOG_LEVEL_WARNING,
00573 (_("[%s] DRC Error: check for minimum clearance between copper (X-direction).")),
00574 footprint_type);
00575 }
00576 result = EXIT_FAILURE;
00577 }
00578
00579 if (pitch_y - pad_width < pad_clearance)
00580 {
00581 if (verbose)
00582 {
00583 g_log ("", G_LOG_LEVEL_WARNING,
00584 (_("[%s] DRC Error: check for minimum clearance between copper (Y-direction).")),
00585 footprint_type);
00586 }
00587 result = EXIT_FAILURE;
00588 }
00589
00590 if (fiducial)
00591 {
00592 if (verbose)
00593 {
00594 g_log ("", G_LOG_LEVEL_WARNING,
00595 (_("[%s] DRC Error: check for fiducials, package should not have fiducials.")),
00596 footprint_type);
00597 }
00598 result = EXIT_FAILURE;
00599 }
00600
00601
00602 if (package_body_length - courtyard_length < courtyard_clearance_with_package)
00603 {
00604 if (verbose)
00605 {
00606 g_log ("", G_LOG_LEVEL_WARNING,
00607 (_("[%s] DRC Error: check for clearance of the package length with regard to the courtyard dimensions.")),
00608 footprint_type);
00609 }
00610 result = EXIT_FAILURE;
00611 }
00612
00613
00614 if (package_body_width - courtyard_width < courtyard_clearance_with_package)
00615 {
00616 if (verbose)
00617 {
00618 g_log ("", G_LOG_LEVEL_WARNING,
00619 (_("[%s] DRC Error: check for clearance of the package width with regard to the courtyard dimensions.")),
00620 footprint_type);
00621 }
00622 result = EXIT_FAILURE;
00623 }
00629
00630 if (silkscreen_package_outline && (silkscreen_line_width == 0.0))
00631 {
00632 if (verbose)
00633 {
00634 g_log ("", G_LOG_LEVEL_WARNING,
00635 (_("[%s] DRC Error: line width 0.0 specified for check for a reasonable silk line width.")),
00636 footprint_type);
00637 }
00638 result = EXIT_FAILURE;
00639 }
00640 switch (units_type)
00641 {
00642 case NO_UNITS:
00643 {
00644 if (verbose)
00645 {
00646 g_log ("", G_LOG_LEVEL_WARNING,
00647 (_("[%s] DRC Error: no units specified for check for a reasonable silk line width.")),
00648 footprint_type);
00649 }
00650 result = EXIT_FAILURE;
00651 break;
00652 }
00653 case MIL:
00654 if (silkscreen_package_outline && (silkscreen_line_width > 40.0))
00655 {
00656 if (verbose)
00657 {
00658 g_log ("", G_LOG_LEVEL_WARNING,
00659 (_("[%s] DRC Error: line width > 40.0 mil specified check for a reasonable silk line width.")),
00660 footprint_type);
00661 }
00662 result = EXIT_FAILURE;
00663 break;
00664 }
00665 case MIL_100:
00666 if (silkscreen_package_outline && (silkscreen_line_width > 4000.0))
00667 {
00668 if (verbose)
00669 {
00670 g_log ("", G_LOG_LEVEL_WARNING,
00671 (_("[%s] DRC Error: line width > 40.0 mil specified check for a reasonable silk line width.")),
00672 footprint_type);
00673 }
00674 result = EXIT_FAILURE;
00675 break;
00676 }
00677 case MM:
00678 if (silkscreen_package_outline && (silkscreen_line_width > 1.0))
00679 {
00680 if (verbose)
00681 {
00682 g_log ("", G_LOG_LEVEL_WARNING,
00683 (_("[%s] DRC Error: line width > 1.0 mm specified check for a reasonable silk line width.")),
00684 footprint_type);
00685 }
00686 result = EXIT_FAILURE;
00687 break;
00688 }
00689 default:
00690 {
00691 if (verbose)
00692 {
00693 g_log ("", G_LOG_LEVEL_WARNING,
00694 (_("[%s] DRC Error: no valid units type specified for check for a reasonable silk line width.")),
00695 footprint_type);
00696 }
00697 result = EXIT_FAILURE;
00698 break;
00699 }
00700 }
00701
00702 if (verbose && (result == EXIT_SUCCESS))
00703 {
00704 g_log ("", G_LOG_LEVEL_INFO,
00705 (_("[%s] DRC Check: no errors while checking package %s.")),
00706 footprint_type, footprint_name);
00707 }
00708 return result;
00709 }
00710
00711
00739 int
00740 diomelf_get_default_footprint_values ()
00741 {
00742 if (!strcmp (footprint_name, "?DIOMELF1911L"))
00743 {
00744 pitch_y = 0.0;
00745 number_of_pins = 2;
00746 package_body_length = 2.00;
00747 package_body_width = 1.20;
00748 package_body_height = 1.20;
00749 package_is_radial = FALSE;
00750 number_of_columns = 0;
00751 number_of_rows = 0;
00752 pitch_x = 1.90;
00753 pad_length = 0.55;
00754 pad_width = 1.30;
00755 pad_shape = g_strdup ("rectangular pad");
00756 pad_shapes_type = SQUARE;
00757 thermal = FALSE;
00758 thermal_length = 0.0;
00759 thermal_width = 0.0;
00760 fiducial = FALSE;
00761 fiducial_pad_diameter = 0.0;
00762 fiducial_pad_solder_mask_clearance = 0.0;
00763 silkscreen_length = 0.20;
00764 silkscreen_width = 1.20;
00765 silkscreen_line_width = 0.20;
00766 courtyard_length = 2.70;
00767 courtyard_width = 1.50;
00768 courtyard_line_width = 0.05;
00769 count_x = 0;
00770 count_y = 0;
00771 footprint_units = g_strdup ("mm");
00772 g_free (footprint_name);
00773 footprint_name = g_strdup ("DIOMELF1911L");
00774 if (verbose)
00775 {
00776 g_log ("", G_LOG_LEVEL_INFO,
00777 (_("%s is also known as")), footprint_name,
00778 " MicroMELF.");
00779 }
00780 return (EXIT_SUCCESS);
00781 }
00782 else if (!strcmp (footprint_name, "?DIOMELF1911M"))
00783 {
00784 pitch_y = 0.0;
00785 number_of_pins = 2;
00786 package_body_length = 2.00;
00787 package_body_width = 1.20;
00788 package_body_height = 1.20;
00789 package_is_radial = FALSE;
00790 number_of_columns = 0;
00791 number_of_rows = 0;
00792 pitch_x = 2.10;
00793 pad_length = 1.15;
00794 pad_width = 1.45;
00795 pad_shape = g_strdup ("rectangular pad");
00796 pad_shapes_type = SQUARE;
00797 thermal = FALSE;
00798 thermal_length = 0.0;
00799 thermal_width = 0.0;
00800 fiducial = FALSE;
00801 fiducial_pad_diameter = 0.0;
00802 fiducial_pad_solder_mask_clearance = 0.0;
00803 silkscreen_length = 0.20;
00804 silkscreen_width = 1.20;
00805 silkscreen_line_width = 0.20;
00806 courtyard_length = 4.30;
00807 courtyard_width = 2.50;
00808 courtyard_line_width = 0.05;
00809 count_x = 0;
00810 count_y = 0;
00811 footprint_units = g_strdup ("mm");
00812 g_free (footprint_name);
00813 footprint_name = g_strdup ("DIOMELF1911M");
00814 if (verbose)
00815 {
00816 g_log ("", G_LOG_LEVEL_INFO,
00817 (_("%s is also known as")), footprint_name,
00818 " MicroMELF.");
00819 }
00820 return (EXIT_SUCCESS);
00821 }
00822 else if (!strcmp (footprint_name, "?DIOMELF1911N"))
00823 {
00824 pitch_y = 0.0;
00825 number_of_pins = 2;
00826 package_body_length = 2.00;
00827 package_body_width = 1.20;
00828 package_body_height = 1.20;
00829 package_is_radial = FALSE;
00830 number_of_columns = 0;
00831 number_of_rows = 0;
00832 pitch_x = 2.00;
00833 pad_length = 0.85;
00834 pad_width = 1.35;
00835 pad_shape = g_strdup ("rectangular pad");
00836 pad_shapes_type = SQUARE;
00837 thermal = FALSE;
00838 thermal_length = 0.0;
00839 thermal_width = 0.0;
00840 fiducial = FALSE;
00841 fiducial_pad_diameter = 0.0;
00842 fiducial_pad_solder_mask_clearance = 0.0;
00843 silkscreen_length = 0.20;
00844 silkscreen_width = 1.20;
00845 silkscreen_line_width = 0.20;
00846 courtyard_length = 3.40;
00847 courtyard_width = 1.90;
00848 courtyard_line_width = 0.05;
00849 count_x = 0;
00850 count_y = 0;
00851 footprint_units = g_strdup ("mm");
00852 g_free (footprint_name);
00853 footprint_name = g_strdup ("DIOMELF1911N");
00854 if (verbose)
00855 {
00856 g_log ("", G_LOG_LEVEL_INFO,
00857 (_("%s is also known as")), footprint_name,
00858 " MicroMELF.");
00859 }
00860 return (EXIT_SUCCESS);
00861 }
00862 else if (!strcmp (footprint_name, "?DIOMELF3414L"))
00863 {
00864 pitch_y = 0.0;
00865 number_of_pins = 2;
00866 package_body_length = 3.60;
00867 package_body_width = 1.50;
00868 package_body_height = 1.50;
00869 package_is_radial = FALSE;
00870 number_of_columns = 0;
00871 number_of_rows = 0;
00872 pitch_x = 3.20;
00873 pad_length = 0.85;
00874 pad_width = 1.55;
00875 pad_shape = g_strdup ("rectangular pad");
00876 pad_shapes_type = SQUARE;
00877 thermal = FALSE;
00878 thermal_length = 0.0;
00879 thermal_width = 0.0;
00880 fiducial = FALSE;
00881 fiducial_pad_diameter = 0.0;
00882 fiducial_pad_solder_mask_clearance = 0.0;
00883 silkscreen_length = 1.60;
00884 silkscreen_width = 1.40;
00885 silkscreen_line_width = 0.20;
00886 courtyard_length = 4.30;
00887 courtyard_width = 1.80;
00888 courtyard_line_width = 0.05;
00889 count_x = 0;
00890 count_y = 0;
00891 footprint_units = g_strdup ("mm");
00892 g_free (footprint_name);
00893 footprint_name = g_strdup ("DIOMELF3414L");
00894 if (verbose)
00895 {
00896 g_log ("", G_LOG_LEVEL_INFO,
00897 (_("%s is also known as")), footprint_name,
00898 " LL-34.");
00899 }
00900 return (EXIT_SUCCESS);
00901 }
00902 else if (!strcmp (footprint_name, "?DIOMELF3414M"))
00903 {
00904 pitch_y = 0.0;
00905 number_of_pins = 2;
00906 package_body_length = 3.60;
00907 package_body_width = 1.50;
00908 package_body_height = 1.50;
00909 package_is_radial = FALSE;
00910 number_of_columns = 0;
00911 number_of_rows = 0;
00912 pitch_x = 3.40;
00913 pad_length = 1.40;
00914 pad_width = 1.75;
00915 pad_shape = g_strdup ("rectangular pad");
00916 pad_shapes_type = SQUARE;
00917 thermal = FALSE;
00918 thermal_length = 0.0;
00919 thermal_width = 0.0;
00920 fiducial = FALSE;
00921 fiducial_pad_diameter = 0.0;
00922 fiducial_pad_solder_mask_clearance = 0.0;
00923 silkscreen_length = 1.30;
00924 silkscreen_width = 1.40;
00925 silkscreen_line_width = 0.20;
00926 courtyard_length = 5.80;
00927 courtyard_width = 2.80;
00928 courtyard_line_width = 0.05;
00929 count_x = 0;
00930 count_y = 0;
00931 footprint_units = g_strdup ("mm");
00932 g_free (footprint_name);
00933 footprint_name = g_strdup ("DIOMELF3414M");
00934 if (verbose)
00935 {
00936 g_log ("", G_LOG_LEVEL_INFO,
00937 (_("%s is also known as")), footprint_name,
00938 " LL-34.");
00939 }
00940 return (EXIT_SUCCESS);
00941 }
00942 else if (!strcmp (footprint_name, "?DIOMELF3414N"))
00943 {
00944 pitch_y = 0.0;
00945 number_of_pins = 2;
00946 package_body_length = 3.60;
00947 package_body_width = 1.50;
00948 package_body_height = 1.50;
00949 package_is_radial = FALSE;
00950 number_of_columns = 0;
00951 number_of_rows = 0;
00952 pitch_x = 3.30;
00953 pad_length = 1.10;
00954 pad_width = 1.65;
00955 pad_shape = g_strdup ("rectangular pad");
00956 pad_shapes_type = SQUARE;
00957 thermal = FALSE;
00958 thermal_length = 0.0;
00959 thermal_width = 0.0;
00960 fiducial = FALSE;
00961 fiducial_pad_diameter = 0.0;
00962 fiducial_pad_solder_mask_clearance = 0.0;
00963 silkscreen_length = 1.50;
00964 silkscreen_width = 1.40;
00965 silkscreen_line_width = 0.20;
00966 courtyard_length = 4.90;
00967 courtyard_width = 2.20;
00968 courtyard_line_width = 0.05;
00969 count_x = 0;
00970 count_y = 0;
00971 footprint_units = g_strdup ("mm");
00972 g_free (footprint_name);
00973 footprint_name = g_strdup ("DIOMELF3414N");
00974 if (verbose)
00975 {
00976 g_log ("", G_LOG_LEVEL_INFO,
00977 (_("%s is also known as")), footprint_name,
00978 " SOD-80.");
00979 }
00980 return (EXIT_SUCCESS);
00981 }
00982 else if (!strcmp (footprint_name, "?DIOMELF3515L"))
00983 {
00984 pitch_y = 0.0;
00985 number_of_pins = 2;
00986 package_body_length = 3.70;
00987 package_body_width = 1.60;
00988 package_body_height = 1.60;
00989 package_is_radial = FALSE;
00990 number_of_columns = 0;
00991 number_of_rows = 0;
00992 pitch_x = 3.40;
00993 pad_length = 0.75;
00994 pad_width = 1.70;
00995 pad_shape = g_strdup ("rectangular pad");
00996 pad_shapes_type = SQUARE;
00997 thermal = FALSE;
00998 thermal_length = 0.0;
00999 thermal_width = 0.0;
01000 fiducial = FALSE;
01001 fiducial_pad_diameter = 0.0;
01002 fiducial_pad_solder_mask_clearance = 0.0;
01003 silkscreen_length = 1.90;
01004 silkscreen_width = 1.50;
01005 silkscreen_line_width = 0.20;
01006 courtyard_length = 4.40;
01007 courtyard_width = 1.90;
01008 courtyard_line_width = 0.05;
01009 count_x = 0;
01010 count_y = 0;
01011 footprint_units = g_strdup ("mm");
01012 g_free (footprint_name);
01013 footprint_name = g_strdup ("DIOMELF3515L");
01014 if (verbose)
01015 {
01016 g_log ("", G_LOG_LEVEL_INFO,
01017 (_("%s is also known as")), footprint_name,
01018 " IEC 100H01.");
01019 }
01020 return (EXIT_SUCCESS);
01021 }
01022 else if (!strcmp (footprint_name, "?DIOMELF3515M"))
01023 {
01024 pitch_y = 0.0;
01025 number_of_pins = 2;
01026 package_body_length = 3.70;
01027 package_body_width = 1.60;
01028 package_body_height = 1.60;
01029 package_is_radial = FALSE;
01030 number_of_columns = 0;
01031 number_of_rows = 0;
01032 pitch_x = 3.60;
01033 pad_length = 1.30;
01034 pad_width = 1.85;
01035 pad_shape = g_strdup ("rectangular pad");
01036 pad_shapes_type = SQUARE;
01037 thermal = FALSE;
01038 thermal_length = 0.0;
01039 thermal_width = 0.0;
01040 fiducial = FALSE;
01041 fiducial_pad_diameter = 0.0;
01042 fiducial_pad_solder_mask_clearance = 0.0;
01043 silkscreen_length = 1.60;
01044 silkscreen_width = 1.50;
01045 silkscreen_line_width = 0.20;
01046 courtyard_length = 5.90;
01047 courtyard_width = 2.90;
01048 courtyard_line_width = 0.05;
01049 count_x = 0;
01050 count_y = 0;
01051 footprint_units = g_strdup ("mm");
01052 g_free (footprint_name);
01053 footprint_name = g_strdup ("DIOMELF3515M");
01054 if (verbose)
01055 {
01056 g_log ("", G_LOG_LEVEL_INFO,
01057 (_("%s is also known as")), footprint_name,
01058 " IEC 100H01.");
01059 }
01060 return (EXIT_SUCCESS);
01061 }
01062 else if (!strcmp (footprint_name, "?DIOMELF3515N"))
01063 {
01064 pitch_y = 0.0;
01065 number_of_pins = 2;
01066 package_body_length = 3.70;
01067 package_body_width = 1.60;
01068 package_body_height = 1.60;
01069 package_is_radial = FALSE;
01070 number_of_columns = 0;
01071 number_of_rows = 0;
01072 pitch_x = 3.50;
01073 pad_length = 1.00;
01074 pad_width = 1.75;
01075 pad_shape = g_strdup ("rectangular pad");
01076 pad_shapes_type = SQUARE;
01077 thermal = FALSE;
01078 thermal_length = 0.0;
01079 thermal_width = 0.0;
01080 fiducial = FALSE;
01081 fiducial_pad_diameter = 0.0;
01082 fiducial_pad_solder_mask_clearance = 0.0;
01083 silkscreen_length = 1.80;
01084 silkscreen_width = 1.50;
01085 silkscreen_line_width = 0.20;
01086 courtyard_length = 5.00;
01087 courtyard_width = 2.30;
01088 courtyard_line_width = 0.05;
01089 count_x = 0;
01090 count_y = 0;
01091 footprint_units = g_strdup ("mm");
01092 g_free (footprint_name);
01093 footprint_name = g_strdup ("DIOMELF3515N");
01094 if (verbose)
01095 {
01096 g_log ("", G_LOG_LEVEL_INFO,
01097 (_("%s is also known as")), footprint_name,
01098 " IEC 100H01.");
01099 }
01100 return (EXIT_SUCCESS);
01101 }
01102 else if (!strcmp (footprint_name, "?DIOMELF3516L"))
01103 {
01104 pitch_y = 0.0;
01105 number_of_pins = 2;
01106 package_body_length = 3.70;
01107 package_body_width = 1.70;
01108 package_body_height = 1.70;
01109 package_is_radial = FALSE;
01110 number_of_columns = 0;
01111 number_of_rows = 0;
01112 pitch_x = 3.20;
01113 pad_length = 0.95;
01114 pad_width = 1.80;
01115 pad_shape = g_strdup ("rectangular pad");
01116 pad_shapes_type = SQUARE;
01117 thermal = FALSE;
01118 thermal_length = 0.0;
01119 thermal_width = 0.0;
01120 fiducial = FALSE;
01121 fiducial_pad_diameter = 0.0;
01122 fiducial_pad_solder_mask_clearance = 0.0;
01123 silkscreen_length = 1.50;
01124 silkscreen_width = 1.70;
01125 silkscreen_line_width = 0.20;
01126 courtyard_length = 4.40;
01127 courtyard_width = 2.00;
01128 courtyard_line_width = 0.05;
01129 count_x = 0;
01130 count_y = 0;
01131 footprint_units = g_strdup ("mm");
01132 g_free (footprint_name);
01133 footprint_name = g_strdup ("DIOMELF3516L");
01134 return (EXIT_SUCCESS);
01135 }
01136 else if (!strcmp (footprint_name, "?DIOMELF3516M"))
01137 {
01138 pitch_y = 0.0;
01139 number_of_pins = 2;
01140 package_body_length = 3.70;
01141 package_body_width = 1.70;
01142 package_body_height = 1.70;
01143 package_is_radial = FALSE;
01144 number_of_columns = 0;
01145 number_of_rows = 0;
01146 pitch_x = 3.40;
01147 pad_length = 1.50;
01148 pad_width = 1.95;
01149 pad_shape = g_strdup ("rectangular pad");
01150 pad_shapes_type = SQUARE;
01151 thermal = FALSE;
01152 thermal_length = 0.0;
01153 thermal_width = 0.0;
01154 fiducial = FALSE;
01155 fiducial_pad_diameter = 0.0;
01156 fiducial_pad_solder_mask_clearance = 0.0;
01157 silkscreen_length = 1.20;
01158 silkscreen_width = 1.70;
01159 silkscreen_line_width = 0.20;
01160 courtyard_length = 5.90;
01161 courtyard_width = 3.00;
01162 courtyard_line_width = 0.05;
01163 count_x = 0;
01164 count_y = 0;
01165 footprint_units = g_strdup ("mm");
01166 g_free (footprint_name);
01167 footprint_name = g_strdup ("DIOMELF3516M");
01168 return (EXIT_SUCCESS);
01169 }
01170 else if (!strcmp (footprint_name, "?DIOMELF3516N"))
01171 {
01172 pitch_y = 0.0;
01173 number_of_pins = 2;
01174 package_body_length = 3.70;
01175 package_body_width = 1.70;
01176 package_body_height = 1.70;
01177 package_is_radial = FALSE;
01178 number_of_columns = 0;
01179 number_of_rows = 0;
01180 pitch_x = 3.30;
01181 pad_length = 1.20;
01182 pad_width = 1.85;
01183 pad_shape = g_strdup ("rectangular pad");
01184 pad_shapes_type = SQUARE;
01185 thermal = FALSE;
01186 thermal_length = 0.0;
01187 thermal_width = 0.0;
01188 fiducial = FALSE;
01189 fiducial_pad_diameter = 0.0;
01190 fiducial_pad_solder_mask_clearance = 0.0;
01191 silkscreen_length = 1.40;
01192 silkscreen_width = 1.70;
01193 silkscreen_line_width = 0.20;
01194 courtyard_length = 5.00;
01195 courtyard_width = 2.40;
01196 courtyard_line_width = 0.05;
01197 count_x = 0;
01198 count_y = 0;
01199 footprint_units = g_strdup ("mm");
01200 g_free (footprint_name);
01201 footprint_name = g_strdup ("DIOMELF3516N");
01202 return (EXIT_SUCCESS);
01203 }
01204 else if (!strcmp (footprint_name, "?DIOMELF3520L"))
01205 {
01206 pitch_y = 0.0;
01207 number_of_pins = 2;
01208 package_body_length = 3.70;
01209 package_body_width = 2.10;
01210 package_body_height = 2.10;
01211 package_is_radial = FALSE;
01212 number_of_columns = 0;
01213 number_of_rows = 0;
01214 pitch_x = 3.40;
01215 pad_length = 0.75;
01216 pad_width = 2.20;
01217 pad_shape = g_strdup ("rectangular pad");
01218 pad_shapes_type = SQUARE;
01219 thermal = FALSE;
01220 thermal_length = 0.0;
01221 thermal_width = 0.0;
01222 fiducial = FALSE;
01223 fiducial_pad_diameter = 0.0;
01224 fiducial_pad_solder_mask_clearance = 0.0;
01225 silkscreen_length = 1.90;
01226 silkscreen_width = 2.10;
01227 silkscreen_line_width = 0.20;
01228 courtyard_length = 4.40;
01229 courtyard_width = 2.40;
01230 courtyard_line_width = 0.05;
01231 count_x = 0;
01232 count_y = 0;
01233 footprint_units = g_strdup ("mm");
01234 g_free (footprint_name);
01235 footprint_name = g_strdup ("DIOMELF3520L");
01236 return (EXIT_SUCCESS);
01237 }
01238 else if (!strcmp (footprint_name, "?DIOMELF3520M"))
01239 {
01240 pitch_y = 0.0;
01241 number_of_pins = 2;
01242 package_body_length = 3.70;
01243 package_body_width = 2.10;
01244 package_body_height = 2.10;
01245 package_is_radial = FALSE;
01246 number_of_columns = 0;
01247 number_of_rows = 0;
01248 pitch_x = 3.60;
01249 pad_length = 1.30;
01250 pad_width = 2.35;
01251 pad_shape = g_strdup ("rectangular pad");
01252 pad_shapes_type = SQUARE;
01253 thermal = FALSE;
01254 thermal_length = 0.0;
01255 thermal_width = 0.0;
01256 fiducial = FALSE;
01257 fiducial_pad_diameter = 0.0;
01258 fiducial_pad_solder_mask_clearance = 0.0;
01259 silkscreen_length = 1.60;
01260 silkscreen_width = 2.10;
01261 silkscreen_line_width = 0.20;
01262 courtyard_length = 5.90;
01263 courtyard_width = 3.40;
01264 courtyard_line_width = 0.05;
01265 count_x = 0;
01266 count_y = 0;
01267 footprint_units = g_strdup ("mm");
01268 g_free (footprint_name);
01269 footprint_name = g_strdup ("DIOMELF3520M");
01270 if (verbose)
01271 {
01272 g_log ("", G_LOG_LEVEL_INFO,
01273 (_("%s is also known as")), footprint_name,
01274 " IEC 100H03.");
01275 }
01276 return (EXIT_SUCCESS);
01277 }
01278 else if (!strcmp (footprint_name, "?DIOMELF3520N"))
01279 {
01280 pitch_y = 0.0;
01281 number_of_pins = 2;
01282 package_body_length = 3.70;
01283 package_body_width = 2.10;
01284 package_body_height = 2.10;
01285 package_is_radial = FALSE;
01286 number_of_columns = 0;
01287 number_of_rows = 0;
01288 pitch_x = 3.50;
01289 pad_length = 1.00;
01290 pad_width = 2.25;
01291 pad_shape = g_strdup ("rectangular pad");
01292 pad_shapes_type = SQUARE;
01293 thermal = FALSE;
01294 thermal_length = 0.0;
01295 thermal_width = 0.0;
01296 fiducial = FALSE;
01297 fiducial_pad_diameter = 0.0;
01298 fiducial_pad_solder_mask_clearance = 0.0;
01299 silkscreen_length = 1.80;
01300 silkscreen_width = 2.10;
01301 silkscreen_line_width = 0.20;
01302 courtyard_length = 5.00;
01303 courtyard_width = 2.80;
01304 courtyard_line_width = 0.05;
01305 count_x = 0;
01306 count_y = 0;
01307 footprint_units = g_strdup ("mm");
01308 g_free (footprint_name);
01309 footprint_name = g_strdup ("DIOMELF3520N");
01310 if (verbose)
01311 {
01312 g_log ("", G_LOG_LEVEL_INFO,
01313 (_("%s is also known as")), footprint_name,
01314 " IEC 100H03.");
01315 }
01316 return (EXIT_SUCCESS);
01317 }
01318 else
01319 {
01320 if (verbose)
01321 {
01322 g_log ("", G_LOG_LEVEL_WARNING,
01323 _("default values for footprint %s not found.\n"),
01324 footprint_name);
01325 }
01326 return (EXIT_FAILURE);
01327 }
01328 return (EXIT_FAILURE);
01329 }
01330
01331
01339 #if GUI
01340 int
01341 diomelf_set_gui_constraints ()
01342 {
01343
01344 GtkWidget *package_is_radial_checkbutton = lookup_widget (GTK_WIDGET (widget),
01345 "package_is_radial_checkbutton");
01346 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (package_is_radial_checkbutton), FALSE);
01347 gtk_widget_set_sensitive (package_is_radial_checkbutton, FALSE);
01348
01349
01350 GtkWidget *number_of_columns_entry = lookup_widget (GTK_WIDGET (widget),
01351 "number_of_columns_entry");
01352 gtk_entry_set_text (GTK_ENTRY (number_of_columns_entry), "2");
01353 gtk_widget_set_sensitive (number_of_columns_entry, FALSE);
01354 GtkWidget *number_of_rows_entry = lookup_widget (GTK_WIDGET (widget),
01355 "number_of_rows_entry");
01356 gtk_entry_set_text (GTK_ENTRY (number_of_rows_entry), "1");
01357 gtk_widget_set_sensitive (number_of_rows_entry, FALSE);
01358 GtkWidget *pitch_y_entry = lookup_widget (GTK_WIDGET (widget),
01359 "pitch_y_entry");
01360 gtk_entry_set_text (GTK_ENTRY (pitch_y_entry), "");
01361 gtk_widget_set_sensitive (pitch_y_entry, FALSE);
01362 GtkWidget *count_x_entry = lookup_widget (GTK_WIDGET (widget),
01363 "count_x_entry");
01364 gtk_entry_set_text (GTK_ENTRY (count_x_entry), "");
01365 gtk_widget_set_sensitive (count_x_entry, FALSE);
01366 GtkWidget *count_y_entry = lookup_widget (GTK_WIDGET (widget),
01367 "count_y_entry");
01368 gtk_entry_set_text (GTK_ENTRY (count_y_entry), "");
01369 gtk_widget_set_sensitive (count_y_entry, FALSE);
01370 GtkWidget *number_1_position_entry = lookup_widget (GTK_WIDGET (widget),
01371 "number_1_position_entry");
01372 gtk_combo_box_set_active (GTK_COMBO_BOX (number_1_position_entry), UPPER_LEFT);
01373 gtk_widget_set_sensitive (number_1_position_entry, FALSE);
01374
01375
01376 gui_constraints_disable_thermal_tab_widgets (widget);
01377
01378
01379 gui_constraints_disable_heel_and_toe_goals_tab_widgets (widget);
01380 return (EXIT_SUCCESS);
01381 }
01382 #endif
01383
01384
01391 int
01392 diomelf_write_footprint ()
01393 {
01394 gdouble xmax;
01395 gdouble xmin;
01396 gdouble ymax;
01397 gdouble ymin;
01398 gdouble x_text;
01399 gdouble y_text;
01400 gchar *pin_pad_flags = g_strdup ("");
01401
01402
01403 fp = fopen (footprint_filename, "w");
01404 if (!fp)
01405 {
01406 if (verbose)
01407 {
01408 g_log ("", G_LOG_LEVEL_WARNING,
01409 _("could not open file for %s footprint: %s."),
01410 footprint_type, footprint_filename);
01411 }
01412 fclose (fp);
01413 return (EXIT_FAILURE);
01414 }
01415
01416 if (license_in_footprint)
01417 {
01418 write_license ();
01419 }
01420
01421
01422 xmin = multiplier * ((-pitch_x / 2.0) - (pad_length / 2.0) - pad_solder_mask_clearance);
01423 xmax = multiplier * (pitch_x / 2.0 + pad_length / 2.0 + pad_solder_mask_clearance);
01424 ymin = multiplier * ((-pad_width / 2.0) - pad_solder_mask_clearance);
01425 ymax = multiplier * (pad_width / 2.0 + pad_solder_mask_clearance);
01426
01427
01428 if ((multiplier * ((-package_body_length / 2.0) - courtyard_clearance_with_package)) < xmin)
01429 xmin = (multiplier * ((-package_body_length / 2.0) - courtyard_clearance_with_package));
01430 if ((multiplier * ((package_body_length / 2.0) + courtyard_clearance_with_package)) > xmax)
01431 xmax = (multiplier * ((package_body_length / 2.0) + courtyard_clearance_with_package));
01432 if ((multiplier * ((-package_body_width / 2.0) - courtyard_clearance_with_package)) < ymin)
01433 ymin = (multiplier * ((-package_body_width / 2.0) - courtyard_clearance_with_package));
01434 if ((multiplier * ((package_body_width / 2.0) + courtyard_clearance_with_package)) > ymax)
01435 ymax = (multiplier * ((package_body_width / 2.0) + courtyard_clearance_with_package));
01436
01437 if (multiplier * (-courtyard_length / 2.0) < xmin)
01438 xmin = multiplier * (-courtyard_length / 2.0);
01439 if (multiplier * (courtyard_length / 2.0) > xmax)
01440 xmax = multiplier * (courtyard_length / 2.0);
01441 if (multiplier * (-courtyard_width / 2.0) < ymin)
01442 ymin = multiplier * (-courtyard_width / 2.0);
01443 if (multiplier * (courtyard_width / 2.0) > ymax)
01444 ymax = multiplier * (courtyard_width / 2.0);
01445
01446
01447 x_text = 0.0 ;
01448 y_text = (ymin - 10000.0);
01449 write_element_header (x_text, y_text);
01450
01451 if (!strcmp (pad_shape, "rectangular pad"))
01452 pin_pad_flags = g_strdup ("square");
01453 if (pad_length > pad_width)
01454 {
01455
01456 write_pad
01457 (
01458 1,
01459 "C",
01460 multiplier * ((-pitch_x - pad_length + pad_width) / 2.0),
01461 0,
01462 multiplier * ((-pitch_x + pad_length - pad_width) / 2.0),
01463 0,
01464 multiplier * pad_width,
01465 multiplier * pad_clearance,
01466 multiplier * (pad_width + (2 * pad_solder_mask_clearance)),
01467
01468 (pin1_square) ? "square" : pin_pad_flags
01469 );
01470
01471 write_pad
01472 (
01473 2,
01474 "A",
01475 multiplier * ((pitch_x - pad_length + pad_width) / 2.0),
01476 0,
01477 multiplier * ((pitch_x + pad_length - pad_width) / 2.0),
01478 0,
01479 multiplier * pad_width,
01480 multiplier * pad_clearance,
01481 multiplier * (pad_width + (2 * pad_solder_mask_clearance)),
01482 pin_pad_flags
01483 );
01484 }
01485 else
01486 {
01487
01488 write_pad
01489 (
01490 1,
01491 "C",
01492 multiplier * (-pitch_x / 2.0),
01493 multiplier * ((pad_width - pad_length) / 2.0),
01494 multiplier * (-pitch_x / 2),
01495 multiplier * ((-pad_width + pad_length) / 2.0),
01496 multiplier * pad_length,
01497 multiplier * pad_clearance,
01498 multiplier * (pad_length + (2 * pad_solder_mask_clearance)),
01499
01500 (pin1_square) ? "square" : pin_pad_flags
01501 );
01502
01503 write_pad
01504 (
01505 2,
01506 "A",
01507 multiplier * (pitch_x / 2.0),
01508 multiplier * ((pad_width - pad_length) / 2.0),
01509 multiplier * (pitch_x / 2.0),
01510 multiplier * ((-pad_width + pad_length) / 2.0),
01511 multiplier * pad_length,
01512 multiplier * pad_clearance,
01513 multiplier * (pad_length + (2 * pad_solder_mask_clearance)),
01514 pin_pad_flags
01515 );
01516 }
01517
01518 if (silkscreen_package_outline && (package_body_width))
01519 {
01520 fprintf (fp, "# Write a package body on the silkscreen\n");
01521 if (pad_width >= package_body_width)
01522 {
01523 write_element_line
01524 (
01525 multiplier * (((-pitch_x + pad_length) / 2.0) + pad_solder_mask_clearance + silkscreen_line_width),
01526 multiplier * (package_body_width / 2.0),
01527 multiplier * (((pitch_x - pad_length) / 2.0) - pad_solder_mask_clearance - silkscreen_line_width),
01528 multiplier * (package_body_width / 2.0),
01529 multiplier * silkscreen_line_width
01530 );
01531 write_element_line
01532 (
01533 multiplier * (((-pitch_x + pad_length) / 2.0) + pad_solder_mask_clearance + silkscreen_line_width),
01534 multiplier * (-package_body_width / 2.0),
01535 multiplier * (((pitch_x - pad_length) / 2.0) - pad_solder_mask_clearance - silkscreen_line_width),
01536 multiplier * (-package_body_width / 2.0),
01537 multiplier * silkscreen_line_width
01538 );
01539 }
01540 else
01541 {
01542
01543 write_element_line
01544 (
01545 multiplier * (-package_body_length / 2.0),
01546 multiplier * (package_body_width / 2.0),
01547 multiplier * (package_body_length / 2.0),
01548 multiplier * (package_body_width / 2.0),
01549 multiplier * silkscreen_line_width
01550 );
01551 write_element_line
01552 (
01553 multiplier * (-package_body_length / 2.0),
01554 multiplier * (-package_body_width / 2.0),
01555 multiplier * (package_body_length / 2.0),
01556 multiplier * (-package_body_width / 2.0),
01557 multiplier * silkscreen_line_width
01558 );
01559
01560 write_element_line
01561 (
01562 multiplier * (-package_body_length / 2.0),
01563 multiplier * (-package_body_width / 2.0),
01564 multiplier * (-package_body_length / 2.0),
01565 multiplier * (((-pad_width - silkscreen_line_width) / 2.0) - pad_solder_mask_clearance),
01566 multiplier * silkscreen_line_width
01567 );
01568 write_element_line
01569 (
01570 multiplier * (-package_body_length / 2.0),
01571 multiplier * (package_body_width / 2.0),
01572 multiplier * (-package_body_length / 2.0),
01573 multiplier * (((pad_width + silkscreen_line_width) / 2.0) + pad_solder_mask_clearance),
01574 multiplier * silkscreen_line_width
01575 );
01576 write_element_line
01577 (
01578 multiplier * (package_body_length / 2.0),
01579 multiplier * (-package_body_width / 2.0),
01580 multiplier * (package_body_length / 2.0),
01581 multiplier * (((-pad_width - silkscreen_line_width) / 2.0) - pad_solder_mask_clearance),
01582 multiplier * silkscreen_line_width
01583 );
01584 write_element_line
01585 (
01586 multiplier * (package_body_length / 2.0),
01587 multiplier * (package_body_width / 2.0),
01588 multiplier * (package_body_length / 2.0),
01589 multiplier * (((pad_width + silkscreen_line_width) / 2.0) + pad_solder_mask_clearance),
01590 multiplier * silkscreen_line_width
01591 );
01592 }
01593 }
01594
01595 if (silkscreen_indicate_1)
01596 {
01597 fprintf (fp, "# Write a pin 1 marker on the silkscreen\n");
01598 if (pad_width >= package_body_width)
01599 {
01600 write_element_line
01601 (
01602 multiplier * (((-pitch_x + pad_length) / 2.0) + pad_solder_mask_clearance + silkscreen_line_width),
01603 multiplier * (-package_body_width / 2.0),
01604 multiplier * (((-pitch_x + pad_length) / 2.0) + pad_solder_mask_clearance + silkscreen_line_width),
01605 multiplier * (package_body_width / 2.0),
01606 multiplier * silkscreen_line_width
01607 );
01608 }
01609 else
01610 {
01611 write_element_arc
01612 (
01613 multiplier * (((-package_body_length) / 2.0) - 2 * silkscreen_line_width),
01614 multiplier * (-package_body_width / 2.0),
01615 multiplier * 0.5 * silkscreen_line_width,
01616 multiplier * 0.5 * silkscreen_line_width,
01617 0,
01618 360,
01619 multiplier * silkscreen_line_width
01620 );
01621 }
01622 }
01623
01624 if (courtyard)
01625 {
01626 fprintf (fp, "# Write a courtyard on the silkscreen\n");
01627 write_rectangle
01628 (
01629 xmin,
01630 ymin,
01631 xmax,
01632 ymax,
01633 multiplier * courtyard_line_width
01634 );
01635 }
01636
01637 if (attributes_in_footprint)
01638 {
01639 write_attributes ();
01640 }
01641
01642 fprintf (fp, "\n");
01643 fprintf (fp, ")\n");
01644 fclose (fp);
01645
01646 if (verbose)
01647 {
01648 g_log ("", G_LOG_LEVEL_INFO,
01649 _("wrote a footprint for a %s package: %s."),
01650 footprint_type,
01651 footprint_filename);
01652 }
01653 return (EXIT_SUCCESS);
01654 }
01655
01656
01660 static fpw_function_t
01661 diomelf_function_list[] =
01662 {
01663 #if GUI
01664 {
01665 "Set GUI constraints",
01666 diomelf_set_gui_constraints,
01667 "Set GUI constraints for a DIOMELF package",
01668 NULL
01669 },
01670 #endif
01671 {
01672 "Create Element",
01673 diomelf_create_element,
01674 "Create a pcb element for a DIOMELF package",
01675 NULL
01676 },
01677 {
01678 "Create Packages List",
01679 diomelf_create_packages_list,
01680 "Create a list of known DIOMELF packages",
01681 NULL
01682 },
01683 {
01684 "DRC DIOM Element",
01685 diomelf_drc,
01686 "Design Rule Check for a DIOMELF package",
01687 NULL
01688 },
01689 {
01690 "Default Element Values",
01691 diomelf_get_default_footprint_values,
01692 "Get default values for a DIOMELF package",
01693 NULL
01694 },
01695 {
01696 "Write footprint",
01697 diomelf_write_footprint,
01698 "Write a footprint for a DIOMELF package",
01699 NULL
01700 }
01701 };
01702
01703
01707 REGISTER_FUNCTIONS (diomelf_function_list)
01708
01709
01710
01713 void
01714 diomelf_init ()
01715 {
01716 register_diomelf_function_list ();
01717 }
01718
01719
01720