- Added sheet information to the net file. i.e. sheet number, human path name and timestamp

- update bom_with_title_block_2_csv.xsl
This commit is contained in:
Ronald Sousa 2015-02-11 11:11:05 +00:00
parent 534a3c1f78
commit 7392f04b75
3 changed files with 54 additions and 60 deletions

View File

@ -653,12 +653,15 @@ static XNODE* node( const wxString& aName, const wxString& aTextualContent = wxE
XNODE* NETLIST_EXPORT_TOOL::makeGenericDesignHeader()
{
SCH_SCREEN* screen;
SCH_SCREENS screenList;
screen = screenList.GetFirst();
SCH_SCREEN* screen;
XNODE* xdesign = node( wxT("design") );
XNODE* xsheetNode;
XNODE* xsheetInfo;
XNODE* xcommentNode;
XNODE* xpagesNode;
XNODE* xpageNode;
wxString sheetNumTxt;
wxString sheetNumTxtFormat = wxT( "%d" );
// the root sheet is a special sheet, call it source
xdesign->AddChild( node( wxT( "source" ), g_RootSheet->GetScreen()->GetFileName() ) );
@ -668,47 +671,44 @@ XNODE* NETLIST_EXPORT_TOOL::makeGenericDesignHeader()
// which Eeschema tool
xdesign->AddChild( node( wxT( "tool" ), wxT( "Eeschema " ) + GetBuildVersion() ) );
xdesign->AddChild( xsheetNode = node( wxT( "sheets" ) ) );
/*
Export the sheets information
*/
SCH_SHEET_LIST sheetList;
xdesign->AddChild( xpagesNode = node( wxT( "sheets" ) ) );
for( screen = screenList.GetFirst(); screen != NULL; screen = screenList.GetNext() )
for( SCH_SHEET_PATH* sheet = sheetList.GetFirst(); sheet; sheet = sheetList.GetNext() )
{
xpagesNode->AddChild( xpageNode = node( wxT( "sheet" ) ) );
// get the string representation of the sheet index number.
// Note that sheet->GetIndex() is zero index base and we need to increment the number by one to make
// human readable
sheetNumTxt.Printf( sheetNumTxtFormat, ( sheetList.GetIndex() + 1 ) );
xpageNode->AddChild( node( wxT( "number" ), sheetNumTxt ) );
xpageNode->AddChild( node( wxT( "names" ), sheet->PathHumanReadable() ) );
xpageNode->AddChild( node( wxT( "tstamps" ), sheet->Path() ) );
screen = sheet->LastScreen();
TITLE_BLOCK tb = screen->GetTitleBlock();
xsheetNode->AddChild( xsheetInfo = node( wxT( "sheet" ) ) );
xpageNode->AddChild( xsheetInfo = node( wxT( "page" ) ) );
xsheetInfo->AddChild( node( wxT( "title" ), tb.GetTitle() ) );
xsheetInfo->AddChild( node( wxT( "company" ), tb.GetCompany() ) );
xsheetInfo->AddChild( node( wxT( "revision" ), tb.GetRevision() ) );
xsheetInfo->AddChild( node( wxT( "issueDate" ), tb.GetDate() ) );
xsheetInfo->AddChild( node( wxT( "comment1" ), tb.GetComment1() ) );
xsheetInfo->AddChild( node( wxT( "comment2" ), tb.GetComment2() ) );
xsheetInfo->AddChild( node( wxT( "comment3" ), tb.GetComment3() ) );
xsheetInfo->AddChild( node( wxT( "comment4" ), tb.GetComment4() ) );
xsheetInfo->AddChild( node( wxT( "source" ), screen->GetFileName() ) );
xsheetInfo->AddChild( xcommentNode = node( wxT( "comments" ) ) );
xcommentNode->AddChild( node( wxT( "comment" ), tb.GetComment1() ) );
xcommentNode->AddChild( node( wxT( "comment" ), tb.GetComment2() ) );
xcommentNode->AddChild( node( wxT( "comment" ), tb.GetComment3() ) );
xcommentNode->AddChild( node( wxT( "comment" ), tb.GetComment4() ) );
}
/* @todo might do a list of schematic pages
<page name="">
<title/>
<revision/>
<company/>
<comments>
<comment>blah</comment> <!-- comment1 -->
<comment>blah</comment> <!-- comment2 -->
</comments>
<pagesize/>
</page>
:
and a sheet hierarchy report here
<sheets>
<sheet name="sheetname1" page="pagenameA">
<sheet name="sheetname2" page="pagenameB"/> use recursion to output?
</sheet>
</sheets>
*/
return xdesign;
}

View File

@ -73,8 +73,8 @@
<xsl:template match="/export/design/sheets/sheet[1]">
<xsl:choose>
<xsl:when test="title !=''">
<xsl:text>Title,</xsl:text><xsl:value-of select="title"/><xsl:text>&nl;</xsl:text>
<xsl:when test="page/title !=''">
<xsl:text>Title,</xsl:text><xsl:value-of select="page/title"/><xsl:text>&nl;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Title,Not Set</xsl:text><xsl:text>&nl;</xsl:text>
@ -83,8 +83,8 @@
<xsl:choose>
<xsl:when test="company !=''">
<xsl:text>Company,</xsl:text><xsl:value-of select="company"/><xsl:text>&nl;</xsl:text>
<xsl:when test="page/company !=''">
<xsl:text>Company,</xsl:text><xsl:value-of select="page/company"/><xsl:text>&nl;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Company,Not Set</xsl:text><xsl:text>&nl;</xsl:text>
@ -92,8 +92,8 @@
</xsl:choose>
<xsl:choose>
<xsl:when test="revision !=''">
<xsl:text>Revision,</xsl:text><xsl:value-of select="revision"/><xsl:text>&nl;</xsl:text>
<xsl:when test="page/revision !=''">
<xsl:text>Revision,</xsl:text><xsl:value-of select="page/revision"/><xsl:text>&nl;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Revision,Not Set</xsl:text><xsl:text>&nl;</xsl:text>
@ -101,39 +101,27 @@
</xsl:choose>
<xsl:choose>
<xsl:when test="issueDate !=''">
<xsl:text>Date Issue,</xsl:text><xsl:value-of select="issueDate"/><xsl:text>&nl;</xsl:text>
<xsl:when test="page/issueDate !=''">
<xsl:text>Date Issue,</xsl:text><xsl:value-of select="page/issueDate"/><xsl:text>&nl;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Date Issue,Not Set</xsl:text><xsl:text>&nl;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="comment1 !=''">
<xsl:text>Comment,</xsl:text><xsl:value-of select="comment1"/><xsl:text>&nl;</xsl:text>
</xsl:when>
</xsl:choose>
<xsl:apply-templates select="page/comments/comment"/><xsl:text>&nl;</xsl:text>
</xsl:template>
<xsl:template match="page/comments/comment">
<xsl:choose>
<xsl:when test="comment2 !=''">
<xsl:text>Comment,</xsl:text><xsl:value-of select="comment2"/><xsl:text>&nl;</xsl:text>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="comment3 !=''">
<xsl:text>Comment,</xsl:text><xsl:value-of select="comment3"/><xsl:text>&nl;</xsl:text>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="comment4 !=''">
<xsl:text>Comment,</xsl:text><xsl:value-of select="comment4"/><xsl:text>&nl;</xsl:text>
<xsl:when test=". !=''">
<xsl:text>Comment,</xsl:text><xsl:value-of select="."/><xsl:text>&nl;</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- the table entries -->
<xsl:template match="components/comp">
<xsl:value-of select="@ref"/><xsl:text>,</xsl:text>

View File

@ -324,6 +324,12 @@ public:
*/
int GetCount() const { return m_count; }
/**
* Function GetIndex
* @return the last selected screen index.
*/
int GetIndex() const { return m_index; }
/**
* Function GetFirst
* @return the first item (sheet) in m_List and prepare calls to GetNext()