Commit 7392f04b authored by Ronald Sousa's avatar Ronald Sousa

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

- update bom_with_title_block_2_csv.xsl
parent 534a3c1f
...@@ -653,12 +653,15 @@ static XNODE* node( const wxString& aName, const wxString& aTextualContent = wxE ...@@ -653,12 +653,15 @@ static XNODE* node( const wxString& aName, const wxString& aTextualContent = wxE
XNODE* NETLIST_EXPORT_TOOL::makeGenericDesignHeader() XNODE* NETLIST_EXPORT_TOOL::makeGenericDesignHeader()
{ {
SCH_SCREEN* screen;
SCH_SCREENS screenList; SCH_SCREENS screenList;
screen = screenList.GetFirst(); SCH_SCREEN* screen;
XNODE* xdesign = node( wxT("design") ); XNODE* xdesign = node( wxT("design") );
XNODE* xsheetNode;
XNODE* xsheetInfo; XNODE* xsheetInfo;
XNODE* xcommentNode;
XNODE* xpagesNode;
XNODE* xpageNode;
wxString sheetNumTxt;
wxString sheetNumTxtFormat = wxT( "%d" );
// the root sheet is a special sheet, call it source // the root sheet is a special sheet, call it source
xdesign->AddChild( node( wxT( "source" ), g_RootSheet->GetScreen()->GetFileName() ) ); xdesign->AddChild( node( wxT( "source" ), g_RootSheet->GetScreen()->GetFileName() ) );
...@@ -668,46 +671,43 @@ XNODE* NETLIST_EXPORT_TOOL::makeGenericDesignHeader() ...@@ -668,46 +671,43 @@ XNODE* NETLIST_EXPORT_TOOL::makeGenericDesignHeader()
// which Eeschema tool // which Eeschema tool
xdesign->AddChild( node( wxT( "tool" ), wxT( "Eeschema " ) + GetBuildVersion() ) ); 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(); 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( "title" ), tb.GetTitle() ) );
xsheetInfo->AddChild( node( wxT( "company" ), tb.GetCompany() ) ); xsheetInfo->AddChild( node( wxT( "company" ), tb.GetCompany() ) );
xsheetInfo->AddChild( node( wxT( "revision" ), tb.GetRevision() ) ); xsheetInfo->AddChild( node( wxT( "revision" ), tb.GetRevision() ) );
xsheetInfo->AddChild( node( wxT( "issueDate" ), tb.GetDate() ) ); xsheetInfo->AddChild( node( wxT( "issueDate" ), tb.GetDate() ) );
xsheetInfo->AddChild( node( wxT( "comment1" ), tb.GetComment1() ) ); xsheetInfo->AddChild( node( wxT( "source" ), screen->GetFileName() ) );
xsheetInfo->AddChild( node( wxT( "comment2" ), tb.GetComment2() ) );
xsheetInfo->AddChild( node( wxT( "comment3" ), tb.GetComment3() ) ); xsheetInfo->AddChild( xcommentNode = node( wxT( "comments" ) ) );
xsheetInfo->AddChild( node( wxT( "comment4" ), tb.GetComment4() ) ); xcommentNode->AddChild( node( wxT( "comment" ), tb.GetComment1() ) );
} xcommentNode->AddChild( node( wxT( "comment" ), tb.GetComment2() ) );
xcommentNode->AddChild( node( wxT( "comment" ), tb.GetComment3() ) );
/* @todo might do a list of schematic pages xcommentNode->AddChild( node( wxT( "comment" ), tb.GetComment4() ) );
<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; return xdesign;
} }
......
...@@ -73,8 +73,8 @@ ...@@ -73,8 +73,8 @@
<xsl:template match="/export/design/sheets/sheet[1]"> <xsl:template match="/export/design/sheets/sheet[1]">
<xsl:choose> <xsl:choose>
<xsl:when test="title !=''"> <xsl:when test="page/title !=''">
<xsl:text>Title,</xsl:text><xsl:value-of select="title"/><xsl:text>&nl;</xsl:text> <xsl:text>Title,</xsl:text><xsl:value-of select="page/title"/><xsl:text>&nl;</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text>Title,Not Set</xsl:text><xsl:text>&nl;</xsl:text> <xsl:text>Title,Not Set</xsl:text><xsl:text>&nl;</xsl:text>
...@@ -83,8 +83,8 @@ ...@@ -83,8 +83,8 @@
<xsl:choose> <xsl:choose>
<xsl:when test="company !=''"> <xsl:when test="page/company !=''">
<xsl:text>Company,</xsl:text><xsl:value-of select="company"/><xsl:text>&nl;</xsl:text> <xsl:text>Company,</xsl:text><xsl:value-of select="page/company"/><xsl:text>&nl;</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text>Company,Not Set</xsl:text><xsl:text>&nl;</xsl:text> <xsl:text>Company,Not Set</xsl:text><xsl:text>&nl;</xsl:text>
...@@ -92,8 +92,8 @@ ...@@ -92,8 +92,8 @@
</xsl:choose> </xsl:choose>
<xsl:choose> <xsl:choose>
<xsl:when test="revision !=''"> <xsl:when test="page/revision !=''">
<xsl:text>Revision,</xsl:text><xsl:value-of select="revision"/><xsl:text>&nl;</xsl:text> <xsl:text>Revision,</xsl:text><xsl:value-of select="page/revision"/><xsl:text>&nl;</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text>Revision,Not Set</xsl:text><xsl:text>&nl;</xsl:text> <xsl:text>Revision,Not Set</xsl:text><xsl:text>&nl;</xsl:text>
...@@ -101,39 +101,27 @@ ...@@ -101,39 +101,27 @@
</xsl:choose> </xsl:choose>
<xsl:choose> <xsl:choose>
<xsl:when test="issueDate !=''"> <xsl:when test="page/issueDate !=''">
<xsl:text>Date Issue,</xsl:text><xsl:value-of select="issueDate"/><xsl:text>&nl;</xsl:text> <xsl:text>Date Issue,</xsl:text><xsl:value-of select="page/issueDate"/><xsl:text>&nl;</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text>Date Issue,Not Set</xsl:text><xsl:text>&nl;</xsl:text> <xsl:text>Date Issue,Not Set</xsl:text><xsl:text>&nl;</xsl:text>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </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:choose>
<xsl:when test="comment1 !=''"> <xsl:when test=". !=''">
<xsl:text>Comment,</xsl:text><xsl:value-of select="comment1"/><xsl:text>&nl;</xsl:text> <xsl:text>Comment,</xsl:text><xsl:value-of select="."/><xsl:text>&nl;</xsl:text>
</xsl:when>
</xsl:choose>
<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> </xsl:when>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<!-- the table entries --> <!-- the table entries -->
<xsl:template match="components/comp"> <xsl:template match="components/comp">
<xsl:value-of select="@ref"/><xsl:text>,</xsl:text> <xsl:value-of select="@ref"/><xsl:text>,</xsl:text>
......
...@@ -324,6 +324,12 @@ public: ...@@ -324,6 +324,12 @@ public:
*/ */
int GetCount() const { return m_count; } int GetCount() const { return m_count; }
/**
* Function GetIndex
* @return the last selected screen index.
*/
int GetIndex() const { return m_index; }
/** /**
* Function GetFirst * Function GetFirst
* @return the first item (sheet) in m_List and prepare calls to GetNext() * @return the first item (sheet) in m_List and prepare calls to GetNext()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment