Commit 275f02ad authored by Marco Mattila's avatar Marco Mattila

Fix BOM-by-reference generator to print the separator character instead of the ascii code

parent ac41e700
...@@ -471,25 +471,25 @@ bool BOM_LISTER::PrintComponentsListByReferenceCsvForm( FILE* aFile ) ...@@ -471,25 +471,25 @@ bool BOM_LISTER::PrintComponentsListByReferenceCsvForm( FILE* aFile )
// Print comment line: // Print comment line:
msg = wxT( "ref" ); msg = wxT( "ref" );
msg << m_separatorSymbol << wxT( "value" ); msg << (wxChar)m_separatorSymbol << wxT( "value" );
if( addDatasheet ) if( addDatasheet )
msg << m_separatorSymbol << wxT( "datasheet" ); msg << (wxChar)m_separatorSymbol << wxT( "datasheet" );
if( printLocCmp ) if( printLocCmp )
msg << m_separatorSymbol << wxT( "sheet path(location)" ); msg << (wxChar)m_separatorSymbol << wxT( "sheet path(location)" );
if( isFieldPrintable( FOOTPRINT ) ) if( isFieldPrintable( FOOTPRINT ) )
msg << m_separatorSymbol << wxT( "footprint" ); msg << (wxChar)m_separatorSymbol << wxT( "footprint" );
for( int ii = FIELD1; ii <= FIELD8; ii++ ) for( int ii = FIELD1; ii <= FIELD8; ii++ )
{ {
if( isFieldPrintable( ii ) ) if( isFieldPrintable( ii ) )
msg << m_separatorSymbol << _( "Field" ) << ii - FIELD1 + 1; msg << (wxChar)m_separatorSymbol << _( "Field" ) << ii - FIELD1 + 1;
} }
if( groupRefs ) if( groupRefs )
msg << m_separatorSymbol << _( "Item count" ); msg << (wxChar)m_separatorSymbol << _( "Item count" );
fprintf( m_outFile, "%s\n", TO_UTF8( msg ) ); fprintf( m_outFile, "%s\n", TO_UTF8( msg ) );
...@@ -531,19 +531,19 @@ bool BOM_LISTER::PrintComponentsListByReferenceCsvForm( FILE* aFile ) ...@@ -531,19 +531,19 @@ bool BOM_LISTER::PrintComponentsListByReferenceCsvForm( FILE* aFile )
{ {
// Store value and datasheet (will be printed later) // Store value and datasheet (will be printed later)
strCur.Empty(); strCur.Empty();
strCur << m_separatorSymbol << comp->GetField( VALUE )->m_Text; strCur << (wxChar)m_separatorSymbol << comp->GetField( VALUE )->m_Text;
if( addDatasheet ) if( addDatasheet )
strCur << m_separatorSymbol << comp->GetField( DATASHEET )->m_Text; strCur << (wxChar)m_separatorSymbol << comp->GetField( DATASHEET )->m_Text;
} }
else else
{ {
// Print the current component reference, value and datasheet // Print the current component reference, value and datasheet
msg = cmpName; msg = cmpName;
msg << m_separatorSymbol << comp->GetField( VALUE )->m_Text; msg << (wxChar)m_separatorSymbol << comp->GetField( VALUE )->m_Text;
if( addDatasheet ) if( addDatasheet )
msg << m_separatorSymbol << comp->GetField( DATASHEET )->m_Text; msg << (wxChar)m_separatorSymbol << comp->GetField( DATASHEET )->m_Text;
fprintf( m_outFile, "%s", TO_UTF8( msg ) ); fprintf( m_outFile, "%s", TO_UTF8( msg ) );
} }
...@@ -574,19 +574,19 @@ bool BOM_LISTER::PrintComponentsListByReferenceCsvForm( FILE* aFile ) ...@@ -574,19 +574,19 @@ bool BOM_LISTER::PrintComponentsListByReferenceCsvForm( FILE* aFile )
{ {
case 1: // One reference to print case 1: // One reference to print
// format C103;47uF;CP6;;;1 // format C103;47uF;CP6;;;1
msg << cmpNameFirst <<strPred << m_separatorSymbol << amount; msg << cmpNameFirst <<strPred << (wxChar)m_separatorSymbol << amount;
break; break;
case 2: // 2 references to print case 2: // 2 references to print
// format C103,C104;47uF;CP6;;;2 // format C103,C104;47uF;CP6;;;2
msg << cmpNameFirst << wxT(",") << cmpNameLast msg << cmpNameFirst << wxT(",") << cmpNameLast
<< strPred << m_separatorSymbol << amount; << strPred << (wxChar)m_separatorSymbol << amount;
break; break;
default: // Many references to print : default: // Many references to print :
// format: C103..C106;47uF;CP6;;;4 // format: C103..C106;47uF;CP6;;;4
msg << cmpNameFirst << wxT("..") << cmpNameLast msg << cmpNameFirst << wxT("..") << cmpNameLast
<< strPred << m_separatorSymbol << amount; << strPred << (wxChar)m_separatorSymbol << amount;
break; break;
} }
fprintf( m_outFile, "%s\n", TO_UTF8( msg ) ); fprintf( m_outFile, "%s\n", TO_UTF8( msg ) );
...@@ -614,17 +614,17 @@ bool BOM_LISTER::PrintComponentsListByReferenceCsvForm( FILE* aFile ) ...@@ -614,17 +614,17 @@ bool BOM_LISTER::PrintComponentsListByReferenceCsvForm( FILE* aFile )
switch( amount ) switch( amount )
{ {
case 1: case 1:
msg << cmpNameFirst << strPred << m_separatorSymbol << amount; msg << cmpNameFirst << strPred << (wxChar)m_separatorSymbol << amount;
break; break;
case 2: case 2:
msg << cmpNameFirst << wxT(",") << cmpNameLast msg << cmpNameFirst << wxT(",") << cmpNameLast
<< strPred << m_separatorSymbol << amount; << strPred << (wxChar)m_separatorSymbol << amount;
break; break;
default: default:
msg << cmpNameFirst << wxT("..") << cmpNameFirst << cmpNameLast msg << cmpNameFirst << wxT("..") << cmpNameFirst << cmpNameLast
<< strPred << m_separatorSymbol << amount; << strPred << (wxChar)m_separatorSymbol << amount;
break; break;
} }
fprintf( m_outFile, "%s\n", TO_UTF8( msg ) ); fprintf( m_outFile, "%s\n", TO_UTF8( msg ) );
......
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