diff --git a/AUTHORS.txt b/AUTHORS.txt index 2129a8113c..fcdafc392e 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -42,6 +42,7 @@ Cheng Sheng Google Inc. Kristoffer Ödmark Oliver Walters Jon Evans +Russell Oliver See also CHANGELOG.txt for contributors. diff --git a/Documentation/eagle-plugin-notes.txt b/Documentation/eagle-plugin-notes.txt new file mode 100644 index 0000000000..b4b23bd0a7 --- /dev/null +++ b/Documentation/eagle-plugin-notes.txt @@ -0,0 +1,39 @@ +Eagle Plugin Implementation Notes. 2017 Russell Oliver + +Below is some notes on the correspondence between Eagle schematics and symbols libraries and the +KiCad equivalent. + +Eagle libraries are a many to many listing of symbols and footprints connected by a device set and +device definitions. They are embedded in the schematic and board files if there are used, and +therefore the schematic symbols and footprints can be recovered from either file. + +An Eagle device set definition is the information needed to represent a physical part at the +schematic level including the functional gates of the device. Each gate is lists the symbol to be +displayed for that gate. This is equivalent to a KiCad symbol unit. Since the symbol is defined +outside of the device set, multiple devices sets in the library can use the same symbol for a gate. +Lower to a device set, is the device definition. This establishes the link between the schematic +symbols and a physical part through the 'connect' elements. These map the symbol pins for each gate +to the physical pins provided by the package (footprint) definition. An Eagle Symbol outlines the +layout of graphical of items including pins. Pins for multi gate symbols are generally labelled +per their function, i.e. input / output. An Eagle symbol pin is not numbered but merely labelled. A +connect element gives the pad number for each pin found in that gate. Therefore the equivalent +KiCad pin number is read from the connect element pad number. Since an Eagle gate is equivalent to +a KiCad symbol unit, the graphical items for that unit will be copied from the Eagle symbol for +that gate and will be unique for that unit. This will yield duplication of the graphical elements +if the same symbol is used for multiple gates but the conversion will be complete. + +An Eagle sheet contains a list of instances, which are equivalent to KiCad schematic component +entries. An instance describes the part, the gate used and its location on the sheet. This is +translated into the equivalent KiCad symbol with the given unit number. + +Eagle 'plain' items describe graphical items with no electrical connection, such as note text, +lines etc. Of importance is the use of wire elements to describe both electrical connections and +graphical items. A wire element will act as an electrical connection when defined within a net and +segment. Anywhere else it is a graphical line. The layer for the wire element will change the +displayed colour for the wire. Connections between regular wires and busses occur when a wire ends +on a bus segment. When translated to KiCad a bus connection symbol is created. Within an Eagle +schematic there can be multiple sheets in a flat hierarchy. For each sheet, there is a list of +electrically connected nets. Each net is broken up into graphically connected segments, defined by +a list of wires and labels. Labels remain associate with wires of that net segment, even if they +are not located on a wire element. This necessitates the movement of such a label to the nearest +wire segment within KiCad. diff --git a/common/eagle_parser.cpp b/common/eagle_parser.cpp index e63b30bea2..e56c8ea154 100644 --- a/common/eagle_parser.cpp +++ b/common/eagle_parser.cpp @@ -26,13 +26,71 @@ #include -#include -#include -#include +#include +#include +#include +#include -#include +constexpr auto DEFAULT_ALIGNMENT = ETEXT::BOTTOM_LEFT; + + +ECOORD::ECOORD( const wxString& aValue, enum ECOORD::UNIT aUnit ) +{ + // this array is used to adjust the fraction part value basing on the number of digits in the fraction + constexpr int DIVIDERS[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000 }; + constexpr unsigned int DIVIDERS_MAX_IDX = sizeof( DIVIDERS ) / sizeof( DIVIDERS[0] ) - 1; + + int integer, fraction, pre_fraction, post_fraction; + + // the following check is needed to handle correctly negative fractions where the integer part == 0 + bool negative = ( aValue[0] == '-' ); + + // %n is used to find out how many digits contains the fraction part, e.g. 0.001 contains 3 digits + int ret = sscanf( aValue.c_str(), "%d.%n%d%n", &integer, &pre_fraction, &fraction, &post_fraction ); + + if( ret == 0 ) + throw XML_PARSER_ERROR( "Invalid coordinate" ); + + // process the integer part + value = ToNanoMeters( integer, aUnit ); + + // process the fraction part + if( ret == 2 ) + { + int digits = post_fraction - pre_fraction; + + // adjust the number of digits if necessary as we cannot handle anything smaller than nanometers (rounding) + if( (unsigned) digits > DIVIDERS_MAX_IDX ) + { + int diff = digits - DIVIDERS_MAX_IDX; + digits = DIVIDERS_MAX_IDX; + fraction /= DIVIDERS[diff]; + } + + int frac_value = ToNanoMeters( fraction, aUnit ) / DIVIDERS[digits]; + + // keep the sign in mind + value = negative ? value - frac_value : value + frac_value; + } +} + + +long long int ECOORD::ToNanoMeters( int aValue, enum UNIT aUnit ) +{ + long long int ret; + + switch( aUnit ) + { + case NM: ret = aValue; break; + case MM: ret = (long long) aValue * 1000000; break; + case INCH: ret = (long long) aValue * 25400000; break; + case MIL: ret = (long long) aValue * 25400; break; + } + + wxASSERT( ( ret > 0 ) == ( aValue > 0 ) ); // check for overflow + return ret; +} -using std::string; // Template specializations below parse wxString to the used types: // - string @@ -40,12 +98,12 @@ using std::string; // - int // - bool // - EROT - +// - ECOORD template<> string Convert( const wxString& aValue ) { - return aValue.ToStdString(); + return string( aValue.ToUTF8() ); } @@ -102,6 +160,15 @@ EROT Convert( const wxString& aRot ) return value; } + +template<> +ECOORD Convert( const wxString& aCoord ) +{ + // Eagle uses millimeters as the default unit + return ECOORD( aCoord, ECOORD::UNIT::MM ); +} + + /** * Function parseRequiredAttribute * parsese the aAttribute of the XML node aNode. @@ -111,7 +178,7 @@ EROT Convert( const wxString& aRot ) * @return T - the attributed parsed as the specified type. */ template -T parseRequiredAttribute( wxXmlNode* aNode, string aAttribute ) +T parseRequiredAttribute( wxXmlNode* aNode, const string& aAttribute ) { wxString value; @@ -130,12 +197,101 @@ T parseRequiredAttribute( wxXmlNode* aNode, string aAttribute ) * found. */ template -OPTIONAL_XML_ATTRIBUTE parseOptionalAttribute( wxXmlNode* aNode, string aAttribute ) +OPTIONAL_XML_ATTRIBUTE parseOptionalAttribute( wxXmlNode* aNode, const string& aAttribute ) { return OPTIONAL_XML_ATTRIBUTE( aNode->GetAttribute( aAttribute ) ); } +NODE_MAP MapChildren( wxXmlNode* aCurrentNode ) +{ + // Map node_name -> node_pointer + NODE_MAP nodesMap; + + // Loop through all children mapping them in nodesMap + if( aCurrentNode ) + aCurrentNode = aCurrentNode->GetChildren(); + + while( aCurrentNode ) + { + // Create a new pair in the map + // key: current node name + // value: current node pointer + nodesMap[aCurrentNode->GetName().ToStdString()] = aCurrentNode; + + // Get next child + aCurrentNode = aCurrentNode->GetNext(); + } + + return nodesMap; +} + + +unsigned long EagleTimeStamp( wxXmlNode* aTree ) +{ + // in this case from a unique tree memory location + return (unsigned long)(void*) aTree; +} + + +time_t EagleModuleTstamp( const string& aName, const string& aValue, int aUnit ) +{ + std::size_t h1 = std::hash{}( aName ); + std::size_t h2 = std::hash{}( aValue ); + std::size_t h3 = std::hash{}( aUnit ); + + return h1 ^ (h2 << 1) ^ (h3 << 2); +} + + +wxPoint ConvertArcCenter( const wxPoint& aStart, const wxPoint& aEnd, double aAngle ) +{ + // Eagle give us start and end. + // S_ARC wants start to give the center, and end to give the start. + double dx = aEnd.x - aStart.x, dy = aEnd.y - aStart.y; + wxPoint mid = ( aStart + aEnd ) / 2; + + double dlen = sqrt( dx*dx + dy*dy ); + wxASSERT( dlen != 0 ); + wxASSERT( aAngle != 0 ); + double dist = dlen / ( 2 * tan( DEG2RAD( aAngle ) / 2 ) ); + + wxPoint center( + mid.x + dist * ( dy / dlen ), + mid.y - dist * ( dx / dlen ) + ); + + return center; +} + + +static int parseAlignment( const wxString& aAlignment ) +{ + // (bottom-left | bottom-center | bottom-right | center-left | + // center | center-right | top-left | top-center | top-right) + if( aAlignment == "center" ) + return ETEXT::CENTER; + else if( aAlignment == "center-right" ) + return ETEXT::CENTER_RIGHT; + else if( aAlignment == "top-left" ) + return ETEXT::TOP_LEFT; + else if( aAlignment == "top-center" ) + return ETEXT::TOP_CENTER; + else if( aAlignment == "top-right" ) + return ETEXT::TOP_RIGHT; + else if( aAlignment == "bottom-left" ) + return ETEXT::BOTTOM_LEFT; + else if( aAlignment == "bottom-center" ) + return ETEXT::BOTTOM_CENTER; + else if( aAlignment == "bottom-right" ) + return ETEXT::BOTTOM_RIGHT; + else if( aAlignment == "center-left" ) + return ETEXT::CENTER_LEFT; + + return DEFAULT_ALIGNMENT; +} + + EWIRE::EWIRE( wxXmlNode* aWire ) { /* @@ -154,11 +310,11 @@ EWIRE::EWIRE( wxXmlNode* aWire ) > */ - x1 = parseRequiredAttribute( aWire, "x1" ); - y1 = parseRequiredAttribute( aWire, "y1" ); - x2 = parseRequiredAttribute( aWire, "x2" ); - y2 = parseRequiredAttribute( aWire, "y2" ); - width = parseRequiredAttribute( aWire, "width" ); + x1 = parseRequiredAttribute( aWire, "x1" ); + y1 = parseRequiredAttribute( aWire, "y1" ); + x2 = parseRequiredAttribute( aWire, "x2" ); + y2 = parseRequiredAttribute( aWire, "y2" ); + width = parseRequiredAttribute( aWire, "width" ); layer = parseRequiredAttribute( aWire, "layer" ); curve = parseOptionalAttribute( aWire, "curve" ); @@ -182,6 +338,47 @@ EWIRE::EWIRE( wxXmlNode* aWire ) } +EJUNCTION::EJUNCTION( wxXmlNode* aJunction ) +{ + /* + + + */ + + x = parseRequiredAttribute( aJunction, "x" ); + y = parseRequiredAttribute( aJunction, "y" ); +} + + +ELABEL::ELABEL( wxXmlNode* aLabel, const wxString& aNetName ) +{ + /* + + + */ + + x = parseRequiredAttribute( aLabel, "x" ); + y = parseRequiredAttribute( aLabel, "y" ); + size = parseRequiredAttribute( aLabel, "size" ); + layer = parseRequiredAttribute( aLabel, "layer" ); + rot = parseOptionalAttribute( aLabel, "rot" ); + xref = parseOptionalAttribute( aLabel, "xref" ); + netname = aNetName; +} + + EVIA::EVIA( wxXmlNode* aVia ) { /* @@ -197,15 +394,15 @@ EVIA::EVIA( wxXmlNode* aVia ) > */ - x = parseRequiredAttribute( aVia, "x" ); - y = parseRequiredAttribute( aVia, "y" ); + x = parseRequiredAttribute( aVia, "x" ); + y = parseRequiredAttribute( aVia, "y" ); string ext = parseRequiredAttribute( aVia, "extent" ); sscanf( ext.c_str(), "%d-%d", &layer_front_most, &layer_back_most ); - drill = parseRequiredAttribute( aVia, "drill" ); - diam = parseOptionalAttribute( aVia, "diameter" ); + drill = parseRequiredAttribute( aVia, "drill" ); + diam = parseOptionalAttribute( aVia, "diameter" ); shape = parseOptionalAttribute( aVia, "shape" ); } @@ -223,10 +420,10 @@ ECIRCLE::ECIRCLE( wxXmlNode* aCircle ) > */ - x = parseRequiredAttribute( aCircle, "x" ); - y = parseRequiredAttribute( aCircle, "y" ); - radius = parseRequiredAttribute( aCircle, "radius" ); - width = parseRequiredAttribute( aCircle, "width" ); + x = parseRequiredAttribute( aCircle, "x" ); + y = parseRequiredAttribute( aCircle, "y" ); + radius = parseRequiredAttribute( aCircle, "radius" ); + width = parseRequiredAttribute( aCircle, "width" ); layer = parseRequiredAttribute( aCircle, "layer" ); } @@ -245,10 +442,10 @@ ERECT::ERECT( wxXmlNode* aRect ) > */ - x1 = parseRequiredAttribute( aRect, "x1" ); - y1 = parseRequiredAttribute( aRect, "y1" ); - x2 = parseRequiredAttribute( aRect, "x2" ); - y2 = parseRequiredAttribute( aRect, "y2" ); + x1 = parseRequiredAttribute( aRect, "x1" ); + y1 = parseRequiredAttribute( aRect, "y1" ); + x2 = parseRequiredAttribute( aRect, "x2" ); + y2 = parseRequiredAttribute( aRect, "y2" ); layer = parseRequiredAttribute( aRect, "layer" ); rot = parseOptionalAttribute( aRect, "rot" ); } @@ -276,9 +473,9 @@ EATTR::EATTR( wxXmlNode* aTree ) name = parseRequiredAttribute( aTree, "name" ); value = parseOptionalAttribute( aTree, "value" ); - x = parseOptionalAttribute( aTree, "x" ); - y = parseOptionalAttribute( aTree, "y" ); - size = parseOptionalAttribute( aTree, "size" ); + x = parseOptionalAttribute( aTree, "x" ); + y = parseOptionalAttribute( aTree, "y" ); + size = parseOptionalAttribute( aTree, "size" ); // KiCad cannot currently put a TEXTE_MODULE on a different layer than the MODULE // Eagle can it seems. @@ -297,6 +494,10 @@ EATTR::EATTR( wxXmlNode* aTree ) display = EATTR::NAME; else if( stemp == "both" ) display = EATTR::BOTH; + + stemp = parseOptionalAttribute( aTree, "align" ); + + align = stemp ? parseAlignment( *stemp ) : DEFAULT_ALIGNMENT; } @@ -316,20 +517,14 @@ EDIMENSION::EDIMENSION( wxXmlNode* aDimension ) > */ - x1 = parseRequiredAttribute( aDimension, "x1" ); - y1 = parseRequiredAttribute( aDimension, "y1" ); - x2 = parseRequiredAttribute( aDimension, "x2" ); - y2 = parseRequiredAttribute( aDimension, "y2" ); - x3 = parseRequiredAttribute( aDimension, "x3" ); - y3 = parseRequiredAttribute( aDimension, "y3" ); + x1 = parseRequiredAttribute( aDimension, "x1" ); + y1 = parseRequiredAttribute( aDimension, "y1" ); + x2 = parseRequiredAttribute( aDimension, "x2" ); + y2 = parseRequiredAttribute( aDimension, "y2" ); + x3 = parseRequiredAttribute( aDimension, "x3" ); + y3 = parseRequiredAttribute( aDimension, "y3" ); layer = parseRequiredAttribute( aDimension, "layer" ); - - opt_string dimType = parseOptionalAttribute( aDimension, "dtype" ); - - if( !dimType ) - { - // default type is parallel - } + dimensionType = parseOptionalAttribute( aDimension, "dtype" ); } @@ -350,9 +545,9 @@ ETEXT::ETEXT( wxXmlNode* aText ) */ text = aText->GetNodeContent(); - x = parseRequiredAttribute( aText, "x" ); - y = parseRequiredAttribute( aText, "y" ); - size = parseRequiredAttribute( aText, "size" ); + x = parseRequiredAttribute( aText, "x" ); + y = parseRequiredAttribute( aText, "y" ); + size = parseRequiredAttribute( aText, "size" ); layer = parseRequiredAttribute( aText, "layer" ); font = parseOptionalAttribute( aText, "font" ); @@ -361,26 +556,38 @@ ETEXT::ETEXT( wxXmlNode* aText ) opt_string stemp = parseOptionalAttribute( aText, "align" ); - // (bottom-left | bottom-center | bottom-right | center-left | - // center | center-right | top-left | top-center | top-right) - if( stemp == "center" ) - align = ETEXT::CENTER; - else if( stemp == "center-right" ) - align = ETEXT::CENTER_RIGHT; - else if( stemp == "top-left" ) - align = ETEXT::TOP_LEFT; - else if( stemp == "top-center" ) - align = ETEXT::TOP_CENTER; - else if( stemp == "top-right" ) - align = ETEXT::TOP_RIGHT; - else if( stemp == "bottom-left" ) - align = ETEXT::BOTTOM_LEFT; - else if( stemp == "bottom-center" ) - align = ETEXT::BOTTOM_CENTER; - else if( stemp == "bottom-right" ) - align = ETEXT::BOTTOM_RIGHT; - else if( stemp == "center-left" ) - align = ETEXT::CENTER_LEFT; + align = stemp ? parseAlignment( *stemp ) : DEFAULT_ALIGNMENT; +} + + +wxSize ETEXT::ConvertSize() const +{ + wxSize textsize; + + if( font ) + { + const wxString& fontName = font.CGet(); + + if( fontName == "vector" ) + { + textsize = wxSize( size.ToSchUnits(), size.ToSchUnits() ); + } + else if( fontName == "fixed" ) + { + textsize = wxSize( size.ToSchUnits(), size.ToSchUnits() * 0.80 ); + } + else + { + wxASSERT( false ); + textsize = wxSize( size.ToSchUnits(), size.ToSchUnits() ); + } + } + else + { + textsize = wxSize( size.ToSchUnits() * 0.85, size.ToSchUnits() ); + } + + return textsize; } @@ -404,12 +611,12 @@ EPAD::EPAD( wxXmlNode* aPad ) // #REQUIRED says DTD, throw exception if not found name = parseRequiredAttribute( aPad, "name" ); - x = parseRequiredAttribute( aPad, "x" ); - y = parseRequiredAttribute( aPad, "y" ); - drill = parseRequiredAttribute( aPad, "drill" ); + x = parseRequiredAttribute( aPad, "x" ); + y = parseRequiredAttribute( aPad, "y" ); + drill = parseRequiredAttribute( aPad, "drill" ); // Optional attributes - diameter = parseOptionalAttribute( aPad, "diameter" ); + diameter = parseOptionalAttribute( aPad, "diameter" ); opt_string s = parseOptionalAttribute( aPad, "shape" ); @@ -452,10 +659,10 @@ ESMD::ESMD( wxXmlNode* aSMD ) // DTD #REQUIRED, throw exception if not found name = parseRequiredAttribute( aSMD, "name" ); - x = parseRequiredAttribute( aSMD, "x" ); - y = parseRequiredAttribute( aSMD, "y" ); - dx = parseRequiredAttribute( aSMD, "dx" ); - dy = parseRequiredAttribute( aSMD, "dy" ); + x = parseRequiredAttribute( aSMD, "x" ); + y = parseRequiredAttribute( aSMD, "y" ); + dx = parseRequiredAttribute( aSMD, "dx" ); + dy = parseRequiredAttribute( aSMD, "dy" ); layer = parseRequiredAttribute( aSMD, "layer" ); roundness = parseOptionalAttribute( aSMD, "roundness" ); @@ -467,6 +674,37 @@ ESMD::ESMD( wxXmlNode* aSMD ) } +EPIN::EPIN( wxXmlNode* aPin ) +{ + /* + + + */ + + // DTD #REQUIRED, throw exception if not found + name = parseRequiredAttribute( aPin, "name" ); + x = parseRequiredAttribute( aPin, "x" ); + y = parseRequiredAttribute( aPin, "y" ); + + visible = parseOptionalAttribute( aPin, "visible" ); + length = parseOptionalAttribute( aPin, "length" ); + direction = parseOptionalAttribute( aPin, "direction" ); + function = parseOptionalAttribute( aPin, "function" ); + swaplevel = parseOptionalAttribute( aPin, "swaplevel" ); + rot = parseOptionalAttribute( aPin, "rot" ); +} + + EVERTEX::EVERTEX( wxXmlNode* aVertex ) { /* @@ -478,8 +716,8 @@ EVERTEX::EVERTEX( wxXmlNode* aVertex ) > */ - x = parseRequiredAttribute( aVertex, "x" ); - y = parseRequiredAttribute( aVertex, "y" ); + x = parseRequiredAttribute( aVertex, "x" ); + y = parseRequiredAttribute( aVertex, "y" ); } @@ -498,11 +736,11 @@ EPOLYGON::EPOLYGON( wxXmlNode* aPolygon ) > */ - width = parseRequiredAttribute( aPolygon, "width" ); + width = parseRequiredAttribute( aPolygon, "width" ); layer = parseRequiredAttribute( aPolygon, "layer" ); - spacing = parseOptionalAttribute( aPolygon, "spacing" ); - isolate = parseOptionalAttribute( aPolygon, "isolate" ); + spacing = parseOptionalAttribute( aPolygon, "spacing" ); + isolate = parseOptionalAttribute( aPolygon, "isolate" ); opt_string s = parseOptionalAttribute( aPolygon, "pour" ); // default pour to solid fill @@ -532,9 +770,9 @@ EHOLE::EHOLE( wxXmlNode* aHole ) */ // #REQUIRED: - x = parseRequiredAttribute( aHole, "x" ); - y = parseRequiredAttribute( aHole, "y" ); - drill = parseRequiredAttribute( aHole, "drill" ); + x = parseRequiredAttribute( aHole, "x" ); + y = parseRequiredAttribute( aHole, "y" ); + drill = parseRequiredAttribute( aHole, "drill" ); } @@ -562,8 +800,8 @@ EELEMENT::EELEMENT( wxXmlNode* aElement ) package = parseRequiredAttribute( aElement, "package" ); ReplaceIllegalFileNameChars( &package ); - x = parseRequiredAttribute( aElement, "x" ); - y = parseRequiredAttribute( aElement, "y" ); + x = parseRequiredAttribute( aElement, "x" ); + y = parseRequiredAttribute( aElement, "y" ); // optional locked = parseOptionalAttribute( aElement, "locked" ); @@ -595,56 +833,169 @@ ELAYER::ELAYER( wxXmlNode* aLayer ) } -NODE_MAP MapChildren( wxXmlNode* currentNode ) +EPART::EPART( wxXmlNode* aPart ) { - // Map node_name -> node_pointer - NODE_MAP nodesMap; + /* + * + * + */ + // #REQUIRED + name = parseRequiredAttribute( aPart, "name" ); + library = parseRequiredAttribute( aPart, "library" ); + deviceset = parseRequiredAttribute( aPart, "deviceset" ); + device = parseRequiredAttribute( aPart, "device" ); + technology = parseOptionalAttribute( aPart, "technology" ); + value = parseOptionalAttribute( aPart, "value" ); +} - // Loop through all children mapping them in nodesMap - currentNode = currentNode->GetChildren(); - while( currentNode ) - { - // Create a new pair in the map - // key: current node name - // value: current node pointer - nodesMap[currentNode->GetName().ToStdString()] = currentNode; - // Get next child - currentNode = currentNode->GetNext(); +EINSTANCE::EINSTANCE( wxXmlNode* aInstance ) +{ + /* + * + * + */ + part = parseRequiredAttribute( aInstance, "part" ); + gate = parseRequiredAttribute( aInstance, "gate" ); + + x = parseRequiredAttribute( aInstance, "x" ); + y = parseRequiredAttribute( aInstance, "y" ); + + // optional + smashed = parseOptionalAttribute( aInstance, "smashed" ); + rot = parseOptionalAttribute( aInstance, "rot" ); +} + + +EGATE::EGATE( wxXmlNode* aGate ) +{ + /* + * + * + */ + + name = parseRequiredAttribute( aGate, "name" ); + symbol = parseRequiredAttribute( aGate, "symbol" ); + + x = parseRequiredAttribute( aGate, "x" ); + y = parseRequiredAttribute( aGate, "y" ); + + opt_string stemp = parseOptionalAttribute( aGate, "addlevel" ); + + // (off | value | name | both) + if( stemp == "must" ) + addlevel = EGATE::MUST; + else if( stemp == "can" ) + addlevel = EGATE::CAN; + else if( stemp == "next" ) + addlevel = EGATE::NEXT; + else if( stemp == "request" ) + addlevel = EGATE::REQUEST; + else if( stemp == "always" ) + addlevel = EGATE::ALWAYS; + else + addlevel = EGATE::NEXT; +} + + +ECONNECT::ECONNECT( wxXmlNode* aConnect ) +{ + /* + * + * + */ + gate = parseRequiredAttribute( aConnect, "gate" ); + pin = parseRequiredAttribute( aConnect, "pin" ); + pad = parseRequiredAttribute( aConnect, "pad" ); + + //TODO: + //int contactroute; + +}; + + +EDEVICE::EDEVICE( wxXmlNode* aDevice ) +{ + /* + + +*/ + name = parseRequiredAttribute( aDevice, "name" ); + package = parseOptionalAttribute( aDevice, "package" ); + + NODE_MAP aDeviceChildren = MapChildren(aDevice); + wxXmlNode* connectNode = getChildrenNodes(aDeviceChildren, "connects"); + + while(connectNode){ + connects.push_back(ECONNECT(connectNode)); + connectNode = connectNode->GetNext(); } - return nodesMap; -} +}; -string makeKey( const string& aFirst, const string& aSecond ) +EDEVICE_SET::EDEVICE_SET( wxXmlNode* aDeviceSet ) { - string key = aFirst + '\x02' + aSecond; - return key; -} - - -unsigned long timeStamp( wxXmlNode* aTree ) -{ - // in this case from a unique tree memory location - return (unsigned long)(void*) aTree; -} - - -wxPoint kicad_arc_center( const wxPoint& aStart, const wxPoint& aEnd, double aAngle ) -{ - // Eagle give us start and end. - // S_ARC wants start to give the center, and end to give the start. - double dx = aEnd.x - aStart.x, dy = aEnd.y - aStart.y; - wxPoint mid = ( aStart + aEnd ) / 2; - - double dlen = sqrt( dx * dx + dy * dy ); - double dist = dlen / ( 2 * tan( DEG2RAD( aAngle ) / 2 ) ); - - wxPoint center( - mid.x + dist * ( dy / dlen ), - mid.y - dist * ( dx / dlen ) - ); - - return center; + /* + + + */ + + name = parseRequiredAttribute(aDeviceSet, "name"); + prefix = parseOptionalAttribute( aDeviceSet, "prefix" ); + uservalue = parseOptionalAttribute( aDeviceSet, "uservalue" ); + + /* Russell: Parsing of devices and gates moved to sch_eagle_plugin.cpp + * + //TODO: description + + NODE_MAP aDeviceSetChildren = MapChildren(aDeviceSet); + wxXmlNode* deviceNode = getChildrenNodes(aDeviceSetChildren, "device"); + + while(deviceNode){ + devices.push_back(EDEVICE(deviceNode)); + deviceNode->GetNext(); + } + + wxXmlNode* gateNode = getChildrenNodes(aDeviceSetChildren, "gate"); + + while(gateNode){ + gates.push_back(EGATE(gateNode)); + gateNode->GetNext(); + } + */ + } diff --git a/common/eda_text.cpp b/common/eda_text.cpp index e577675436..cc234ad4e5 100644 --- a/common/eda_text.cpp +++ b/common/eda_text.cpp @@ -35,20 +35,7 @@ #include // EDA_DRAW_PANEL #include - -// Conversion to application internal units defined at build time. -#if defined( PCBNEW ) - #include // for FMT_IU -#elif defined( EESCHEMA ) - #include // for FMT_IU -#elif defined( GERBVIEW ) -#elif defined( PL_EDITOR ) - #include - #define FMT_IU Double2Str -#else -#error "Cannot resolve units formatting due to no definition of EESCHEMA or PCBNEW." -#endif - +#include #include EDA_TEXT::EDA_TEXT( const wxString& text ) : diff --git a/common/fp_lib_table.cpp b/common/fp_lib_table.cpp index 8ebcbb7f7c..99a2afc358 100644 --- a/common/fp_lib_table.cpp +++ b/common/fp_lib_table.cpp @@ -52,7 +52,7 @@ void FP_LIB_TABLE_ROW::SetType( const wxString& aType ) type = IO_MGR::EnumFromStr( aType ); if( IO_MGR::PCB_FILE_T( -1 ) == type ) - type = IO_MGR::KICAD; + type = IO_MGR::KICAD_SEXP; } diff --git a/common/wildcards_and_files_ext.cpp b/common/wildcards_and_files_ext.cpp index 80a178a4ca..c872db7f11 100644 --- a/common/wildcards_and_files_ext.cpp +++ b/common/wildcards_and_files_ext.cpp @@ -72,6 +72,8 @@ const wxString SchematicSymbolFileWildcard( _( "KiCad drawing symbol file (*.sym const wxString SchematicLibraryFileWildcard( _( "KiCad component library file (*.lib)|*.lib" ) ); const wxString ProjectFileWildcard( _( "KiCad project files (*.pro)|*.pro" ) ); const wxString SchematicFileWildcard( _( "KiCad schematic files (*.sch)|*.sch" ) ); +const wxString EagleSchematicFileWildcard( _( "Eagle XML schematic file (*.sch)|*.sch" ) ); +const wxString EagleFilesWildcard( _( "Eagle XML files (*.sch *.brd)|*.sch;*.brd" ) ); const wxString NetlistFileWildcard( _( "KiCad netlist files (*.net)|*.net" ) ); const wxString GerberFileWildcard( _( "Gerber files (*.pho)|*.pho" ) ); const wxString LegacyPcbFileWildcard( _( "KiCad printed circuit board files (*.brd)|*.brd" ) ); diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index c5552187c9..6c6c3406f7 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -168,6 +168,7 @@ set( EESCHEMA_SRCS sch_bus_entry.cpp sch_collectors.cpp sch_component.cpp + sch_eagle_plugin.cpp sch_field.cpp sch_io_mgr.cpp sch_item_struct.cpp @@ -299,7 +300,7 @@ target_link_libraries( eeschema ) # the DSO (KIFACE) housing the main eeschema code: -add_library( eeschema_kiface MODULE +add_library( eeschema_kiface SHARED ${EESCHEMA_SRCS} ${EESCHEMA_COMMON_SRCS} ) @@ -437,3 +438,4 @@ add_custom_target( add_dependencies( eeschema_kiface dialog_bom_cfg_lexer_source_files ) add_subdirectory( plugins ) +add_subdirectory( qa ) diff --git a/eeschema/dialogs/dialog_bom.cpp b/eeschema/dialogs/dialog_bom.cpp index 1de3e8d422..51cc37c22d 100644 --- a/eeschema/dialogs/dialog_bom.cpp +++ b/eeschema/dialogs/dialog_bom.cpp @@ -433,7 +433,7 @@ void DIALOG_BOM::OnRunPlugin( wxCommandEvent& event ) m_parent->SetExecFlags( wxEXEC_SHOW_CONSOLE ); #endif - m_parent->CreateNetlist( -1, fullfilename, 0, &reporter ); + m_parent->CreateNetlist( -1, fullfilename, 0, &reporter, false ); m_Messages->SetValue( reportmsg ); } diff --git a/eeschema/dialogs/dialog_netlist.cpp b/eeschema/dialogs/dialog_netlist.cpp index 2b84556fe8..cb938df573 100644 --- a/eeschema/dialogs/dialog_netlist.cpp +++ b/eeschema/dialogs/dialog_netlist.cpp @@ -611,7 +611,7 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event ) else m_Parent->SetNetListerCommand( wxEmptyString ); - m_Parent->CreateNetlist( currPage->m_IdNetType, fullpath, netlist_opt ); + m_Parent->CreateNetlist( currPage->m_IdNetType, fullpath, netlist_opt, NULL, false ); WriteCurrentNetlistSetup(); @@ -689,7 +689,7 @@ void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event ) netlist_opt |= NET_ADJUST_PASSIVE_VALS; if( ! m_Parent->CreateNetlist( currPage->m_IdNetType, fn.GetFullPath(), - netlist_opt ) ) + netlist_opt, NULL, false ) ) return; ExecuteFile( this, ExecFile, CommandLine ); @@ -878,4 +878,3 @@ int InvokeDialogNetList( SCH_EDIT_FRAME* aCaller ) return dlg.ShowModal(); } - diff --git a/eeschema/eeschema_id.h b/eeschema/eeschema_id.h index 9317b23c12..e31d0adc65 100644 --- a/eeschema/eeschema_id.h +++ b/eeschema/eeschema_id.h @@ -60,6 +60,7 @@ enum id_eeschema_frm { ID_UPDATE_ONE_SHEET = ID_END_LIST, ID_SAVE_ONE_SHEET_UNDER_NEW_NAME, + ID_IMPORT_NON_KICAD_SCH, /* Schematic editor main menubar IDs. */ ID_RESCUE_CACHED, diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 1683d7f600..f38dee5cba 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -47,6 +47,7 @@ #include #include #include +#include //#define USE_SCH_LEGACY_IO_PLUGIN @@ -190,8 +191,6 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in { // implement the pseudo code from KIWAY_PLAYER.h: - SCH_SCREENS screenList; - // This is for python: if( aFileSet.size() != 1 ) { @@ -216,34 +215,8 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in return false; } - // Save any currently open and modified project files. - for( SCH_SCREEN* screen = screenList.GetFirst(); screen; screen = screenList.GetNext() ) - { - if( screen->IsModify() ) - { - int response = YesNoCancelDialog( this, _( - "The current schematic has been modified. Do you wish to save the changes?" ), - wxEmptyString, - _( "Save and Load" ), - _( "Load Without Saving" ) - ); - - if( response == wxID_CANCEL ) - { - return false; - } - else if( response == wxID_YES ) - { - wxCommandEvent dummy; - OnSaveProject( dummy ); - } - else - { - // response == wxID_NO, fall thru - } - break; - } - } + if( !AskToSaveChanges() ) + return false; wxFileName pro = fullFileName; pro.SetExt( ProjectFileExtension ); @@ -314,7 +287,6 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in { delete g_RootSheet; // Delete the current project. g_RootSheet = NULL; // Force CreateScreens() to build new empty project on load failure. - SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_LEGACY ) ); try @@ -399,7 +371,7 @@ bool SCH_EDIT_FRAME::AppendOneEEProject() // open file chooser dialog wxString path = wxPathOnly( Prj().GetProjectFullName() ); - wxFileDialog dlg( this, _( "Import Schematic" ), path, + wxFileDialog dlg( this, _( "Append Schematic" ), path, wxEmptyString, SchematicFileWildcard, wxFD_OPEN | wxFD_FILE_MUST_EXIST ); @@ -533,6 +505,25 @@ void SCH_EDIT_FRAME::OnAppendProject( wxCommandEvent& event ) } +void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent ) +{ + if( !AskToSaveChanges() ) + return; + + wxString path = wxPathOnly( Prj().GetProjectFullName() ); + + wxFileDialog dlg( this, _( "Import Schematic" ), path, + wxEmptyString, EagleSchematicFileWildcard, + wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + + if( dlg.ShowModal() == wxID_CANCEL ) + return; + + // For now there is only one import plugin + ImportFile( dlg.GetPath(), SCH_IO_MGR::SCH_EAGLE ); +} + + void SCH_EDIT_FRAME::OnSaveProject( wxCommandEvent& aEvent ) { SCH_SCREEN* screen; @@ -606,3 +597,118 @@ bool SCH_EDIT_FRAME::doAutoSave() return autoSaveOk; } + + +bool SCH_EDIT_FRAME::ImportFile( const wxString& aFileName, int aFileType ) +{ + wxString fullFileName( aFileName ); + + SCH_PLUGIN::SCH_PLUGIN_RELEASER pi; + wxString projectpath; + wxFileName newfilename; + SCH_SHEET_LIST sheetList( g_RootSheet ); + SCH_SCREENS schematic; + + switch( (SCH_IO_MGR::SCH_FILE_T) aFileType ) + { + case SCH_IO_MGR::SCH_EAGLE: + // We insist on caller sending us an absolute path, if it does not, we say it's a bug. + wxASSERT_MSG( wxFileName( fullFileName ).IsAbsolute(), + wxT( "Import eagle schematic caller didn't send full filename" ) ); + + if( !LockFile( fullFileName ) ) + { + wxString msg = wxString::Format( _( "Schematic file '%s' is already open." ), + GetChars( fullFileName ) ); + DisplayError( this, msg ); + return false; + } + + try + { + pi.set( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EAGLE ) ); + g_RootSheet = pi->Load( fullFileName, &Kiway() ); + + projectpath = Kiway().Prj().GetProjectPath(); + newfilename = Prj().AbsolutePath( Prj().GetProjectName() ); + newfilename.SetExt( SchematicFileExtension ); + + m_CurrentSheet->clear(); + m_CurrentSheet->push_back( g_RootSheet ); + SetScreen( m_CurrentSheet->LastScreen() ); + + g_RootSheet->SetFileName( newfilename.GetFullPath() ); + GetScreen()->SetFileName( newfilename.GetFullPath() ); + GetScreen()->SetModify(); + + UpdateFileHistory( fullFileName ); + schematic.UpdateSymbolLinks(); // Update all symbol library links for all sheets. + GetScreen()->TestDanglingEnds(); // Only perform the dangling end test on root sheet. + + GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); + Zoom_Automatique( false ); + SetSheetNumberAndCount(); + m_canvas->Refresh( true ); + UpdateTitle(); + } + catch( const IO_ERROR& ioe ) + { + // Do not leave g_RootSheet == NULL because it is expected to be + // a valid sheet. Therefore create a dummy empty root sheet and screen. + CreateScreens(); + Zoom_Automatique( false ); + + wxString msg; + msg.Printf( _( "Error loading schematic file '%s'.\n%s" ), + GetChars( fullFileName ), GetChars( ioe.What() ) ); + DisplayError( this, msg ); + + msg.Printf( _( "Failed to load '%s'" ), GetChars( fullFileName ) ); + AppendMsgPanel( wxEmptyString, msg, CYAN ); + + return false; + } + + return true; + + default: + return false; + } + + return false; +} + + +bool SCH_EDIT_FRAME::AskToSaveChanges() +{ + SCH_SCREENS screenList; + + // Save any currently open and modified project files. + for( SCH_SCREEN* screen = screenList.GetFirst(); screen; screen = screenList.GetNext() ) + { + if( screen->IsModify() ) + { + int response = YesNoCancelDialog( m_parent, _( + "The current schematic has been modified. Do you wish to save the changes?" ), + wxEmptyString, + _( "Save and Load" ), + _( "Load Without Saving" ) + ); + + if( response == wxID_CANCEL ) + { + return false; + } + else if( response == wxID_YES ) + { + wxCommandEvent dummy; + OnSaveProject( dummy ); + } + // else wxID_NO, so do not save + + break; + } + } + + return true; +} diff --git a/eeschema/lib_arc.cpp b/eeschema/lib_arc.cpp index 263ad17734..1c8bb20f38 100644 --- a/eeschema/lib_arc.cpp +++ b/eeschema/lib_arc.cpp @@ -745,7 +745,7 @@ void LIB_ARC::calcEdit( const wxPoint& aPosition ) } m_Pos = newCenterPoint; - calcRadiusAngles(); + CalcRadiusAngles(); } else if( m_Flags == IS_NEW ) { @@ -781,7 +781,7 @@ void LIB_ARC::calcEdit( const wxPoint& aPosition ) cY += m_ArcStart.y; m_Pos.x = cX; m_Pos.y = cY; - calcRadiusAngles(); + CalcRadiusAngles(); SetEraseLastDrawItem(); } @@ -792,7 +792,7 @@ void LIB_ARC::calcEdit( const wxPoint& aPosition ) } -void LIB_ARC::calcRadiusAngles() +void LIB_ARC::CalcRadiusAngles() { wxPoint centerStartVector = twoPointVector( m_Pos, m_ArcStart ); wxPoint centerEndVector = twoPointVector( m_Pos, m_ArcEnd ); diff --git a/eeschema/lib_arc.h b/eeschema/lib_arc.h index cc77f5487f..2c870c9c3d 100644 --- a/eeschema/lib_arc.h +++ b/eeschema/lib_arc.h @@ -78,10 +78,6 @@ class LIB_ARC : public LIB_ITEM */ void calcEdit( const wxPoint& aPosition ) override; - /** - * Calculate the radius and angle of an arc using the start, end, and center points. - */ - void calcRadiusAngles(); public: LIB_ARC( LIB_PART * aParent ); @@ -153,6 +149,12 @@ public: void SetEnd( const wxPoint& aPoint ) { m_ArcEnd = aPoint; } + /** + * Calculate the radius and angle of an arc using the start, end, and center points. + */ + void CalcRadiusAngles(); + + wxString GetSelectMenuText() const override; BITMAP_DEF GetMenuImage() const override; diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index 1f99840924..32c2db648b 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -130,7 +130,8 @@ static const wxString getPinOrientationName( unsigned aPinOrientationCode ) static int InternalPinDecoSize( const LIB_PIN &aPin ) { - return aPin.GetNameTextSize() / 2; + + return aPin.GetNameTextSize() != 0 ? aPin.GetNameTextSize() / 2 : aPin.GetNumberTextSize() / 2; } /// Utility for getting the size of the 'external' pin decorators (as a radius) diff --git a/eeschema/lib_pin.h b/eeschema/lib_pin.h index 29993650cf..ab5ebd3b7b 100644 --- a/eeschema/lib_pin.h +++ b/eeschema/lib_pin.h @@ -37,6 +37,7 @@ class SCH_COMPONENT; #include "pin_shape.h" #include "pin_type.h" +#include "class_libentry.h" // Circle diameter drawn at the active end of pins: #define TARGET_PIN_RADIUS 12 @@ -362,7 +363,13 @@ public: * Return whether this pin forms an implicit power connection: i.e., is hidden * and of type POWER_IN. */ - bool IsPowerConnection() const { return !IsVisible() && GetType() == PIN_POWER_IN; } + bool IsPowerConnection() const { + + return ( + ( !IsVisible() && GetType() == PIN_POWER_IN ) + || + ( (LIB_PART*)GetParent()->IsPower() && GetType() == PIN_POWER_IN ) + ) ; } int GetPenSize() const override; diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp index 056a8acb19..c44592a4f8 100644 --- a/eeschema/menubar.cpp +++ b/eeschema/menubar.cpp @@ -338,10 +338,15 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject ) } AddMenuItem( aParentMenu, - ID_APPEND_PROJECT, _( "Imp&ort Schematic Sheet Content" ), - _( "Import schematic sheet content from other project in current sheet" ), + ID_APPEND_PROJECT, _( "App&end Schematic Sheet" ), + _( "Import schematic sheet content from another project to current sheet" ), KiBitmap( open_document_xpm ) ); + AddMenuItem( aParentMenu, + ID_IMPORT_NON_KICAD_SCH, _( "&Import Non-Kicad Schematic File" ), + _( "Import schematic file from other applications" ), + KiBitmap( open_document_xpm ) ); // TODO needs a different icon + aParentMenu->AppendSeparator(); text = AddHotkeyName( _( "&Save Schematic Project" ), diff --git a/eeschema/netlist.cpp b/eeschema/netlist.cpp index 638978a88c..d118bf28fd 100644 --- a/eeschema/netlist.cpp +++ b/eeschema/netlist.cpp @@ -110,15 +110,26 @@ void SCH_EDIT_FRAME::sendNetlist() bool SCH_EDIT_FRAME::CreateNetlist( int aFormat, const wxString& aFullFileName, - unsigned aNetlistOptions, REPORTER* aReporter ) + unsigned aNetlistOptions, REPORTER* aReporter, bool aSilent ) { - if( !prepareForNetlist() ) - return false; + if( !aSilent ) // checks for errors and invokes annotation dialog as neccessary + { + if( !prepareForNetlist() ) + return false; + } + else // performs similar function as prepareForNetlist but without a dialog. + { + SCH_SCREENS schematic; + schematic.UpdateSymbolLinks(); + SCH_SHEET_LIST sheets( g_RootSheet ); + sheets.AnnotatePowerSymbols( Prj().SchLibs() ); + schematic.SchematicCleanUp(); + } std::unique_ptr connectedItemsList( BuildNetListBase() ); bool success = WriteNetListFile( connectedItemsList.release(), aFormat, - aFullFileName, aNetlistOptions, aReporter ); + aFullFileName, aNetlistOptions, aReporter ); return success; } diff --git a/eeschema/qa/CMakeLists.txt b/eeschema/qa/CMakeLists.txt new file mode 100644 index 0000000000..f11329f35b --- /dev/null +++ b/eeschema/qa/CMakeLists.txt @@ -0,0 +1,44 @@ +# +# This program source code file is part of KiCad, a free EDA CAD application. +# +# Copyright (C) 2017 CERN +# @author Alejandro García Montoro +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, you may find one here: +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# or you may search the http://www.gnu.org website for the version 2 license, +# or you may write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +find_package( Boost COMPONENTS unit_test_framework REQUIRED ) + +include_directories( BEFORE ${INC_BEFORE} ) +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${INC_AFTER} + ) + +add_executable( qa_eagle_plugin + test_module.cpp + test_basic.cpp + ) + +add_dependencies( qa_eagle_plugin common eeschema_kiface ) + +target_link_libraries( qa_eagle_plugin + common + eeschema_kiface + ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} + ${wxWidgets_LIBRARIES} + ) diff --git a/eeschema/qa/data/eagle_schematics/eagle-import-testfile.brd b/eeschema/qa/data/eagle_schematics/eagle-import-testfile.brd new file mode 100644 index 0000000000..3d6a02c96a --- /dev/null +++ b/eeschema/qa/data/eagle_schematics/eagle-import-testfile.brd @@ -0,0 +1,2859 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>Resistors, Capacitors, Inductors</b><p> +Based on the previous libraries: +<ul> +<li>r.lbr +<li>cap.lbr +<li>cap-fe.lbr +<li>captant.lbr +<li>polcap.lbr +<li>ipc-smd.lbr +</ul> +All SMD packages are defined according to the IPC specifications and CECC<p> +<author>Created by librarian@cadsoft.de</author><p> +<p> +for Electrolyt Capacitors see also :<p> +www.bccomponents.com <p> +www.panasonic.com<p> +www.kemet.com<p> +http://www.secc.co.jp/pdf/os_e/2004/e_os_all.pdf <b>(SANYO)</b> +<p> +for trimmer refence see : <u>www.electrospec-inc.com/cross_references/trimpotcrossref.asp</u><p> + +<table border=0 cellspacing=0 cellpadding=0 width="100%" cellpaddding=0> +<tr valign="top"> + +<! <td width="10">&nbsp;</td> +<td width="90%"> + +<b><font color="#0000FF" size="4">TRIM-POT CROSS REFERENCE</font></b> +<P> +<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2> + <TR> + <TD COLSPAN=8> + <FONT SIZE=3 FACE=ARIAL><B>RECTANGULAR MULTI-TURN</B></FONT> + </TD> + </TR> + <TR> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">BOURNS</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">BI&nbsp;TECH</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">DALE-VISHAY</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">PHILIPS/MEPCO</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">MURATA</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">PANASONIC</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">SPECTROL</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">MILSPEC</FONT> + </B> + </TD><TD>&nbsp;</TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3 > + 3005P<BR> + 3006P<BR> + 3006W<BR> + 3006Y<BR> + 3009P<BR> + 3009W<BR> + 3009Y<BR> + 3057J<BR> + 3057L<BR> + 3057P<BR> + 3057Y<BR> + 3059J<BR> + 3059L<BR> + 3059P<BR> + 3059Y<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 89P<BR> + 89W<BR> + 89X<BR> + 89PH<BR> + 76P<BR> + 89XH<BR> + 78SLT<BR> + 78L&nbsp;ALT<BR> + 56P&nbsp;ALT<BR> + 78P&nbsp;ALT<BR> + T8S<BR> + 78L<BR> + 56P<BR> + 78P<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + T18/784<BR> + 783<BR> + 781<BR> + -<BR> + -<BR> + -<BR> + 2199<BR> + 1697/1897<BR> + 1680/1880<BR> + 2187<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 8035EKP/CT20/RJ-20P<BR> + -<BR> + RJ-20X<BR> + -<BR> + -<BR> + -<BR> + 1211L<BR> + 8012EKQ&nbsp;ALT<BR> + 8012EKR&nbsp;ALT<BR> + 1211P<BR> + 8012EKJ<BR> + 8012EKL<BR> + 8012EKQ<BR> + 8012EKR<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 2101P<BR> + 2101W<BR> + 2101Y<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 2102L<BR> + 2102S<BR> + 2102Y<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + EVMCOG<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 43P<BR> + 43W<BR> + 43Y<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 40L<BR> + 40P<BR> + 40Y<BR> + 70Y-T602<BR> + 70L<BR> + 70P<BR> + 70Y<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + RT/RTR12<BR> + RT/RTR12<BR> + RT/RTR12<BR> + -<BR> + RJ/RJR12<BR> + RJ/RJR12<BR> + RJ/RJR12<BR></FONT> + </TD> + </TR> + <TR> + <TD COLSPAN=8>&nbsp; + </TD> + </TR> + <TR> + <TD COLSPAN=8> + <FONT SIZE=4 FACE=ARIAL><B>SQUARE MULTI-TURN</B></FONT> + </TD> + </TR> + <TR> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3250L<BR> + 3250P<BR> + 3250W<BR> + 3250X<BR> + 3252P<BR> + 3252W<BR> + 3252X<BR> + 3260P<BR> + 3260W<BR> + 3260X<BR> + 3262P<BR> + 3262W<BR> + 3262X<BR> + 3266P<BR> + 3266W<BR> + 3266X<BR> + 3290H<BR> + 3290P<BR> + 3290W<BR> + 3292P<BR> + 3292W<BR> + 3292X<BR> + 3296P<BR> + 3296W<BR> + 3296X<BR> + 3296Y<BR> + 3296Z<BR> + 3299P<BR> + 3299W<BR> + 3299X<BR> + 3299Y<BR> + 3299Z<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 66P&nbsp;ALT<BR> + 66W&nbsp;ALT<BR> + 66X&nbsp;ALT<BR> + 66P&nbsp;ALT<BR> + 66W&nbsp;ALT<BR> + 66X&nbsp;ALT<BR> + -<BR> + 64W&nbsp;ALT<BR> + -<BR> + 64P&nbsp;ALT<BR> + 64W&nbsp;ALT<BR> + 64X&nbsp;ALT<BR> + 64P<BR> + 64W<BR> + 64X<BR> + 66X&nbsp;ALT<BR> + 66P&nbsp;ALT<BR> + 66W&nbsp;ALT<BR> + 66P<BR> + 66W<BR> + 66X<BR> + 67P<BR> + 67W<BR> + 67X<BR> + 67Y<BR> + 67Z<BR> + 68P<BR> + 68W<BR> + 68X<BR> + 67Y&nbsp;ALT<BR> + 67Z&nbsp;ALT<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 5050<BR> + 5091<BR> + 5080<BR> + 5087<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + T63YB<BR> + T63XB<BR> + -<BR> + -<BR> + -<BR> + 5887<BR> + 5891<BR> + 5880<BR> + -<BR> + -<BR> + -<BR> + T93Z<BR> + T93YA<BR> + T93XA<BR> + T93YB<BR> + T93XB<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 8026EKP<BR> + 8026EKW<BR> + 8026EKM<BR> + 8026EKP<BR> + 8026EKB<BR> + 8026EKM<BR> + 1309X<BR> + 1309P<BR> + 1309W<BR> + 8024EKP<BR> + 8024EKW<BR> + 8024EKN<BR> + RJ-9P/CT9P<BR> + RJ-9W<BR> + RJ-9X<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 3103P<BR> + 3103Y<BR> + 3103Z<BR> + 3103P<BR> + 3103Y<BR> + 3103Z<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 3105P/3106P<BR> + 3105W/3106W<BR> + 3105X/3106X<BR> + 3105Y/3106Y<BR> + 3105Z/3105Z<BR> + 3102P<BR> + 3102W<BR> + 3102X<BR> + 3102Y<BR> + 3102Z<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + EVMCBG<BR> + EVMCCG<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 55-1-X<BR> + 55-4-X<BR> + 55-3-X<BR> + 55-2-X<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 50-2-X<BR> + 50-4-X<BR> + 50-3-X<BR> + -<BR> + -<BR> + -<BR> + 64P<BR> + 64W<BR> + 64X<BR> + 64Y<BR> + 64Z<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + RT/RTR22<BR> + RT/RTR22<BR> + RT/RTR22<BR> + RT/RTR22<BR> + RJ/RJR22<BR> + RJ/RJR22<BR> + RJ/RJR22<BR> + RT/RTR26<BR> + RT/RTR26<BR> + RT/RTR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RT/RTR24<BR> + RT/RTR24<BR> + RT/RTR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> + <TR> + <TD COLSPAN=8>&nbsp; + </TD> + </TR> + <TR> + <TD COLSPAN=8> + <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT> + </TD> + </TR> + <TR> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3323P<BR> + 3323S<BR> + 3323W<BR> + 3329H<BR> + 3329P<BR> + 3329W<BR> + 3339H<BR> + 3339P<BR> + 3339W<BR> + 3352E<BR> + 3352H<BR> + 3352K<BR> + 3352P<BR> + 3352T<BR> + 3352V<BR> + 3352W<BR> + 3362H<BR> + 3362M<BR> + 3362P<BR> + 3362R<BR> + 3362S<BR> + 3362U<BR> + 3362W<BR> + 3362X<BR> + 3386B<BR> + 3386C<BR> + 3386F<BR> + 3386H<BR> + 3386K<BR> + 3386M<BR> + 3386P<BR> + 3386S<BR> + 3386W<BR> + 3386X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 25P<BR> + 25S<BR> + 25RX<BR> + 82P<BR> + 82M<BR> + 82PA<BR> + -<BR> + -<BR> + -<BR> + 91E<BR> + 91X<BR> + 91T<BR> + 91B<BR> + 91A<BR> + 91V<BR> + 91W<BR> + 25W<BR> + 25V<BR> + 25P<BR> + -<BR> + 25S<BR> + 25U<BR> + 25RX<BR> + 25X<BR> + 72XW<BR> + 72XL<BR> + 72PM<BR> + 72RX<BR> + -<BR> + 72PX<BR> + 72P<BR> + 72RXW<BR> + 72RXL<BR> + 72X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + T7YB<BR> + T7YA<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + TXD<BR> + TYA<BR> + TYP<BR> + -<BR> + TYD<BR> + TX<BR> + -<BR> + 150SX<BR> + 100SX<BR> + 102T<BR> + 101S<BR> + 190T<BR> + 150TX<BR> + 101<BR> + -<BR> + -<BR> + 101SX<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + ET6P<BR> + ET6S<BR> + ET6X<BR> + RJ-6W/8014EMW<BR> + RJ-6P/8014EMP<BR> + RJ-6X/8014EMX<BR> + TM7W<BR> + TM7P<BR> + TM7X<BR> + -<BR> + 8017SMS<BR> + -<BR> + 8017SMB<BR> + 8017SMA<BR> + -<BR> + -<BR> + CT-6W<BR> + CT-6H<BR> + CT-6P<BR> + CT-6R<BR> + -<BR> + CT-6V<BR> + CT-6X<BR> + -<BR> + -<BR> + 8038EKV<BR> + -<BR> + 8038EKX<BR> + -<BR> + -<BR> + 8038EKP<BR> + 8038EKZ<BR> + 8038EKW<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + 3321H<BR> + 3321P<BR> + 3321N<BR> + 1102H<BR> + 1102P<BR> + 1102T<BR> + RVA0911V304A<BR> + -<BR> + RVA0911H413A<BR> + RVG0707V100A<BR> + RVA0607V(H)306A<BR> + RVA1214H213A<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 3104B<BR> + 3104C<BR> + 3104F<BR> + 3104H<BR> + -<BR> + 3104M<BR> + 3104P<BR> + 3104S<BR> + 3104W<BR> + 3104X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + EVMQ0G<BR> + EVMQIG<BR> + EVMQ3G<BR> + EVMS0G<BR> + EVMQ0G<BR> + EVMG0G<BR> + -<BR> + -<BR> + -<BR> + EVMK4GA00B<BR> + EVM30GA00B<BR> + EVMK0GA00B<BR> + EVM38GA00B<BR> + EVMB6<BR> + EVLQ0<BR> + -<BR> + EVMMSG<BR> + EVMMBG<BR> + EVMMAG<BR> + -<BR> + -<BR> + EVMMCS<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + EVMM1<BR> + -<BR> + -<BR> + EVMM0<BR> + -<BR> + -<BR> + EVMM3<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + 62-3-1<BR> + 62-1-2<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 67R<BR> + -<BR> + 67P<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 67X<BR> + 63V<BR> + 63S<BR> + 63M<BR> + -<BR> + -<BR> + 63H<BR> + 63P<BR> + -<BR> + -<BR> + 63X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + RJ/RJR50<BR> + RJ/RJR50<BR> + RJ/RJR50<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> +</TABLE> +<P>&nbsp;<P> +<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3> + <TR> + <TD COLSPAN=7> + <FONT color="#0000FF" SIZE=4 FACE=ARIAL><B>SMD TRIM-POT CROSS REFERENCE</B></FONT> + <P> + <FONT SIZE=4 FACE=ARIAL><B>MULTI-TURN</B></FONT> + </TD> + </TR> + <TR> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3224G<BR> + 3224J<BR> + 3224W<BR> + 3269P<BR> + 3269W<BR> + 3269X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 44G<BR> + 44J<BR> + 44W<BR> + 84P<BR> + 84W<BR> + 84X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + ST63Z<BR> + ST63Y<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + ST5P<BR> + ST5W<BR> + ST5X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> + <TR> + <TD COLSPAN=7>&nbsp; + </TD> + </TR> + <TR> + <TD COLSPAN=7> + <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT> + </TD> + </TR> + <TR> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3314G<BR> + 3314J<BR> + 3364A/B<BR> + 3364C/D<BR> + 3364W/X<BR> + 3313G<BR> + 3313J<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 23B<BR> + 23A<BR> + 21X<BR> + 21W<BR> + -<BR> + 22B<BR> + 22A<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + ST5YL/ST53YL<BR> + ST5YJ/5T53YJ<BR> + ST-23A<BR> + ST-22B<BR> + ST-22<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + ST-4B<BR> + ST-4A<BR> + -<BR> + -<BR> + -<BR> + ST-3B<BR> + ST-3A<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + EVM-6YS<BR> + EVM-1E<BR> + EVM-1G<BR> + EVM-1D<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + G4B<BR> + G4A<BR> + TR04-3S1<BR> + TRG04-2S1<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + DVR-43A<BR> + CVR-42C<BR> + CVR-42A/C<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> +</TABLE> +<P> +<FONT SIZE=4 FACE=ARIAL><B>ALT =&nbsp;ALTERNATE</B></FONT> +<P> + +&nbsp; +<P> +</td> +</tr> +</table> + + +<b>Aluminum electrolytic capacitors</b> reflow soldering<p> +SMD (Chip) Standard 085 CS<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>INDUCTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>AVR Devices</b><p> +Configurable logic, microcontrollers, nonvolatile memories<p> +Based on the following sources:<p> +<ul> +<li>www.atmel.com +<li>CD-ROM : Configurable Logic Microcontroller Nonvolatile Memory +<li>CadSoft download site, www.cadsoft.de or www.cadsoftusa.com , file at90smcu_v400.zip +<li>avr.lbr +</ul> +<author>Revised by librarian@cadsoft.de</author> + + +<B>Dual In Line</B> + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Pin Header Connectors</b><p> +<author>Created by librarian@cadsoft.de</author> + + +<b>PIN HEADER</b> + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>Resistors, Capacitors, Inductors</b><p> +Based on the previous libraries: +<ul> +<li>r.lbr +<li>cap.lbr +<li>cap-fe.lbr +<li>captant.lbr +<li>polcap.lbr +<li>ipc-smd.lbr +</ul> +All SMD packages are defined according to the IPC specifications and CECC<p> +<author>Created by librarian@cadsoft.de</author><p> +<p> +for Electrolyt Capacitors see also :<p> +www.bccomponents.com <p> +www.panasonic.com<p> +www.kemet.com<p> +<p> +for trimmer refence see : <u>www.electrospec-inc.com/cross_references/trimpotcrossref.asp</u><p> + +<map name="nav_main"> +<area shape="rect" coords="0,1,140,23" href="../military_specs.asp" title=""> +<area shape="rect" coords="0,24,140,51" href="../about.asp" title=""> +<area shape="rect" coords="1,52,140,77" href="../rfq.asp" title=""> +<area shape="rect" coords="0,78,139,103" href="../products.asp" title=""> +<area shape="rect" coords="1,102,138,128" href="../excess_inventory.asp" title=""> +<area shape="rect" coords="1,129,138,150" href="../edge.asp" title=""> +<area shape="rect" coords="1,151,139,178" href="../industry_links.asp" title=""> +<area shape="rect" coords="0,179,139,201" href="../comments.asp" title=""> +<area shape="rect" coords="1,203,138,231" href="../directory.asp" title=""> +<area shape="default" nohref> +</map> + +<html> + +<title></title> + + <LINK REL="StyleSheet" TYPE="text/css" HREF="style-sheet.css"> + +<body bgcolor="#ffffff" text="#000000" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0"> +<table border=0 cellspacing=0 cellpadding=0 width="100%" cellpaddding=0 height="55%"> +<tr valign="top"> + +</td> +<! <td width="10">&nbsp;</td> +<td width="90%"> + +<b><font color="#0000FF" size="4">TRIM-POT CROSS REFERENCE</font></b> +<P> +<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2> + <TR> + <TD COLSPAN=8> + <FONT SIZE=3 FACE=ARIAL><B>RECTANGULAR MULTI-TURN</B></FONT> + </TD> + </TR> + <TR> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">BOURNS</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">BI&nbsp;TECH</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">DALE-VISHAY</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">PHILIPS/MEPCO</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">MURATA</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">PANASONIC</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">SPECTROL</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">MILSPEC</FONT> + </B> + </TD><TD>&nbsp;</TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3 > + 3005P<BR> + 3006P<BR> + 3006W<BR> + 3006Y<BR> + 3009P<BR> + 3009W<BR> + 3009Y<BR> + 3057J<BR> + 3057L<BR> + 3057P<BR> + 3057Y<BR> + 3059J<BR> + 3059L<BR> + 3059P<BR> + 3059Y<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 89P<BR> + 89W<BR> + 89X<BR> + 89PH<BR> + 76P<BR> + 89XH<BR> + 78SLT<BR> + 78L&nbsp;ALT<BR> + 56P&nbsp;ALT<BR> + 78P&nbsp;ALT<BR> + T8S<BR> + 78L<BR> + 56P<BR> + 78P<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + T18/784<BR> + 783<BR> + 781<BR> + -<BR> + -<BR> + -<BR> + 2199<BR> + 1697/1897<BR> + 1680/1880<BR> + 2187<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 8035EKP/CT20/RJ-20P<BR> + -<BR> + RJ-20X<BR> + -<BR> + -<BR> + -<BR> + 1211L<BR> + 8012EKQ&nbsp;ALT<BR> + 8012EKR&nbsp;ALT<BR> + 1211P<BR> + 8012EKJ<BR> + 8012EKL<BR> + 8012EKQ<BR> + 8012EKR<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 2101P<BR> + 2101W<BR> + 2101Y<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 2102L<BR> + 2102S<BR> + 2102Y<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + EVMCOG<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 43P<BR> + 43W<BR> + 43Y<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 40L<BR> + 40P<BR> + 40Y<BR> + 70Y-T602<BR> + 70L<BR> + 70P<BR> + 70Y<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + RT/RTR12<BR> + RT/RTR12<BR> + RT/RTR12<BR> + -<BR> + RJ/RJR12<BR> + RJ/RJR12<BR> + RJ/RJR12<BR></FONT> + </TD> + </TR> + <TR> + <TD COLSPAN=8>&nbsp; + </TD> + </TR> + <TR> + <TD COLSPAN=8> + <FONT SIZE=4 FACE=ARIAL><B>SQUARE MULTI-TURN</B></FONT> + </TD> + </TR> + <TR> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3250L<BR> + 3250P<BR> + 3250W<BR> + 3250X<BR> + 3252P<BR> + 3252W<BR> + 3252X<BR> + 3260P<BR> + 3260W<BR> + 3260X<BR> + 3262P<BR> + 3262W<BR> + 3262X<BR> + 3266P<BR> + 3266W<BR> + 3266X<BR> + 3290H<BR> + 3290P<BR> + 3290W<BR> + 3292P<BR> + 3292W<BR> + 3292X<BR> + 3296P<BR> + 3296W<BR> + 3296X<BR> + 3296Y<BR> + 3296Z<BR> + 3299P<BR> + 3299W<BR> + 3299X<BR> + 3299Y<BR> + 3299Z<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 66P&nbsp;ALT<BR> + 66W&nbsp;ALT<BR> + 66X&nbsp;ALT<BR> + 66P&nbsp;ALT<BR> + 66W&nbsp;ALT<BR> + 66X&nbsp;ALT<BR> + -<BR> + 64W&nbsp;ALT<BR> + -<BR> + 64P&nbsp;ALT<BR> + 64W&nbsp;ALT<BR> + 64X&nbsp;ALT<BR> + 64P<BR> + 64W<BR> + 64X<BR> + 66X&nbsp;ALT<BR> + 66P&nbsp;ALT<BR> + 66W&nbsp;ALT<BR> + 66P<BR> + 66W<BR> + 66X<BR> + 67P<BR> + 67W<BR> + 67X<BR> + 67Y<BR> + 67Z<BR> + 68P<BR> + 68W<BR> + 68X<BR> + 67Y&nbsp;ALT<BR> + 67Z&nbsp;ALT<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 5050<BR> + 5091<BR> + 5080<BR> + 5087<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + T63YB<BR> + T63XB<BR> + -<BR> + -<BR> + -<BR> + 5887<BR> + 5891<BR> + 5880<BR> + -<BR> + -<BR> + -<BR> + T93Z<BR> + T93YA<BR> + T93XA<BR> + T93YB<BR> + T93XB<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 8026EKP<BR> + 8026EKW<BR> + 8026EKM<BR> + 8026EKP<BR> + 8026EKB<BR> + 8026EKM<BR> + 1309X<BR> + 1309P<BR> + 1309W<BR> + 8024EKP<BR> + 8024EKW<BR> + 8024EKN<BR> + RJ-9P/CT9P<BR> + RJ-9W<BR> + RJ-9X<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 3103P<BR> + 3103Y<BR> + 3103Z<BR> + 3103P<BR> + 3103Y<BR> + 3103Z<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 3105P/3106P<BR> + 3105W/3106W<BR> + 3105X/3106X<BR> + 3105Y/3106Y<BR> + 3105Z/3105Z<BR> + 3102P<BR> + 3102W<BR> + 3102X<BR> + 3102Y<BR> + 3102Z<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + EVMCBG<BR> + EVMCCG<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 55-1-X<BR> + 55-4-X<BR> + 55-3-X<BR> + 55-2-X<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 50-2-X<BR> + 50-4-X<BR> + 50-3-X<BR> + -<BR> + -<BR> + -<BR> + 64P<BR> + 64W<BR> + 64X<BR> + 64Y<BR> + 64Z<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + RT/RTR22<BR> + RT/RTR22<BR> + RT/RTR22<BR> + RT/RTR22<BR> + RJ/RJR22<BR> + RJ/RJR22<BR> + RJ/RJR22<BR> + RT/RTR26<BR> + RT/RTR26<BR> + RT/RTR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RT/RTR24<BR> + RT/RTR24<BR> + RT/RTR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> + <TR> + <TD COLSPAN=8>&nbsp; + </TD> + </TR> + <TR> + <TD COLSPAN=8> + <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT> + </TD> + </TR> + <TR> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3323P<BR> + 3323S<BR> + 3323W<BR> + 3329H<BR> + 3329P<BR> + 3329W<BR> + 3339H<BR> + 3339P<BR> + 3339W<BR> + 3352E<BR> + 3352H<BR> + 3352K<BR> + 3352P<BR> + 3352T<BR> + 3352V<BR> + 3352W<BR> + 3362H<BR> + 3362M<BR> + 3362P<BR> + 3362R<BR> + 3362S<BR> + 3362U<BR> + 3362W<BR> + 3362X<BR> + 3386B<BR> + 3386C<BR> + 3386F<BR> + 3386H<BR> + 3386K<BR> + 3386M<BR> + 3386P<BR> + 3386S<BR> + 3386W<BR> + 3386X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 25P<BR> + 25S<BR> + 25RX<BR> + 82P<BR> + 82M<BR> + 82PA<BR> + -<BR> + -<BR> + -<BR> + 91E<BR> + 91X<BR> + 91T<BR> + 91B<BR> + 91A<BR> + 91V<BR> + 91W<BR> + 25W<BR> + 25V<BR> + 25P<BR> + -<BR> + 25S<BR> + 25U<BR> + 25RX<BR> + 25X<BR> + 72XW<BR> + 72XL<BR> + 72PM<BR> + 72RX<BR> + -<BR> + 72PX<BR> + 72P<BR> + 72RXW<BR> + 72RXL<BR> + 72X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + T7YB<BR> + T7YA<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + TXD<BR> + TYA<BR> + TYP<BR> + -<BR> + TYD<BR> + TX<BR> + -<BR> + 150SX<BR> + 100SX<BR> + 102T<BR> + 101S<BR> + 190T<BR> + 150TX<BR> + 101<BR> + -<BR> + -<BR> + 101SX<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + ET6P<BR> + ET6S<BR> + ET6X<BR> + RJ-6W/8014EMW<BR> + RJ-6P/8014EMP<BR> + RJ-6X/8014EMX<BR> + TM7W<BR> + TM7P<BR> + TM7X<BR> + -<BR> + 8017SMS<BR> + -<BR> + 8017SMB<BR> + 8017SMA<BR> + -<BR> + -<BR> + CT-6W<BR> + CT-6H<BR> + CT-6P<BR> + CT-6R<BR> + -<BR> + CT-6V<BR> + CT-6X<BR> + -<BR> + -<BR> + 8038EKV<BR> + -<BR> + 8038EKX<BR> + -<BR> + -<BR> + 8038EKP<BR> + 8038EKZ<BR> + 8038EKW<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + 3321H<BR> + 3321P<BR> + 3321N<BR> + 1102H<BR> + 1102P<BR> + 1102T<BR> + RVA0911V304A<BR> + -<BR> + RVA0911H413A<BR> + RVG0707V100A<BR> + RVA0607V(H)306A<BR> + RVA1214H213A<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 3104B<BR> + 3104C<BR> + 3104F<BR> + 3104H<BR> + -<BR> + 3104M<BR> + 3104P<BR> + 3104S<BR> + 3104W<BR> + 3104X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + EVMQ0G<BR> + EVMQIG<BR> + EVMQ3G<BR> + EVMS0G<BR> + EVMQ0G<BR> + EVMG0G<BR> + -<BR> + -<BR> + -<BR> + EVMK4GA00B<BR> + EVM30GA00B<BR> + EVMK0GA00B<BR> + EVM38GA00B<BR> + EVMB6<BR> + EVLQ0<BR> + -<BR> + EVMMSG<BR> + EVMMBG<BR> + EVMMAG<BR> + -<BR> + -<BR> + EVMMCS<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + EVMM1<BR> + -<BR> + -<BR> + EVMM0<BR> + -<BR> + -<BR> + EVMM3<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + 62-3-1<BR> + 62-1-2<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 67R<BR> + -<BR> + 67P<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 67X<BR> + 63V<BR> + 63S<BR> + 63M<BR> + -<BR> + -<BR> + 63H<BR> + 63P<BR> + -<BR> + -<BR> + 63X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + RJ/RJR50<BR> + RJ/RJR50<BR> + RJ/RJR50<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> +</TABLE> +<P>&nbsp;<P> +<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3> + <TR> + <TD COLSPAN=7> + <FONT color="#0000FF" SIZE=4 FACE=ARIAL><B>SMD TRIM-POT CROSS REFERENCE</B></FONT> + <P> + <FONT SIZE=4 FACE=ARIAL><B>MULTI-TURN</B></FONT> + </TD> + </TR> + <TR> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3224G<BR> + 3224J<BR> + 3224W<BR> + 3269P<BR> + 3269W<BR> + 3269X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 44G<BR> + 44J<BR> + 44W<BR> + 84P<BR> + 84W<BR> + 84X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + ST63Z<BR> + ST63Y<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + ST5P<BR> + ST5W<BR> + ST5X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> + <TR> + <TD COLSPAN=7>&nbsp; + </TD> + </TR> + <TR> + <TD COLSPAN=7> + <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT> + </TD> + </TR> + <TR> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3314G<BR> + 3314J<BR> + 3364A/B<BR> + 3364C/D<BR> + 3364W/X<BR> + 3313G<BR> + 3313J<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 23B<BR> + 23A<BR> + 21X<BR> + 21W<BR> + -<BR> + 22B<BR> + 22A<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + ST5YL/ST53YL<BR> + ST5YJ/5T53YJ<BR> + ST-23A<BR> + ST-22B<BR> + ST-22<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + ST-4B<BR> + ST-4A<BR> + -<BR> + -<BR> + -<BR> + ST-3B<BR> + ST-3A<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + EVM-6YS<BR> + EVM-1E<BR> + EVM-1G<BR> + EVM-1D<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + G4B<BR> + G4A<BR> + TR04-3S1<BR> + TRG04-2S1<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + DVR-43A<BR> + CVR-42C<BR> + CVR-42A/C<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> +</TABLE> +<P> +<FONT SIZE=4 FACE=ARIAL><B>ALT =&nbsp;ALTERNATE</B></FONT> +<P> + +&nbsp; +<P> +</td> +</tr> +</table> +</BODY></HTML> + + +<b>RESISTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +type 0204, grid 2.5 mm + + + + + + +>NAME +>VALUE + + + + + + +<b>PIN HEADER</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + +<b>EAGLE Design Rules</b> +<p> +Die Standard-Design-Rules sind so gewählt, dass sie für +die meisten Anwendungen passen. Sollte ihre Platine +besondere Anforderungen haben, treffen Sie die erforderlichen +Einstellungen hier und speichern die Design Rules unter +einem neuen Namen ab. +<b>EAGLE Design Rules</b> +<p> +The default Design Rules have been set to cover +a wide range of applications. Your particular design +may have different requirements, so please make the +necessary adjustments and save your customized +design rules under a new name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Since Version 8.2, Eagle supports online libraries. The ids +of those online libraries will not be understood (or retained) +with this version. + + + diff --git a/eeschema/qa/data/eagle_schematics/eagle-import-testfile.sch b/eeschema/qa/data/eagle_schematics/eagle-import-testfile.sch new file mode 100644 index 0000000000..ffd7bf5186 --- /dev/null +++ b/eeschema/qa/data/eagle_schematics/eagle-import-testfile.sch @@ -0,0 +1,13530 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>Supply Symbols</b><p> + GND, VCC, 0V, +5V, -5V, etc.<p> + Please keep in mind, that these devices are necessary for the + automatic wiring of the supply signals.<p> + The pin name defined in the symbol is identical to the net which is to be wired automatically.<p> + In this library the device names are the same as the pin names of the symbols, therefore the correct signal names appear next to the supply symbols in the schematic.<p> + <author>Created by librarian@cadsoft.de</author> + + + + + +>VALUE + + + + + +>VALUE + + + + + +<b>SUPPLY SYMBOL</b> + + + + + + + + + + + + +<b>SUPPLY SYMBOL</b> + + + + + + + + + + + + + + +<b>Resistors, Capacitors, Inductors</b><p> +Based on the previous libraries: +<ul> +<li>r.lbr +<li>cap.lbr +<li>cap-fe.lbr +<li>captant.lbr +<li>polcap.lbr +<li>ipc-smd.lbr +</ul> +All SMD packages are defined according to the IPC specifications and CECC<p> +<author>Created by librarian@cadsoft.de</author><p> +<p> +for Electrolyt Capacitors see also :<p> +www.bccomponents.com <p> +www.panasonic.com<p> +www.kemet.com<p> +<p> +for trimmer refence see : <u>www.electrospec-inc.com/cross_references/trimpotcrossref.asp</u><p> + +<map name="nav_main"> +<area shape="rect" coords="0,1,140,23" href="../military_specs.asp" title=""> +<area shape="rect" coords="0,24,140,51" href="../about.asp" title=""> +<area shape="rect" coords="1,52,140,77" href="../rfq.asp" title=""> +<area shape="rect" coords="0,78,139,103" href="../products.asp" title=""> +<area shape="rect" coords="1,102,138,128" href="../excess_inventory.asp" title=""> +<area shape="rect" coords="1,129,138,150" href="../edge.asp" title=""> +<area shape="rect" coords="1,151,139,178" href="../industry_links.asp" title=""> +<area shape="rect" coords="0,179,139,201" href="../comments.asp" title=""> +<area shape="rect" coords="1,203,138,231" href="../directory.asp" title=""> +<area shape="default" nohref> +</map> + +<html> + +<title></title> + + <LINK REL="StyleSheet" TYPE="text/css" HREF="style-sheet.css"> + +<body bgcolor="#ffffff" text="#000000" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0"> +<table border=0 cellspacing=0 cellpadding=0 width="100%" cellpaddding=0 height="55%"> +<tr valign="top"> + +</td> +<! <td width="10">&nbsp;</td> +<td width="90%"> + +<b><font color="#0000FF" size="4">TRIM-POT CROSS REFERENCE</font></b> +<P> +<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2> + <TR> + <TD COLSPAN=8> + <FONT SIZE=3 FACE=ARIAL><B>RECTANGULAR MULTI-TURN</B></FONT> + </TD> + </TR> + <TR> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">BOURNS</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">BI&nbsp;TECH</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">DALE-VISHAY</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">PHILIPS/MEPCO</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">MURATA</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">PANASONIC</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">SPECTROL</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">MILSPEC</FONT> + </B> + </TD><TD>&nbsp;</TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3 > + 3005P<BR> + 3006P<BR> + 3006W<BR> + 3006Y<BR> + 3009P<BR> + 3009W<BR> + 3009Y<BR> + 3057J<BR> + 3057L<BR> + 3057P<BR> + 3057Y<BR> + 3059J<BR> + 3059L<BR> + 3059P<BR> + 3059Y<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 89P<BR> + 89W<BR> + 89X<BR> + 89PH<BR> + 76P<BR> + 89XH<BR> + 78SLT<BR> + 78L&nbsp;ALT<BR> + 56P&nbsp;ALT<BR> + 78P&nbsp;ALT<BR> + T8S<BR> + 78L<BR> + 56P<BR> + 78P<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + T18/784<BR> + 783<BR> + 781<BR> + -<BR> + -<BR> + -<BR> + 2199<BR> + 1697/1897<BR> + 1680/1880<BR> + 2187<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 8035EKP/CT20/RJ-20P<BR> + -<BR> + RJ-20X<BR> + -<BR> + -<BR> + -<BR> + 1211L<BR> + 8012EKQ&nbsp;ALT<BR> + 8012EKR&nbsp;ALT<BR> + 1211P<BR> + 8012EKJ<BR> + 8012EKL<BR> + 8012EKQ<BR> + 8012EKR<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 2101P<BR> + 2101W<BR> + 2101Y<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 2102L<BR> + 2102S<BR> + 2102Y<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + EVMCOG<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 43P<BR> + 43W<BR> + 43Y<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 40L<BR> + 40P<BR> + 40Y<BR> + 70Y-T602<BR> + 70L<BR> + 70P<BR> + 70Y<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + RT/RTR12<BR> + RT/RTR12<BR> + RT/RTR12<BR> + -<BR> + RJ/RJR12<BR> + RJ/RJR12<BR> + RJ/RJR12<BR></FONT> + </TD> + </TR> + <TR> + <TD COLSPAN=8>&nbsp; + </TD> + </TR> + <TR> + <TD COLSPAN=8> + <FONT SIZE=4 FACE=ARIAL><B>SQUARE MULTI-TURN</B></FONT> + </TD> + </TR> + <TR> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3250L<BR> + 3250P<BR> + 3250W<BR> + 3250X<BR> + 3252P<BR> + 3252W<BR> + 3252X<BR> + 3260P<BR> + 3260W<BR> + 3260X<BR> + 3262P<BR> + 3262W<BR> + 3262X<BR> + 3266P<BR> + 3266W<BR> + 3266X<BR> + 3290H<BR> + 3290P<BR> + 3290W<BR> + 3292P<BR> + 3292W<BR> + 3292X<BR> + 3296P<BR> + 3296W<BR> + 3296X<BR> + 3296Y<BR> + 3296Z<BR> + 3299P<BR> + 3299W<BR> + 3299X<BR> + 3299Y<BR> + 3299Z<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 66P&nbsp;ALT<BR> + 66W&nbsp;ALT<BR> + 66X&nbsp;ALT<BR> + 66P&nbsp;ALT<BR> + 66W&nbsp;ALT<BR> + 66X&nbsp;ALT<BR> + -<BR> + 64W&nbsp;ALT<BR> + -<BR> + 64P&nbsp;ALT<BR> + 64W&nbsp;ALT<BR> + 64X&nbsp;ALT<BR> + 64P<BR> + 64W<BR> + 64X<BR> + 66X&nbsp;ALT<BR> + 66P&nbsp;ALT<BR> + 66W&nbsp;ALT<BR> + 66P<BR> + 66W<BR> + 66X<BR> + 67P<BR> + 67W<BR> + 67X<BR> + 67Y<BR> + 67Z<BR> + 68P<BR> + 68W<BR> + 68X<BR> + 67Y&nbsp;ALT<BR> + 67Z&nbsp;ALT<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 5050<BR> + 5091<BR> + 5080<BR> + 5087<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + T63YB<BR> + T63XB<BR> + -<BR> + -<BR> + -<BR> + 5887<BR> + 5891<BR> + 5880<BR> + -<BR> + -<BR> + -<BR> + T93Z<BR> + T93YA<BR> + T93XA<BR> + T93YB<BR> + T93XB<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 8026EKP<BR> + 8026EKW<BR> + 8026EKM<BR> + 8026EKP<BR> + 8026EKB<BR> + 8026EKM<BR> + 1309X<BR> + 1309P<BR> + 1309W<BR> + 8024EKP<BR> + 8024EKW<BR> + 8024EKN<BR> + RJ-9P/CT9P<BR> + RJ-9W<BR> + RJ-9X<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 3103P<BR> + 3103Y<BR> + 3103Z<BR> + 3103P<BR> + 3103Y<BR> + 3103Z<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 3105P/3106P<BR> + 3105W/3106W<BR> + 3105X/3106X<BR> + 3105Y/3106Y<BR> + 3105Z/3105Z<BR> + 3102P<BR> + 3102W<BR> + 3102X<BR> + 3102Y<BR> + 3102Z<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + EVMCBG<BR> + EVMCCG<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 55-1-X<BR> + 55-4-X<BR> + 55-3-X<BR> + 55-2-X<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 50-2-X<BR> + 50-4-X<BR> + 50-3-X<BR> + -<BR> + -<BR> + -<BR> + 64P<BR> + 64W<BR> + 64X<BR> + 64Y<BR> + 64Z<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + RT/RTR22<BR> + RT/RTR22<BR> + RT/RTR22<BR> + RT/RTR22<BR> + RJ/RJR22<BR> + RJ/RJR22<BR> + RJ/RJR22<BR> + RT/RTR26<BR> + RT/RTR26<BR> + RT/RTR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RT/RTR24<BR> + RT/RTR24<BR> + RT/RTR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> + <TR> + <TD COLSPAN=8>&nbsp; + </TD> + </TR> + <TR> + <TD COLSPAN=8> + <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT> + </TD> + </TR> + <TR> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3323P<BR> + 3323S<BR> + 3323W<BR> + 3329H<BR> + 3329P<BR> + 3329W<BR> + 3339H<BR> + 3339P<BR> + 3339W<BR> + 3352E<BR> + 3352H<BR> + 3352K<BR> + 3352P<BR> + 3352T<BR> + 3352V<BR> + 3352W<BR> + 3362H<BR> + 3362M<BR> + 3362P<BR> + 3362R<BR> + 3362S<BR> + 3362U<BR> + 3362W<BR> + 3362X<BR> + 3386B<BR> + 3386C<BR> + 3386F<BR> + 3386H<BR> + 3386K<BR> + 3386M<BR> + 3386P<BR> + 3386S<BR> + 3386W<BR> + 3386X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 25P<BR> + 25S<BR> + 25RX<BR> + 82P<BR> + 82M<BR> + 82PA<BR> + -<BR> + -<BR> + -<BR> + 91E<BR> + 91X<BR> + 91T<BR> + 91B<BR> + 91A<BR> + 91V<BR> + 91W<BR> + 25W<BR> + 25V<BR> + 25P<BR> + -<BR> + 25S<BR> + 25U<BR> + 25RX<BR> + 25X<BR> + 72XW<BR> + 72XL<BR> + 72PM<BR> + 72RX<BR> + -<BR> + 72PX<BR> + 72P<BR> + 72RXW<BR> + 72RXL<BR> + 72X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + T7YB<BR> + T7YA<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + TXD<BR> + TYA<BR> + TYP<BR> + -<BR> + TYD<BR> + TX<BR> + -<BR> + 150SX<BR> + 100SX<BR> + 102T<BR> + 101S<BR> + 190T<BR> + 150TX<BR> + 101<BR> + -<BR> + -<BR> + 101SX<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + ET6P<BR> + ET6S<BR> + ET6X<BR> + RJ-6W/8014EMW<BR> + RJ-6P/8014EMP<BR> + RJ-6X/8014EMX<BR> + TM7W<BR> + TM7P<BR> + TM7X<BR> + -<BR> + 8017SMS<BR> + -<BR> + 8017SMB<BR> + 8017SMA<BR> + -<BR> + -<BR> + CT-6W<BR> + CT-6H<BR> + CT-6P<BR> + CT-6R<BR> + -<BR> + CT-6V<BR> + CT-6X<BR> + -<BR> + -<BR> + 8038EKV<BR> + -<BR> + 8038EKX<BR> + -<BR> + -<BR> + 8038EKP<BR> + 8038EKZ<BR> + 8038EKW<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + 3321H<BR> + 3321P<BR> + 3321N<BR> + 1102H<BR> + 1102P<BR> + 1102T<BR> + RVA0911V304A<BR> + -<BR> + RVA0911H413A<BR> + RVG0707V100A<BR> + RVA0607V(H)306A<BR> + RVA1214H213A<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 3104B<BR> + 3104C<BR> + 3104F<BR> + 3104H<BR> + -<BR> + 3104M<BR> + 3104P<BR> + 3104S<BR> + 3104W<BR> + 3104X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + EVMQ0G<BR> + EVMQIG<BR> + EVMQ3G<BR> + EVMS0G<BR> + EVMQ0G<BR> + EVMG0G<BR> + -<BR> + -<BR> + -<BR> + EVMK4GA00B<BR> + EVM30GA00B<BR> + EVMK0GA00B<BR> + EVM38GA00B<BR> + EVMB6<BR> + EVLQ0<BR> + -<BR> + EVMMSG<BR> + EVMMBG<BR> + EVMMAG<BR> + -<BR> + -<BR> + EVMMCS<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + EVMM1<BR> + -<BR> + -<BR> + EVMM0<BR> + -<BR> + -<BR> + EVMM3<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + 62-3-1<BR> + 62-1-2<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 67R<BR> + -<BR> + 67P<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 67X<BR> + 63V<BR> + 63S<BR> + 63M<BR> + -<BR> + -<BR> + 63H<BR> + 63P<BR> + -<BR> + -<BR> + 63X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + RJ/RJR50<BR> + RJ/RJR50<BR> + RJ/RJR50<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> +</TABLE> +<P>&nbsp;<P> +<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3> + <TR> + <TD COLSPAN=7> + <FONT color="#0000FF" SIZE=4 FACE=ARIAL><B>SMD TRIM-POT CROSS REFERENCE</B></FONT> + <P> + <FONT SIZE=4 FACE=ARIAL><B>MULTI-TURN</B></FONT> + </TD> + </TR> + <TR> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3224G<BR> + 3224J<BR> + 3224W<BR> + 3269P<BR> + 3269W<BR> + 3269X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 44G<BR> + 44J<BR> + 44W<BR> + 84P<BR> + 84W<BR> + 84X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + ST63Z<BR> + ST63Y<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + ST5P<BR> + ST5W<BR> + ST5X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> + <TR> + <TD COLSPAN=7>&nbsp; + </TD> + </TR> + <TR> + <TD COLSPAN=7> + <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT> + </TD> + </TR> + <TR> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3314G<BR> + 3314J<BR> + 3364A/B<BR> + 3364C/D<BR> + 3364W/X<BR> + 3313G<BR> + 3313J<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 23B<BR> + 23A<BR> + 21X<BR> + 21W<BR> + -<BR> + 22B<BR> + 22A<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + ST5YL/ST53YL<BR> + ST5YJ/5T53YJ<BR> + ST-23A<BR> + ST-22B<BR> + ST-22<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + ST-4B<BR> + ST-4A<BR> + -<BR> + -<BR> + -<BR> + ST-3B<BR> + ST-3A<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + EVM-6YS<BR> + EVM-1E<BR> + EVM-1G<BR> + EVM-1D<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + G4B<BR> + G4A<BR> + TR04-3S1<BR> + TRG04-2S1<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + DVR-43A<BR> + CVR-42C<BR> + CVR-42A/C<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> +</TABLE> +<P> +<FONT SIZE=4 FACE=ARIAL><B>ALT =&nbsp;ALTERNATE</B></FONT> +<P> + +&nbsp; +<P> +</td> +</tr> +</table> +</BODY></HTML> + + +<b>RESISTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b> wave soldering<p> + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b> + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +wave soldering + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +Source: http://download.siliconexpert.com/pdfs/2005/02/24/Semi_Ap/2/VSH/Resistor/dcrcwfre.pdf + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b> wave soldering<p> +Source: http://download.siliconexpert.com/pdfs/2005/02/24/Semi_Ap/2/VSH/Resistor/dcrcwfre.pdf + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.10 W + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.25 W + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.12 W + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.10 W + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.25 W + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.25 W + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.12 W + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.25 W + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +type 0204, grid 5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0204, grid 7.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0207, grid 10 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0207, grid 12 mm + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>RESISTOR</b><p> +type 0207, grid 15mm + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>RESISTOR</b><p> +type 0207, grid 2.5 mm + + + + + + + +>NAME +>VALUE + + +<b>RESISTOR</b><p> +type 0207, grid 5 mm + + + + + + + +>NAME +>VALUE + + +<b>RESISTOR</b><p> +type 0207, grid 7.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0309, grid 10mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0309, grid 12.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0411, grid 12.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0411, grid 15 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0411, grid 3.81 mm + + + + + + +>NAME +>VALUE + + + +<b>RESISTOR</b><p> +type 0414, grid 15 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0414, grid 5 mm + + + + + + +>NAME +>VALUE + + + +<b>RESISTOR</b><p> +type 0617, grid 17.5 mm + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0617, grid 22.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0617, grid 5 mm + + + + + + +>NAME +>VALUE + + + +<b>RESISTOR</b><p> +type 0922, grid 22.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>RESISTOR</b><p> +type 0613, grid 5 mm + + + + + + +>NAME +>VALUE + + + +<b>RESISTOR</b><p> +type 0613, grid 15 mm + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0817, grid 22.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +0817 + + + + +<b>RESISTOR</b><p> +type 0817, grid 6.35 mm + + + + + + +>NAME +>VALUE +0817 + + + +<b>RESISTOR</b><p> +type V234, grid 12.5 mm + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type V235, grid 17.78 mm + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type V526-0, grid 2.5 mm + + + + + + + + + + +>NAME +>VALUE + + +<b>Mini MELF 0102 Axial</b> + + + + +>NAME +>VALUE + + + +<b>RESISTOR</b><p> +type 0922, grid 7.5 mm + + + + + + +>NAME +>VALUE +0922 + + + +<b>CECC Size RC2211</b> Reflow Soldering<p> +source Beyschlag + + + + + + +>NAME +>VALUE + + +<b>CECC Size RC2211</b> Wave Soldering<p> +source Beyschlag + + + + + + +>NAME +>VALUE + + +<b>CECC Size RC3715</b> Reflow Soldering<p> +source Beyschlag + + + + + + + + +>NAME +>VALUE + + +<b>CECC Size RC3715</b> Wave Soldering<p> +source Beyschlag + + + + + + + + +>NAME +>VALUE + + +<b>CECC Size RC6123</b> Reflow Soldering<p> +source Beyschlag + + + + + + + + +>NAME +>VALUE + + +<b>CECC Size RC6123</b> Wave Soldering<p> +source Beyschlag + + + + + + + + +>NAME +>VALUE + + +<b>RESISTOR</b><p> +type RDH, grid 15 mm + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +RDH + + + + +<b>RESISTOR</b><p> +type 0204, grid 2.5 mm + + + + + + +>NAME +>VALUE + + +<b>RESISTOR</b><p> +type 0309, grid 2.5 mm + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b> chip<p> +Source: http://www.vishay.com/docs/20008/dcrcw.pdf + + +>NAME +>VALUE + + + + + +<b>Bulk Metal® Foil Technology</b>, Tubular Axial Lead Resistors, Meets or Exceeds MIL-R-39005 Requirements<p> +MIL SIZE RNC55<br> +Source: VISHAY .. vta56.pdf + + + + + + + + +>NAME +>VALUE + + + + +<b>Bulk Metal® Foil Technology</b>, Tubular Axial Lead Resistors, Meets or Exceeds MIL-R-39005 Requirements<p> +MIL SIZE RNC60<br> +Source: VISHAY .. vta56.pdf + + + + + + + + +>NAME +>VALUE + + + + +<b>Bulk Metal® Foil Technology</b>, Tubular Axial Lead Resistors, Meets or Exceeds MIL-R-39005 Requirements<p> +MIL SIZE RBR52<br> +Source: VISHAY .. vta56.pdf + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Bulk Metal® Foil Technology</b>, Tubular Axial Lead Resistors, Meets or Exceeds MIL-R-39005 Requirements<p> +MIL SIZE RBR53<br> +Source: VISHAY .. vta56.pdf + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Bulk Metal® Foil Technology</b>, Tubular Axial Lead Resistors, Meets or Exceeds MIL-R-39005 Requirements<p> +MIL SIZE RBR54<br> +Source: VISHAY .. vta56.pdf + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Bulk Metal® Foil Technology</b>, Tubular Axial Lead Resistors, Meets or Exceeds MIL-R-39005 Requirements<p> +MIL SIZE RBR55<br> +Source: VISHAY .. vta56.pdf + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Bulk Metal® Foil Technology</b>, Tubular Axial Lead Resistors, Meets or Exceeds MIL-R-39005 Requirements<p> +MIL SIZE RBR56<br> +Source: VISHAY .. vta56.pdf + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Package 4527</b><p> +Source: http://www.vishay.com/docs/31059/wsrhigh.pdf + + + + + + +>NAME +>VALUE + + +<b>Wirewound Resistors, Precision Power</b><p> +Source: VISHAY wscwsn.pdf + + + + + + + + + + +>NAME +>VALUE + + +<b>Wirewound Resistors, Precision Power</b><p> +Source: VISHAY wscwsn.pdf + + + + + + +>NAME +>VALUE + + +<b>Wirewound Resistors, Precision Power</b><p> +Source: VISHAY wscwsn.pdf + + + + + + + + + + +>NAME +>VALUE + + +<b>Wirewound Resistors, Precision Power</b><p> +Source: VISHAY wscwsn.pdf + + + + + + + + + + +>NAME +>VALUE + + +<b>Wirewound Resistors, Precision Power</b><p> +Source: VISHAY wscwsn.pdf + + + + + + +>NAME +>VALUE + + +<b>Wirewound Resistors, Precision Power</b><p> +Source: VISHAY wscwsn.pdf + + + + + + +>NAME +>VALUE + + +<b>CRCW1218 Thick Film, Rectangular Chip Resistors</b><p> +Source: http://www.vishay.com .. dcrcw.pdf + + + + +>NAME +>VALUE + + + + +<b>Chip Monolithic Ceramic Capacitors</b> Medium Voltage High Capacitance for General Use<p> +Source: http://www.murata.com .. GRM43DR72E224KW01.pdf + + + + + + +>NAME +>VALUE + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<B>RESISTOR</B>, American symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>Resistors, Capacitors, Inductors</b><p> +Based on the previous libraries: +<ul> +<li>r.lbr +<li>cap.lbr +<li>cap-fe.lbr +<li>captant.lbr +<li>polcap.lbr +<li>ipc-smd.lbr +</ul> +All SMD packages are defined according to the IPC specifications and CECC<p> +<author>Created by librarian@cadsoft.de</author><p> +<p> +for Electrolyt Capacitors see also :<p> +www.bccomponents.com <p> +www.panasonic.com<p> +www.kemet.com<p> +http://www.secc.co.jp/pdf/os_e/2004/e_os_all.pdf <b>(SANYO)</b> +<p> +for trimmer refence see : <u>www.electrospec-inc.com/cross_references/trimpotcrossref.asp</u><p> + +<table border=0 cellspacing=0 cellpadding=0 width="100%" cellpaddding=0> +<tr valign="top"> + +<! <td width="10">&nbsp;</td> +<td width="90%"> + +<b><font color="#0000FF" size="4">TRIM-POT CROSS REFERENCE</font></b> +<P> +<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2> + <TR> + <TD COLSPAN=8> + <FONT SIZE=3 FACE=ARIAL><B>RECTANGULAR MULTI-TURN</B></FONT> + </TD> + </TR> + <TR> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">BOURNS</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">BI&nbsp;TECH</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">DALE-VISHAY</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">PHILIPS/MEPCO</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">MURATA</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">PANASONIC</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">SPECTROL</FONT> + </B> + </TD> + <TD ALIGN=CENTER> + <B> + <FONT SIZE=3 FACE=ARIAL color="#FF0000">MILSPEC</FONT> + </B> + </TD><TD>&nbsp;</TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3 > + 3005P<BR> + 3006P<BR> + 3006W<BR> + 3006Y<BR> + 3009P<BR> + 3009W<BR> + 3009Y<BR> + 3057J<BR> + 3057L<BR> + 3057P<BR> + 3057Y<BR> + 3059J<BR> + 3059L<BR> + 3059P<BR> + 3059Y<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 89P<BR> + 89W<BR> + 89X<BR> + 89PH<BR> + 76P<BR> + 89XH<BR> + 78SLT<BR> + 78L&nbsp;ALT<BR> + 56P&nbsp;ALT<BR> + 78P&nbsp;ALT<BR> + T8S<BR> + 78L<BR> + 56P<BR> + 78P<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + T18/784<BR> + 783<BR> + 781<BR> + -<BR> + -<BR> + -<BR> + 2199<BR> + 1697/1897<BR> + 1680/1880<BR> + 2187<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 8035EKP/CT20/RJ-20P<BR> + -<BR> + RJ-20X<BR> + -<BR> + -<BR> + -<BR> + 1211L<BR> + 8012EKQ&nbsp;ALT<BR> + 8012EKR&nbsp;ALT<BR> + 1211P<BR> + 8012EKJ<BR> + 8012EKL<BR> + 8012EKQ<BR> + 8012EKR<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 2101P<BR> + 2101W<BR> + 2101Y<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 2102L<BR> + 2102S<BR> + 2102Y<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + EVMCOG<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 43P<BR> + 43W<BR> + 43Y<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 40L<BR> + 40P<BR> + 40Y<BR> + 70Y-T602<BR> + 70L<BR> + 70P<BR> + 70Y<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + RT/RTR12<BR> + RT/RTR12<BR> + RT/RTR12<BR> + -<BR> + RJ/RJR12<BR> + RJ/RJR12<BR> + RJ/RJR12<BR></FONT> + </TD> + </TR> + <TR> + <TD COLSPAN=8>&nbsp; + </TD> + </TR> + <TR> + <TD COLSPAN=8> + <FONT SIZE=4 FACE=ARIAL><B>SQUARE MULTI-TURN</B></FONT> + </TD> + </TR> + <TR> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3250L<BR> + 3250P<BR> + 3250W<BR> + 3250X<BR> + 3252P<BR> + 3252W<BR> + 3252X<BR> + 3260P<BR> + 3260W<BR> + 3260X<BR> + 3262P<BR> + 3262W<BR> + 3262X<BR> + 3266P<BR> + 3266W<BR> + 3266X<BR> + 3290H<BR> + 3290P<BR> + 3290W<BR> + 3292P<BR> + 3292W<BR> + 3292X<BR> + 3296P<BR> + 3296W<BR> + 3296X<BR> + 3296Y<BR> + 3296Z<BR> + 3299P<BR> + 3299W<BR> + 3299X<BR> + 3299Y<BR> + 3299Z<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + 66P&nbsp;ALT<BR> + 66W&nbsp;ALT<BR> + 66X&nbsp;ALT<BR> + 66P&nbsp;ALT<BR> + 66W&nbsp;ALT<BR> + 66X&nbsp;ALT<BR> + -<BR> + 64W&nbsp;ALT<BR> + -<BR> + 64P&nbsp;ALT<BR> + 64W&nbsp;ALT<BR> + 64X&nbsp;ALT<BR> + 64P<BR> + 64W<BR> + 64X<BR> + 66X&nbsp;ALT<BR> + 66P&nbsp;ALT<BR> + 66W&nbsp;ALT<BR> + 66P<BR> + 66W<BR> + 66X<BR> + 67P<BR> + 67W<BR> + 67X<BR> + 67Y<BR> + 67Z<BR> + 68P<BR> + 68W<BR> + 68X<BR> + 67Y&nbsp;ALT<BR> + 67Z&nbsp;ALT<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 5050<BR> + 5091<BR> + 5080<BR> + 5087<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + T63YB<BR> + T63XB<BR> + -<BR> + -<BR> + -<BR> + 5887<BR> + 5891<BR> + 5880<BR> + -<BR> + -<BR> + -<BR> + T93Z<BR> + T93YA<BR> + T93XA<BR> + T93YB<BR> + T93XB<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 8026EKP<BR> + 8026EKW<BR> + 8026EKM<BR> + 8026EKP<BR> + 8026EKB<BR> + 8026EKM<BR> + 1309X<BR> + 1309P<BR> + 1309W<BR> + 8024EKP<BR> + 8024EKW<BR> + 8024EKN<BR> + RJ-9P/CT9P<BR> + RJ-9W<BR> + RJ-9X<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 3103P<BR> + 3103Y<BR> + 3103Z<BR> + 3103P<BR> + 3103Y<BR> + 3103Z<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 3105P/3106P<BR> + 3105W/3106W<BR> + 3105X/3106X<BR> + 3105Y/3106Y<BR> + 3105Z/3105Z<BR> + 3102P<BR> + 3102W<BR> + 3102X<BR> + 3102Y<BR> + 3102Z<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + EVMCBG<BR> + EVMCCG<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 55-1-X<BR> + 55-4-X<BR> + 55-3-X<BR> + 55-2-X<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 50-2-X<BR> + 50-4-X<BR> + 50-3-X<BR> + -<BR> + -<BR> + -<BR> + 64P<BR> + 64W<BR> + 64X<BR> + 64Y<BR> + 64Z<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + RT/RTR22<BR> + RT/RTR22<BR> + RT/RTR22<BR> + RT/RTR22<BR> + RJ/RJR22<BR> + RJ/RJR22<BR> + RJ/RJR22<BR> + RT/RTR26<BR> + RT/RTR26<BR> + RT/RTR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RJ/RJR26<BR> + RT/RTR24<BR> + RT/RTR24<BR> + RT/RTR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + RJ/RJR24<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> + <TR> + <TD COLSPAN=8>&nbsp; + </TD> + </TR> + <TR> + <TD COLSPAN=8> + <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT> + </TD> + </TR> + <TR> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT> + </TD> + <TD ALIGN=CENTER> + <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3323P<BR> + 3323S<BR> + 3323W<BR> + 3329H<BR> + 3329P<BR> + 3329W<BR> + 3339H<BR> + 3339P<BR> + 3339W<BR> + 3352E<BR> + 3352H<BR> + 3352K<BR> + 3352P<BR> + 3352T<BR> + 3352V<BR> + 3352W<BR> + 3362H<BR> + 3362M<BR> + 3362P<BR> + 3362R<BR> + 3362S<BR> + 3362U<BR> + 3362W<BR> + 3362X<BR> + 3386B<BR> + 3386C<BR> + 3386F<BR> + 3386H<BR> + 3386K<BR> + 3386M<BR> + 3386P<BR> + 3386S<BR> + 3386W<BR> + 3386X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 25P<BR> + 25S<BR> + 25RX<BR> + 82P<BR> + 82M<BR> + 82PA<BR> + -<BR> + -<BR> + -<BR> + 91E<BR> + 91X<BR> + 91T<BR> + 91B<BR> + 91A<BR> + 91V<BR> + 91W<BR> + 25W<BR> + 25V<BR> + 25P<BR> + -<BR> + 25S<BR> + 25U<BR> + 25RX<BR> + 25X<BR> + 72XW<BR> + 72XL<BR> + 72PM<BR> + 72RX<BR> + -<BR> + 72PX<BR> + 72P<BR> + 72RXW<BR> + 72RXL<BR> + 72X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + T7YB<BR> + T7YA<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + TXD<BR> + TYA<BR> + TYP<BR> + -<BR> + TYD<BR> + TX<BR> + -<BR> + 150SX<BR> + 100SX<BR> + 102T<BR> + 101S<BR> + 190T<BR> + 150TX<BR> + 101<BR> + -<BR> + -<BR> + 101SX<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + ET6P<BR> + ET6S<BR> + ET6X<BR> + RJ-6W/8014EMW<BR> + RJ-6P/8014EMP<BR> + RJ-6X/8014EMX<BR> + TM7W<BR> + TM7P<BR> + TM7X<BR> + -<BR> + 8017SMS<BR> + -<BR> + 8017SMB<BR> + 8017SMA<BR> + -<BR> + -<BR> + CT-6W<BR> + CT-6H<BR> + CT-6P<BR> + CT-6R<BR> + -<BR> + CT-6V<BR> + CT-6X<BR> + -<BR> + -<BR> + 8038EKV<BR> + -<BR> + 8038EKX<BR> + -<BR> + -<BR> + 8038EKP<BR> + 8038EKZ<BR> + 8038EKW<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + 3321H<BR> + 3321P<BR> + 3321N<BR> + 1102H<BR> + 1102P<BR> + 1102T<BR> + RVA0911V304A<BR> + -<BR> + RVA0911H413A<BR> + RVG0707V100A<BR> + RVA0607V(H)306A<BR> + RVA1214H213A<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 3104B<BR> + 3104C<BR> + 3104F<BR> + 3104H<BR> + -<BR> + 3104M<BR> + 3104P<BR> + 3104S<BR> + 3104W<BR> + 3104X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + EVMQ0G<BR> + EVMQIG<BR> + EVMQ3G<BR> + EVMS0G<BR> + EVMQ0G<BR> + EVMG0G<BR> + -<BR> + -<BR> + -<BR> + EVMK4GA00B<BR> + EVM30GA00B<BR> + EVMK0GA00B<BR> + EVM38GA00B<BR> + EVMB6<BR> + EVLQ0<BR> + -<BR> + EVMMSG<BR> + EVMMBG<BR> + EVMMAG<BR> + -<BR> + -<BR> + EVMMCS<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + EVMM1<BR> + -<BR> + -<BR> + EVMM0<BR> + -<BR> + -<BR> + EVMM3<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + 62-3-1<BR> + 62-1-2<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 67R<BR> + -<BR> + 67P<BR> + -<BR> + -<BR> + -<BR> + -<BR> + 67X<BR> + 63V<BR> + 63S<BR> + 63M<BR> + -<BR> + -<BR> + 63H<BR> + 63P<BR> + -<BR> + -<BR> + 63X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + RJ/RJR50<BR> + RJ/RJR50<BR> + RJ/RJR50<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> +</TABLE> +<P>&nbsp;<P> +<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3> + <TR> + <TD COLSPAN=7> + <FONT color="#0000FF" SIZE=4 FACE=ARIAL><B>SMD TRIM-POT CROSS REFERENCE</B></FONT> + <P> + <FONT SIZE=4 FACE=ARIAL><B>MULTI-TURN</B></FONT> + </TD> + </TR> + <TR> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3224G<BR> + 3224J<BR> + 3224W<BR> + 3269P<BR> + 3269W<BR> + 3269X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 44G<BR> + 44J<BR> + 44W<BR> + 84P<BR> + 84W<BR> + 84X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + ST63Z<BR> + ST63Y<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + ST5P<BR> + ST5W<BR> + ST5X<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> + <TR> + <TD COLSPAN=7>&nbsp; + </TD> + </TR> + <TR> + <TD COLSPAN=7> + <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT> + </TD> + </TR> + <TR> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT> + </TD> + <TD> + <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT> + </TD> + </TR> + <TR> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 3314G<BR> + 3314J<BR> + 3364A/B<BR> + 3364C/D<BR> + 3364W/X<BR> + 3313G<BR> + 3313J<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + 23B<BR> + 23A<BR> + 21X<BR> + 21W<BR> + -<BR> + 22B<BR> + 22A<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + ST5YL/ST53YL<BR> + ST5YJ/5T53YJ<BR> + ST-23A<BR> + ST-22B<BR> + ST-22<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + ST-4B<BR> + ST-4A<BR> + -<BR> + -<BR> + -<BR> + ST-3B<BR> + ST-3A<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + EVM-6YS<BR> + EVM-1E<BR> + EVM-1G<BR> + EVM-1D<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + G4B<BR> + G4A<BR> + TR04-3S1<BR> + TRG04-2S1<BR> + -<BR> + -<BR> + -<BR></FONT> + </TD> + <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> + -<BR> + -<BR> + DVR-43A<BR> + CVR-42C<BR> + CVR-42A/C<BR> + -<BR> + -<BR></FONT> + </TD> + </TR> +</TABLE> +<P> +<FONT SIZE=4 FACE=ARIAL><B>ALT =&nbsp;ALTERNATE</B></FONT> +<P> + +&nbsp; +<P> +</td> +</tr> +</table> + + +<b>INDUCTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>INDUCTOR</b><p> +precision wire wound + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>INDUCTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>INDUCTOR</b><p> +molded + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>INDUCTOR</b><p> +precision wire wound + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>INDUCTOR</b><p> +molded + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>INDUCTOR</b><p> +molded + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>INDUCTOR</b> + + + + + + + + +>NAME +>VALUE + + + + + +<b>INDUCTOR</b><p> +molded + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>INDUCTOR</b><p> +precision wire wound + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>INDUCTOR</b><p> +precision wire wound + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>INDUCTOR</b><p> +molded + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>INDUCTOR</b><p> +molded + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>RESISTOR</b><p> +type 0204, grid 5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0204, grid 7.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0204, grid 2.5 mm + + + + + + +>NAME +>VALUE + + +<b>RESISTOR</b><p> +type 0207, grid 10 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0207, grid 12 mm + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>RESISTOR</b><p> +type 0207, grid 15mm + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>RESISTOR</b><p> +type 0207, grid 2.5 mm + + + + + + + +>NAME +>VALUE + + +<b>RESISTOR</b><p> +type 0207, grid 5 mm + + + + + + + +>NAME +>VALUE + + +<b>RESISTOR</b><p> +type 0207, grid 7.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>INDUCTOR</b><p> +chip + + + + +>NAME +>VALUE + + + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + + + + + + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + + + + +>NAME +>VALUE + + +<b>Inductor</b><p> +Source: TJ-Serie Vishay.pdf + + + +>NAME +>VALUE + + +<b>POWER-CHOKE WE-TPC</b><p> +Würth Elektronik, Partnumber: 744053220<br> +Source: WE-TPC 744053220.pdf + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>POWER INDUCTORS</b> (SMT Type)<p> +Source: www.sumida.com/products/pdf/CEP125.pdf + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>NIS02 Chip Inductor</b><p> +Source: http://www.niccomp.com/Catalog/nis.pdf + + +>NAME +>VALUE + + + + + + +<b>PIS 2826</b> Inductor<p> +Source: http://www.stetco.com/products/inductors/pdf/PIS2816.pdf + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<B>Vishay Dale Inductor</b><p> +Source: www.vishay.com .. ir.pdf + + + + + + + + + + + + +>NAME +>VALUE + + + + +<B>Vishay Dale Inductor</b><p> +Source: www.vishay.com .. ir.pdf + + + + + + + + + + + + +>NAME +>VALUE + + + + +<B>Vishay Dale Inductor</b><p> +Source: www.vishay.com .. irf.pdf + + + + + + + + + + + + +>NAME +>VALUE + + + + +<B>Vishay Dale Inductor</b><p> +Source: www.vishay.com .. irf.pdf + + + + + + + + + + + + +>NAME +>VALUE + + + + +<B>Vishay Dale Inductor</b><p> +Source: www.vishay.com .. irf24.pdf + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<B>Vishay Dale Inductor</b><p> +Source: www.vishay.com .. irf36.pdf + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<B>Vishay Dale Inductor</b><p> +Source: www.vishay.com .. irf46.pdf + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>TAYO YUDEN Inductor</b><p> +Source: je999f5.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>TAYO YUDEN Inductor</b><p> +Source: je999f5.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>TAYO YUDEN Inductor</b><p> +Source: je999f5.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>TAYO YUDEN Inductor</b><p> +Source: je999f5.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>TAYO YUDEN Inductor</b><p> +Source: je999f5.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>TAYO YUDEN Inductor</b><p> +Source: je999f5.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>TAYO YUDEN Inductor</b><p> +Source: je999f5.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Axial Conformal Coated Inductor</b><p> +Source: TOP MAGNETICS CORPORATION .. tfi.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Axial Conformal Coated Inductor</b><p> +Source: TOP MAGNETICS CORPORATION .. tfi.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Axial Conformal Coated Inductor</b><p> +Source: TOP MAGNETICS CORPORATION .. tfi.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Axial Conformal Coated Inductor</b><p> +Source: TOP MAGNETICS CORPORATION .. tfi.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Axial Conformal Coated Inductor</b><p> +Source: TOP MAGNETICS CORPORATION .. tfi.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Radial Lead RF Chokes</b><p> +Source: www.bourns.com .. 6000_series.pdf + + + +>NAME +>VALUE + + +<b>TANTALUM CAPACITOR</b> + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>TANTALUM CAPACITOR</b> + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>TANTALUM CAPACITOR</b> + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>TANTALUM CAPACITOR</b> + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +body 5 x 5 mm, rectangle, grid 2.54 mm + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +body 7.6 x 5 mm, rectangle, grid 5.08 mm + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +body 12.7 x 7.6 mm, rectangle, grid 10.16 mm + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +body 12.5 x 12.5 mm, rectangle, grid 10.16 mm + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 4 mm, grid 2.54 mm + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 4 mm, grid 2.54 mm + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 5 mm, grid 2.54 mm + + + + + + + + + + + + +>NAME +>VALUE +TT + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 6 mm, grid 2.54 mm + + + + + + + + + + + + +>NAME +>VALUE +TT + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 6 mm, grid 2.54 mm + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 7 mm, grid 2.54 mm + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 7 mm, grid 2.54 mm + + + + + + + + + + + + +>NAME +>VALUE +TT + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 10 mm, grid 5.08 mm + + + + + + + + + + + + +>NAME +>VALUE +TT + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 11 mm, grid 5.08 mm + + + + + + + + + + + + +>NAME +>VALUE +TT + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 11 mm, grid 5.08 mm + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 6 mm, grid 5.08 mm + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 6 mm, grid 5.08 mm + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 7 mm, grid 5.08 mm + + + + + + + + + + + + +>NAME +>VALUE +TT + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 7 mm, grid 5.08 mm + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 9 mm, grid 5.08 mm + + + + + + + + + + + + +>NAME +>VALUE +TT + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 9 mm, grid 5.08 mm + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +rectangle, grid 2.54 mm + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +rectangle, grid 5.08 mm + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +rectangle, grid 5.08 mm + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +rectangle, grid 10.16 mm + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +rectangle, grid 10.16 mm + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 4.5 mm, grid 5.08 mm + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 5.0 mm, grid 5.08 mm + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 7.0 mm, grid 5.08 mm + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 6.0 mm, grid 5.08 mm + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 8.0 mm, grid 5.08 mm + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 1.8 mm, diameter 4 mm + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 15.24 mm, diameter 5 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 15.24 mm, diameter 6 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 15.24 mm, diameter 9 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 2.54 mm, diameter 4 mm + + + + + + + + +>NAME +>VALUE + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 2.54 mm, diameter 5 mm + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 2.54 mm, diameter 6 mm + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 2.54 mm, diameter 7 mm + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 2.54 mm, diameter 4 mm, + + + + + + + + +>NAME +>VALUE + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 2 mm, diameter 4 mm + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 2.032 mm, diameter 5 mm + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 22.86 mm, diameter 10 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 22.86 mm, diameter 6 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 22.86 mm, diameter 9 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 3.5 mm, diameter 10 mm + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 25.4 mm, diameter 10 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 25.4 mm, diameter 9 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 3.5 mm, diameter 8 mm + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 30.48 mm, diameter 10 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 30.48 mm, diameter 12 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 30.48 mm, diameter 16 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 35.56 mm, diameter 12 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 30.48 mm, diameter 14 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 30.48 mm, diameter 16 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 30.48 mm, diameter 18 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 45.72 mm, diameter 16 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 45.72 mm, diameter 18 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 45.72 mm, diameter 21 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 45.72 mm, diameter 22 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 45.72 mm, diameter 25 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 5.08 mm, diameter 10.5 mm + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 5.08 mm, diameter 13 mm + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 5.05 mm, diameter 4 mm + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 5.08 mm, diameter 5 mm + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 5.08 mm, diameter 6 mm + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 5.08 mm, diameter 8.5 mm + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 50 mm, diameter 25 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 50 mm, diameter 30 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 55 mm, diameter 25 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 55 mm, diameter 30 mm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 5.08 mm, diameter 9 mm + + + + + + + + + +>NAME +>VALUE + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 7.62 mm, diameter 16 mm + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 7.62 mm, diameter 18 mm + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 10.16 mm, diameter 20 mm + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 10.16 mm, diameter 22.5 mm + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 10.16 mm, diameter 25 mm + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 10.16 mm, diameter 30 mm + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 10.16 mm, diameter 35 mm + + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>Aluminum electrolytic capacitors</b> reflow soldering<p> +SMD (Chip) Standard 085 CS<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Aluminum electrolytic capacitors</b> wave soldering<p> +SMD (Chip) Standard 085 CS<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Aluminum electrolytic capacitors</b> reflow soldering<p> +SMD (Chip) Standard 085 CS<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Aluminum electrolytic capacitors</b> wave soldering<p> +SMD (Chip) Standard 085 CS<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Aluminum electrolytic capacitors</b> reflow soldering<p> +SMD (Chip) Long Life 139 CLL<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Aluminum electrolytic capacitors</b> wave soldering<p> +SMD (Chip) Long Life 139 CLL<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Aluminum electrolytic capacitors</b> reflow soldering<p> +SMD (Chip) Long Life 139 CLL<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Aluminum electrolytic capacitors</b> wave soldering<p> +SMD (Chip) Long Life 139 CLL<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>Aluminum electrolytic capacitors SMD (Chip)</b><p> +Long life base plate, High temperature 140 CLH<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors SMD (Chip)</b><p> +Long life base plate, High temperature 140 CLH<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors SMD (Chip)</b><p> +Long life base plate, High temperature 140 CLH<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors SMD (Chip)</b><p> +Long life base plate, very low impedance 150 CLZ<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors SMD (Chip)</b><p> +Long life base plate, very low impedance 150 CLZ<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors SMD (Chip)</b><p> +Long life base plate, very low impedance 150 CLZ<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors</b><p> +SMD (Chip) Long Life Vertical 153 CLV<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors</b><p> +SMD (Chip) Long Life Vertical 153 CLV<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors</b><p> +SMD (Chip) Long Life Vertical 153 CLV<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors</b><p> +SMD (Chip) Long Life Vertical 153 CLV<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors</b><p> +SMD (Chip) Long Life Vertical 153 CLV<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors</b><p> +SMD (Chip) Long Life Vertical 153 CLV<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors</b><p> +SMD (Chip) Long Life Vertical 153 CLV<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors</b><p> +SMD (Chip) Long Life Vertical 153 CLV<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors</b><p> +High Temperature solid electrolytic SMD 175 TMP<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Aluminum electrolytic capacitors</b><p> +High Temperature solid electrolytic SMD 175 TMP<p> +http://www.bccomponents.com/ + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Chip Capacitor Type KEMET A / EIA 3216-18 reflow solder</b><p>KEMET S / EIA 3216-12 + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor Type KEMET A / EIA 3216-18 Wave solder</b><p> +KEMET S / EIA 3216-12 + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor Type KEMET B / EIA 3528-21 reflow solder</b><p>KEMET T / EIA 3528-12 + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor Type KEMET B / EIA 3528-21 Wave solder</b><p> +KEMET T / EIA 3528-12 + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor Type KEMET C / EIA 6032-28 reflow solder</b><p>KEMET U / EIA 6032-15 + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor Type KEMET C / EIA 6032-28 Wafe solder</b><p> +KEMET U / EIA 6032-15 + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor Type KEMET D / EIA 7343-21</b><p>KEMET V / EIA 7343-20, KEMET X / EIA 7343-43 reflow solder + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor Type KEMET D / EIA 7343-21</b><p> +KEMET V / EIA 7343-20, KEMET X / EIA 7343-43 Wafe solder + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor Type KEMET E / EIA 7260-38 reflow solder</b> + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor Type KEMET E / EIA 7260-38 Wafe solder</b> + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor Type KEMET R/EIA 2012-12 reflow solder</b> + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor Type KEMET R/EIA 2012-12 Wafe solder</b> + + + + + + +>NAME +>VALUE + + + + + +<b>Panasonic Aluminium Electrolytic Capacitor VS-Serie Package A</b> + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + +<b>Panasonic Aluminium Electrolytic Capacitor VS-Serie Package B</b> + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + +<b>Panasonic Aluminium Electrolytic Capacitor VS-Serie Package C</b> + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + +<b>Panasonic Aluminium Electrolytic Capacitor VS-Serie Package D</b> + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + +<b>Panasonic Aluminium Electrolytic Capacitor VS-Serie Package E</b> + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + +<b>Panasonic Aluminium Electrolytic Capacitor VS-Serie Package F</b> + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + +<b>Panasonic Aluminium Electrolytic Capacitor VS-Serie Package G</b> + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +diameter 5 mm, grid 2.54 mm + + + + + + + + + + + + + + + + + +>NAME +>VALUE +TT + + + + + + + +<b>ELECTROLYTIC CAPACITOR</b><p> +grid 2.54 mm, diameter 6 mm + + + + + + + + + + + + +>NAME +>VALUE + + + +<b>Chip Capacitor </b> Polar tantalum capacitors with solid electrolyte<p> +Siemens Matsushita Components B 45 194, B 45 197, B 45 198<br> +Source: www.farnell.com/datasheets/247.pdf + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor</b> Polar tantalum capacitors with solid electrolyte<p> +Siemens Matsushita Components B 45 194<br> +Source: www.farnell.com/datasheets/247.pdf + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor</b> Polar tantalum capacitors with solid electrolyte<p> +Siemens Matsushita Components B 45 194<br> +Source: www.farnell.com/datasheets/247.pdf + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor </b> Polar tantalum capacitors with solid electrolyte<p> +Siemens Matsushita Components B 45 194, B 45 197, B 45 198<br> +Source: www.farnell.com/datasheets/247.pdf + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor </b> Polar tantalum capacitors with solid electrolyte<p> +Siemens Matsushita Components B 45 194, B 45 197, B 45 198<br> +Source: www.farnell.com/datasheets/247.pdf + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor </b> Polar tantalum capacitors with solid electrolyte<p> +Siemens Matsushita Components B 45 194, B 45 197, B 45 198<br> +Source: www.farnell.com/datasheets/247.pdf + + + + + + +>NAME +>VALUE + + + + + +<b>Chip Capacitor </b> Polar tantalum capacitors with solid electrolyte<p> +Siemens Matsushita Components B 45 194, B 45 197, B 45 198<br> +Source: www.farnell.com/datasheets/247.pdf + + + + + + +>NAME +>VALUE + + + + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b><p> +Source: e_os_all.pdf + + + + +>NAME +>VALUE + + +<b>SANYO OSCON Capacitor</b> SMD type with conductive polymer electrolyte<p> +Source: e_os_all.pdf + + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b> SMD type with conductive polymer electrolyte<p> +Source: e_os_all.pdf + + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b> SMD type with conductive polymer electrolyte<p> +Source: e_os_all.pdf + + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b> SMD type with conductive polymer electrolyte<p> +Source: e_os_all.pdf + + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b> SMD type with conductive polymer electrolyte<p> +Source: e_os_all.pdf + + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b> SMD type with conductive polymer electrolyte<p> +Source: e_os_all.pdf + + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>SANYO OSCON Capacitor</b> SMD type with conductive polymer electrolyte<p> +Source: e_os_all.pdf + + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>ALUMINUM ELECTROLYTIC CAPACITORS</b> UD Series 10 x 10 mm<p> +Source: http://products.nichicon.co.jp/en/pdf/XJA043/e-ud.pdf + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>ALUMINUM ELECTROLYTIC CAPACITORS</b> UD Series 4 x 5.8 mm<p> +Source: http://products.nichicon.co.jp/en/pdf/XJA043/e-ud.pdf + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>ALUMINUM ELECTROLYTIC CAPACITORS</b> UD Series 5 x 5.8 mm<p> +Source: http://products.nichicon.co.jp/en/pdf/XJA043/e-ud.pdf + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>ALUMINUM ELECTROLYTIC CAPACITORS</b> UD Series 6.3 x 5.8 mm<p> +Source: http://products.nichicon.co.jp/en/pdf/XJA043/e-ud.pdf + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>ALUMINUM ELECTROLYTIC CAPACITORS</b> UD Series 6.3 x 7.7 mm<p> +Source: http://products.nichicon.co.jp/en/pdf/XJA043/e-ud.pdf + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>ALUMINUM ELECTROLYTIC CAPACITORS</b> UD Series 8 x 10 mm<p> +Source: http://products.nichicon.co.jp/en/pdf/XJA043/e-ud.pdf + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + +>NAME ++ +>VALUE + + + + + + + +<B>INDUCTOR</B>, American symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<B>POLARIZED CAPACITOR</B>, European symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>Pin Header Connectors</b><p> +<author>Created by librarian@cadsoft.de</author> + + +<b>PIN HEADER</b> + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>PIN HEADER</b> + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>PIN HEADER</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>Frames for Sheet and Layout</b> + + + + + + + + + + + + + + + + + + + + +>DRAWING_NAME +>LAST_DATE_TIME +>SHEET +Sheet: + + + + + +<b>FRAME</b><p> +DIN A4, landscape with location and doc. field + + + + + + + + + + + + + + + + +<b>PIN HEADER</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>AVR Devices</b><p> +Configurable logic, microcontrollers, nonvolatile memories<p> +Based on the following sources:<p> +<ul> +<li>www.atmel.com +<li>CD-ROM : Configurable Logic Microcontroller Nonvolatile Memory +<li>CadSoft download site, www.cadsoft.de or www.cadsoftusa.com , file at90smcu_v400.zip +<li>avr.lbr +</ul> +<author>Revised by librarian@cadsoft.de</author> + + +<B>Dual In Line</B> + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + +2-wire serial <B>EEPROM</B> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sheet1 + +right +UP +Test +bottom-left +Bus B is present on both sheets, therefore global labels should be used +Arc test symbol. +Eagle used think lines and no line ending to emulate a filled arc. Kicad expands the arc to the necessary radius and uses a direct fill +normal +Smashed +hidden name and value + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Since Version 6.2.2 text objects can contain more than one line, +which will not be processed correctly with this version. + + +Since Version 8.2, Eagle supports online libraries. The ids +of those online libraries will not be understood (or retained) +with this version. + + + diff --git a/eeschema/qa/data/fixtures_eagle_plugin.h b/eeschema/qa/data/fixtures_eagle_plugin.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/eeschema/qa/test_basic.cpp b/eeschema/qa/test_basic.cpp new file mode 100644 index 0000000000..5df77c9cbc --- /dev/null +++ b/eeschema/qa/test_basic.cpp @@ -0,0 +1,49 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017 CERN + * @author Alejandro García Montoro + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include + +#include + +/** + * Checks that the SCH_IO manager finds the Eagle plugin + */ +BOOST_AUTO_TEST_CASE( FindPlugin ) +{ + BOOST_CHECK( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EAGLE ) != NULL ); +} + +/** + * + */ +BOOST_AUTO_TEST_CASE( Load ) +{ + SCH_PLUGIN* pi = SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EAGLE ); + + pi->Load("/home/alejandro/Proyectos/kicad/kicad-alejandro/eeschema/qa/data/eagle_schematics/empty.sch", + NULL); +} diff --git a/eeschema/qa/test_module.cpp b/eeschema/qa/test_module.cpp new file mode 100644 index 0000000000..69417ab09c --- /dev/null +++ b/eeschema/qa/test_module.cpp @@ -0,0 +1,32 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017 CERN + * @author Alejandro García Montoro + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * Main file for the schematic eagle plugin tests to be compiled + */ + +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE "Schematic Eagle plugin" + +#include diff --git a/eeschema/sch_eagle_plugin.cpp b/eeschema/sch_eagle_plugin.cpp new file mode 100644 index 0000000000..26c3e7dddc --- /dev/null +++ b/eeschema/sch_eagle_plugin.cpp @@ -0,0 +1,2343 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017 CERN + * @author Alejandro García Montoro + * @author Maciej Suminski + * @author Russell Oliver + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +using std::string; + + +// Eagle schematic axes are aligned with x increasing left to right and Y increasing bottom to top +// Kicad schematic axes are aligned with x increasing left to right and Y increasing top to bottom. + +using namespace std; + +/** + * Provides an easy access to the children of an XML node via their names. + * @param aCurrentNode is a pointer to a wxXmlNode, whose children will be mapped. + * @param aName the name of the specific child names to be counted. + * @return number of children with the give node name. + */ +static int countChildren( wxXmlNode* aCurrentNode, const std::string& aName ) +{ + // Map node_name -> node_pointer + int count = 0; + + // Loop through all children counting them if they match the given name + aCurrentNode = aCurrentNode->GetChildren(); + + while( aCurrentNode ) + { + if( aCurrentNode->GetName().ToStdString() == aName ) + count++; + + // Get next child + aCurrentNode = aCurrentNode->GetNext(); + } + + return count; +} + + +void SCH_EAGLE_PLUGIN::loadLayerDefs( wxXmlNode* aLayers ) +{ + std::vector eagleLayers; + + // Get the first layer and iterate + wxXmlNode* layerNode = aLayers->GetChildren(); + + while( layerNode ) + { + ELAYER elayer( layerNode ); + eagleLayers.push_back( elayer ); + + layerNode = layerNode->GetNext(); + } + + // match layers based on their names + for( const auto& elayer : eagleLayers ) + { + /** + * Layers in Kicad schematics are not actually layers, but abstract groups mainly used to + * decide item colours. + * + * + * + * + * + * + * + * + * + * + * + * + */ + + + if( elayer.name == "Nets" ) + { + m_layerMap[elayer.number] = LAYER_WIRE; + } + else if( elayer.name == "Info" || elayer.name == "Guide" ) + { + m_layerMap[elayer.number] = LAYER_NOTES; + } + else if( elayer.name == "Busses" ) + { + m_layerMap[elayer.number] = LAYER_BUS; + } + } +} + + +SCH_LAYER_ID SCH_EAGLE_PLUGIN::kiCadLayer( int aEagleLayer ) +{ + auto it = m_layerMap.find( aEagleLayer ); + return it == m_layerMap.end() ? LAYER_NOTES : it->second; +} + + +// Return the kicad component orientation based on eagle rotation degrees. +static COMPONENT_ORIENTATION_T kiCadComponentRotation( float eagleDegrees ) +{ + int roti = int( eagleDegrees ); + + switch( roti ) + { + default: + wxASSERT_MSG( false, wxString::Format( "Unhandled orientation (%d degrees)", roti ) ); + + case 0: + return CMP_ORIENT_0; + + case 90: + return CMP_ORIENT_90; + + case 180: + return CMP_ORIENT_180; + + case 270: + return CMP_ORIENT_270; + } + + return CMP_ORIENT_0; +} + + +// Calculate text alignment based on the given Eagle text alignment parameters. +static void eagleToKicadAlignment( EDA_TEXT* aText, int aEagleAlignment, + int aRelDegress, bool aMirror, bool aSpin, int aAbsDegress ) +{ + int align = aEagleAlignment; + + if( aRelDegress == 90 ) + { + aText->SetTextAngle( 900 ); + } + else if( aRelDegress == 180 ) + align = -align; + else if( aRelDegress == 270 ) + { + aText->SetTextAngle( 900 ); + align = -align; + } + + if( aMirror == true ) + { + if( aAbsDegress == 90 || aAbsDegress == 270 ) + { + if( align == ETEXT::BOTTOM_RIGHT ) + align = ETEXT::TOP_RIGHT; + else if( align == ETEXT::BOTTOM_LEFT ) + align = ETEXT::TOP_LEFT; + else if( align == ETEXT::TOP_LEFT ) + align = ETEXT::BOTTOM_LEFT; + else if( align == ETEXT::TOP_RIGHT ) + align = ETEXT::BOTTOM_RIGHT; + } + else if( aAbsDegress == 0 || aAbsDegress == 180 ) + { + if( align == ETEXT::BOTTOM_RIGHT ) + align = ETEXT::BOTTOM_LEFT; + else if( align == ETEXT::BOTTOM_LEFT ) + align = ETEXT::BOTTOM_RIGHT; + else if( align == ETEXT::TOP_LEFT ) + align = ETEXT::TOP_RIGHT; + else if( align == ETEXT::TOP_RIGHT ) + align = ETEXT::TOP_LEFT; + else if( align == ETEXT::CENTER_LEFT ) + align = ETEXT::CENTER_RIGHT; + else if( align == ETEXT::CENTER_RIGHT ) + align = ETEXT::CENTER_LEFT; + } + } + + switch( align ) + { + case ETEXT::CENTER: + aText->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER ); + aText->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER ); + break; + + case ETEXT::CENTER_LEFT: + aText->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT ); + aText->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER ); + break; + + case ETEXT::CENTER_RIGHT: + aText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT ); + aText->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER ); + break; + + case ETEXT::TOP_CENTER: + aText->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER ); + aText->SetVertJustify( GR_TEXT_VJUSTIFY_TOP ); + break; + + case ETEXT::TOP_LEFT: + aText->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT ); + aText->SetVertJustify( GR_TEXT_VJUSTIFY_TOP ); + break; + + case ETEXT::TOP_RIGHT: + aText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT ); + aText->SetVertJustify( GR_TEXT_VJUSTIFY_TOP ); + break; + + case ETEXT::BOTTOM_CENTER: + aText->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER ); + aText->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM ); + break; + + case ETEXT::BOTTOM_LEFT: + aText->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT ); + aText->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM ); + break; + + case ETEXT::BOTTOM_RIGHT: + aText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT ); + aText->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM ); + break; + + default: + aText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT ); + aText->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM ); + } +} + + +SCH_EAGLE_PLUGIN::SCH_EAGLE_PLUGIN() +{ + m_rootSheet = nullptr; +} + + +SCH_EAGLE_PLUGIN::~SCH_EAGLE_PLUGIN() +{ +} + + +const wxString SCH_EAGLE_PLUGIN::GetName() const +{ + return wxT( "EAGLE" ); +} + + +const wxString SCH_EAGLE_PLUGIN::GetFileExtension() const +{ + return wxT( "sch" ); +} + + +int SCH_EAGLE_PLUGIN::GetModifyHash() const +{ + return 0; +} + + +SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, KIWAY* aKiway, + SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties ) +{ + wxASSERT( !aFileName || aKiway != NULL ); + LOCALE_IO toggle; // toggles on, then off, the C locale. + + // Load the document + wxXmlDocument xmlDocument; + + m_filename = aFileName; + m_kiway = aKiway; + + if( !xmlDocument.Load( m_filename.GetFullPath() ) ) + THROW_IO_ERROR( wxString::Format( _( "Unable to read file '%s'" ), + m_filename.GetFullPath() ) ); + + // Delete on exception, if I own m_rootSheet, according to aAppendToMe + unique_ptr deleter( aAppendToMe ? nullptr : m_rootSheet ); + + if( aAppendToMe ) + { + m_rootSheet = aAppendToMe->GetRootSheet(); + } + else + { + m_rootSheet = new SCH_SHEET(); + m_rootSheet->SetFileName( aFileName ); + } + + if( !m_rootSheet->GetScreen() ) + { + SCH_SCREEN* screen = new SCH_SCREEN( aKiway ); + screen->SetFileName( aFileName ); + m_rootSheet->SetScreen( screen ); + } + + // Create a schematic symbol library + wxString projectpath = m_kiway->Prj().GetProjectPath(); + wxFileName libfn = m_kiway->Prj().AbsolutePath( m_kiway->Prj().GetProjectName() ); + + libfn.SetExt( SchematicLibraryFileExtension ); + std::unique_ptr lib( new PART_LIB( LIBRARY_TYPE_EESCHEMA, libfn.GetFullPath() ) ); + lib->EnableBuffering(); + + if( !wxFileName::FileExists( lib->GetFullFileName() ) ) + { + lib->Create(); + } + + m_partlib = lib.release(); + + // Retrieve the root as current node + wxXmlNode* currentNode = xmlDocument.GetRoot(); + + // If the attribute is found, store the Eagle version; + // otherwise, store the dummy "0.0" version. + m_version = currentNode->GetAttribute( "version", "0.0" ); + + // Map all children into a readable dictionary + NODE_MAP children = MapChildren( currentNode ); + + // Load drawing + loadDrawing( children["drawing"] ); + + PART_LIBS* prjLibs = aKiway->Prj().SchLibs(); + + // There are two ways to add a new library, the official one that requires creating a file: + m_partlib->Save( false ); + // prjLibs->AddLibrary( m_partlib->GetFullFileName() ); + // or undocumented one: + prjLibs->insert( prjLibs->begin(), m_partlib ); + + deleter.release(); + return m_rootSheet; +} + + +void SCH_EAGLE_PLUGIN::loadDrawing( wxXmlNode* aDrawingNode ) +{ + // Map all children into a readable dictionary + NODE_MAP drawingChildren = MapChildren( aDrawingNode ); + + // Board nodes should not appear in .sch files + // wxXmlNode* board = drawingChildren["board"] + + // wxXmlNode* grid = drawingChildren["grid"] + + wxXmlNode* layers = drawingChildren["layers"]; + + loadLayerDefs( layers ); + + // wxXmlNode* library = drawingChildren["library"] + + // wxXmlNode* settings = drawingChildren["settings"] + + + // Load schematic + loadSchematic( drawingChildren["schematic"] ); +} + + +void SCH_EAGLE_PLUGIN::countNets( wxXmlNode* aSchematicNode ) +{ + // Map all children into a readable dictionary + NODE_MAP schematicChildren = MapChildren( aSchematicNode ); + // Loop through all the sheets + wxXmlNode* sheetNode = schematicChildren["sheets"]->GetChildren(); + + while( sheetNode ) + { + NODE_MAP sheetChildren = MapChildren( sheetNode ); + // Loop through all nets + // From the DTD: "Net is an electrical connection in a schematic." + wxXmlNode* netNode = getChildrenNodes( sheetChildren, "nets" ); + + while( netNode ) + { + std::string netName = netNode->GetAttribute( "name" ).ToStdString(); + + if( m_netCounts.count( netName ) ) + m_netCounts[netName] = m_netCounts[netName] + 1; + else + m_netCounts[netName] = 1; + + // Get next net + netNode = netNode->GetNext(); + } + + sheetNode = sheetNode->GetNext(); + } +} + + +void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode ) +{ + // Map all children into a readable dictionary + NODE_MAP schematicChildren = MapChildren( aSchematicNode ); + + wxXmlNode* partNode = schematicChildren["parts"]->GetChildren(); + + while( partNode ) + { + std::unique_ptr epart( new EPART( partNode ) ); + string name = epart->name; + m_partlist[name] = std::move( epart ); + partNode = partNode->GetNext(); + } + + + // Loop through all the libraries + wxXmlNode* libraryNode = schematicChildren["libraries"]->GetChildren(); + + while( libraryNode ) + { + // Read the library name + wxString libName = libraryNode->GetAttribute( "name" ); + + EAGLE_LIBRARY* elib = &m_eagleLibs[libName.ToStdString()]; + elib->name = libName.ToStdString(); + + loadLibrary( libraryNode, &m_eagleLibs[libName.ToStdString()] ); + + libraryNode = libraryNode->GetNext(); + } + + // find all nets and count how many sheets they appear on. + // local labels will be used for nets found only on that sheet. + countNets( aSchematicNode ); + + // Loop through all the sheets + wxXmlNode* sheetNode = schematicChildren["sheets"]->GetChildren(); + + int sheet_count = countChildren( schematicChildren["sheets"], "sheet" ); + + // If eagle schematic has multiple sheets. + + if( sheet_count > 1 ) + { + int x, y, i; + i = 1; + x = 1; + y = 1; + + while( sheetNode ) + { + wxPoint pos = wxPoint( x * 1000, y * 1000 ); + std::unique_ptr sheet( new SCH_SHEET( pos ) ); + SCH_SCREEN* screen = new SCH_SCREEN( m_kiway ); + + sheet->SetTimeStamp( GetNewTimeStamp() - i ); // minus the sheet index to make it unique. + sheet->SetParent( m_rootSheet->GetScreen() ); + sheet->SetScreen( screen ); + + m_currentSheet = sheet.get(); + sheet->GetScreen()->SetFileName( sheet->GetFileName() ); + m_rootSheet->GetScreen()->Append( sheet.release() ); + loadSheet( sheetNode, i ); + + + sheetNode = sheetNode->GetNext(); + x += 2; + + if( x > 10 ) + { + x = 1; + y += 2; + } + + i++; + } + } + else + { + while( sheetNode ) + { + m_currentSheet = m_rootSheet; + loadSheet( sheetNode, 0 ); + sheetNode = sheetNode->GetNext(); + } + } +} + + +void SCH_EAGLE_PLUGIN::loadSheet( wxXmlNode* aSheetNode, int aSheetIndex ) +{ + // Map all children into a readable dictionary + NODE_MAP sheetChildren = MapChildren( aSheetNode ); + + // Get description node + wxXmlNode* descriptionNode = getChildrenNodes( sheetChildren, "description" ); + + wxString des; + std::string filename; + + if( descriptionNode ) + { + des = descriptionNode->GetContent(); + m_currentSheet->SetName( des ); + filename = des.ToStdString(); + } + else + { + filename = m_filename.GetName().ToStdString() + "_" + std::to_string( aSheetIndex ); + m_currentSheet->SetName( filename ); + } + + ReplaceIllegalFileNameChars( &filename ); + replace( filename.begin(), filename.end(), ' ', '_' ); + + wxString fn = wxString( filename + ".sch" ); + m_currentSheet->SetFileName( fn ); + wxFileName fileName = m_currentSheet->GetFileName(); + m_currentSheet->GetScreen()->SetFileName( fileName.GetFullPath() ); + + // Loop through all busses + // From the DTD: "Buses receive names which determine which signals they include. + // A bus is a drawing object. It does not create any electrical connections. + // These are always created by means of the nets and their names." + wxXmlNode* busNode = getChildrenNodes( sheetChildren, "busses" ); + + while( busNode ) + { + // Get the bus name + wxString busName = busNode->GetAttribute( "name" ); + + // Load segments of this bus + loadSegments( busNode, busName, wxString() ); + + // Get next bus + busNode = busNode->GetNext(); + } + + // Loop through all nets + // From the DTD: "Net is an electrical connection in a schematic." + wxXmlNode* netNode = getChildrenNodes( sheetChildren, "nets" ); + + while( netNode ) + { + // Get the net name and class + wxString netName = netNode->GetAttribute( "name" ); + wxString netClass = netNode->GetAttribute( "class" ); + + // Load segments of this net + loadSegments( netNode, netName, netClass ); + + // Get next net + netNode = netNode->GetNext(); + } + + addBusEntries(); + + // Loop through all instances + wxXmlNode* instanceNode = getChildrenNodes( sheetChildren, "instances" ); + + while( instanceNode ) + { + loadInstance( instanceNode ); + instanceNode = instanceNode->GetNext(); + } + + /* moduleinst is a design block definition and is an EagleCad 8 feature, + * + * // Loop through all moduleinsts + * wxXmlNode* moduleinstNode = getChildrenNodes( sheetChildren, "moduleinsts" ); + * + * while( moduleinstNode ) + * { + * loadModuleinst( moduleinstNode ); + * moduleinstNode = moduleinstNode->GetNext(); + * } + */ + + wxXmlNode* plainNode = getChildrenNodes( sheetChildren, "plain" ); + + while( plainNode ) + { + wxString nodeName = plainNode->GetName(); + + if( nodeName == "text" ) + { + m_currentSheet->GetScreen()->Append( loadPlainText( plainNode ) ); + } + else if( nodeName == "wire" ) + { + m_currentSheet->GetScreen()->Append( loadWire( plainNode ) ); + } + + plainNode = plainNode->GetNext(); + } + + // Find the bounding box of the imported items. + EDA_RECT sheetBoundingBox; + + SCH_ITEM* item = m_currentSheet->GetScreen()->GetDrawItems(); + sheetBoundingBox = item->GetBoundingBox(); + item = item->Next(); + + while( item ) + { + sheetBoundingBox.Merge( item->GetBoundingBox() ); + item = item->Next(); + } + + // Calculate the new sheet size. + + wxSize targetSheetSize = sheetBoundingBox.GetSize(); + targetSheetSize.IncBy( 1500, 1500 ); + + // Get current Eeschema sheet size. + wxSize pageSizeIU = m_currentSheet->GetScreen()->GetPageSettings().GetSizeIU(); + PAGE_INFO pageInfo = m_currentSheet->GetScreen()->GetPageSettings(); + + // Increase if necessary + if( pageSizeIU.x < targetSheetSize.x ) + pageInfo.SetWidthMils( targetSheetSize.x ); + + if( pageSizeIU.y < targetSheetSize.y ) + pageInfo.SetHeightMils( targetSheetSize.y ); + + // Set the new sheet size. + m_currentSheet->GetScreen()->SetPageSettings( pageInfo ); + + pageSizeIU = m_currentSheet->GetScreen()->GetPageSettings().GetSizeIU(); + wxPoint sheetcentre( pageSizeIU.x / 2, pageSizeIU.y / 2 ); + wxPoint itemsCentre = sheetBoundingBox.Centre(); + + // round the translation to nearest 100mil to place it on the grid. + wxPoint translation = sheetcentre - itemsCentre; + translation.x = translation.x - translation.x % 100; + translation.y = translation.y - translation.y % 100; + + // Translate the items. + item = m_currentSheet->GetScreen()->GetDrawItems(); + + while( item ) + { + item->SetPosition( item->GetPosition() + translation ); + item->ClearFlags(); + item = item->Next(); + } +} + + +void SCH_EAGLE_PLUGIN::loadSegments( wxXmlNode* aSegmentsNode, const wxString& netName, + const wxString& aNetClass ) +{ + // Loop through all segments + wxXmlNode* currentSegment = aSegmentsNode->GetChildren(); + SCH_SCREEN* screen = m_currentSheet->GetScreen(); + + int segmentCount = countChildren( aSegmentsNode, "segment" ); + + // wxCHECK( screen, [>void<] ); + while( currentSegment ) + { + bool labelled = false; // has a label been added to this continously connected segment + NODE_MAP segmentChildren = MapChildren( currentSegment ); + + // Loop through all segment children + wxXmlNode* segmentAttribute = currentSegment->GetChildren(); + + // load wire nodes first + // label positions will then be tested for an underlying wire, since eagle labels can be seperated from the wire + + DLIST segmentWires; + segmentWires.SetOwnership( false ); + + while( segmentAttribute ) + { + if( segmentAttribute->GetName() == "wire" ) + { + segmentWires.Append( loadWire( segmentAttribute ) ); + } + + segmentAttribute = segmentAttribute->GetNext(); + } + + segmentAttribute = currentSegment->GetChildren(); + + while( segmentAttribute ) + { + wxString nodeName = segmentAttribute->GetName(); + + if( nodeName == "junction" ) + { + screen->Append( loadJunction( segmentAttribute ) ); + } + else if( nodeName == "label" ) + { + screen->Append( loadLabel( segmentAttribute, netName, segmentWires ) ); + labelled = true; + } + else if( nodeName == "pinref" ) + { + segmentAttribute->GetAttribute( "gate" ); // REQUIRED + segmentAttribute->GetAttribute( "part" ); // REQUIRED + segmentAttribute->GetAttribute( "pin" ); // REQUIRED + } + else if( nodeName == "wire" ) + { + // already handled; + } + else // DEFAULT + { + // THROW_IO_ERROR( wxString::Format( _( "XML node '%s' unknown" ), nodeName ) ); + } + + // Get next segment attribute + segmentAttribute = segmentAttribute->GetNext(); + } + + SCH_LINE* wire = segmentWires.begin(); + + // Add a small label to the net segment if it hasn't been labelled already + // this preserves the named net feature of Eagle schematics. + if( labelled == false && wire != NULL ) + { + wxString netname = escapeName( netName ); + + // Add a global label if the net appears on more than one Eagle sheet + if( m_netCounts[netName.ToStdString()] > 1 ) + { + std::unique_ptr glabel( new SCH_GLOBALLABEL ); + glabel->SetPosition( wire->MidPoint() ); + glabel->SetText( netname ); + glabel->SetTextSize( wxSize( 10, 10 ) ); + glabel->SetLabelSpinStyle( 0 ); + screen->Append( glabel.release() ); + } + else if( segmentCount > 1 ) + { + std::unique_ptr label( new SCH_LABEL ); + label->SetPosition( wire->MidPoint() ); + label->SetText( netname ); + label->SetTextSize( wxSize( 10, 10 ) ); + label->SetLabelSpinStyle( 0 ); + screen->Append( label.release() ); + } + } + + + SCH_LINE* next_wire; + + while( wire != NULL ) + { + next_wire = wire->Next(); + screen->Append( wire ); + wire = next_wire; + } + + currentSegment = currentSegment->GetNext(); + } +} + + +SCH_LINE* SCH_EAGLE_PLUGIN::loadWire( wxXmlNode* aWireNode ) +{ + std::unique_ptr wire( new SCH_LINE ); + + auto ewire = EWIRE( aWireNode ); + + wire->SetLayer( kiCadLayer( ewire.layer ) ); + + wxPoint begin, end; + + begin.x = ewire.x1.ToSchUnits(); + begin.y = -ewire.y1.ToSchUnits(); + end.x = ewire.x2.ToSchUnits(); + end.y = -ewire.y2.ToSchUnits(); + + wire->SetStartPoint( begin ); + wire->SetEndPoint( end ); + + return wire.release(); +} + + +SCH_JUNCTION* SCH_EAGLE_PLUGIN::loadJunction( wxXmlNode* aJunction ) +{ + std::unique_ptr junction( new SCH_JUNCTION ); + + auto ejunction = EJUNCTION( aJunction ); + wxPoint pos( ejunction.x.ToSchUnits(), -ejunction.y.ToSchUnits() ); + + junction->SetPosition( pos ); + + return junction.release(); +} + + +SCH_TEXT* SCH_EAGLE_PLUGIN::loadLabel( wxXmlNode* aLabelNode, + const wxString& aNetName, + const DLIST& segmentWires ) +{ + auto elabel = ELABEL( aLabelNode, aNetName ); + + wxPoint elabelpos( elabel.x.ToSchUnits(), -elabel.y.ToSchUnits() ); + + wxString netname = escapeName( elabel.netname ); + + + // Determine if the Label is a local and global label based on the number of sheets the net appears on. + if( m_netCounts[aNetName.ToStdString()] > 1 ) + { + std::unique_ptr glabel( new SCH_GLOBALLABEL ); + glabel->SetPosition( elabelpos ); + glabel->SetText( netname ); + glabel->SetTextSize( wxSize( elabel.size.ToSchUnits(), elabel.size.ToSchUnits() ) ); + glabel->SetLabelSpinStyle( 2 ); + + if( elabel.rot ) + { + glabel->SetLabelSpinStyle( ( int( elabel.rot->degrees ) / 90 + 2 ) % 4 ); + + if( elabel.rot->mirror + && ( glabel->GetLabelSpinStyle() == 0 || glabel->GetLabelSpinStyle() == 2 ) ) + glabel->SetLabelSpinStyle( glabel->GetLabelSpinStyle() % 4 ); + } + + SCH_LINE* wire; + SCH_LINE* next_wire; + + bool labelOnWire = false; + auto glabelPosition = glabel->GetPosition(); + + // determine if the segment has been labelled. + for( wire = segmentWires.begin(); wire; wire = next_wire ) + { + next_wire = wire->Next(); + + if( wire->HitTest( glabelPosition, 0 ) ) + { + labelOnWire = true; + break; + } + } + + wire = segmentWires.begin(); + + // Reposition label if necessary + if( labelOnWire == false ) + { + wxPoint newLabelPos = findNearestLinePoint( elabelpos, segmentWires ); + + if( wire ) + { + glabel->SetPosition( newLabelPos ); + } + } + + return glabel.release(); + } + else + { + std::unique_ptr label( new SCH_LABEL ); + label->SetPosition( elabelpos ); + label->SetText( netname ); + label->SetTextSize( wxSize( elabel.size.ToSchUnits(), elabel.size.ToSchUnits() ) ); + + label->SetLabelSpinStyle( 0 ); + + if( elabel.rot ) + { + label->SetLabelSpinStyle( int(elabel.rot->degrees / 90) % 4 ); + + if( elabel.rot->mirror + && ( label->GetLabelSpinStyle() == 0 || label->GetLabelSpinStyle() == 2 ) ) + label->SetLabelSpinStyle( (label->GetLabelSpinStyle() + 2) % 4 ); + } + + SCH_LINE* wire; + SCH_LINE* next_wire; + + bool labelOnWire = false; + auto labelPosition = label->GetPosition(); + + for( wire = segmentWires.begin(); wire; wire = next_wire ) + { + next_wire = wire->Next(); + + if( wire->HitTest( labelPosition, 0 ) ) + { + labelOnWire = true; + break; + } + } + + wire = segmentWires.begin(); + + // Reposition label if necessary + if( labelOnWire == false ) + { + if( wire ) + { + wxPoint newLabelPos = findNearestLinePoint( elabelpos, segmentWires ); + label->SetPosition( newLabelPos ); + } + } + + return label.release(); + } +} + + +wxPoint SCH_EAGLE_PLUGIN::findNearestLinePoint( const wxPoint& aPoint, const DLIST& aLines ) +{ + wxPoint nearestPoint; + + float mindistance = std::numeric_limits::max(); + float d; + SCH_LINE* line = aLines.begin(); + + // Find the nearest start, middle or end of a line from the list of lines. + while( line != NULL ) + { + auto testpoint = line->GetStartPoint(); + d = sqrt( abs( ( (aPoint.x - testpoint.x) ^ 2 ) + ( (aPoint.y - testpoint.y) ^ 2 ) ) ); + + if( d < mindistance ) + { + mindistance = d; + nearestPoint = testpoint; + } + + testpoint = line->MidPoint(); + d = sqrt( abs( ( (aPoint.x - testpoint.x) ^ 2 ) + ( (aPoint.y - testpoint.y) ^ 2 ) ) ); + + if( d < mindistance ) + { + mindistance = d; + nearestPoint = testpoint; + } + + testpoint = line->GetEndPoint(); + d = sqrt( abs( ( (aPoint.x - testpoint.x) ^ 2 ) + ( (aPoint.y - testpoint.y) ^ 2 ) ) ); + + if( d < mindistance ) + { + mindistance = d; + nearestPoint = testpoint; + } + + line = line->Next(); + } + + return nearestPoint; +} + + +void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode ) +{ + auto einstance = EINSTANCE( aInstanceNode ); + + SCH_SCREEN* screen = m_currentSheet->GetScreen(); + + // Find the part in the list for the sheet. + // Assign the component its value from the part entry + // Calculate the unit number from the gate entry of the instance + // Assign the the LIB_ID from deviceset and device names + + EPART* epart = m_partlist[einstance.part].get(); + + std::string libraryname = epart->library; + std::string gatename = epart->deviceset + epart->device + einstance.gate; + + wxString sntemp = wxString( epart->deviceset + epart->device ); + sntemp.Replace( "*", "" ); + std::string symbolname = sntemp.ToStdString(); + + int unit = m_eagleLibs[libraryname].GateUnit[gatename]; + + std::string package; + EAGLE_LIBRARY* elib = &m_eagleLibs[libraryname]; + + auto p = elib->package.find( symbolname ); + + if( p != elib->package.end() ) + { + package = p->second; + } + + LIB_ID libId( wxEmptyString, symbolname ); + + LIB_PART* part = m_partlib->FindPart( symbolname ); + + if( !part ) + return; + + std::unique_ptr component( new SCH_COMPONENT() ); + component->SetLibId( libId ); + component->SetUnit( unit ); + component->SetPosition( wxPoint( einstance.x.ToSchUnits(), -einstance.y.ToSchUnits() ) ); + component->GetField( FOOTPRINT )->SetText( wxString( package ) ); + component->SetTimeStamp( EagleModuleTstamp( einstance.part, epart->value ? *epart->value : "", + unit ) ); + + if( einstance.rot ) + { + component->SetOrientation( kiCadComponentRotation( einstance.rot->degrees ) ); + + if( einstance.rot->mirror ) + { + component->MirrorY( einstance.x.ToSchUnits() ); + } + } + + + LIB_FIELDS partFields; + part->GetFields( partFields ); + + for( auto const& field : partFields ) + { + component->GetField( field.GetId() )->ImportValues( field ); + component->GetField( field.GetId() )->SetTextPos( + component->GetPosition() + field.GetTextPos() ); + } + + component->GetField( REFERENCE )->SetText( einstance.part ); + + SCH_SHEET_PATH sheetpath; + m_rootSheet->LocatePathOfScreen( screen, &sheetpath ); + wxString current_sheetpath = sheetpath.Path(); + + wxString tstamp; + tstamp.Printf( "%8.8lX", (unsigned long) component->GetTimeStamp() ); + current_sheetpath += tstamp; + + component->AddHierarchicalReference( current_sheetpath, wxString( einstance.part ), unit ); + + if( epart->value ) + component->GetField( VALUE )->SetText( wxString::FromUTF8( epart->value->c_str() ) ); + else + component->GetField( VALUE )->SetText( symbolname ); + + // Set the visibility of fields. + component->GetField( REFERENCE )->SetVisible( part->GetField( REFERENCE )->IsVisible() ); + component->GetField( VALUE )->SetVisible( part->GetField( VALUE )->IsVisible() ); + + bool valueAttributeFound = false; + bool nameAttributeFound = false; + + + wxXmlNode* attributeNode = aInstanceNode->GetChildren(); + + // Parse attributes for the instance + while( attributeNode ) + { + if( attributeNode->GetName() == "attribute" ) + { + auto attr = EATTR( attributeNode ); + + SCH_FIELD* field; + + if( attr.name == "name" || attr.name == "value" ) + { + if( attr.name == "name" ) + { + field = component->GetField( REFERENCE ); + nameAttributeFound = true; + } + else + { + field = component->GetField( VALUE ); + valueAttributeFound = true; + } + + field->SetPosition( wxPoint( attr.x->ToSchUnits(), -attr.y->ToSchUnits() ) ); + int align = attr.align ? *attr.align : ETEXT::BOTTOM_LEFT; + int absdegrees = attr.rot ? attr.rot->degrees : 0; + bool mirror = attr.rot ? attr.rot->mirror : false; + + if( einstance.rot && einstance.rot->mirror ) + mirror = !mirror; + + bool spin = attr.rot ? attr.rot->spin : false; + + if( attr.display == EATTR::Off ) + field->SetVisible( false ); + + int rotation = einstance.rot ? einstance.rot->degrees : 0; + int reldegrees = ( absdegrees - rotation + 360.0 ); + reldegrees %= 360; + + eagleToKicadAlignment( (EDA_TEXT*) field, align, reldegrees, mirror, spin, + absdegrees ); + } + } + + attributeNode = attributeNode->GetNext(); + } + + if( einstance.smashed && einstance.smashed.Get() ) + { + if( !valueAttributeFound ) + component->GetField( VALUE )->SetVisible( false ); + + if( !nameAttributeFound ) + component->GetField( REFERENCE )->SetVisible( false ); + } + + component->ClearFlags(); + + screen->Append( component.release() ); +} + + +EAGLE_LIBRARY* SCH_EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLibraryNode, + EAGLE_LIBRARY* aEagleLibrary ) +{ + NODE_MAP libraryChildren = MapChildren( aLibraryNode ); + + // Loop through the symbols and load each of them + wxXmlNode* symbolNode = libraryChildren["symbols"]->GetChildren(); + + while( symbolNode ) + { + string symbolName = symbolNode->GetAttribute( "name" ).ToStdString(); + aEagleLibrary->SymbolNodes[symbolName] = symbolNode; + symbolNode = symbolNode->GetNext(); + } + + // Loop through the devicesets and load each of them + wxXmlNode* devicesetNode = libraryChildren["devicesets"]->GetChildren(); + + while( devicesetNode ) + { + // Get Device set information + EDEVICE_SET edeviceset = EDEVICE_SET( devicesetNode ); + + wxString prefix = edeviceset.prefix ? edeviceset.prefix.Get() : ""; + + NODE_MAP aDeviceSetChildren = MapChildren( devicesetNode ); + wxXmlNode* deviceNode = getChildrenNodes( aDeviceSetChildren, "devices" ); + + // For each device in the device set: + while( deviceNode ) + { + // Get device information + EDEVICE edevice = EDEVICE( deviceNode ); + + // Create symbol name from deviceset and device names. + wxString symbolName = wxString( edeviceset.name + edevice.name ); + symbolName.Replace( "*", "" ); + + if( edevice.package ) + aEagleLibrary->package[symbolName.ToStdString()] = edevice.package.Get(); + + // Create KiCad symbol. + unique_ptr kpart( new LIB_PART( symbolName ) ); + + // Process each gate in the deviceset for this device. + wxXmlNode* gateNode = getChildrenNodes( aDeviceSetChildren, "gates" ); + int gates_count = countChildren( aDeviceSetChildren["gates"], "gate" ); + kpart->SetUnitCount( gates_count ); + + LIB_FIELD* reference = kpart->GetField( REFERENCE ); + + if( prefix.length() == 0 ) + reference->SetVisible( false ); + else + reference->SetText( prefix ); + + int gateindex = 1; + bool ispower = false; + + while( gateNode ) + { + EGATE egate = EGATE( gateNode ); + + aEagleLibrary->GateUnit[edeviceset.name + edevice.name + egate.name] = gateindex; + + ispower = loadSymbol( aEagleLibrary->SymbolNodes[egate.symbol], + kpart, &edevice, gateindex, egate.name ); + + gateindex++; + gateNode = gateNode->GetNext(); + } // gateNode + + kpart->SetUnitCount( gates_count ); + + if( gates_count == 1 && ispower ) + kpart->SetPower(); + + string name = kpart->GetName().ToStdString(); + m_partlib->AddPart( kpart.get() ); + aEagleLibrary->KiCadSymbols.insert( name, kpart.release() ); + + deviceNode = deviceNode->GetNext(); + } // devicenode + + devicesetNode = devicesetNode->GetNext(); + } // devicesetNode + + return aEagleLibrary; +} + + +bool SCH_EAGLE_PLUGIN::loadSymbol( wxXmlNode* aSymbolNode, + std::unique_ptr& aPart, + EDEVICE* aDevice, + int aGateNumber, + string aGateName ) +{ + wxString symbolName = aSymbolNode->GetAttribute( "name" ); + std::vector items; + + wxXmlNode* currentNode = aSymbolNode->GetChildren(); + + bool foundName = false; + bool foundValue = false; + bool ispower = false; + int pincount = 0; + + while( currentNode ) + { + wxString nodeName = currentNode->GetName(); + + if( nodeName == "circle" ) + { + aPart->AddDrawItem( loadSymbolCircle( aPart, currentNode, aGateNumber ) ); + } + else if( nodeName == "pin" ) + { + EPIN ePin = EPIN( currentNode ); + std::unique_ptr pin( loadPin( aPart, currentNode, &ePin, aGateNumber ) ); + pincount++; + + if( ePin.direction ) + { + if( wxString( *ePin.direction ).Lower()== "sup" ) + { + ispower = true; + pin->SetType( PIN_POWER_IN ); + } + else if( wxString( *ePin.direction ).Lower()== "pas" ) + { + pin->SetType( PIN_PASSIVE ); + } + else if( wxString( *ePin.direction ).Lower()== "out" ) + { + pin->SetType( PIN_OUTPUT ); + } + else if( wxString( *ePin.direction ).Lower()== "in" ) + { + pin->SetType( PIN_INPUT ); + } + else if( wxString( *ePin.direction ).Lower()== "nc" ) + { + pin->SetType( PIN_NC ); + } + else if( wxString( *ePin.direction ).Lower()== "io" ) + { + pin->SetType( PIN_BIDI ); + } + else if( wxString( *ePin.direction ).Lower()== "oc" ) + { + pin->SetType( PIN_OPENEMITTER ); + } + else if( wxString( *ePin.direction ).Lower()== "hiz" ) + { + pin->SetType( PIN_TRISTATE ); + } + else + { + pin->SetType( PIN_UNSPECIFIED ); + } + } + + + if( aDevice->connects.size() != 0 ) + { + for( auto connect : aDevice->connects ) + { + if( connect.gate == aGateName and pin->GetName().ToStdString() == connect.pin ) + { + wxArrayString pads = wxSplit( wxString( connect.pad ), ' '); + + pin->SetPartNumber( aGateNumber ); + pin->SetUnit( aGateNumber ); + pin->SetName( escapeName( pin->GetName() ) ); + + if( pads.GetCount() > 1) + { + pin->SetNumberTextSize( 0 ); + } + + for( int i = 0; i < pads.GetCount(); i++) + { + LIB_PIN* apin = new LIB_PIN( *pin ); + + wxString padname( pads[i] ); + apin->SetNumber( padname ); + aPart->AddDrawItem( apin ); + } + break; + } + } + } + else + { + pin->SetPartNumber( aGateNumber ); + pin->SetUnit( aGateNumber ); + wxString stringPinNum = wxString::Format( wxT( "%i" ), pincount ); + pin->SetNumber( stringPinNum ); + aPart->AddDrawItem( pin.release() ); + } + } + else if( nodeName == "polygon" ) + { + aPart->AddDrawItem( loadSymbolPolyLine( aPart, currentNode, aGateNumber ) ); + } + else if( nodeName == "rectangle" ) + { + aPart->AddDrawItem( loadSymbolRectangle( aPart, currentNode, aGateNumber ) ); + } + else if( nodeName == "text" ) + { + std::unique_ptr libtext( loadSymbolText( aPart, currentNode, aGateNumber ) ); + + if( libtext->GetText().Upper() ==">NAME" ) + { + LIB_FIELD* field = aPart->GetField( REFERENCE ); + loadFieldAttributes( field, libtext.get() ); + foundName = true; + } + else if( libtext->GetText().Upper() ==">VALUE" ) + { + LIB_FIELD* field = aPart->GetField( VALUE ); + loadFieldAttributes( field, libtext.get() ); + foundValue = true; + } + else + { + aPart->AddDrawItem( libtext.release() ); + } + } + else if( nodeName == "wire" ) + { + aPart->AddDrawItem( loadSymbolWire( aPart, currentNode, aGateNumber ) ); + } + + /* + * else if( nodeName == "description" ) + * { + * } + * else if( nodeName == "dimension" ) + * { + * } + * else if( nodeName == "frame" ) + * { + * } + */ + + currentNode = currentNode->GetNext(); + } + + if( foundName == false ) + aPart->GetField( REFERENCE )->SetVisible( false ); + + if( foundValue == false ) + aPart->GetField( VALUE )->SetVisible( false ); + + return pincount == 1 ? ispower : false; +} + + +LIB_CIRCLE* SCH_EAGLE_PLUGIN::loadSymbolCircle( std::unique_ptr& aPart, + wxXmlNode* aCircleNode, + int aGateNumber ) +{ + // Parse the circle properties + ECIRCLE c( aCircleNode ); + + unique_ptr circle( new LIB_CIRCLE( aPart.get() ) ); + + circle->SetPosition( wxPoint( c.x.ToSchUnits(), c.y.ToSchUnits() ) ); + circle->SetRadius( c.radius.ToSchUnits() ); + circle->SetWidth( c.width.ToSchUnits() ); + circle->SetUnit( aGateNumber ); + + return circle.release(); +} + + +LIB_RECTANGLE* SCH_EAGLE_PLUGIN::loadSymbolRectangle( std::unique_ptr& aPart, + wxXmlNode* aRectNode, + int aGateNumber ) +{ + ERECT rect( aRectNode ); + + unique_ptr rectangle( new LIB_RECTANGLE( aPart.get() ) ); + + rectangle->SetPosition( wxPoint( rect.x1.ToSchUnits(), rect.y1.ToSchUnits() ) ); + rectangle->SetEnd( wxPoint( rect.x2.ToSchUnits(), rect.y2.ToSchUnits() ) ); + + rectangle->SetUnit( aGateNumber ); + // Eagle rectangles are filled by definition. + rectangle->SetFillMode( FILLED_SHAPE ); + + return rectangle.release(); +} + + +LIB_ITEM* SCH_EAGLE_PLUGIN::loadSymbolWire( std::unique_ptr& aPart, + wxXmlNode* aWireNode, + int aGateNumber ) +{ + auto ewire = EWIRE( aWireNode ); + + wxPoint begin, end; + + begin.x = ewire.x1.ToSchUnits(); + begin.y = ewire.y1.ToSchUnits(); + end.x = ewire.x2.ToSchUnits(); + end.y = ewire.y2.ToSchUnits(); + + // if the wire is an arc + if( ewire.curve ) + { + std::unique_ptr arc( new LIB_ARC( aPart.get() ) ); + wxPoint center = ConvertArcCenter( begin, end, *ewire.curve * -1 ); + + double radius = sqrt( abs( ( ( center.x - begin.x ) * ( center.x - begin.x ) ) + + ( ( center.y - begin.y ) * ( center.y - begin.y ) ) ) ) * 2; + + // this emulates the filled semicircles created by a thick arc with flat ends caps. + if( ewire.width.ToSchUnits() * 2 > radius ) + { + wxPoint centerStartVector = begin - center; + wxPoint centerEndVector = end - center; + + centerStartVector.x = centerStartVector.x * ewire.width.ToSchUnits() * 2 / radius; + centerStartVector.y = centerStartVector.y * ewire.width.ToSchUnits() * 2 / radius; + + centerEndVector.x = centerEndVector.x * ewire.width.ToSchUnits() * 2 / radius; + centerEndVector.y = centerEndVector.y * ewire.width.ToSchUnits() * 2 / radius; + + begin = center + centerStartVector; + end = center + centerEndVector; + + radius = sqrt( abs( ( ( center.x - begin.x ) * ( center.x - begin.x ) ) + + ( ( center.y - begin.y ) * ( center.y - begin.y ) ) ) ) * 2; + + arc->SetWidth( 1 ); + arc->SetFillMode( FILLED_SHAPE ); + } + else + { + arc->SetWidth( ewire.width.ToSchUnits() ); + } + + arc->SetPosition( center ); + + if( *ewire.curve > 0 ) + { + arc->SetStart( begin ); + arc->SetEnd( end ); + } + else + { + arc->SetStart( end ); + arc->SetEnd( begin ); + } + + arc->SetRadius( radius ); + arc->CalcRadiusAngles(); + arc->SetUnit( aGateNumber ); + + return (LIB_ITEM*) arc.release(); + } + else + { + std::unique_ptr polyLine( new LIB_POLYLINE( aPart.get() ) ); + + polyLine->AddPoint( begin ); + polyLine->AddPoint( end ); + polyLine->SetUnit( aGateNumber ); + + return (LIB_ITEM*) polyLine.release(); + } +} + + +LIB_POLYLINE* SCH_EAGLE_PLUGIN::loadSymbolPolyLine( std::unique_ptr& aPart, + wxXmlNode* aPolygonNode, int aGateNumber ) +{ + std::unique_ptr polyLine( new LIB_POLYLINE( aPart.get() ) ); + + EPOLYGON epoly( aPolygonNode ); + wxXmlNode* vertex = aPolygonNode->GetChildren(); + + + wxPoint pt; + + while( vertex ) + { + if( vertex->GetName() == "vertex" ) // skip node + { + EVERTEX evertex( vertex ); + pt = wxPoint( evertex.x.ToSchUnits(), evertex.y.ToSchUnits() ); + polyLine->AddPoint( pt ); + } + + vertex = vertex->GetNext(); + } + + polyLine->SetFillMode( FILLED_SHAPE ); + polyLine->SetUnit( aGateNumber ); + + return polyLine.release(); +} + + +LIB_PIN* SCH_EAGLE_PLUGIN::loadPin( std::unique_ptr& aPart, + wxXmlNode* aPin, + EPIN* aEPin, + int aGateNumber ) +{ + std::unique_ptr pin( new LIB_PIN( aPart.get() ) ); + pin->SetPosition( wxPoint( aEPin->x.ToSchUnits(), aEPin->y.ToSchUnits() ) ); + pin->SetName( aEPin->name ); + pin->SetUnit( aGateNumber ); + + int roti = aEPin->rot ? aEPin->rot->degrees : 0; + + switch( roti ) + { + default: + wxASSERT_MSG( false, wxString::Format( "Unhandled orientation (%d degrees)", roti ) ); + + // fall through + case 0: + pin->SetOrientation( 'R' ); + break; + + case 90: + pin->SetOrientation( 'U' ); + break; + + case 180: + pin->SetOrientation( 'L' ); + break; + + case 270: + pin->SetOrientation( 'D' ); + break; + } + + if( aEPin->length ) + { + wxString length = aEPin->length.Get(); + + if( length =="short" ) + { + pin->SetLength( 100 ); + } + else if( length =="middle" ) + { + pin->SetLength( 200 ); + } + else if( length == "long" ) + { + pin->SetLength( 300 ); + } + else if( length == "point" ) + { + pin->SetLength( 0 ); + } + } + + // emulate the visibility of pin elements + if( aEPin->visible ) + { + wxString visible = aEPin->visible.Get(); + + if( visible == "off" ) + { + pin->SetNameTextSize( 0 ); + pin->SetNumberTextSize( 0 ); + } + else if( visible == "pad" ) + { + pin->SetNameTextSize( 0 ); + } + else if( visible == "pin" ) + { + pin->SetNumberTextSize( 0 ); + } + + /* + * else if( visible == "both" ) + * { + * } + */ + } + + if( aEPin->function ) + { + wxString function = aEPin->function.Get(); + + if( function == "dot" ) + { + pin->SetShape( PINSHAPE_INVERTED ); + } + else if( function == "clk" ) + { + pin->SetShape( PINSHAPE_CLOCK ); + } + else if( function == "dotclk" ) + { + pin->SetShape( PINSHAPE_INVERTED_CLOCK ); + } + } + + return pin.release(); +} + + +LIB_TEXT* SCH_EAGLE_PLUGIN::loadSymbolText( std::unique_ptr& aPart, + wxXmlNode* aLibText, int aGateNumber ) +{ + std::unique_ptr libtext( new LIB_TEXT( aPart.get() ) ); + ETEXT etext( aLibText ); + + libtext->SetUnit( aGateNumber ); + libtext->SetPosition( wxPoint( etext.x.ToSchUnits(), etext.y.ToSchUnits() ) ); + libtext->SetText( aLibText->GetNodeContent().IsEmpty() ? "~~" : aLibText->GetNodeContent() ); + loadTextAttributes( libtext.get(), etext ); + + return libtext.release(); +} + + +SCH_TEXT* SCH_EAGLE_PLUGIN::loadPlainText( wxXmlNode* aSchText ) +{ + std::unique_ptr schtext( new SCH_TEXT() ); + ETEXT etext = ETEXT( aSchText ); + + const wxString& thetext = aSchText->GetNodeContent(); + schtext->SetText( thetext.IsEmpty() ? "\" \"" : escapeName( thetext ) ); + schtext->SetPosition( wxPoint( etext.x.ToSchUnits(), -etext.y.ToSchUnits() ) ); + loadTextAttributes( schtext.get(), etext ); + schtext->SetItalic( false ); + + return schtext.release(); +} + + +void SCH_EAGLE_PLUGIN::loadTextAttributes( EDA_TEXT* aText, const ETEXT& aAttribs ) const +{ + aText->SetTextSize( aAttribs.ConvertSize() ); + + if( aAttribs.ratio ) + { + if( aAttribs.ratio.CGet() > 12 ) + { + aText->SetBold( true ); + aText->SetThickness( GetPenSizeForBold( aText->GetTextWidth() ) ); + } + } + + int align = aAttribs.align ? *aAttribs.align : ETEXT::BOTTOM_LEFT; + int degrees = aAttribs.rot ? aAttribs.rot->degrees : 0; + bool mirror = aAttribs.rot ? aAttribs.rot->mirror : false; + bool spin = aAttribs.rot ? aAttribs.rot->spin : false; + + eagleToKicadAlignment( aText, align, degrees, mirror, spin, 0 ); +} + + +void SCH_EAGLE_PLUGIN::loadFieldAttributes( LIB_FIELD* aField, const LIB_TEXT* aText ) const +{ + aField->SetTextPos( aText->GetPosition() ); + aField->SetTextSize( aText->GetTextSize() ); + aField->SetTextAngle( aText->GetTextAngle() ); + aField->SetBold( aText->IsBold() ); + aField->SetVertJustify( aText->GetVertJustify() ); + aField->SetHorizJustify( aText->GetHorizJustify() ); + aField->SetVisible( true ); +} + + +bool SCH_EAGLE_PLUGIN::CheckHeader( const wxString& aFileName ) +{ + // Open file and check first line + wxTextFile tempFile; + + tempFile.Open( aFileName ); + wxString firstline; + // read the first line + firstline = tempFile.GetFirstLine(); + wxString secondline = tempFile.GetNextLine(); + wxString thirdline = tempFile.GetNextLine(); + tempFile.Close(); + + return firstline.StartsWith( "GetScreen()->GetDrawItems(); item; item = item->Next() ) + { + if( item->Type() == SCH_LABEL_T || item->Type() == SCH_GLOBAL_LABEL_T ) + { + if( TestSegmentHit( item->GetPosition(), ( (SCH_LINE*) aWire )->GetStartPoint(), + ( (SCH_LINE*) aWire )->GetEndPoint(), 0 ) ) + { + item->SetPosition( aNewEndPoint ); + } + } + } +} + + +void SCH_EAGLE_PLUGIN::addBusEntries() +{ + // Add bus entry symbols + + // for each wire segment, compare each end with all busess. + // If the wire end is found to end on a bus segment, place a bus entry symbol. + + for( SCH_ITEM* bus = m_currentSheet->GetScreen()->GetDrawItems(); bus; bus = bus->Next() ) + { + // Check line type for line + if( bus->Type() != SCH_LINE_T ) + continue; + + // Check line type for wire + if( ( (SCH_LINE*) bus )->GetLayer() != LAYER_BUS ) + continue; + + + wxPoint busstart = ( (SCH_LINE*) bus )->GetStartPoint(); + wxPoint busend = ( (SCH_LINE*) bus )->GetEndPoint(); + + SCH_ITEM* nextline; + + for( SCH_ITEM* line = m_currentSheet->GetScreen()->GetDrawItems(); line; line = nextline ) + { + nextline = line->Next(); + + // Check line type for line + if( line->Type() == SCH_LINE_T ) + { + // Check line type for bus + if( ( (SCH_LINE*) line )->GetLayer() == LAYER_WIRE ) + { + // Get points of both segments. + + wxPoint linestart = ( (SCH_LINE*) line )->GetStartPoint(); + wxPoint lineend = ( (SCH_LINE*) line )->GetEndPoint(); + + + // Test for horizontal wire and vertical bus + if( linestart.y == lineend.y && busstart.x == busend.x ) + { + if( TestSegmentHit( linestart, busstart, busend, 0 ) ) + { + // Wire start is on a bus. + // Wire start is on the vertical bus + + // if the end of the wire is to the left of the bus + if( lineend.x < busstart.x ) + { + // | + // ---| + // | + if( TestSegmentHit( linestart + wxPoint( 0, -100 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( linestart + wxPoint( + -100, + 0 ), + '/' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, linestart + wxPoint( -100, 0 ) ); + ( (SCH_LINE*) line )->SetStartPoint( linestart + + wxPoint( -100, 0 ) ); + } + else if( TestSegmentHit( linestart + wxPoint( 0, 100 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( linestart + wxPoint( + -100, + 0 ), + '\\' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, linestart + wxPoint( -100, 0 ) ); + ( (SCH_LINE*) line )->SetStartPoint( linestart + + wxPoint( -100, 0 ) ); + } + else + { + SCH_MARKER* marker = new SCH_MARKER( linestart, + "Bus Entry neeeded" ); + + m_currentSheet->GetScreen()->Append( marker ); + } + } + // else the wire end is to the right of the bus + // Wire is to the right of the bus + // | + // |---- + // | + else + { + // test is bus exists above the wire + if( TestSegmentHit( linestart + wxPoint( 0, -100 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( linestart + wxPoint( + 0, + -100 ), + '\\' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, linestart + wxPoint( 100, 0 ) ); + ( (SCH_LINE*) line )->SetStartPoint( linestart + wxPoint( 100, + 0 ) ); + } + // test is bus exists below the wire + else if( TestSegmentHit( linestart + wxPoint( 0, 100 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( linestart + wxPoint( + 0, + 100 ), + '/' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, linestart + wxPoint( 100, 0 ) ); + ( (SCH_LINE*) line )->SetStartPoint( linestart + wxPoint( 100, + 0 ) ); + } + else + { + SCH_MARKER* marker = new SCH_MARKER( linestart, + "Bus Entry neeeded" ); + + m_currentSheet->GetScreen()->Append( marker ); + } + } + } + + // Same thing but test end of the wire instead. + if( TestSegmentHit( lineend, busstart, busend, 0 ) ) + { + // Wire end is on the vertical bus + + // if the start of the wire is to the left of the bus + if( linestart.x < busstart.x ) + { + // Test if bus exists above the wire + if( TestSegmentHit( lineend + wxPoint( 0, 100 ), busstart, busend, + 0 ) ) + { + // | + // ___/| + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( + -100, + 0 ), + '\\' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, lineend + wxPoint( -100, 0 ) ); + ( (SCH_LINE*) line )->SetEndPoint( lineend + + wxPoint( -100, 0 ) ); + } + // Test if bus exists below the wire + else if( TestSegmentHit( lineend + wxPoint( 0, -100 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( + -100, + 0 ), + '/' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, lineend + wxPoint( -100, 0 ) ); + ( (SCH_LINE*) line )->SetEndPoint( lineend + + wxPoint( -100, 0 ) ); + } + else + { + SCH_MARKER* marker = new SCH_MARKER( lineend, + "Bus Entry neeeded" ); + + m_currentSheet->GetScreen()->Append( marker ); + } + } + // else the start of the wire is to the right of the bus + // | + // |---- + // | + else + { + // test if bus existed above the wire + if( TestSegmentHit( lineend + wxPoint( 0, -100 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( + 0, + -100 ), + '\\' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, lineend + wxPoint( 100, 0 ) ); + ( (SCH_LINE*) line )->SetEndPoint( lineend + + wxPoint( 100, 0 ) ); + } + // test if bus existed below the wire + else if( TestSegmentHit( lineend + wxPoint( 0, 100 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( + 0, + 100 ), + '/' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, lineend + wxPoint( 100, 0 ) ); + ( (SCH_LINE*) line )->SetEndPoint( lineend + + wxPoint( 100, 0 ) ); + } + else + { + SCH_MARKER* marker = new SCH_MARKER( lineend, + "Bus Entry neeeded" ); + + m_currentSheet->GetScreen()->Append( marker ); + } + } + } + } // if( linestart.y == lineend.y && busstart.x == busend.x) + + // Test for horizontal wire and vertical bus + if( linestart.x == lineend.x && busstart.y == busend.y ) + { + if( TestSegmentHit( linestart, busstart, busend, 0 ) ) + { + // Wire start is on the bus + // If wire end is above the bus, + if( lineend.y < busstart.y ) + { + // Test for bus existance to the left of the wire + if( TestSegmentHit( linestart + wxPoint( -100, 0 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( linestart + wxPoint( + -100, + 0 ), + '/' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, linestart + wxPoint( 0, -100 ) ); + ( (SCH_LINE*) line )->SetStartPoint( linestart + + wxPoint( 0, -100 ) ); + } + else if( TestSegmentHit( linestart + wxPoint( 100, 0 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( linestart + wxPoint( + 0, + 100 ), + '\\' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, linestart + wxPoint( 0, -100 ) ); + ( (SCH_LINE*) line )->SetStartPoint( linestart + + wxPoint( 0, -100 ) ); + } + else + { + SCH_MARKER* marker = new SCH_MARKER( linestart, + "Bus Entry neeeded" ); + + m_currentSheet->GetScreen()->Append( marker ); + } + } + else // wire end is below the bus. + { + // Test for bus existance to the left of the wire + if( TestSegmentHit( linestart + wxPoint( -100, 0 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( linestart + wxPoint( + -100, + 0 ), + '\\' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, linestart + wxPoint( 0, 100 ) ); + ( (SCH_LINE*) line )->SetStartPoint( linestart + wxPoint( 0, + 100 ) ); + } + else if( TestSegmentHit( linestart + wxPoint( 100, 0 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( linestart + wxPoint( + 100, + 0 ), + '/' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, linestart + wxPoint( 0, 100 ) ); + ( (SCH_LINE*) line )->SetStartPoint( linestart + wxPoint( 0, + 100 ) ); + } + else + { + SCH_MARKER* marker = new SCH_MARKER( linestart, + "Bus Entry neeeded" ); + + m_currentSheet->GetScreen()->Append( marker ); + } + } + } + + if( TestSegmentHit( lineend, busstart, busend, 0 ) ) + { + // Wire end is on the bus + // If wire start is above the bus, + + if( linestart.y < busstart.y ) + { + // Test for bus existance to the left of the wire + if( TestSegmentHit( lineend + wxPoint( -100, 0 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( + -100, + 0 ), + '/' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, lineend + wxPoint( 0, -100 ) ); + ( (SCH_LINE*) line )->SetEndPoint( lineend + + wxPoint( 0, -100 ) ); + } + else if( TestSegmentHit( lineend + wxPoint( 100, 0 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( + 0, + -100 ), + '\\' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, lineend + wxPoint( 0, -100 ) ); + ( (SCH_LINE*) line )->SetEndPoint( lineend + + wxPoint( 0, -100 ) ); + } + else + { + SCH_MARKER* marker = new SCH_MARKER( lineend, + "Bus Entry neeeded" ); + + m_currentSheet->GetScreen()->Append( marker ); + } + } + else // wire end is below the bus. + { + // Test for bus existance to the left of the wire + if( TestSegmentHit( lineend + wxPoint( -100, 0 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( + -100, + 0 ), + '\\' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, lineend + wxPoint( 0, 100 ) ); + ( (SCH_LINE*) line )->SetEndPoint( lineend + + wxPoint( 0, 100 ) ); + } + else if( TestSegmentHit( lineend + wxPoint( 100, 0 ), busstart, + busend, 0 ) ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( + 0, + 100 ), + '/' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, lineend + wxPoint( 0, 100 ) ); + ( (SCH_LINE*) line )->SetEndPoint( lineend + + wxPoint( 0, 100 ) ); + } + else + { + SCH_MARKER* marker = new SCH_MARKER( lineend, + "Bus Entry neeeded" ); + + m_currentSheet->GetScreen()->Append( marker ); + } + } + } + } + + linestart = ( (SCH_LINE*) line )->GetStartPoint(); + lineend = ( (SCH_LINE*) line )->GetEndPoint(); + busstart = ( (SCH_LINE*) bus )->GetStartPoint(); + busend = ( (SCH_LINE*) bus )->GetEndPoint(); + + + // bus entry wire isn't horizontal or vertical + if( TestSegmentHit( linestart, busstart, busend, 0 ) ) + { + wxPoint wirevector = linestart - lineend; + + if( wirevector.x > 0 ) + { + if( wirevector.y > 0 ) + { + wxPoint p = linestart + wxPoint( -100, -100 ); + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( p, '\\' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, p ); + + if( p == lineend ) // wire is overlapped by bus entry symbol + { + m_currentSheet->GetScreen()->DeleteItem( line ); + } + else + { + ( (SCH_LINE*) line )->SetStartPoint( p ); + } + } + else + { + wxPoint p = linestart + wxPoint( -100, 100 ); + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( p, '/' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + + moveLabels( line, p ); + + if( p== lineend ) // wire is overlapped by bus entry symbol + { + m_currentSheet->GetScreen()->DeleteItem( line ); + } + else + { + ( (SCH_LINE*) line )->SetStartPoint( p ); + } + } + } + else + { + if( wirevector.y > 0 ) + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( linestart, + '/' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + + moveLabels( line, linestart + wxPoint( 100, -100 ) ); + + if( linestart + wxPoint( 100, -100 )== lineend ) // wire is overlapped by bus entry symbol + { + m_currentSheet->GetScreen()->DeleteItem( line ); + } + else + { + ( (SCH_LINE*) line )->SetStartPoint( linestart + + wxPoint( 100, -100 ) ); + } + } + else + { + SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( linestart, + '\\' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, linestart + wxPoint( 100, 100 ) ); + + if( linestart + wxPoint( 100, 100 )== lineend ) // wire is overlapped by bus entry symbol + { + m_currentSheet->GetScreen()->DeleteItem( line ); + } + else + { + ( (SCH_LINE*) line )->SetStartPoint( linestart + + wxPoint( 100, 100 ) ); + } + } + } + } + + if( TestSegmentHit( lineend, busstart, busend, 0 ) ) + { + wxPoint wirevector = linestart - lineend; + + if( wirevector.x > 0 ) + { + if( wirevector.y > 0 ) + { + wxPoint p = lineend + wxPoint( 100, 100 ); + SCH_BUS_WIRE_ENTRY* busEntry = + new SCH_BUS_WIRE_ENTRY( lineend, '\\' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + + moveLabels( line, p ); + + if( p == linestart ) // wire is overlapped by bus entry symbol + { + m_currentSheet->GetScreen()->DeleteItem( line ); + } + else + { + ( (SCH_LINE*) line )->SetEndPoint( p ); + } + } + else + { + wxPoint p = lineend + wxPoint( 100, -100 ); + SCH_BUS_WIRE_ENTRY* busEntry = + new SCH_BUS_WIRE_ENTRY( lineend, '/' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + + moveLabels( line, p ); + + if( p== linestart ) // wire is overlapped by bus entry symbol + { + m_currentSheet->GetScreen()->DeleteItem( line ); + } + else + { + ( (SCH_LINE*) line )->SetEndPoint( p ); + } + } + } + else + { + if( wirevector.y > 0 ) + { + wxPoint p = lineend + wxPoint( -100, 100 ); + SCH_BUS_WIRE_ENTRY* busEntry = + new SCH_BUS_WIRE_ENTRY( p, '/' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, p ); + + if( p == linestart ) // wire is overlapped by bus entry symbol + { + m_currentSheet->GetScreen()->DeleteItem( line ); + } + else + { + ( (SCH_LINE*) line )->SetEndPoint( p ); + } + } + else + { + wxPoint p = lineend + wxPoint( -100, -100 ); + SCH_BUS_WIRE_ENTRY* busEntry = + new SCH_BUS_WIRE_ENTRY( p, '\\' ); + busEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busEntry ); + moveLabels( line, p ); + + if( p == linestart ) // wire is overlapped by bus entry symbol + { + m_currentSheet->GetScreen()->DeleteItem( line ); + } + else + { + ( (SCH_LINE*) line )->SetEndPoint( p ); + } + } + } + } + } + } + } // for ( line .. + } // for ( bus .. +} + + +wxString SCH_EAGLE_PLUGIN::escapeName( const wxString& aNetName ) +{ + wxString ret( aNetName ); + + ret.Replace( "~", "~~" ); + ret.Replace( "!", "~" ); + + return ret; +} diff --git a/eeschema/sch_eagle_plugin.h b/eeschema/sch_eagle_plugin.h new file mode 100644 index 0000000000..50c57f7c31 --- /dev/null +++ b/eeschema/sch_eagle_plugin.h @@ -0,0 +1,189 @@ +/* +* This program source code file is part of KiCad, a free EDA CAD application. +* +* Copyright (C) 2017 CERN +* @author Alejandro García Montoro +* @author Maciej Suminski +* @author Russell Oliver +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 3 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License along +* with this program. If not, see . +*/ + +#ifndef _SCH_EAGLE_PLUGIN_H_ +#define _SCH_EAGLE_PLUGIN_H_ + +#include + +#include +#include +#include +#include +#include + +#include + +class EDA_TEXT; +class KIWAY; +class LINE_READER; +class SCH_SCREEN; +class SCH_SHEET; +class SCH_BITMAP; +class SCH_JUNCTION; +class SCH_NO_CONNECT; +class SCH_LINE; +class SCH_BUS_ENTRY_BASE; +class SCH_TEXT; +class SCH_GLOBALLABEL; +class SCH_COMPONENT; +class SCH_FIELD; +class PROPERTIES; +class SCH_EAGLE_PLUGIN_CACHE; +class LIB_PART; +class PART_LIB; +class LIB_ALIAS; +class LIB_CIRCLE; +class LIB_FIELD; +class LIB_RECTANGLE; +class LIB_POLYLINE; +class LIB_PIN; +class LIB_TEXT; + + +typedef struct EAGLE_LIBRARY +{ + std::string name; + boost::ptr_map KiCadSymbols; + std::unordered_map SymbolNodes; + std::unordered_map GateUnit; + std::unordered_map package; +} EAGLE_LIBRARY; + +typedef boost::ptr_map EPART_LIST; + + +/** + * Class SCH_EAGLE_PLUGIN + * is a #SCH_PLUGIN derivation for loading 6.x+ Eagle schematic files. + * + * As with all SCH_PLUGINs there is no UI dependencies i.e. windowing calls allowed. + */ +class SCH_EAGLE_PLUGIN : public SCH_PLUGIN +{ +public: + SCH_EAGLE_PLUGIN(); + ~SCH_EAGLE_PLUGIN(); + + const wxString GetName() const override; + + const wxString GetFileExtension() const override; + + int GetModifyHash() const override; + + SCH_SHEET* Load( const wxString& aFileName, KIWAY* aKiway, SCH_SHEET* aAppendToMe = NULL, + const PROPERTIES* aProperties = NULL ) override; + + bool CheckHeader( const wxString& aFileName ) override; + + + // unimplemented functions. Will trigger a not_implemented IO error. + //void SaveLibrary( const wxString& aFileName, const PROPERTIES* aProperties = NULL ) override; + + //void Save( const wxString& aFileName, SCH_SCREEN* aSchematic, KIWAY* aKiway, + // const PROPERTIES* aProperties = NULL ) override; + + //size_t GetSymbolLibCount( const wxString& aLibraryPath, + // const PROPERTIES* aProperties = NULL ) override; + + //void EnumerateSymbolLib( wxArrayString& aAliasNameList, const wxString& aLibraryPath, + // const PROPERTIES* aProperties = NULL ) override; + + //LIB_ALIAS* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName, + // const PROPERTIES* aProperties = NULL ) override; + + //void SaveSymbol( const wxString& aLibraryPath, const LIB_PART* aSymbol, + // const PROPERTIES* aProperties = NULL ) override; + + //void DeleteAlias( const wxString& aLibraryPath, const wxString& aAliasName, + // const PROPERTIES* aProperties = NULL ) override; + + //void DeleteSymbol( const wxString& aLibraryPath, const wxString& aAliasName, + // const PROPERTIES* aProperties = NULL ) override; + + //void CreateSymbolLib( const wxString& aLibraryPath, + // const PROPERTIES* aProperties = NULL ) override; + + // bool DeleteSymbolLib( const wxString& aLibraryPath, + // const PROPERTIES* aProperties = NULL ) override; + + //bool IsSymbolLibWritable( const wxString& aLibraryPath ) override; + + //void SymbolLibOptions( PROPERTIES* aListToAppendTo ) const override; + +private: + void loadDrawing( wxXmlNode* aDrawingNode ); + void loadLayerDefs( wxXmlNode* aLayers ); + void loadSchematic( wxXmlNode* aSchematicNode ); + void loadSheet( wxXmlNode* aSheetNode, int sheetcount ); + void loadInstance( wxXmlNode* aInstanceNode ); + EAGLE_LIBRARY* loadLibrary( wxXmlNode* aLibraryNode, EAGLE_LIBRARY* aEagleLib ); + void countNets( wxXmlNode* aSchematicNode ); + + /// Moves any labels on the wire to the new end point of the wire. + void moveLabels( SCH_ITEM* aWire, const wxPoint& aNewEndPoint ); + + /// This function finds best way to place a bus entry symbol for when an Eagle wire segment + /// ends on an Eagle bus segment. + void addBusEntries(); + + ///> Translates Eagle special characters to their counterparts in KiCad. + static wxString escapeName( const wxString& aNetName ); + + /// Return the matching layer or return LAYER_NOTES + SCH_LAYER_ID kiCadLayer( int aEagleLayer ); + + wxPoint findNearestLinePoint( const wxPoint& aPoint, const DLIST& aLines ); + + void loadSegments( wxXmlNode* aSegmentsNode, const wxString& aNetName, + const wxString& aNetClass ); + SCH_LINE* loadWire( wxXmlNode* aWireNode ); + SCH_TEXT* loadLabel( wxXmlNode* aLabelNode, const wxString& aNetName, const DLIST< SCH_LINE >& segmentWires); + SCH_JUNCTION* loadJunction( wxXmlNode* aJunction ); + SCH_TEXT* loadPlainText( wxXmlNode* aSchText ); + + bool loadSymbol( wxXmlNode* aSymbolNode, std::unique_ptr& aPart, EDEVICE* aDevice, int aGateNumber, string aGateName ); + LIB_CIRCLE* loadSymbolCircle( std::unique_ptr& aPart, wxXmlNode* aCircleNode, int aGateNumber ); + LIB_RECTANGLE* loadSymbolRectangle( std::unique_ptr& aPart, wxXmlNode* aRectNode, int aGateNumber ); + LIB_POLYLINE* loadSymbolPolyLine( std::unique_ptr& aPart, wxXmlNode* aPolygonNode, int aGateNumber ); + LIB_ITEM* loadSymbolWire( std::unique_ptr& aPart, wxXmlNode* aWireNode, int aGateNumber ); + LIB_PIN* loadPin( std::unique_ptr& aPart, wxXmlNode*, EPIN* epin, int aGateNumber ); + LIB_TEXT* loadSymbolText( std::unique_ptr& aPart, wxXmlNode* aLibText, int aGateNumber ); + + void loadTextAttributes( EDA_TEXT* aText, const ETEXT& aAttribs ) const; + void loadFieldAttributes( LIB_FIELD* aField, const LIB_TEXT* aText ) const; + + KIWAY* m_kiway; ///< For creating sub sheets. + SCH_SHEET* m_rootSheet; ///< The root sheet of the schematic being loaded.. + SCH_SHEET* m_currentSheet; ///< The current sheet of the schematic being loaded.. + wxString m_version; ///< Eagle file version. + wxFileName m_filename; + PART_LIB* m_partlib; ///< symbol library for imported file. + + EPART_MAP m_partlist; + std::map m_eagleLibs; + + std::map m_netCounts; + std::map m_layerMap; +}; + +#endif // _SCH_EAGLE_PLUGIN_H_ diff --git a/eeschema/sch_io_mgr.cpp b/eeschema/sch_io_mgr.cpp index e33eaa1b15..7a8d9e1b4e 100644 --- a/eeschema/sch_io_mgr.cpp +++ b/eeschema/sch_io_mgr.cpp @@ -25,6 +25,7 @@ #include #include +#include #include @@ -54,6 +55,8 @@ SCH_PLUGIN* SCH_IO_MGR::FindPlugin( SCH_FILE_T aFileType ) { case SCH_LEGACY: return new SCH_LEGACY_PLUGIN(); + case SCH_EAGLE: + return new SCH_EAGLE_PLUGIN(); case SCH_KICAD: return NULL; } @@ -85,6 +88,9 @@ const wxString SCH_IO_MGR::ShowType( SCH_FILE_T aType ) case SCH_LEGACY: return wxString( wxT( "Legacy" ) ); + + case SCH_EAGLE: + return wxString( wxT( "EAGLE" ) ); } } @@ -97,6 +103,8 @@ SCH_IO_MGR::SCH_FILE_T SCH_IO_MGR::EnumFromStr( const wxString& aType ) if( aType == wxT( "Legacy" ) ) return SCH_LEGACY; + else if( aType == wxT( "EAGLE" ) ) + return SCH_EAGLE; // wxASSERT( blow up here ) @@ -162,3 +170,6 @@ void SCH_IO_MGR::Save( SCH_FILE_T aFileType, const wxString& aFileName, THROW_IO_ERROR( wxString::Format( FMT_NOTFOUND, ShowType( aFileType ).GetData() ) ); } + + +DECLARE_ENUM_VECTOR( SCH_IO_MGR, SCH_FILE_T ); diff --git a/eeschema/sch_io_mgr.h b/eeschema/sch_io_mgr.h index 9734762e43..eb3f5b83d0 100644 --- a/eeschema/sch_io_mgr.h +++ b/eeschema/sch_io_mgr.h @@ -24,7 +24,9 @@ */ #include +#include #include +#include class SCH_SHEET; @@ -49,15 +51,16 @@ public: * A set of file types that the #SCH_IO_MGR knows about, and for which there * has been a plugin written. */ - enum SCH_FILE_T + DEFINE_ENUM_VECTOR( SCH_FILE_T, { SCH_LEGACY, ///< Legacy Eeschema file formats prior to s-expression. SCH_KICAD, ///< The s-expression version of the schematic file formats. + SCH_EAGLE, ///< Autodesk Eagle file format // Add your schematic type here. // ALTIUM, // etc. - }; + } ); /** * Return a #SCH_PLUGIN which the caller can use to import, export, save, or load @@ -72,6 +75,7 @@ public: * @return the plugin corresponding to aFileType or NULL if not found. * Caller owns the returned object, and must call PluginRelease when done using it. */ + APIEXPORT static SCH_PLUGIN* FindPlugin( SCH_FILE_T aFileType ); /** @@ -481,6 +485,14 @@ public: */ virtual void SymbolLibOptions( PROPERTIES* aListToAppendTo ) const; + /** + * Function CheckHeader + * returns true if the first line in @a aFileName begins with the expected header + * @param aFileName is the name of the file to use as input + * + */ + virtual bool CheckHeader( const wxString& aFileName ); + //----------------------------------------------------- diff --git a/eeschema/sch_item_struct.h b/eeschema/sch_item_struct.h index 112b39c422..a532561e80 100644 --- a/eeschema/sch_item_struct.h +++ b/eeschema/sch_item_struct.h @@ -51,8 +51,6 @@ typedef SCH_ITEMS::iterator SCH_ITEMS_ITR; typedef std::vector< SCH_ITEMS_ITR > SCH_ITEMS_ITRS; -#define FMT_IU SCH_ITEM::FormatInternalUnits -#define FMT_ANGLE SCH_ITEM::FormatAngle /** diff --git a/eeschema/sch_legacy_plugin.cpp b/eeschema/sch_legacy_plugin.cpp index c73dad3746..b7daee5ecd 100644 --- a/eeschema/sch_legacy_plugin.cpp +++ b/eeschema/sch_legacy_plugin.cpp @@ -3604,5 +3604,19 @@ void SCH_LEGACY_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const PROPERT } +bool SCH_LEGACY_PLUGIN::CheckHeader( const wxString& aFileName ) +{ + // Open file and check first line + wxTextFile tempFile; + + tempFile.Open( aFileName ); + wxString firstline; + // read the first line + firstline = tempFile.GetFirstLine(); + tempFile.Close(); + + return firstline.StartsWith( "EESchema" ); +} + const char* SCH_LEGACY_PLUGIN::PropBuffering = "buffering"; const char* SCH_LEGACY_PLUGIN::PropNoDocFile = "no_doc_file"; diff --git a/eeschema/sch_legacy_plugin.h b/eeschema/sch_legacy_plugin.h index 8f15376d7b..dfdfac17df 100644 --- a/eeschema/sch_legacy_plugin.h +++ b/eeschema/sch_legacy_plugin.h @@ -124,6 +124,8 @@ public: const PROPERTIES* aProperties = NULL ) override; void SaveLibrary( const wxString& aLibraryPath, const PROPERTIES* aProperties = NULL ) override; + bool CheckHeader( const wxString& aFileName ) override; + private: void loadHierarchy( SCH_SHEET* aSheet ); void loadHeader( FILE_LINE_READER& aReader, SCH_SCREEN* aScreen ); diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index 48c3cb397e..21b6fe8fd3 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -598,3 +598,9 @@ void SCH_LINE::SetPosition( const wxPoint& aPosition ) m_end = m_end - ( m_start - aPosition ); m_start = aPosition; } + + +wxPoint SCH_LINE::MidPoint() +{ + return wxPoint( ( m_start.x + m_end.x ) / 2, ( m_start.y + m_end.y ) / 2 ); +} diff --git a/eeschema/sch_line.h b/eeschema/sch_line.h index 30435c6c10..7b8cf5d1bc 100644 --- a/eeschema/sch_line.h +++ b/eeschema/sch_line.h @@ -143,6 +143,8 @@ public: void Plot( PLOTTER* aPlotter ) override; + wxPoint MidPoint(); + EDA_ITEM* Clone() const override; #if defined(DEBUG) diff --git a/eeschema/sch_plugin.cpp b/eeschema/sch_plugin.cpp index 7b859ea272..fac5ae3f5e 100644 --- a/eeschema/sch_plugin.cpp +++ b/eeschema/sch_plugin.cpp @@ -188,3 +188,11 @@ void SCH_PLUGIN::SymbolLibOptions( PROPERTIES* aListToAppendTo ) const ) ); #endif } + + +bool SCH_PLUGIN::CheckHeader( const wxString& aFileName ) +{ + // not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface. + not_implemented( this, __FUNCTION__ ); + return NULL; +} diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 7ec2bd11a9..3ec3545753 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -223,6 +223,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME ) EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, SCH_EDIT_FRAME::OnLoadFile ) EVT_MENU( ID_APPEND_PROJECT, SCH_EDIT_FRAME::OnAppendProject ) + EVT_MENU( ID_IMPORT_NON_KICAD_SCH, SCH_EDIT_FRAME::OnImportProject ) EVT_TOOL( ID_NEW_PROJECT, SCH_EDIT_FRAME::OnNewProject ) EVT_TOOL( ID_LOAD_PROJECT, SCH_EDIT_FRAME::OnLoadProject ) diff --git a/eeschema/schframe.h b/eeschema/schframe.h index c990fc2b0a..72402e94c0 100644 --- a/eeschema/schframe.h +++ b/eeschema/schframe.h @@ -532,7 +532,8 @@ public: bool CreateNetlist( int aFormat, const wxString& aFullFileName, unsigned aNetlistOptions, - REPORTER* aReporter = NULL ); + REPORTER* aReporter = NULL, + bool silent = false ) override; /** * Function WriteNetListFile @@ -784,6 +785,21 @@ public: bool IsSearchCacheObsolete( const SCH_FIND_REPLACE_DATA& aSearchCriteria ); + /** + * Function ImportFile + * load the given filename but sets the path to the current project path. + * @param full filepath of file to be imported. + * @param aFileType SCH_FILE_T value for filetype + */ + bool ImportFile( const wxString& aFileName, int aFileType ) override; + + /** + * Checks whether any of the screens has unsaved changes and asks the user + * whether to save or drop them. + * @return True if user decided to save or drop changes, false if the + * operation should be cancelled. + */ + bool AskToSaveChanges(); private: @@ -868,6 +884,7 @@ private: void OnNewProject( wxCommandEvent& event ); void OnLoadProject( wxCommandEvent& event ); void OnAppendProject( wxCommandEvent& event ); + void OnImportProject( wxCommandEvent& event ); void OnOpenPcbnew( wxCommandEvent& event ); void OnOpenPcbModuleEditor( wxCommandEvent& event ); void OnOpenCvpcb( wxCommandEvent& event ); diff --git a/include/class_board_item.h b/include/class_board_item.h index 2921a59b30..9c2c541251 100644 --- a/include/class_board_item.h +++ b/include/class_board_item.h @@ -35,9 +35,6 @@ #include #include -/// Abbrevation for fomatting internal units to a string. -#define FMT_IU BOARD_ITEM::FormatInternalUnits -#define FMT_ANGLE BOARD_ITEM::FormatAngle class BOARD; class BOARD_ITEM_CONTAINER; diff --git a/include/eagle_parser.h b/include/eagle_parser.h index fbbab2ec3e..8f7eca3a47 100644 --- a/include/eagle_parser.h +++ b/include/eagle_parser.h @@ -3,7 +3,7 @@ * * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck * Copyright (C) 2012-2016 KiCad Developers, see AUTHORS.txt for contributors. - * Copyright (C) 2017 CERN. + * Copyright (C) 2017 CERN * @author Alejandro García Montoro * * This program is free software; you can redistribute it and/or @@ -44,9 +44,20 @@ using std::string; class MODULE; +struct EINSTANCE; +struct EPART; +struct ETEXT; -typedef std::unordered_map< string, wxXmlNode* > NODE_MAP; -typedef std::map< string, MODULE* > MODULE_MAP; +typedef std::unordered_map NODE_MAP; +typedef std::map MODULE_MAP; +typedef std::map EINSTANCE_MAP; +typedef std::map> EPART_MAP; + +static inline wxXmlNode* getChildrenNodes( NODE_MAP& aMap, const string& aName ) +{ + auto it = aMap.find( aName ); + return it == aMap.end() ? nullptr : it->second->GetChildren(); +} /** @@ -98,7 +109,7 @@ struct TRIPLET */ class XPATH { - std::vector p; + std::vector p; public: void push( const char* aPathSegment, const char* aAttribute="" ) @@ -336,14 +347,34 @@ public: } }; + +/** + * Function MapChildren + * provides an easy access to the children of an XML node via their names. + * @param currentNode is a pointer to a wxXmlNode, whose children will be mapped. + * @return NODE_MAP - a map linking the name of each children to the children itself (via a + * wxXmlNode*) + */ +NODE_MAP MapChildren( wxXmlNode* aCurrentNode ); + +/// Make a unique time stamp +unsigned long EagleTimeStamp( wxXmlNode* aTree ); + +/// Computes module timestamp basing on its name, value and unit +time_t EagleModuleTstamp( const string& aName, const string& aValue, int aUnit ); + +/// Convert an Eagle curve end to a KiCad center for S_ARC +wxPoint ConvertArcCenter( const wxPoint& aStart, const wxPoint& aEnd, double aAngle ); + // Pre-declare for typedefs struct EROT; - +struct ECOORD; typedef OPTIONAL_XML_ATTRIBUTE opt_string; typedef OPTIONAL_XML_ATTRIBUTE opt_int; typedef OPTIONAL_XML_ATTRIBUTE opt_double; typedef OPTIONAL_XML_ATTRIBUTE opt_bool; typedef OPTIONAL_XML_ATTRIBUTE opt_erot; +typedef OPTIONAL_XML_ATTRIBUTE opt_ecoord; // All of the 'E'STRUCTS below merely hold Eagle XML information verbatim, in binary. @@ -352,14 +383,78 @@ typedef OPTIONAL_XML_ATTRIBUTE opt_erot; // forms of information in these 'E'STRUCTS. They are only binary forms // of the Eagle information in the corresponding Eagle XML nodes. +// Eagle coordinates +struct ECOORD +{ + enum UNIT + { + NM, ///< nanometers + MM, ///< millimeters + INCH, ///< inches + MIL, ///< mils/thous + }; + + ///> Value expressed in nanometers + long long int value; + + ///> Unit used for the value field + static constexpr UNIT ECOORD_UNIT = NM; + + ECOORD() + : value( 0 ) + { + } + + ECOORD( int aValue, enum UNIT aUnit ) + : value( ToNanoMeters( aValue, aUnit ) ) + { + } + + ECOORD( const wxString& aValue, enum UNIT aUnit ); + + int ToSchUnits() const + { + // mils + return value / 25400; + } + + int ToPcbUnits() const + { + // nanometers + return value; + } + + float ToMm() const + { + return value / 1000000.0; + } + + ECOORD operator+( const ECOORD& aOther ) const + { + return ECOORD( value + aOther.value, ECOORD_UNIT ); + } + + ECOORD operator-( const ECOORD& aOther ) const + { + return ECOORD( value - aOther.value, ECOORD_UNIT ); + } + + bool operator==( const ECOORD& aOther ) const + { + return value == aOther.value; + } + + static long long int ToNanoMeters( int aValue, enum UNIT aUnit ); +}; + /// Eagle net struct ENET { - int netcode; - std::string netname; + int netcode; + string netname; - ENET( int aNetCode, const std::string& aNetName ) : + ENET( int aNetCode, const string& aNetName ) : netcode( aNetCode ), netname( aNetName ) {} @@ -394,11 +489,11 @@ struct EROT /// Eagle wire struct EWIRE { - double x1; - double y1; - double x2; - double y2; - double width; + ECOORD x1; + ECOORD y1; + ECOORD x2; + ECOORD y2; + ECOORD width; LAYER_NUM layer; // for style: (continuous | longdash | shortdash | dashdot) @@ -422,15 +517,40 @@ struct EWIRE }; +/// Eagle Junction +struct EJUNCTION +{ + ECOORD x; + ECOORD y; + + EJUNCTION( wxXmlNode* aJunction); +}; + + +/// Eagle label +struct ELABEL +{ + ECOORD x; + ECOORD y; + ECOORD size; + LAYER_NUM layer; + opt_erot rot; + opt_string xref; + wxString netname; + + ELABEL( wxXmlNode* aLabel, const wxString& aNetName ); +}; + + /// Eagle via struct EVIA { - double x; - double y; + ECOORD x; + ECOORD y; int layer_front_most; /// < extent int layer_back_most; /// < inclusive - double drill; - opt_double diam; + ECOORD drill; + opt_ecoord diam; opt_string shape; EVIA( wxXmlNode* aVia ); @@ -440,10 +560,10 @@ struct EVIA /// Eagle circle struct ECIRCLE { - double x; - double y; - double radius; - double width; + ECOORD x; + ECOORD y; + ECOORD radius; + ECOORD width; LAYER_NUM layer; ECIRCLE( wxXmlNode* aCircle ); @@ -453,10 +573,10 @@ struct ECIRCLE /// Eagle XML rectangle in binary struct ERECT { - double x1; - double y1; - double x2; - double y2; + ECOORD x1; + ECOORD y1; + ECOORD x2; + ECOORD y2; int layer; opt_erot rot; @@ -474,9 +594,9 @@ struct EATTR { string name; opt_string value; - opt_double x; - opt_double y; - opt_double size; + opt_ecoord x; + opt_ecoord y; + opt_ecoord size; opt_int layer; opt_double ratio; opt_erot rot; @@ -488,6 +608,7 @@ struct EATTR BOTH, }; opt_int display; + opt_int align; EATTR( wxXmlNode* aTree ); EATTR() {} @@ -497,12 +618,12 @@ struct EATTR /// Eagle dimension element struct EDIMENSION { - double x1; - double y1; - double x2; - double y2; - double x3; - double y3; + ECOORD x1; + ECOORD y1; + ECOORD x2; + ECOORD y2; + ECOORD x3; + ECOORD y3; int layer; opt_string dimensionType; @@ -515,9 +636,9 @@ struct EDIMENSION struct ETEXT { string text; - double x; - double y; - double size; + ECOORD x; + ECOORD y; + ECOORD size; int layer; opt_string font; opt_double ratio; @@ -537,9 +658,12 @@ struct ETEXT BOTTOM_RIGHT = -TOP_LEFT, }; - opt_int align; + opt_int align; ETEXT( wxXmlNode* aText ); + + /// Calculate text size based on font type and size + wxSize ConvertSize() const; }; @@ -547,10 +671,10 @@ struct ETEXT struct EPAD { string name; - double x; - double y; - double drill; - opt_double diameter; + ECOORD x; + ECOORD y; + ECOORD drill; + opt_ecoord diameter; // for shape: (square | round | octagon | long | offset) enum { @@ -574,10 +698,10 @@ struct EPAD struct ESMD { string name; - double x; - double y; - double dx; - double dy; + ECOORD x; + ECOORD y; + ECOORD dx; + ECOORD dy; int layer; opt_int roundness; opt_erot rot; @@ -589,11 +713,29 @@ struct ESMD }; +/// Eagle pin element +struct EPIN +{ + string name; + ECOORD x; + ECOORD y; + + opt_string visible; + opt_string length; + opt_string direction; + opt_string function; + opt_int swaplevel; + opt_erot rot; + + EPIN( wxXmlNode* aPin ); +}; + + /// Eagle vertex struct EVERTEX { - double x; - double y; + ECOORD x; + ECOORD y; EVERTEX( wxXmlNode* aVertex ); }; @@ -602,9 +744,9 @@ struct EVERTEX /// Eagle polygon, without vertices which are parsed as needed struct EPOLYGON { - double width; + ECOORD width; int layer; - opt_double spacing; + opt_ecoord spacing; // KiCad priority is opposite of Eagle rank, that is: // - Eagle Low rank drawn first @@ -619,7 +761,7 @@ struct EPOLYGON CUTOUT, }; int pour; - opt_double isolate; + opt_ecoord isolate; opt_bool orphans; opt_bool thermals; opt_int rank; @@ -631,9 +773,9 @@ struct EPOLYGON /// Eagle hole element struct EHOLE { - double x; - double y; - double drill; + ECOORD x; + ECOORD y; + ECOORD drill; EHOLE( wxXmlNode* aHole ); }; @@ -646,8 +788,8 @@ struct EELEMENT string library; string package; string value; - double x; - double y; + ECOORD x; + ECOORD y; opt_bool locked; opt_bool smashed; opt_erot rot; @@ -738,23 +880,151 @@ struct EAGLE_LAYER }; }; -/** - * Function MapChildren - * provides an easy access to the children of an XML node via their names. - * @param currentNode is a pointer to a wxXmlNode, whose children will be mapped. - * @return NODE_MAP - a map linking the name of each children to the children itself (via a - * wxXmlNode*) - */ -NODE_MAP MapChildren( wxXmlNode* currentNode ); -/// Assemble a two part key as a simple concatenation of aFirst and aSecond parts, -/// using a separator. -string makeKey( const string& aFirst, const string& aSecond ); +struct EPART +{ + /* + * + * + */ -/// Make a unique time stamp -unsigned long timeStamp( wxXmlNode* aTree ); + string name; + string library; + string deviceset; + string device; + opt_string technology; + opt_string value; + + EPART( wxXmlNode* aPart ); +}; + + +struct EINSTANCE +{ + /* + * + * + */ + + string part; + string gate; + ECOORD x; + ECOORD y; + opt_bool smashed; + opt_erot rot; + + EINSTANCE( wxXmlNode* aInstance ); +}; + + +struct EGATE +{ + /* + * + * + */ + + string name; + string symbol; + + ECOORD x; + ECOORD y; + + opt_int addlevel; + opt_int swaplevel; + + enum + { + MUST, + CAN, + NEXT, + REQUEST, + ALWAYS + }; + + EGATE( wxXmlNode* aGate ); +}; + + +struct ECONNECT +{ + /* + * + * + */ + string gate; + string pin; + string pad; + int contactroute; + + ECONNECT( wxXmlNode* aConnect ); +}; + + +struct EDEVICE +{ + /* + + +*/ + string name; + opt_string package; + + std::vector connects; + + EDEVICE( wxXmlNode* aDevice ); +}; + + +struct EDEVICE_SET +{ + /* + + + */ + + string name; + opt_string prefix; + opt_bool uservalue; + //std::vector devices; + //std::vector gates; + + + EDEVICE_SET( wxXmlNode* aDeviceSet ); +}; -/// Convert an Eagle curve end to a KiCad center for S_ARC -wxPoint kicad_arc_center( const wxPoint& aStart, const wxPoint& aEnd, double aAngle ); #endif // _EAGLE_PARSER_H_ diff --git a/include/enum_vector.h b/include/enum_vector.h new file mode 100644 index 0000000000..78c14e8a1c --- /dev/null +++ b/include/enum_vector.h @@ -0,0 +1,46 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017 CERN + * @author Maciej Suminski + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef DEFINE_ENUM_VECTOR + +/** + * Macro to create const vectors containing enum values to enable easy iteration. + * + * Usage: + * [header] + * class A { + * DEFINE_ENUM_VECTOR( COLORS, { RED, GREEN, BLUE } ); + * }; + * + * [source] + * for( auto color : A::COLORS_vector ) { + * // do sth with color + * } + * + * DECLARE_ENUM_VECTOR( COLORS ); + */ +#define DEFINE_ENUM_VECTOR(enum_name, ...) \ + enum enum_name __VA_ARGS__; \ + static constexpr enum_name enum_name##_vector[] = __VA_ARGS__; + +#define DECLARE_ENUM_VECTOR(class_name, enum_name) \ + constexpr class_name::enum_name class_name::enum_name##_vector[]; + +#endif diff --git a/include/fp_lib_table.h b/include/fp_lib_table.h index b28756d5e9..64c561f20b 100644 --- a/include/fp_lib_table.h +++ b/include/fp_lib_table.h @@ -54,7 +54,7 @@ public: } FP_LIB_TABLE_ROW() : - type( IO_MGR::KICAD ) + type( IO_MGR::KICAD_SEXP ) { } diff --git a/include/kiway_player.h b/include/kiway_player.h index a4fd6836ca..6eefa80033 100644 --- a/include/kiway_player.h +++ b/include/kiway_player.h @@ -179,6 +179,49 @@ public: return false; } + /** + * Function ImportFile + * load the given filename but sets the path to the current project path. + * @param full filepath of file to be imported. + * @param aFileType enum value for filetype + */ + VTBL_ENTRY bool ImportFile( const wxString& aFileName, int aFileType ) + { + // overload me for your wxFrame type. + + return false; + } + + /** + * Function ReadPcbNetlist + * provides access to PcbNew's function ReadPcbNetlist. + */ + VTBL_ENTRY void ReadPcbNetlist( const wxString& aNetlistFileName, + const wxString& aCmpFileName, + REPORTER* aReporter, + bool aChangeFootprint, + bool aDeleteBadTracks, + bool aDeleteExtraFootprints, + bool aSelectByTimestamp, + bool aDeleteSinglePadNets, + bool aIsDryRun ) + { + }; + + /** + * Function ReadPcbNetlist + * provides access to Eeschema's function CreateNetlist. + */ + VTBL_ENTRY bool CreateNetlist( int aFormat, + const wxString& aFullFileName, + unsigned aNetlistOptions, + REPORTER* aReporter = NULL, + bool silent = false ) + { + return false; + }; + + /** * Function ShowModal * puts up this wxFrame as if it were a modal dialog, with all other instantiated diff --git a/include/unit_format.h b/include/unit_format.h new file mode 100644 index 0000000000..4cf5c71728 --- /dev/null +++ b/include/unit_format.h @@ -0,0 +1,44 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017 KiCad Developers, see change_log.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef UNIT_FORMAT_H +#define UNIT_FORMAT_H + +// Conversion to application internal units defined at build time. +#if defined( PCBNEW ) + #include + #define FMT_IU BOARD_ITEM::FormatInternalUnits + #define FMT_ANGLE BOARD_ITEM::FormatAngle +#elif defined( EESCHEMA ) + #include + #define FMT_IU SCH_ITEM::FormatInternalUnits + #define FMT_ANGLE SCH_ITEM::FormatAngle +#elif defined( GERBVIEW ) +#elif defined( PL_EDITOR ) + #include + #define FMT_IU Double2Str +#else +#error "Cannot resolve units formatting due to no definition of EESCHEMA or PCBNEW." +#endif + +#endif /* UNIT_FORMAT_H */ diff --git a/include/wildcards_and_files_ext.h b/include/wildcards_and_files_ext.h index 1a2f223f2d..c113e48932 100644 --- a/include/wildcards_and_files_ext.h +++ b/include/wildcards_and_files_ext.h @@ -88,6 +88,8 @@ extern const wxString CsvFileWildcard; extern const wxString LegacyPcbFileWildcard; extern const wxString PcbFileWildcard; extern const wxString EaglePcbFileWildcard; +extern const wxString EagleSchematicFileWildcard; +extern const wxString EagleFilesWildcard; extern const wxString PCadPcbFileWildcard; extern const wxString PdfFileWildcard; extern const wxString PSFileWildcard; diff --git a/kicad/CMakeLists.txt b/kicad/CMakeLists.txt index 56fc78b8e3..088576dc1c 100644 --- a/kicad/CMakeLists.txt +++ b/kicad/CMakeLists.txt @@ -7,6 +7,8 @@ add_definitions( -DKICAD ) include_directories( BEFORE ${INC_BEFORE} ) include_directories( + ../pcbnew + ../eeschema ${INC_AFTER} ) @@ -25,6 +27,7 @@ set( KICAD_SRCS prjconfig.cpp project_template.cpp tree_project_frame.cpp + import_project.cpp ) if( MINGW ) diff --git a/kicad/import_project.cpp b/kicad/import_project.cpp new file mode 100644 index 0000000000..f5d56b7939 --- /dev/null +++ b/kicad/import_project.cpp @@ -0,0 +1,212 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors. + * @author Russell Oliver + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * @file import_project.cpp + * @brief routines for importing an eagle project + */ + + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "pgm_kicad.h" + +#include +#include +#include +#include +#include + +class PCB_EDIT_FRAME; + +#include "kicad.h" + +void KICAD_MANAGER_FRAME::OnImportEagleFiles( wxCommandEvent& event ) +{ + // Close other windows. + if( !Kiway.PlayersClose( false ) ) + return; + + + wxString title = _( "Import Eagle Project Files" ); + int style = wxFD_OPEN | wxFD_FILE_MUST_EXIST; + wxString default_dir = GetMruPath(); + + ClearMsg(); + + wxFileDialog schdlg( this, title, default_dir, wxEmptyString, + EagleFilesWildcard, style ); + + if( schdlg.ShowModal() == wxID_CANCEL ) + return; + + + wxFileName sch( schdlg.GetPath() ); + + sch.SetExt( SchematicFileExtension ); + + + wxString protitle = _( "Kicad Project Destination" ); + + wxFileDialog prodlg( this, protitle, sch.GetPath(), sch.GetName(), + ProjectFileWildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + + if( prodlg.ShowModal() == wxID_CANCEL ) + return; + + wxFileName pro( prodlg.GetPath() ); + // Check if the project directory is empty + wxDir directory( pro.GetPath() ); + + if( directory.HasFiles() ) + { + wxString msg = _( "The selected directory is not empty. We recommend you " + "create projects in their own clean directory.\n\nDo you " + "want to create a new empty directory for the project?" ); + + if( IsOK( this, msg ) ) + { + // Append a new directory with the same name of the project file + // and try to create it + pro.AppendDir( pro.GetName() ); + + if( !wxMkdir( pro.GetPath() ) ) + // There was a problem, undo + pro.RemoveLastDir(); + } + } + + + + wxFileName pcb( sch ); + wxFileName netlist( pro ); + pro.SetExt( ProjectFileExtension ); // enforce extension + pcb.SetExt( LegacyPcbFileExtension ); // enforce extension + netlist.SetExt( NetlistFileExtension ); + + if( !pro.IsAbsolute() ) + pro.MakeAbsolute(); + + SetProjectFileName( pro.GetFullPath() ); + + wxString prj_filename = GetProjectFileName(); + + wxString sch_filename = sch.GetFullPath(); + + if( sch.FileExists() ) + { + SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) Kiway.Player( FRAME_SCH, false ); + + if( !schframe ) + { + try + { + schframe = (SCH_EDIT_FRAME*) Kiway.Player( FRAME_SCH, true ); + } + catch( IO_ERROR err ) + { + wxMessageBox( _( "Eeschema failed to load:\n" ) + err.What(), + _( "KiCad Error" ), wxOK | wxICON_ERROR, this ); + return; + } + } + + schframe->ImportFile( sch_filename, SCH_IO_MGR::SCH_EAGLE ); + + if( !schframe->IsShown() ) // the frame exists, (created by the dialog field editor) + // but no project loaded. + { + schframe->Show( true ); + } + + if( schframe->IsIconized() ) + schframe->Iconize( false ); + + schframe->Raise(); + + schframe->CreateNetlist( NET_TYPE_PCBNEW, netlist.GetFullPath(), 0, NULL, true ); + } + + if( pcb.FileExists() ) + { + PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Kiway.Player( FRAME_PCB, false ); + + if( !pcbframe ) + { + try + { + pcbframe = (PCB_EDIT_FRAME*) Kiway.Player( FRAME_PCB, true ); + } + catch( IO_ERROR err ) + { + wxMessageBox( _( "Pcbnew failed to load:\n" ) + err.What(), _( "KiCad Error" ), + wxOK | wxICON_ERROR, this ); + return; + } + } + + // a pcb frame can be already existing, but not yet used. + // this is the case when running the footprint editor, or the footprint viewer first + // if the frame is not visible, the board is not yet loaded + if( !pcbframe->IsVisible() ) + { + pcbframe->ImportFile( pcb.GetFullPath(), IO_MGR::EAGLE ); + pcbframe->Show( true ); + } + + // On Windows, Raise() does not bring the window on screen, when iconized + if( pcbframe->IsIconized() ) + pcbframe->Iconize( false ); + + pcbframe->Raise(); + + if( netlist.FileExists() ) + { + pcbframe->ReadPcbNetlist( netlist.GetFullPath(), + wxEmptyString, + NULL, + false, + false, + false, + false, + false, + false ); + } + } + + ReCreateTreePrj(); +} diff --git a/kicad/kicad.h b/kicad/kicad.h index 2455750dc0..cdaa66b5f4 100644 --- a/kicad/kicad.h +++ b/kicad/kicad.h @@ -123,6 +123,7 @@ enum id_kicad_frm { ID_SAVE_AND_ZIP_FILES, ID_READ_ZIP_ARCHIVE, ID_INIT_WATCHED_PATHS, + ID_IMPORT_EAGLE_PROJECT, // Please, verify: the number of items in this list should be // less than ROOM_FOR_KICADMANAGER (see id.h) @@ -194,6 +195,11 @@ public: void ReCreateMenuBar() override; void RecreateBaseHToolbar(); + /** + * Open dialog to import Eagle schematic and board files. + */ + void OnImportEagleFiles( wxCommandEvent& event ); + /** * Displays \a aText in the text panel. * diff --git a/kicad/menubar.cpp b/kicad/menubar.cpp index e3043c8cc4..b57efe8dbc 100644 --- a/kicad/menubar.cpp +++ b/kicad/menubar.cpp @@ -66,6 +66,7 @@ BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME ) EVT_MENU( wxID_INDEX, KICAD_MANAGER_FRAME::GetKicadHelp ) EVT_MENU( ID_HELP_GET_INVOLVED, KICAD_MANAGER_FRAME::GetKicadContribute ) EVT_MENU( wxID_ABOUT, KICAD_MANAGER_FRAME::GetKicadAbout ) + EVT_MENU( ID_IMPORT_EAGLE_PROJECT, KICAD_MANAGER_FRAME::OnImportEagleFiles ) // Range menu events EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, @@ -265,7 +266,21 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() KiBitmap( save_project_xpm ) ); #endif - // Separator + fileMenu->AppendSeparator(); + wxMenu* importprjSubMenu = new wxMenu(); + + AddMenuItem( importprjSubMenu, ID_IMPORT_EAGLE_PROJECT, _( "Eagle CAD" ), + _( "Import Eagle CAD XML schematic and board" ), + KiBitmap( new_project_xpm ) ); + + + AddMenuItem( fileMenu, importprjSubMenu, + wxID_ANY, + _( "Import Project" ), + _( "Import project files from other software" ), + KiBitmap( new_project_xpm ) ); + + fileMenu->AppendSeparator(); // Archive diff --git a/pcbnew/class_netclass.cpp b/pcbnew/class_netclass.cpp index 37532adbf7..bd5b6f6ceb 100644 --- a/pcbnew/class_netclass.cpp +++ b/pcbnew/class_netclass.cpp @@ -33,6 +33,10 @@ #include #include +/// Abbrevation for fomatting internal units to a string. +#define FMT_IU BOARD_ITEM::FormatInternalUnits +#define FMT_ANGLE BOARD_ITEM::FormatAngle + // This will get mapped to "kicad_default" in the specctra_export. const char NETCLASS::Default[] = "Default"; diff --git a/pcbnew/dialogs/dialog_fp_lib_table.cpp b/pcbnew/dialogs/dialog_fp_lib_table.cpp index fc8e9d747e..eb8b90599c 100644 --- a/pcbnew/dialogs/dialog_fp_lib_table.cpp +++ b/pcbnew/dialogs/dialog_fp_lib_table.cpp @@ -185,7 +185,7 @@ public: wxArrayString choices; - choices.Add( IO_MGR::ShowType( IO_MGR::KICAD ) ); + choices.Add( IO_MGR::ShowType( IO_MGR::KICAD_SEXP ) ); choices.Add( IO_MGR::ShowType( IO_MGR::GITHUB ) ); choices.Add( IO_MGR::ShowType( IO_MGR::LEGACY ) ); choices.Add( IO_MGR::ShowType( IO_MGR::EAGLE ) ); diff --git a/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp b/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp index 2f80070bed..c2088cbb18 100644 --- a/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 65b32b7d69..292c700e12 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/dialogs/wizard_add_fplib.cpp b/pcbnew/dialogs/wizard_add_fplib.cpp index 5e18815d40..903a41be49 100644 --- a/pcbnew/dialogs/wizard_add_fplib.cpp +++ b/pcbnew/dialogs/wizard_add_fplib.cpp @@ -65,7 +65,7 @@ static const struct IO_MGR::PCB_FILE_T m_Plugin; } fileFilters[FILTER_COUNT] = { - { "KiCad (folder with .kicad_mod files)", "kicad_mod", false, IO_MGR::KICAD }, + { "KiCad (folder with .kicad_mod files)", "kicad_mod", false, IO_MGR::KICAD_SEXP }, { "Eagle 6.x (*.lbr)", "lbr", true, IO_MGR::EAGLE }, { "KiCad legacy (*.mod)", "mod", true, IO_MGR::LEGACY }, { "Geda (folder with *.fp files)", "fp", false, IO_MGR::GEDA_PCB }, @@ -206,7 +206,7 @@ wxString WIZARD_FPLIB_TABLE::LIBRARY::GetPluginName() const case IO_MGR::LEGACY: return wxT( "Legacy" ); - case IO_MGR::KICAD: + case IO_MGR::KICAD_SEXP: return wxT( "KiCad" ); case IO_MGR::EAGLE: @@ -544,7 +544,7 @@ void WIZARD_FPLIB_TABLE::OnWizardFinished( wxWizardEvent& aEvent ) wxString path = it->GetAbsolutePath(); path.Replace( GetGithubURL(), getDownloadDir() ); it->setPath( path ); - it->setPluginType( IO_MGR::KICAD ); + it->setPluginType( IO_MGR::KICAD_SEXP ); } } } @@ -654,7 +654,7 @@ bool WIZARD_FPLIB_TABLE::downloadGithubLibsFromList( wxArrayString& aUrlList, try { PLUGIN::RELEASER src( IO_MGR::PluginFind( IO_MGR::GITHUB ) ); - PLUGIN::RELEASER dst( IO_MGR::PluginFind( IO_MGR::KICAD ) ); + PLUGIN::RELEASER dst( IO_MGR::PluginFind( IO_MGR::KICAD_SEXP ) ); wxArrayString footprints; diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index ce6cb0e70f..0de3dee5f9 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -83,15 +83,23 @@ typedef MODULE_MAP::const_iterator MODULE_CITER; /// Parse an eagle distance which is either mm, or mils if there is "mil" suffix. /// Return is in BIU. -static double parseEagle( const wxString& aDistance ) +static int parseEagle( const wxString& aDistance ) { - double ret = strtod( aDistance.c_str(), NULL ); - if( aDistance.npos != aDistance.find( "mil" ) ) - ret = IU_PER_MILS * ret; - else - ret = IU_PER_MM * ret; + ECOORD::UNIT unit = ( aDistance.npos != aDistance.find( "mil" ) ) + ? ECOORD::UNIT::MIL : ECOORD::UNIT::MM; - return ret; + ECOORD coord( aDistance, unit ); + + return coord.ToPcbUnits(); +} + + +/// Assemble a two part key as a simple concatenation of aFirst and aSecond parts, +/// using a separator. +static string makeKey( const string& aFirst, const string& aSecond ) +{ + string key = aFirst + '\x02' + aSecond; + return key; } @@ -137,7 +145,6 @@ EAGLE_PLUGIN::EAGLE_PLUGIN() : m_mod_time( wxDateTime::Now() ) { init( NULL ); - clear_cu_map(); } @@ -162,16 +169,10 @@ const wxString EAGLE_PLUGIN::GetFileExtension() const } -int inline EAGLE_PLUGIN::kicad( double d ) const -{ - return KiROUND( biu_per_mm * d ); -} - - -wxSize inline EAGLE_PLUGIN::kicad_fontz( double d ) const +wxSize inline EAGLE_PLUGIN::kicad_fontz( const ECOORD& d ) const { // texts seem to better match eagle when scaled down by 0.95 - int kz = kicad( d ) * 95 / 100; + int kz = d.ToPcbUnits() * 95 / 100; return wxSize( kz, kz ); } @@ -277,8 +278,6 @@ void EAGLE_PLUGIN::init( const PROPERTIES* aProperties ) m_board = NULL; m_props = aProperties; - mm_per_biu = 1/IU_PER_MM; - biu_per_mm = IU_PER_MM; delete m_rules; m_rules = new ERULES(); @@ -354,19 +353,19 @@ void EAGLE_PLUGIN::loadDesignRules( wxXmlNode* aDesignRules ) void EAGLE_PLUGIN::loadLayerDefs( wxXmlNode* aLayers ) { - typedef std::vector ELAYERS; - typedef ELAYERS::const_iterator EITER; - - ELAYERS cu; // copper layers + ELAYERS cu; // copper layers // Get the first layer and iterate wxXmlNode* layerNode = aLayers->GetChildren(); - // find the subset of layers that are copper, and active + m_eagleLayers.clear(); + while( layerNode ) { - ELAYER elayer( layerNode ); + ELAYER elayer( layerNode ); + m_eagleLayers.insert( std::make_pair( elayer.number, elayer ) ); + // find the subset of layers that are copper and active if( elayer.number >= 1 && elayer.number <= 16 && ( !elayer.active || *elayer.active ) ) { cu.push_back( elayer ); @@ -457,7 +456,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) } else { - wxPoint center = kicad_arc_center( start, end, *w.curve); + wxPoint center = ConvertArcCenter( start, end, *w.curve ); dseg->SetShape( S_ARC ); dseg->SetStart( center ); @@ -465,7 +464,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) dseg->SetAngle( *w.curve * -10.0 ); // KiCad rotates the other way } - dseg->SetTimeStamp( timeStamp( gr ) ); + dseg->SetTimeStamp( EagleTimeStamp( gr ) ); dseg->SetLayer( layer ); dseg->SetWidth( Millimeter2iu( DEFAULT_PCB_EDGE_THICKNESS ) ); } @@ -484,15 +483,15 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) m_board->Add( pcbtxt, ADD_APPEND ); pcbtxt->SetLayer( layer ); - pcbtxt->SetTimeStamp( timeStamp( gr ) ); + pcbtxt->SetTimeStamp( EagleTimeStamp( gr ) ); pcbtxt->SetText( FROM_UTF8( t.text.c_str() ) ); pcbtxt->SetTextPos( wxPoint( kicad_x( t.x ), kicad_y( t.y ) ) ); pcbtxt->SetTextSize( kicad_fontz( t.size ) ); - double ratio = t.ratio ? *t.ratio : 8; // DTD says 8 is default + double ratio = t.ratio ? *t.ratio : 8; // DTD says 8 is default - pcbtxt->SetThickness( kicad( t.size * ratio / 100 ) ); + pcbtxt->SetThickness( t.size.ToPcbUnits() * ratio / 100 ); int align = t.align ? *t.align : ETEXT::BOTTOM_LEFT; @@ -592,11 +591,11 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) m_board->Add( dseg, ADD_APPEND ); dseg->SetShape( S_CIRCLE ); - dseg->SetTimeStamp( timeStamp( gr ) ); + dseg->SetTimeStamp( EagleTimeStamp( gr ) ); dseg->SetLayer( layer ); dseg->SetStart( wxPoint( kicad_x( c.x ), kicad_y( c.y ) ) ); dseg->SetEnd( wxPoint( kicad_x( c.x + c.radius ), kicad_y( c.y ) ) ); - dseg->SetWidth( kicad( c.width ) ); + dseg->SetWidth( c.width.ToPcbUnits() ); } m_xpath->pop(); } @@ -615,7 +614,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board ); m_board->Add( zone, ADD_APPEND ); - zone->SetTimeStamp( timeStamp( gr ) ); + zone->SetTimeStamp( EagleTimeStamp( gr ) ); zone->SetLayer( layer ); zone->SetNetCode( NETINFO_LIST::UNCONNECTED ); @@ -667,7 +666,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) pad->SetPosition( padpos + module->GetPosition() ); */ - wxSize sz( kicad( e.drill ), kicad( e.drill ) ); + wxSize sz( e.drill.ToPcbUnits(), e.drill.ToPcbUnits() ); pad->SetDrillSize( sz ); pad->SetSize( sz ); @@ -694,6 +693,24 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) DIMENSION* dimension = new DIMENSION( m_board ); m_board->Add( dimension, ADD_APPEND ); + if( d.dimensionType ) + { + // Eagle dimension graphic arms may have different lengths, but they look + // incorrect in KiCad (the graphic is tilted). Make them even lenght in such case. + if( *d.dimensionType == "horizontal" ) + { + int newY = ( d.y1.ToPcbUnits() + d.y2.ToPcbUnits() ) / 2; + d.y1 = ECOORD( newY, ECOORD::UNIT::NM ); + d.y2 = ECOORD( newY, ECOORD::UNIT::NM ); + } + else if( *d.dimensionType == "vertical" ) + { + int newX = ( d.x1.ToPcbUnits() + d.x2.ToPcbUnits() ) / 2; + d.x1 = ECOORD( newX, ECOORD::UNIT::NM ); + d.x2 = ECOORD( newX, ECOORD::UNIT::NM ); + } + } + dimension->SetLayer( layer ); // The origin and end are assumed to always be in this order from eagle dimension->SetOrigin( wxPoint( kicad_x( d.x1 ), kicad_y( d.y1 ) ) ); @@ -713,8 +730,8 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) // because the "height" of the dimension is perpendicular to that axis // Note the check is just if two axes are close enough to each other // Eagle appears to have some rounding errors - if( fabs( d.x1 - d.x2 ) < 0.05 ) - dimension->SetHeight( kicad_x( d.x1 - d.x3 ) ); + if( abs( ( d.x1 - d.x2 ).ToPcbUnits() ) < 50000 ) // 50000 nm = 0.05 mm + dimension->SetHeight( kicad_x( d.x3 - d.x1 ) ); else dimension->SetHeight( kicad_y( d.y3 - d.y1 ) ); @@ -871,18 +888,21 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements ) refanceNamePresetInPackageLayout = true; valueNamePresetInPackageLayout = true; m->SetPosition( wxPoint( kicad_x( e.x ), kicad_y( e.y ) ) ); + // Is >NAME field set in package layout ? if( m->GetReference().size() == 0 ) { m->Reference().SetVisible( false ); // No so no show refanceNamePresetInPackageLayout = false; } + // Is >VALUE field set in package layout if( m->GetValue().size() == 0 ) { m->Value().SetVisible( false ); // No so no show valueNamePresetInPackageLayout = false; } + m->SetReference( FROM_UTF8( e.name.c_str() ) ); m->SetValue( FROM_UTF8( e.value.c_str() ) ); @@ -890,6 +910,7 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements ) { // Not smashed so show NAME & VALUE if( valueNamePresetInPackageLayout ) m->Value().SetVisible( true ); // Only if place holder in package layout + if( refanceNamePresetInPackageLayout ) m->Reference().SetVisible( true ); // Only if place holder in package layout } @@ -1084,7 +1105,7 @@ void EAGLE_PLUGIN::orientModuleText( MODULE* m, const EELEMENT& e, ratio = *a.ratio; } - int lw = int( fontz.y * ratio / 100.0 ); + int lw = int( fontz.y * ratio / 100 ); txt->SetThickness( lw ); int align = ETEXT::BOTTOM_LEFT; // bottom-left is eagle default @@ -1163,9 +1184,9 @@ void EAGLE_PLUGIN::orientModuleText( MODULE* m, const EELEMENT& e, MODULE* EAGLE_PLUGIN::makeModule( wxXmlNode* aPackage, const string& aPkgName ) const { - std::unique_ptr m( new MODULE( m_board ) ); + std::unique_ptr m( new MODULE( m_board ) ); - m->SetFPID( LIB_ID( UTF8(aPkgName) ) ); + m->SetFPID( LIB_ID( UTF8( aPkgName ) ) ); // Get the first package item and iterate wxXmlNode* packageItem = aPackage->GetChildren(); @@ -1213,37 +1234,46 @@ void EAGLE_PLUGIN::packageWire( MODULE* aModule, wxXmlNode* aTree ) const EWIRE w( aTree ); PCB_LAYER_ID layer = kicad_layer( w.layer ); - if( IsNonCopperLayer( layer ) ) // only valid non-copper wires, skip copper package wires + if( IsCopperLayer( layer ) ) // skip copper "package.circle"s { - wxPoint start( kicad_x( w.x1 ), kicad_y( w.y1 ) ); - wxPoint end( kicad_x( w.x2 ), kicad_y( w.y2 ) ); - int width = kicad( w.width ); - - // FIXME: the cap attribute is ignored because kicad can't create lines - // with flat ends. - EDGE_MODULE* dwg; - if( !w.curve ) - { - dwg = new EDGE_MODULE( aModule, S_SEGMENT ); - - dwg->SetStart0( start ); - dwg->SetEnd0( end ); - } - else - { - dwg = new EDGE_MODULE( aModule, S_ARC ); - wxPoint center = kicad_arc_center( start, end, *w.curve); - - dwg->SetStart0( center ); - dwg->SetEnd0( start ); - dwg->SetAngle( *w.curve * -10.0 ); // KiCad rotates the other way - } - - dwg->SetLayer( layer ); - dwg->SetWidth( width ); - - aModule->GraphicalItemsList().PushBack( dwg ); + wxLogMessage( wxString::Format( + "Line on copper layer in package %s (%f mm, %f mm) (%f mm, %f mm)." + "\nMoving to Dwgs.User layer", + aModule->GetFPID().GetLibItemName().c_str(), w.x1.ToMm(), w.y1.ToMm(), + w.x2.ToMm(), w.y2.ToMm() ) ); + layer = Dwgs_User; } + + wxPoint start( kicad_x( w.x1 ), kicad_y( w.y1 ) ); + wxPoint end( kicad_x( w.x2 ), kicad_y( w.y2 ) ); + int width = w.width.ToPcbUnits(); + + // FIXME: the cap attribute is ignored because kicad can't create lines + // with flat ends. + EDGE_MODULE* dwg; + + if( !w.curve ) + { + dwg = new EDGE_MODULE( aModule, S_SEGMENT ); + + dwg->SetStart0( start ); + dwg->SetEnd0( end ); + } + else + { + dwg = new EDGE_MODULE( aModule, S_ARC ); + wxPoint center = ConvertArcCenter( start, end, *w.curve ); + + dwg->SetStart0( center ); + dwg->SetEnd0( start ); + dwg->SetAngle( *w.curve * -10.0 ); // KiCad rotates the other way + } + + dwg->SetLayer( layer ); + dwg->SetWidth( width ); + dwg->SetDrawCoord(); + + aModule->GraphicalItemsList().PushBack( dwg ); } @@ -1267,9 +1297,7 @@ void EAGLE_PLUGIN::packagePad( MODULE* aModule, wxXmlNode* aTree ) const RotatePoint( &padpos, aModule->GetOrientation() ); pad->SetPosition( padpos + aModule->GetPosition() ); - - pad->SetDrillSize( wxSize( kicad( e.drill ), kicad( e.drill ) ) ); - + pad->SetDrillSize( wxSize( e.drill.ToPcbUnits(), e.drill.ToPcbUnits() ) ); pad->SetLayerSet( LSET::AllCuMask().set( B_Mask ).set( F_Mask ) ); if( e.shape ) @@ -1305,7 +1333,7 @@ void EAGLE_PLUGIN::packagePad( MODULE* aModule, wxXmlNode* aTree ) const if( e.diameter ) { - int diameter = kicad( *e.diameter ); + int diameter = e.diameter->ToPcbUnits(); pad->SetSize( wxSize( diameter, diameter ) ); } else @@ -1340,6 +1368,14 @@ void EAGLE_PLUGIN::packageText( MODULE* aModule, wxXmlNode* aTree ) const ETEXT t( aTree ); PCB_LAYER_ID layer = kicad_layer( t.layer ); + if( IsCopperLayer( layer ) ) // skip copper texts + { + wxLogMessage( wxString::Format( + "Unsupported text on copper layer in package %s.\nMoving to Dwgs.User layer.", + aModule->GetFPID().GetLibItemName().c_str() ) ); + layer = Dwgs_User; + } + if( layer == UNDEFINED_LAYER ) { layer = Cmts_User; @@ -1358,7 +1394,7 @@ void EAGLE_PLUGIN::packageText( MODULE* aModule, wxXmlNode* aTree ) const aModule->GraphicalItemsList().PushBack( txt ); } - txt->SetTimeStamp( timeStamp( aTree ) ); + txt->SetTimeStamp( EagleTimeStamp( aTree ) ); txt->SetText( FROM_UTF8( t.text.c_str() ) ); wxPoint pos( kicad_x( t.x ), kicad_y( t.y ) ); @@ -1371,7 +1407,7 @@ void EAGLE_PLUGIN::packageText( MODULE* aModule, wxXmlNode* aTree ) const double ratio = t.ratio ? *t.ratio : 8; // DTD says 8 is default - txt->SetThickness( kicad( t.size * ratio / 100 ) ); + txt->SetThickness( t.size.ToPcbUnits() * ratio / 100 ); int align = t.align ? *t.align : ETEXT::BOTTOM_LEFT; // bottom-left is eagle default @@ -1446,31 +1482,44 @@ void EAGLE_PLUGIN::packageRectangle( MODULE* aModule, wxXmlNode* aTree ) const ERECT r( aTree ); PCB_LAYER_ID layer = kicad_layer( r.layer ); - if( IsNonCopperLayer( layer ) ) // skip copper "package.rectangle"s + // Rectangles are not supported yet in footprints as they are not editable. + wxLogMessage( wxString::Format( "Unsupported rectangle in package %s" + " (%f mm, %f mm) (%f mm, %f mm), layer: %s", + aModule->GetFPID().GetLibItemName().c_str(), r.x1.ToMm(), r.y1.ToMm(), + r.x2.ToMm(), r.y2.ToMm(), eagle_layer_name( r.layer ) ) ); + + return; + + if( IsCopperLayer( layer ) ) // skip copper "package.circle"s { - EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_POLYGON ); - aModule->GraphicalItemsList().PushBack( dwg ); - - dwg->SetLayer( layer ); - dwg->SetWidth( 0 ); - - dwg->SetTimeStamp( timeStamp( aTree ) ); - - std::vector pts; - - wxPoint start( wxPoint( kicad_x( r.x1 ), kicad_y( r.y1 ) ) ); - wxPoint end( wxPoint( kicad_x( r.x1 ), kicad_y( r.y2 ) ) ); - - pts.push_back( start ); - pts.push_back( wxPoint( kicad_x( r.x2 ), kicad_y( r.y1 ) ) ); - pts.push_back( wxPoint( kicad_x( r.x2 ), kicad_y( r.y2 ) ) ); - pts.push_back( end ); - - dwg->SetPolyPoints( pts ); - - dwg->SetStart0( start ); - dwg->SetEnd0( end ); + wxLogMessage( wxString::Format( + "Unsupported rectangle on copper layer in package %s.\nMoving to Dwgs.User layer.", + aModule->GetFPID().GetLibItemName().c_str() ) ); + layer = Dwgs_User; } + + EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_POLYGON ); + aModule->GraphicalItemsList().PushBack( dwg ); + + dwg->SetLayer( layer ); + dwg->SetWidth( 0 ); + + dwg->SetTimeStamp( EagleTimeStamp( aTree ) ); + + std::vector pts; + + wxPoint start( wxPoint( kicad_x( r.x1 ), kicad_y( r.y1 ) ) ); + wxPoint end( wxPoint( kicad_x( r.x1 ), kicad_y( r.y2 ) ) ); + + pts.push_back( start ); + pts.push_back( wxPoint( kicad_x( r.x2 ), kicad_y( r.y1 ) ) ); + pts.push_back( wxPoint( kicad_x( r.x2 ), kicad_y( r.y2 ) ) ); + pts.push_back( end ); + + dwg->SetPolyPoints( pts ); + + dwg->SetStart0( start ); + dwg->SetEnd0( end ); } @@ -1479,53 +1528,46 @@ void EAGLE_PLUGIN::packagePolygon( MODULE* aModule, wxXmlNode* aTree ) const EPOLYGON p( aTree ); PCB_LAYER_ID layer = kicad_layer( p.layer ); - if( IsNonCopperLayer( layer ) ) // skip copper "package.rectangle"s + if( IsCopperLayer( layer ) ) // skip copper "package.circle"s { - EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_POLYGON ); - aModule->GraphicalItemsList().PushBack( dwg ); - - dwg->SetWidth( 0 ); // it's filled, no need for boundary width - - /* - switch( layer ) - { - case Eco1_User: layer = F_SilkS; break; - case Eco2_User: layer = B_SilkS; break; - - // all MODULE templates (created from eagle packages) are on front layer - // until cloned. - case Cmts_User: layer = F_SilkS; break; - } - */ - - dwg->SetLayer( layer ); - - dwg->SetTimeStamp( timeStamp( aTree ) ); - - std::vector pts; - // TODO: I think there's no way to know a priori the number of children in wxXmlNode :() - // pts.reserve( aTree.size() ); - - // Get the first vertex and iterate - wxXmlNode* vertex = aTree->GetChildren(); - - while( vertex ) - { - if( vertex->GetName() != "vertex" ) // skip node - continue; - - EVERTEX v( vertex ); - - pts.push_back( wxPoint( kicad_x( v.x ), kicad_y( v.y ) ) ); - - vertex = vertex->GetNext(); - } - - dwg->SetPolyPoints( pts ); - - dwg->SetStart0( *pts.begin() ); - dwg->SetEnd0( pts.back() ); + wxLogMessage( wxString::Format( + "Unsupported polygon on copper layer in package %s.\nMoving to Dwgs.User layer.", + aModule->GetFPID().GetLibItemName().c_str() ) ); + layer = Dwgs_User; } + + EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_POLYGON ); + aModule->GraphicalItemsList().PushBack( dwg ); + + dwg->SetWidth( 0 ); // it's filled, no need for boundary width + + dwg->SetLayer( layer ); + + dwg->SetTimeStamp( EagleTimeStamp( aTree ) ); + + std::vector pts; + // TODO: I think there's no way to know a priori the number of children in wxXmlNode :() + // pts.reserve( aTree.size() ); + + // Get the first vertex and iterate + wxXmlNode* vertex = aTree->GetChildren(); + + while( vertex ) + { + if( vertex->GetName() != "vertex" ) // skip node + continue; + + EVERTEX v( vertex ); + + pts.push_back( wxPoint( kicad_x( v.x ), kicad_y( v.y ) ) ); + + vertex = vertex->GetNext(); + } + + dwg->SetPolyPoints( pts ); + dwg->SetStart0( *pts.begin() ); + dwg->SetEnd0( pts.back() ); + dwg->SetDrawCoord(); } @@ -1533,11 +1575,20 @@ void EAGLE_PLUGIN::packageCircle( MODULE* aModule, wxXmlNode* aTree ) const { ECIRCLE e( aTree ); PCB_LAYER_ID layer = kicad_layer( e.layer ); + + if( IsCopperLayer( layer ) ) // skip copper "package.circle"s + { + wxLogMessage( wxString::Format( + "Unsupported circle on copper layer in package %s.\nMoving to Dwgs.User layer.", + aModule->GetFPID().GetLibItemName().c_str() ) ); + layer = Dwgs_User; + } + EDGE_MODULE* gr = new EDGE_MODULE( aModule, S_CIRCLE ); aModule->GraphicalItemsList().PushBack( gr ); - gr->SetWidth( kicad( e.width ) ); + gr->SetWidth( e.width.ToPcbUnits() ); switch( (int) layer ) { @@ -1551,10 +1602,10 @@ void EAGLE_PLUGIN::packageCircle( MODULE* aModule, wxXmlNode* aTree ) const } gr->SetLayer( layer ); - gr->SetTimeStamp( timeStamp( aTree ) ); - + gr->SetTimeStamp( EagleTimeStamp( aTree ) ); gr->SetStart0( wxPoint( kicad_x( e.x ), kicad_y( e.y ) ) ); gr->SetEnd0( wxPoint( kicad_x( e.x + e.radius ), kicad_y( e.y ) ) ); + gr->SetDrawCoord(); } @@ -1579,7 +1630,7 @@ void EAGLE_PLUGIN::packageHole( MODULE* aModule, wxXmlNode* aTree ) const pad->SetPos0( padpos ); pad->SetPosition( padpos + aModule->GetPosition() ); - wxSize sz( kicad( e.drill ), kicad( e.drill ) ); + wxSize sz( e.drill.ToPcbUnits(), e.drill.ToPcbUnits() ); pad->SetDrillSize( sz ); pad->SetSize( sz ); @@ -1616,7 +1667,7 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, wxXmlNode* aTree ) const pad->SetPosition( padpos + aModule->GetPosition() ); - pad->SetSize( wxSize( kicad( e.dx ), kicad( e.dy ) ) ); + pad->SetSize( wxSize( e.dx.ToPcbUnits(), e.dy.ToPcbUnits() ) ); pad->SetLayer( layer ); @@ -1703,12 +1754,12 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals ) { TRACK* t = new TRACK( m_board ); - t->SetTimeStamp( timeStamp( netItem ) ); + t->SetTimeStamp( EagleTimeStamp( netItem ) ); t->SetPosition( wxPoint( kicad_x( w.x1 ), kicad_y( w.y1 ) ) ); t->SetEnd( wxPoint( kicad_x( w.x2 ), kicad_y( w.y2 ) ) ); - int width = kicad( w.width ); + int width = w.width.ToPcbUnits(); if( width < m_min_trace ) m_min_trace = width; @@ -1738,7 +1789,7 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals ) IsCopperLayer( layer_back_most ) ) { int kidiam; - int drillz = kicad( v.drill ); + int drillz = v.drill.ToPcbUnits(); VIA* via = new VIA( m_board ); m_board->m_Track.Insert( via, NULL ); @@ -1746,7 +1797,7 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals ) if( v.diam ) { - kidiam = kicad( *v.diam ); + kidiam = v.diam->ToPcbUnits(); via->SetWidth( kidiam ); } else @@ -1781,7 +1832,7 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals ) else via->SetViaType( VIA_BLIND_BURIED ); - via->SetTimeStamp( timeStamp( netItem ) ); + via->SetTimeStamp( EagleTimeStamp( netItem ) ); wxPoint pos( kicad_x( v.x ), kicad_y( v.y ) ); @@ -1827,7 +1878,7 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals ) m_board->Add( zone, ADD_APPEND ); zones.push_back( zone ); - zone->SetTimeStamp( timeStamp( netItem ) ); + zone->SetTimeStamp( EagleTimeStamp( netItem ) ); zone->SetLayer( layer ); zone->SetNetCode( netCode ); @@ -1863,14 +1914,14 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals ) // clearances, etc. zone->SetArcSegmentCount( 32 ); // @todo: should be a constructor default? - zone->SetMinThickness( kicad( p.width ) ); + zone->SetMinThickness( p.width.ToPcbUnits() ); // FIXME: KiCad zones have very rounded corners compared to eagle. // This means that isolation amounts that work well in eagle // tend to make copper intrude in soldermask free areas around pads. if( p.isolate ) { - zone->SetZoneClearance( kicad( *p.isolate ) ); + zone->SetZoneClearance( p.isolate->ToPcbUnits() ); } else { zone->SetZoneClearance( 0 ); @@ -1885,8 +1936,8 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals ) // based on what the zone is connecting to. // (i.e. width of spoke is half of the smaller side of an smd pad) // This is a basic workaround - zone->SetThermalReliefGap( kicad( p.width + 0.05 ) ); - zone->SetThermalReliefCopperBridge( kicad( p.width + 0.05 ) ); + zone->SetThermalReliefGap( p.width.ToPcbUnits() + 50000 ); // 50000nm == 0.05mm + zone->SetThermalReliefCopperBridge( p.width.ToPcbUnits() + 50000 ); } int rank = p.rank ? (p.max_priority - *p.rank) : p.max_priority; @@ -1975,8 +2026,8 @@ PCB_LAYER_ID EAGLE_PLUGIN::kicad_layer( int aEagleLayer ) const case EAGLE_LAYER::HOLES: default: // some layers do not map to KiCad - wxLogMessage( wxString::Format( "Unsupported Eagle layer %d. Use drawings layer", - aEagleLayer ) ); + wxLogMessage( wxString::Format( "Unsupported Eagle layer '%s' (%d), converted to Dwgs.User layer", + eagle_layer_name( aEagleLayer ), aEagleLayer ) ); kiLayer = Dwgs_User; break; } } @@ -1985,6 +2036,14 @@ PCB_LAYER_ID EAGLE_PLUGIN::kicad_layer( int aEagleLayer ) const } +const string& EAGLE_PLUGIN::eagle_layer_name( int aLayer ) const +{ + static const string unknown( "unknown" ); + auto it = m_eagleLayers.find( aLayer ); + return it == m_eagleLayers.end() ? unknown : it->second.name; +} + + void EAGLE_PLUGIN::centerBoard() { if( m_props ) diff --git a/pcbnew/eagle_plugin.h b/pcbnew/eagle_plugin.h index 81b468c8cb..6d41f70bb5 100644 --- a/pcbnew/eagle_plugin.h +++ b/pcbnew/eagle_plugin.h @@ -125,8 +125,11 @@ public: ~EAGLE_PLUGIN(); private: + typedef std::vector ELAYERS; + typedef ELAYERS::const_iterator EITER; int m_cu_map[17]; ///< map eagle to kicad, cu layers only. + std::map m_eagleLayers; ///< Eagle layers data stored by the layer number ERULES* m_rules; ///< Eagle design rules. XPATH* m_xpath; ///< keeps track of what we are working on within @@ -148,9 +151,6 @@ private: int m_min_via; ///< smallest via we find on Load(), in BIU. int m_min_via_hole; ///< smallest via diameter hole we find on Load(), in BIU. - double mm_per_biu; ///< how many mm in each BIU - double biu_per_mm; ///< how many bius in a mm - wxString m_lib_path; wxDateTime m_mod_time; @@ -160,20 +160,17 @@ private: void clear_cu_map(); /// Convert an Eagle distance to a KiCad distance. - int kicad( double d ) const; - int kicad_y( double y ) const { return -kicad( y ); } - int kicad_x( double x ) const { return kicad( x ); } + int kicad_y( const ECOORD& y ) const { return -y.ToPcbUnits(); } + int kicad_x( const ECOORD& x ) const { return x.ToPcbUnits(); } /// create a font size (fontz) from an eagle font size scalar - wxSize kicad_fontz( double d ) const; + wxSize kicad_fontz( const ECOORD& d ) const; /// Convert an Eagle layer to a KiCad layer. PCB_LAYER_ID kicad_layer( int aLayer ) const; - /// Convert a KiCad distance to an Eagle distance. - double eagle( BIU d ) const { return mm_per_biu * d; } - double eagle_x( BIU x ) const { return eagle( x ); } - double eagle_y( BIU y ) const { return eagle( y ); } + /// Get Eagle layer name by its number + const std::string& eagle_layer_name( int aLayer ) const; /// This PLUGIN only caches one footprint library, this determines which one. void cacheLib( const wxString& aLibraryPath ); diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 88b4cdc13c..87829e4b13 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include @@ -94,10 +96,10 @@ bool AskLoadBoardFileName( wxWindow* aParent, int* aCtl, wxString* aFileName, bo IO_MGR::PCB_FILE_T pluginType; } loaders[] = { - { PcbFileWildcard, IO_MGR::KICAD }, // Current Kicad board files - { LegacyPcbFileWildcard, IO_MGR::LEGACY }, // Old Kicad board files - { EaglePcbFileWildcard, IO_MGR::EAGLE }, // Import board files - { PCadPcbFileWildcard, IO_MGR::PCAD }, // Import board files + { PcbFileWildcard, IO_MGR::KICAD_SEXP }, // Current Kicad board files + { LegacyPcbFileWildcard, IO_MGR::LEGACY }, // Old Kicad board files + { EaglePcbFileWildcard, IO_MGR::EAGLE }, // Import board files + { PCadPcbFileWildcard, IO_MGR::PCAD }, // Import board files }; wxFileName fileName( *aFileName ); @@ -394,7 +396,7 @@ IO_MGR::PCB_FILE_T plugin_type( const wxString& aFileName, int aCtl ) } else { - pluginType = IO_MGR::KICAD; + pluginType = IO_MGR::KICAD_SEXP; } return pluginType; @@ -467,7 +469,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in IO_MGR::PCB_FILE_T pluginType = plugin_type( fullFileName, aCtl ); - bool converted = pluginType != IO_MGR::LEGACY && pluginType != IO_MGR::KICAD; + bool converted = pluginType != IO_MGR::LEGACY && pluginType != IO_MGR::KICAD_SEXP; if( !converted ) { @@ -709,7 +711,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF try { - PLUGIN::RELEASER pi( IO_MGR::PluginFind( IO_MGR::KICAD ) ); + PLUGIN::RELEASER pi( IO_MGR::PluginFind( IO_MGR::KICAD_SEXP ) ); wxASSERT( pcbFileName.IsAbsolute() ); @@ -788,7 +790,7 @@ bool PCB_EDIT_FRAME::SavePcbCopy( const wxString& aFileName ) try { - PLUGIN::RELEASER pi( IO_MGR::PluginFind( IO_MGR::KICAD ) ); + PLUGIN::RELEASER pi( IO_MGR::PluginFind( IO_MGR::KICAD_SEXP ) ); wxASSERT( pcbFileName.IsAbsolute() ); @@ -861,3 +863,34 @@ bool PCB_EDIT_FRAME::doAutoSave() return false; } + + +bool PCB_EDIT_FRAME::ImportFile( const wxString& aFileName, int aFileType ) +{ + switch( (IO_MGR::PCB_FILE_T) aFileType ) + { + case IO_MGR::EAGLE: + if( OpenProjectFiles( std::vector( 1, aFileName ), + KICTL_EAGLE_BRD ) ) + { + wxString projectpath = Kiway().Prj().GetProjectPath(); + wxFileName newfilename = Prj().AbsolutePath( Prj().GetProjectName() ); + + newfilename.SetExt( KiCadPcbFileExtension ); + + GetBoard()->SetFileName( newfilename.GetFullPath() ); + UpdateTitle(); + + ArchiveModulesOnBoard( true, newfilename.GetName() ); + + return true; + } + + return false; + + default: + return false; + } + + return false; +} diff --git a/pcbnew/io_mgr.cpp b/pcbnew/io_mgr.cpp index 2b41083775..cff29cdfd7 100644 --- a/pcbnew/io_mgr.cpp +++ b/pcbnew/io_mgr.cpp @@ -65,7 +65,7 @@ PLUGIN* IO_MGR::PluginFind( PCB_FILE_T aFileType ) case LEGACY: return new LEGACY_PLUGIN(); - case KICAD: + case KICAD_SEXP: return new PCB_IO(); case EAGLE: @@ -116,7 +116,7 @@ const wxString IO_MGR::ShowType( PCB_FILE_T aType ) case LEGACY: return wxString( wxT( "Legacy" ) ); - case KICAD: + case KICAD_SEXP: return wxString( wxT( "KiCad" ) ); case EAGLE: @@ -141,7 +141,7 @@ IO_MGR::PCB_FILE_T IO_MGR::EnumFromStr( const wxString& aType ) // library tables, so don't do change, only additions are ok. if( aType == wxT( "KiCad" ) ) - return KICAD; + return KICAD_SEXP; if( aType == wxT( "Legacy" ) ) return LEGACY; @@ -181,7 +181,7 @@ const wxString IO_MGR::GetFileExtension( PCB_FILE_T aFileType ) IO_MGR::PCB_FILE_T IO_MGR::GuessPluginTypeFromLibPath( const wxString& aLibPath ) { - PCB_FILE_T ret = KICAD; // default guess, unless detected otherwise. + PCB_FILE_T ret = KICAD_SEXP; // default guess, unless detected otherwise. wxFileName fn( aLibPath ); if( fn.GetExt() == LegacyFootprintLibPathExtension ) @@ -209,7 +209,7 @@ IO_MGR::PCB_FILE_T IO_MGR::GuessPluginTypeFromLibPath( const wxString& aLibPath else if( fn.GetExt() == KiCadFootprintLibPathExtension && !aLibPath.StartsWith( wxT( "http" ) ) ) { - ret = KICAD; + ret = KICAD_SEXP; } else { @@ -254,4 +254,3 @@ void IO_MGR::Save( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aBoar THROW_IO_ERROR( wxString::Format( FMT_NOTFOUND, ShowType( aFileType ).GetData() ) ); } - diff --git a/pcbnew/io_mgr.h b/pcbnew/io_mgr.h index c90c7c9c30..ce889a45c9 100644 --- a/pcbnew/io_mgr.h +++ b/pcbnew/io_mgr.h @@ -51,7 +51,7 @@ public: enum PCB_FILE_T { LEGACY, ///< Legacy Pcbnew file formats prior to s-expression. - KICAD, ///< S-expression Pcbnew file format. + KICAD_SEXP, ///< S-expression Pcbnew file format. EAGLE, PCAD, GEDA_PCB, ///< Geda PCB file formats. diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index 06145c660f..21d4b7ce3a 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -53,7 +53,8 @@ using namespace PCB_KEYS_T; -#define FMTIU BOARD_ITEM::FormatInternalUnits +#define FMT_IU BOARD_ITEM::FormatInternalUnits +#define FMT_ANGLE BOARD_ITEM::FormatAngle /** * @ingroup trace_env_vars @@ -538,105 +539,105 @@ void PCB_IO::formatSetup( BOARD* aBoard, int aNestLevel ) const // Save current default track width, for compatibility with older Pcbnew version; m_out->Print( aNestLevel+1, "(last_trace_width %s)\n", - FMTIU( dsnSettings.GetCurrentTrackWidth() ).c_str() ); + FMT_IU( dsnSettings.GetCurrentTrackWidth() ).c_str() ); // Save custom tracks width list (the first is not saved here: this is the netclass value for( unsigned ii = 1; ii < dsnSettings.m_TrackWidthList.size(); ii++ ) m_out->Print( aNestLevel+1, "(user_trace_width %s)\n", - FMTIU( dsnSettings.m_TrackWidthList[ii] ).c_str() ); + FMT_IU( dsnSettings.m_TrackWidthList[ii] ).c_str() ); m_out->Print( aNestLevel+1, "(trace_clearance %s)\n", - FMTIU( dsnSettings.GetDefault()->GetClearance() ).c_str() ); + FMT_IU( dsnSettings.GetDefault()->GetClearance() ).c_str() ); // ZONE_SETTINGS m_out->Print( aNestLevel+1, "(zone_clearance %s)\n", - FMTIU( aBoard->GetZoneSettings().m_ZoneClearance ).c_str() ); + FMT_IU( aBoard->GetZoneSettings().m_ZoneClearance ).c_str() ); m_out->Print( aNestLevel+1, "(zone_45_only %s)\n", aBoard->GetZoneSettings().m_Zone_45_Only ? "yes" : "no" ); m_out->Print( aNestLevel+1, "(trace_min %s)\n", - FMTIU( dsnSettings.m_TrackMinWidth ).c_str() ); + FMT_IU( dsnSettings.m_TrackMinWidth ).c_str() ); m_out->Print( aNestLevel+1, "(segment_width %s)\n", - FMTIU( dsnSettings.m_DrawSegmentWidth ).c_str() ); + FMT_IU( dsnSettings.m_DrawSegmentWidth ).c_str() ); m_out->Print( aNestLevel+1, "(edge_width %s)\n", - FMTIU( dsnSettings.m_EdgeSegmentWidth ).c_str() ); + FMT_IU( dsnSettings.m_EdgeSegmentWidth ).c_str() ); // Save current default via size, for compatibility with older Pcbnew version; m_out->Print( aNestLevel+1, "(via_size %s)\n", - FMTIU( dsnSettings.GetDefault()->GetViaDiameter() ).c_str() ); + FMT_IU( dsnSettings.GetDefault()->GetViaDiameter() ).c_str() ); m_out->Print( aNestLevel+1, "(via_drill %s)\n", - FMTIU( dsnSettings.GetDefault()->GetViaDrill() ).c_str() ); + FMT_IU( dsnSettings.GetDefault()->GetViaDrill() ).c_str() ); m_out->Print( aNestLevel+1, "(via_min_size %s)\n", - FMTIU( dsnSettings.m_ViasMinSize ).c_str() ); + FMT_IU( dsnSettings.m_ViasMinSize ).c_str() ); m_out->Print( aNestLevel+1, "(via_min_drill %s)\n", - FMTIU( dsnSettings.m_ViasMinDrill ).c_str() ); + FMT_IU( dsnSettings.m_ViasMinDrill ).c_str() ); // Save custom vias diameters list (the first is not saved here: this is // the netclass value for( unsigned ii = 1; ii < dsnSettings.m_ViasDimensionsList.size(); ii++ ) m_out->Print( aNestLevel+1, "(user_via %s %s)\n", - FMTIU( dsnSettings.m_ViasDimensionsList[ii].m_Diameter ).c_str(), - FMTIU( dsnSettings.m_ViasDimensionsList[ii].m_Drill ).c_str() ); + FMT_IU( dsnSettings.m_ViasDimensionsList[ii].m_Diameter ).c_str(), + FMT_IU( dsnSettings.m_ViasDimensionsList[ii].m_Drill ).c_str() ); // for old versions compatibility: if( dsnSettings.m_BlindBuriedViaAllowed ) m_out->Print( aNestLevel+1, "(blind_buried_vias_allowed yes)\n" ); m_out->Print( aNestLevel+1, "(uvia_size %s)\n", - FMTIU( dsnSettings.GetDefault()->GetuViaDiameter() ).c_str() ); + FMT_IU( dsnSettings.GetDefault()->GetuViaDiameter() ).c_str() ); m_out->Print( aNestLevel+1, "(uvia_drill %s)\n", - FMTIU( dsnSettings.GetDefault()->GetuViaDrill() ).c_str() ); + FMT_IU( dsnSettings.GetDefault()->GetuViaDrill() ).c_str() ); m_out->Print( aNestLevel+1, "(uvias_allowed %s)\n", ( dsnSettings.m_MicroViasAllowed ) ? "yes" : "no" ); m_out->Print( aNestLevel+1, "(uvia_min_size %s)\n", - FMTIU( dsnSettings.m_MicroViasMinSize ).c_str() ); + FMT_IU( dsnSettings.m_MicroViasMinSize ).c_str() ); m_out->Print( aNestLevel+1, "(uvia_min_drill %s)\n", - FMTIU( dsnSettings.m_MicroViasMinDrill ).c_str() ); + FMT_IU( dsnSettings.m_MicroViasMinDrill ).c_str() ); m_out->Print( aNestLevel+1, "(pcb_text_width %s)\n", - FMTIU( dsnSettings.m_PcbTextWidth ).c_str() ); + FMT_IU( dsnSettings.m_PcbTextWidth ).c_str() ); m_out->Print( aNestLevel+1, "(pcb_text_size %s %s)\n", - FMTIU( dsnSettings.m_PcbTextSize.x ).c_str(), - FMTIU( dsnSettings.m_PcbTextSize.y ).c_str() ); + FMT_IU( dsnSettings.m_PcbTextSize.x ).c_str(), + FMT_IU( dsnSettings.m_PcbTextSize.y ).c_str() ); m_out->Print( aNestLevel+1, "(mod_edge_width %s)\n", - FMTIU( dsnSettings.m_ModuleSegmentWidth ).c_str() ); + FMT_IU( dsnSettings.m_ModuleSegmentWidth ).c_str() ); m_out->Print( aNestLevel+1, "(mod_text_size %s %s)\n", - FMTIU( dsnSettings.m_ModuleTextSize.x ).c_str(), - FMTIU( dsnSettings.m_ModuleTextSize.y ).c_str() ); + FMT_IU( dsnSettings.m_ModuleTextSize.x ).c_str(), + FMT_IU( dsnSettings.m_ModuleTextSize.y ).c_str() ); m_out->Print( aNestLevel+1, "(mod_text_width %s)\n", - FMTIU( dsnSettings.m_ModuleTextWidth ).c_str() ); + FMT_IU( dsnSettings.m_ModuleTextWidth ).c_str() ); m_out->Print( aNestLevel+1, "(pad_size %s %s)\n", - FMTIU( dsnSettings.m_Pad_Master.GetSize().x ).c_str(), - FMTIU( dsnSettings.m_Pad_Master.GetSize().y ).c_str() ); + FMT_IU( dsnSettings.m_Pad_Master.GetSize().x ).c_str(), + FMT_IU( dsnSettings.m_Pad_Master.GetSize().y ).c_str() ); m_out->Print( aNestLevel+1, "(pad_drill %s)\n", - FMTIU( dsnSettings.m_Pad_Master.GetDrillSize().x ).c_str() ); + FMT_IU( dsnSettings.m_Pad_Master.GetDrillSize().x ).c_str() ); m_out->Print( aNestLevel+1, "(pad_to_mask_clearance %s)\n", - FMTIU( dsnSettings.m_SolderMaskMargin ).c_str() ); + FMT_IU( dsnSettings.m_SolderMaskMargin ).c_str() ); if( dsnSettings.m_SolderMaskMinWidth ) m_out->Print( aNestLevel+1, "(solder_mask_min_width %s)\n", - FMTIU( dsnSettings.m_SolderMaskMinWidth ).c_str() ); + FMT_IU( dsnSettings.m_SolderMaskMinWidth ).c_str() ); if( dsnSettings.m_SolderPasteMargin != 0 ) m_out->Print( aNestLevel+1, "(pad_to_paste_clearance %s)\n", - FMTIU( dsnSettings.m_SolderPasteMargin ).c_str() ); + FMT_IU( dsnSettings.m_SolderPasteMargin ).c_str() ); if( dsnSettings.m_SolderPasteMarginRatio != 0 ) m_out->Print( aNestLevel+1, "(pad_to_paste_clearance_ratio %s)\n", Double2Str( dsnSettings.m_SolderPasteMarginRatio ).c_str() ); m_out->Print( aNestLevel+1, "(aux_axis_origin %s %s)\n", - FMTIU( aBoard->GetAuxOrigin().x ).c_str(), - FMTIU( aBoard->GetAuxOrigin().y ).c_str() ); + FMT_IU( aBoard->GetAuxOrigin().x ).c_str(), + FMT_IU( aBoard->GetAuxOrigin().y ).c_str() ); if( aBoard->GetGridOrigin().x || aBoard->GetGridOrigin().y ) m_out->Print( aNestLevel+1, "(grid_origin %s %s)\n", - FMTIU( aBoard->GetGridOrigin().x ).c_str(), - FMTIU( aBoard->GetGridOrigin().y ).c_str() ); + FMT_IU( aBoard->GetGridOrigin().x ).c_str(), + FMT_IU( aBoard->GetGridOrigin().y ).c_str() ); m_out->Print( aNestLevel+1, "(visible_elements %X)\n", dsnSettings.GetVisibleElements() ); @@ -655,7 +656,7 @@ void PCB_IO::formatGeneral( BOARD* aBoard, int aNestLevel ) const m_out->Print( aNestLevel, "(general\n" ); // Write Bounding box info m_out->Print( aNestLevel+1, "(thickness %s)\n", - FMTIU( dsnSettings.GetBoardThickness() ).c_str() ); + FMT_IU( dsnSettings.GetBoardThickness() ).c_str() ); m_out->Print( aNestLevel+1, "(drawings %d)\n", aBoard->Drawings().Size() ); m_out->Print( aNestLevel+1, "(tracks %d)\n", aBoard->GetNumSegmTrack() ); diff --git a/pcbnew/librairi.cpp b/pcbnew/librairi.cpp index 549fc34c51..897651be37 100644 --- a/pcbnew/librairi.cpp +++ b/pcbnew/librairi.cpp @@ -144,7 +144,7 @@ static IO_MGR::PCB_FILE_T detect_file_type( FILE* aFile, const wxFileName& aFile if( !strncasecmp( line, "(module", strlen( "(module" ) ) ) { - file_type = IO_MGR::KICAD; + file_type = IO_MGR::KICAD_SEXP; *aName = aFileName.GetName(); } else if( !strncasecmp( line, FOOTPRINT_LIBRARY_HEADER, FOOTPRINT_LIBRARY_HEADER_CNT ) ) @@ -240,7 +240,7 @@ MODULE* try_load_footprint( const wxFileName& aFileName, IO_MGR::PCB_FILE_T aFil module = parse_module_with_plugin( aFileName, aFileType, aName ); break; - case IO_MGR::KICAD: + case IO_MGR::KICAD_SEXP: module = parse_module_kicad( aFileName ); break; @@ -441,27 +441,47 @@ bool FOOTPRINT_EDIT_FRAME::SaveCurrentModule( const wxString* aLibPath ) return true; } -wxString PCB_BASE_EDIT_FRAME::CreateNewLibrary() +wxString PCB_BASE_EDIT_FRAME::CreateNewLibrary(const wxString& aLibName ) { // Kicad cannot write legacy format libraries, only .pretty new format // because the legacy format cannot handle current features. // The footprint library is actually a directory - // prompt user for footprint library name, ending by ".pretty" + // if a library name is not given, prompt user for footprint library name, ending by ".pretty" // Because there are constraints for the directory name to create, // (the name should have the extension ".pretty", and the folder cannot be inside // a footprint library), we do not use the standard wxDirDialog. + wxString initialPath = wxPathOnly( Prj().GetProjectFullName() ); - DIALOG_SELECT_PRETTY_LIB dlg( this, initialPath ); - if( dlg.ShowModal() != wxID_OK ) - return wxEmptyString; + wxString libPath; - wxString libPath = dlg.GetFullPrettyLibName(); + if( aLibName.IsEmpty() ) + { + DIALOG_SELECT_PRETTY_LIB dlg( this, initialPath ); - // We can save fp libs only using IO_MGR::KICAD format (.pretty libraries) - IO_MGR::PCB_FILE_T piType = IO_MGR::KICAD; + if( dlg.ShowModal() != wxID_OK ) + return wxEmptyString; + + libPath = dlg.GetFullPrettyLibName(); + } + else + { + wxFileName fn = aLibName; + + if( !fn.IsAbsolute() ) + fn.MakeAbsolute( initialPath ); + + // Enforce the extension: + fn.SetExt( KiCadFootprintLibPathExtension ); + + libPath = fn.GetFullPath(); + } + + + // We can save fp libs only using IO_MGR::KICAD_SEXP format (.pretty libraries) + IO_MGR::PCB_FILE_T piType = IO_MGR::KICAD_SEXP; try { @@ -570,7 +590,7 @@ bool FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary() } -void PCB_EDIT_FRAME::ArchiveModulesOnBoard( bool aStoreInNewLib ) +void PCB_EDIT_FRAME::ArchiveModulesOnBoard( bool aStoreInNewLib, const wxString& aLibName ) { if( GetBoard()->m_Modules == NULL ) { @@ -611,12 +631,12 @@ void PCB_EDIT_FRAME::ArchiveModulesOnBoard( bool aStoreInNewLib ) { // The footprints are saved in a new .pretty library. // If this library already exists, all previous footprints will be deleted - wxString libPath = CreateNewLibrary(); + wxString libPath = CreateNewLibrary( aLibName ); if( libPath.IsEmpty() ) // Aborted return; - IO_MGR::PCB_FILE_T piType = IO_MGR::KICAD; + IO_MGR::PCB_FILE_T piType = IO_MGR::KICAD_SEXP; PLUGIN::RELEASER pi( IO_MGR::PluginFind( piType ) ); for( MODULE* curr_fp = GetBoard()->m_Modules; curr_fp; curr_fp = curr_fp->Next() ) diff --git a/pcbnew/pcb_base_edit_frame.h b/pcbnew/pcb_base_edit_frame.h index 83427f005a..12b46aa3ad 100644 --- a/pcbnew/pcb_base_edit_frame.h +++ b/pcbnew/pcb_base_edit_frame.h @@ -52,14 +52,16 @@ public: /** * Function CreateNewLibrary - * prompts user for a library path, then creates a new footprint library at that - * location. If library exists, user is warned about that, and is given a chance + * If a library name is given, creates a new footprint library in the project folder + * with the given name. If no library name is given it prompts user for a library path, + * then creates a new footprint library at that location. + * If library exists, user is warned about that, and is given a chance * to abort the new creation, and in that case existing library is first deleted. * * @return wxString - the newly created library path if library was successfully * created, else wxEmptyString because user aborted or error. */ - wxString CreateNewLibrary(); + wxString CreateNewLibrary(const wxString& aLibName = wxEmptyString); /** * Function OnEditItemRequest diff --git a/pcbnew/swig/pcbnew_scripting_helpers.cpp b/pcbnew/swig/pcbnew_scripting_helpers.cpp index b1dc10267a..a5af6cdc5f 100644 --- a/pcbnew/swig/pcbnew_scripting_helpers.cpp +++ b/pcbnew/swig/pcbnew_scripting_helpers.cpp @@ -60,7 +60,7 @@ void ScriptingSetPcbEditFrame( PCB_EDIT_FRAME* aPcbEditFrame ) BOARD* LoadBoard( wxString& aFileName ) { if( aFileName.EndsWith( wxT( ".kicad_pcb" ) ) ) - return LoadBoard( aFileName, IO_MGR::KICAD ); + return LoadBoard( aFileName, IO_MGR::KICAD_SEXP ); else if( aFileName.EndsWith( wxT( ".brd" ) ) ) return LoadBoard( aFileName, IO_MGR::LEGACY ); @@ -95,7 +95,7 @@ bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat ) bool SaveBoard( wxString& aFileName, BOARD* aBoard ) { - return SaveBoard( aFileName, aBoard, IO_MGR::KICAD ); + return SaveBoard( aFileName, aBoard, IO_MGR::KICAD_SEXP ); } diff --git a/include/wxPcbStruct.h b/pcbnew/wxPcbStruct.h similarity index 98% rename from include/wxPcbStruct.h rename to pcbnew/wxPcbStruct.h index c5c7b57179..46ec7263f2 100644 --- a/include/wxPcbStruct.h +++ b/pcbnew/wxPcbStruct.h @@ -30,10 +30,10 @@ #define WXPCB_STRUCT_H_ -#include -#include -#include -#include +#include "pcb_base_edit_frame.h" +#include "config_params.h" +#include "class_undoredo_container.h" +#include "zones.h" /* Forward declarations of classes. */ @@ -864,6 +864,14 @@ public: */ bool AppendBoardFile( const wxString& aFullFileName, int aCtl ); + /** + * Function ImportFile + * load the given filename but sets the path to the current project path. + * @param full filepath of file to be imported. + * @param aFileType PCB_FILE_T value for filetype + */ + bool ImportFile( const wxString& aFileName, int aFileType ) override; + /** * Function SavePcbFile * writes the board data structures to \a a aFileName @@ -933,8 +941,12 @@ public: * This lib should be in fp lib table, and is type is .pretty * false: save modules in a new lib. It it is an existing lib, * previous footprints will be removed + * + * @param aLibName: + * optional library name to create, stops dialog call. + * must be called with aStoreInNewLib as true */ - void ArchiveModulesOnBoard( bool aStoreInNewLib ); + void ArchiveModulesOnBoard( bool aStoreInNewLib, const wxString& aLibName = wxEmptyString ); /** * Function RecreateBOMFileFromBoard @@ -1546,7 +1558,7 @@ public: bool aDeleteExtraFootprints, bool aSelectByTimestamp, bool aDeleteSinglePadNets, - bool aIsDryRun ); + bool aIsDryRun ) override; /** * Function RemoveMisConnectedTracks