コード例 #1
0
XNODE* NETLIST_EXPORTER_GENERIC::makeRoot( int aCtl )
{
    XNODE*      xroot = node( wxT( "export" ) );

    xroot->AddAttribute( wxT( "version" ), wxT( "D" ) );

    if( aCtl & GNL_HEADER )
        // add the "design" header
        xroot->AddChild( makeDesignHeader() );

    if( aCtl & GNL_COMPONENTS )
        xroot->AddChild( makeComponents() );

    if( aCtl & GNL_PARTS )
        xroot->AddChild( makeLibParts() );

    if( aCtl & GNL_LIBRARIES )
        // must follow makeGenericLibParts()
        xroot->AddChild( makeLibraries() );

    if( aCtl & GNL_NETS )
        xroot->AddChild( makeListOfNets() );

    return xroot;
}
コード例 #2
0
/// This method creates an XML-snippet of a single material phase.
std::string makePhase(Phase const& p)
{
    std::stringstream phase;

    phase << indent(8) << "<phase>\n";
    phase << indent(10) << "<type>" << p.property[MPL::name] << "</type>\n";
    phase << makeComponents(p.component);
    phase << makeProperties(8, p.property);
    phase << indent(8) << "</phase>\n";
    return phase.str();
}
コード例 #3
0
static SCENEGRAPH* loadIDFBoard( const wxString& aFileName )
{
    LOCALESWITCH switcher;
    IDF3_BOARD brd( IDF3::CAD_ELEC );

    // note: if the IDF model is defective no outline substitutes shall be made
    if( !brd.ReadFile( aFileName, true ) )
    {
        #ifdef DEBUG
        do {
            std::ostringstream ostr;
            std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
            std::cerr << " * [INFO] Failed to read IDF file:\n";
            std::cerr << brd.GetError() << "\n\n";
            std::cerr << " * [INFO] IDF file '" << aFileName.ToUTF8() << "'";
            wxLogTrace( MASK_IDF, "%s\n", ostr.str().c_str() );
        } while( 0 );
        #endif

        return NULL;
    }

    IFSG_TRANSFORM tx0( true );
    SGNODE* topNode = tx0.GetRawPtr();

    bool noBoard = false;
    bool noComp = false;
    bool noOther = false;

    if( NULL == makeBoard( brd, topNode ) )
        noBoard = true;

    if( !makeComponents( brd, topNode ) )
        noComp = true;

    if( !makeOtherOutlines( brd, topNode ) )
        noOther = true;

    if( noBoard && noComp && noOther )
    {
        tx0.Destroy();
        return NULL;
    }

    return (SCENEGRAPH*) topNode;
}