fix backanno for unicode and eeschema's debug build
This commit is contained in:
parent
7327197c17
commit
795e069a7a
|
@ -36,6 +36,7 @@ set(CVPCB_SRCS
|
|||
set(CVPCB_EXTRA_SRCS
|
||||
../pcbnew/basepcbframe.cpp
|
||||
../pcbnew/class_board.cpp
|
||||
../pcbnew/class_board_item.cpp
|
||||
../pcbnew/class_cotation.cpp
|
||||
../pcbnew/class_drawsegment.cpp
|
||||
../pcbnew/class_edge_mod.cpp
|
||||
|
|
|
@ -20,9 +20,6 @@
|
|||
/**************************************************************/
|
||||
bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* StuffFile )
|
||||
/**************************************************************/
|
||||
|
||||
/* get footprint info from each line in the Stuff File by Ref Desg
|
||||
*/
|
||||
{
|
||||
int LineNum = 0;
|
||||
char* cp, Ref[256], FootPrint[256], Line[1024];
|
||||
|
@ -30,25 +27,33 @@ bool WinEDA_SchematicFrame::ProcessStuffFile(FILE* StuffFile)
|
|||
SCH_COMPONENT* Cmp;
|
||||
PartTextStruct* TextField;
|
||||
|
||||
while( GetLine( StuffFile, Line, &LineNum, sizeof(Line) ) ) {
|
||||
if( sscanf( Line, "comp = \"%s module = \"%s", Ref, FootPrint) == 2 ) {
|
||||
while( GetLine( StuffFile, Line, &LineNum, sizeof(Line) ) )
|
||||
{
|
||||
if( sscanf( Line, "comp = \"%s module = \"%s", Ref, FootPrint ) == 2 )
|
||||
{
|
||||
for( cp = Ref; *cp; cp++ )
|
||||
if( *cp == '"' )
|
||||
*cp = 0;
|
||||
|
||||
for( cp = FootPrint; *cp; cp++ )
|
||||
if( *cp == '"' )
|
||||
*cp = 0;
|
||||
|
||||
// printf("'%s' '%s'\n", Ref, FootPrint);
|
||||
|
||||
wxString reference = CONV_FROM_UTF8( Ref );
|
||||
|
||||
DrawList = WinEDA_SchematicFrame::FindComponentAndItem(
|
||||
Ref, TRUE, 2, wxEmptyString, false);
|
||||
reference, TRUE, 2, wxEmptyString, false );
|
||||
|
||||
if( DrawList == NULL )
|
||||
continue;
|
||||
|
||||
if( DrawList->Type() == TYPE_SCH_COMPONENT ) {
|
||||
if( DrawList->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
Cmp = (SCH_COMPONENT*) DrawList;
|
||||
TextField = &Cmp->m_Field[FOOTPRINT];
|
||||
TextField->m_Text = FootPrint;
|
||||
TextField->m_Text = CONV_FROM_UTF8( FootPrint );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,6 +61,7 @@ bool WinEDA_SchematicFrame::ProcessStuffFile(FILE* StuffFile)
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************/
|
||||
bool WinEDA_SchematicFrame::ReadInputStuffFile()
|
||||
/**************************************************************/
|
||||
|
@ -76,6 +82,7 @@ bool WinEDA_SchematicFrame::ReadInputStuffFile()
|
|||
wxFD_OPEN,
|
||||
FALSE
|
||||
);
|
||||
|
||||
if( filename.IsEmpty() )
|
||||
return FALSE;
|
||||
|
||||
|
@ -87,13 +94,14 @@ bool WinEDA_SchematicFrame::ReadInputStuffFile()
|
|||
return FALSE;
|
||||
|
||||
StuffFile = wxFopen( filename, wxT( "rt" ) );
|
||||
if( StuffFile == NULL ) {
|
||||
if( StuffFile == NULL )
|
||||
{
|
||||
msg.Printf( _( "Failed to open Stuff File <%s>" ), filename.GetData() );
|
||||
DisplayError( this, msg, 20 );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ProcessStuffFile( StuffFile );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,16 @@ public:
|
|||
int LoadOneEEProject( const wxString& FileName, bool IsNew );
|
||||
bool LoadOneEEFile( SCH_SCREEN* screen, const wxString& FullFileName );
|
||||
bool ReadInputStuffFile();
|
||||
|
||||
|
||||
/**
|
||||
* Function ProcessStuffFile
|
||||
* gets footprint info from each line in the Stuff File by Ref Desg
|
||||
* @param filename The file to read from.
|
||||
* @return bool - true if success, else true.
|
||||
*/
|
||||
bool ProcessStuffFile( FILE* filename );
|
||||
|
||||
bool SaveEEFile( SCH_SCREEN* screen, int FileSave );
|
||||
SCH_SCREEN* CreateNewScreen( SCH_SCREEN* OldScreen, int TimeStamp );
|
||||
|
||||
|
|
Loading…
Reference in New Issue