Beispiel #1
0
/* ---------------------------------------------------------------------------
 * creates a new pad in an element
 */
PadTypePtr
CreateNewPad (ElementTypePtr Element,
	      LocationType X1, LocationType Y1, LocationType X2,
	      LocationType Y2, BDimension Thickness, BDimension Clearance,
	      BDimension Mask, char *Name, char *Number, FlagType Flags)
{
  PadTypePtr pad = GetPadMemory (Element);

  /* copy values */
  if (X1 > X2 || (X1 == X2 && Y1 > Y2))
    {
      pad->Point1.X = X2;
      pad->Point1.Y = Y2;
      pad->Point2.X = X1;
      pad->Point2.Y = Y1;
    }
  else
    {
      pad->Point1.X = X1;
      pad->Point1.Y = Y1;
      pad->Point2.X = X2;
      pad->Point2.Y = Y2;
    }
  pad->Thickness = Thickness;
  pad->Clearance = Clearance;
  pad->Mask = Mask;
  pad->Name = STRDUP (Name);
  pad->Number = STRDUP (Number);
  pad->Flags = Flags;
  CLEAR_FLAG (WARNFLAG, pad);
  pad->ID = ID++;
  pad->Element = Element;
  return (pad);
}
Beispiel #2
0
/*!
 * \brief Creates a new pad in an element.
 */
PadType *
CreateNewPad (ElementType *Element,
	      Coord X1, Coord Y1, Coord X2,
	      Coord Y2, Coord Thickness, Coord Clearance,
	      Coord Mask, char *Name, char *Number, FlagType Flags)
{
  PadType *pad = GetPadMemory (Element);

  /* copy values */
  if (X1 > X2 || (X1 == X2 && Y1 > Y2))
    {
      pad->Point1.X = X2;
      pad->Point1.Y = Y2;
      pad->Point2.X = X1;
      pad->Point2.Y = Y1;
    }
  else
    {
      pad->Point1.X = X1;
      pad->Point1.Y = Y1;
      pad->Point2.X = X2;
      pad->Point2.Y = Y2;
    }
  pad->Thickness = Thickness;
  pad->Clearance = Clearance;
  pad->Mask = Mask;
  pad->Name = STRDUP (Name);
  pad->Number = STRDUP (Number);
  pad->Flags = Flags;
  CLEAR_FLAG (WARNFLAG, pad);
  pad->ID = ID++;
  pad->Element = Element;
  return (pad);
}