eeschema: problems found. some (not all) solved (see changelog)

This commit is contained in:
CHARRAS 2008-02-21 12:21:01 +00:00
parent 36554e68d4
commit c759be6f52
9 changed files with 231 additions and 180 deletions

View File

@ -5,6 +5,21 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Feb-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema
added : full text conversion between text, label, global label and hierarchical label
some problems fixed:
- annotation incorrectly cleared.
- reference not copied in component copy.
- incorrect redo when changing the chip name in component edition
bugs not fixed
- undo/redo problems when changing a text type between text, label, global label and hierarchical label
- incorrect annotation in complex hierarchy with multi parts per package (duplicates created).
2008-Feb-20 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema

View File

@ -89,67 +89,82 @@ const wxString& EDA_SchComponentStruct::ReturnFieldName( int aFieldNdx ) const
return m_Field[aFieldNdx].m_Name;
}
/************************************/
/****************************************************************/
wxString EDA_SchComponentStruct::GetPath( DrawSheetList* sheet )
/************************************/
/****************************************************************/
{
wxString str;
str.Printf(_("%8.8lX"), m_TimeStamp );
str.Printf( wxT( "%8.8lX" ), m_TimeStamp );
return sheet->Path() + str;
}
/************************************/
/********************************************************************/
const wxString EDA_SchComponentStruct::GetRef( DrawSheetList* sheet )
/************************************/
/********************************************************************/
{
wxString path = GetPath( sheet );
unsigned int i;
for(i=0; i<m_Paths.GetCount(); i++){
if( m_Paths[i].Cmp(path) == 0 ){
for( i = 0; i<m_Paths.GetCount(); i++ )
{
if( m_Paths[i].Cmp( path ) == 0 )
{
/*printf("GetRef path: %s ref: %s\n",
CONV_TO_UTF8(m_Paths[i]),
CONV_TO_UTF8(m_References[i])); */
* CONV_TO_UTF8(m_Paths[i]),
* CONV_TO_UTF8(m_References[i])); */
return m_References[i];
}
}
//if it was not found in m_Paths array, then see if it is in
// m_Field[REFERENCE] -- if so, use this as a default for this path.
// this will happen if we load a version 1 schematic file.
// it will also mean that multiple instances of the same sheet by default
// all have the same component references, but perhaps this is best.
if( !m_Field[REFERENCE].m_Text.IsEmpty() ){
if( !m_Field[REFERENCE].m_Text.IsEmpty() )
{
SetRef( sheet, m_Field[REFERENCE].m_Text );
return m_Field[REFERENCE].m_Text;
}
return m_PrefixString;
}
/************************************/
/***********************************************************************/
void EDA_SchComponentStruct::SetRef( DrawSheetList* sheet, wxString ref )
/************************************/
/***********************************************************************/
{
//check to see if it is already there before inserting it
wxString path = GetPath( sheet );
printf( "SetRef path: %s ref: %s\n",
CONV_TO_UTF8( path ),
CONV_TO_UTF8( ref ) );
unsigned int i;
bool notInArray = true;
for(i=0; i<m_Paths.GetCount(); i++){
if(m_Paths[i].Cmp(path) == 0){
for( i = 0; i<m_Paths.GetCount(); i++ )
{
if( m_Paths[i].Cmp( path ) == 0 )
{
//just update the reference text, not the timestamp.
m_References.RemoveAt( i );
m_References.Insert( ref, i );
notInArray = false;
}
}
if(notInArray){
if( notInArray )
{
m_References.Add( ref );
m_Paths.Add( path );
}
if(m_Field[REFERENCE].m_Text.IsEmpty() ||
( abs(m_Field[REFERENCE].m_Pos.x - m_Pos.x) +
abs(m_Field[REFERENCE].m_Pos.y - m_Pos.y) > 1000)) {
if( m_Field[REFERENCE].m_Text.IsEmpty()
|| ( abs( m_Field[REFERENCE].m_Pos.x - m_Pos.x ) +
abs( m_Field[REFERENCE].m_Pos.y - m_Pos.y ) > 1000) )
{
//move it to a reasonable position..
m_Field[REFERENCE].m_Pos = m_Pos;
m_Field[REFERENCE].m_Pos.x += 50; //a slight offset..
@ -158,14 +173,16 @@ void EDA_SchComponentStruct::SetRef( DrawSheetList* sheet, wxString ref )
m_Field[REFERENCE].m_Text = ref; //for drawing.
}
/************************************/
/**************************************/
void EDA_SchComponentStruct::ClearRefs()
/************************************/
/**************************************/
{
m_Paths.Empty();
m_References.Empty();
}
const wxString& EDA_SchComponentStruct::GetFieldValue( int aFieldNdx ) const
{
// avoid unnecessarily copying wxStrings.
@ -186,6 +203,7 @@ EDA_SchComponentStruct::EDA_SchComponentStruct( const wxPoint& pos ) :
int ii;
m_Multi = 0; /* In multi unit chip - which unit to draw. */
//m_FlagControlMulti = 0;
m_UsedOnSheets.Clear();
m_Convert = 0; /* Gestion des mutiples representations (conversion De Morgan) */
@ -214,9 +232,9 @@ EDA_SchComponentStruct::EDA_SchComponentStruct( const wxPoint& pos ) :
}
/**********************************************************************/
/************************************************/
EDA_Rect EDA_SchComponentStruct::GetBoundaryBox()
/**********************************************************************/
/************************************************/
{
EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
EDA_Rect BoundaryBox;
@ -230,7 +248,7 @@ EDA_Rect EDA_SchComponentStruct::GetBoundaryBox()
// We must reverse Y values, because matrix orientation
// suppose Y axis normal for the library items coordinates,
// m_Transform reverse Y values, but BoundaryBox ais already reversed!
// m_Transform reverse Y values, but BoundaryBox is already reversed!
y0 = -BoundaryBox.GetY();
ym = -BoundaryBox.GetBottom();
}
@ -262,6 +280,8 @@ EDA_Rect EDA_SchComponentStruct::GetBoundaryBox()
BoundaryBox.Offset( m_Pos );
return BoundaryBox;
}
/**************************************************************************/
void PartTextStruct::SwapData( PartTextStruct* copyitem )
/**************************************************************************/
@ -295,6 +315,7 @@ void EDA_SchComponentStruct::SwapData( EDA_SchComponentStruct* copyitem )
* swap data between this and copyitem
*/
{
EXCHG( m_ChipName, copyitem->m_ChipName );
EXCHG( m_Pos, copyitem->m_Pos );
EXCHG( m_Multi, copyitem->m_Multi );
EXCHG( m_Convert, copyitem->m_Convert );
@ -342,13 +363,19 @@ void EDA_SchComponentStruct::ClearAnnotation()
*/
{
wxString defRef = m_PrefixString;
defRef.Append( _("?") );
while( defRef.Last() == '?' )
defRef.RemoveLast();
defRef.Append( wxT( "?" ) );
m_References.Empty();
unsigned int i;
for(i=0; i< m_Paths.GetCount(); i++){
for( i = 0; i< m_Paths.GetCount(); i++ )
{
m_References.Add( defRef );
}
m_Field[REFERENCE].m_Text = defRef; //for drawing.
EDA_LibComponentStruct* Entry;
Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
@ -367,6 +394,8 @@ EDA_SchComponentStruct* EDA_SchComponentStruct::GenCopy()
new_item->m_Multi = m_Multi;
new_item->m_ChipName = m_ChipName;
new_item->m_PrefixString = m_PrefixString;
//new_item->m_FlagControlMulti = m_FlagControlMulti;
new_item->m_UsedOnSheets = m_UsedOnSheets;
new_item->m_Convert = m_Convert;
@ -612,8 +641,8 @@ wxPoint EDA_SchComponentStruct::GetScreenCoord( const wxPoint& coord )
}
#if defined (DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
@ -646,14 +675,15 @@ void EDA_SchComponentStruct::Show( int nestLevel, std::ostream& os )
NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
}
#endif
/***************************************************************************/
PartTextStruct::PartTextStruct( const wxPoint& pos, const wxString& text ) :
EDA_BaseStruct( DRAW_PART_TEXT_STRUCT_TYPE ), EDA_TextStruct( text )
EDA_BaseStruct( DRAW_PART_TEXT_STRUCT_TYPE )
, EDA_TextStruct( text )
/***************************************************************************/
{
m_Pos = pos;

View File

@ -117,7 +117,7 @@ void WinEDA_SchematicFrame::EditSchematicText( DrawTextStruct* TextStruct,
wxDC* DC )
/*************************************************************************/
/* Edit the properties of the text (Label, Gloab label, graphic text).. )
/* Edit the properties of the text (Label, Global label, graphic text).. )
* pointed by "TextStruct"
*/
{
@ -330,7 +330,7 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text,
/*****************************************************************************/
/* Routine to change a text type to an other one (GraphicText, label or Glabel).
* A new test, label or global label is created from the old text.
* A new test, label or hierarchical or global label is created from the old text.
* the old text is deleted
*/
{
@ -389,10 +389,10 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text,
{
DrawPanel->ForceCloseManageCurseur( DrawPanel, DC );
}
if( (flags & IS_NEW) == 0 ) // Delete old text and save it in undo list
if( (flags & IS_NEW) == 0 ) // Remove old text from current list and save it in undo list
{
Text->m_Flags = 0;
DeleteStruct( DrawPanel, DC, Text );
DeleteStruct( DrawPanel, DC, Text ); // old text is really saved in undo list
GetScreen()->SetCurItem( NULL );
g_ItemToRepeat = NULL;
}

View File

@ -380,6 +380,8 @@ void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel )
_( "Change to Label" ), glabel2label_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
_( "Change to Text" ), glabel2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL,
_( "Change to Hierarchical Label" ), label2glabel_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type,
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
}
@ -402,6 +404,8 @@ void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* HLabel )
_( "Change to Label" ), glabel2label_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
_( "Change to Text" ), glabel2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
_( "Change to Global label" ), label2glabel_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type,
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
}
@ -424,9 +428,11 @@ void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label )
// add menu change type text (to label, glabel, text):
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
_( "Change to Glabel" ), label2glabel_xpm );
_( "Change to Global label" ), label2glabel_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT,
_( "Change to Text" ), label2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL,
_( "Change to Hierarchical Label" ), label2glabel_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type,
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
}
@ -450,6 +456,8 @@ void AddMenusForText( wxMenu* PopMenu, DrawTextStruct* Text )
// add menu change type text (to label, glabel, text):
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL,
_( "Change to Label" ), label2text_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL,
_( "Change to Hierarchical Label" ), label2glabel_xpm );
ADD_MENUITEM( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL,
_( "Change to Glabel" ), label2glabel_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, menu_change_type,

View File

@ -42,6 +42,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_EDIT_TEXT:
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL:
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL:
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL:
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT:
case ID_POPUP_SCH_SET_SHAPE_TEXT:
case ID_POPUP_SCH_ROTATE_TEXT:
@ -395,6 +396,12 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
&dc, DRAW_GLOBAL_LABEL_STRUCT_TYPE );
break;
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL:
DrawPanel->MouseToCursorSchema();
ConvertTextType( (DrawTextStruct*) GetScreen()->GetCurItem(),
&dc, DRAW_HIER_LABEL_STRUCT_TYPE );
break;
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT:
DrawPanel->MouseToCursorSchema();
ConvertTextType( (DrawTextStruct*) GetScreen()->GetCurItem(),
@ -403,7 +410,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_SET_SHAPE_TEXT:
// Non utilis<69>
// Not used
break;
case ID_POPUP_SCH_ROTATE_FIELD:

View File

@ -5,7 +5,7 @@
COMMON_GLOBL wxString g_BuildVersion
#ifdef EDA_BASE
(wxT("(2008-02-13)"))
(wxT("(2008-02-20)"))
#endif
;

View File

@ -355,7 +355,7 @@ enum main_id {
ID_POPUP_SCH_ADD_JUNCTION,
ID_POPUP_SCH_ADD_LABEL,
ID_POPUP_SCH_ADD_GLABEL,
ID_POPUP_SCH_UNUSED0,
ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL,
ID_POPUP_SCH_UNUSED1,
ID_POPUP_SCH_UNUSED2,
ID_POPUP_SCH_UNUSED3,

Binary file not shown.

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kicad\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2008-02-20 20:29+0100\n"
"PO-Revision-Date: 2008-02-21 07:51+0100\n"
"Last-Translator: \n"
"Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n"
"MIME-Version: 1.0\n"
@ -3633,9 +3633,8 @@ msgid "Apply"
msgstr "Appliquer"
#: pcbnew/specctra_import.cpp:74
#, fuzzy
msgid "Merge Specctra Session file:"
msgstr "Fichier Specctra DSN"
msgstr "Fichier Specctra Session à Fusionner:"
#: pcbnew/specctra_import.cpp:100
msgid "BOARD may be corrupted, do not save it."
@ -3643,17 +3642,17 @@ msgstr "Le PCB peut
#: pcbnew/specctra_import.cpp:102
msgid "Fix problem and try again."
msgstr ""
msgstr "Fixer le problème et recommencer."
#: pcbnew/specctra_import.cpp:116
msgid "Session file imported and merged OK."
msgstr ""
msgstr "Fichier Session importé et fusionné correctement."
#: pcbnew/specctra_import.cpp:182
#: pcbnew/specctra_import.cpp:290
#, c-format
msgid "Session file uses invalid layer id \"%s\""
msgstr ""
msgstr "Le Fichier Session utilise une couche invalide n° \"%s\""
#: pcbnew/specctra_import.cpp:232
msgid "Session via padstack has no shapes"
@ -4434,9 +4433,8 @@ msgid "Last Change"
msgstr "Last Change"
#: pcbnew/class_module.cpp:1076
#, fuzzy
msgid "Netlist path"
msgstr "Netliste: "
msgstr "Chemin Netliste "
#: pcbnew/class_module.cpp:1110
msgid "3D-Shape"
@ -4575,14 +4573,14 @@ msgid "%s not found"
msgstr "%s non trouvé"
#: pcbnew/cross-probing.cpp:111
#, fuzzy, c-format
#, c-format
msgid "%s pin %s not found"
msgstr " fichier %s non trouvé"
msgstr "%s pin %s non trouvée"
#: pcbnew/cross-probing.cpp:113
#, fuzzy, c-format
#, c-format
msgid "%s pin %s found"
msgstr " non trouvé"
msgstr "%s pin %s trouvée"
#: pcbnew/specctra_export.cpp:64
msgid "Specctra DSN file:"
@ -4604,7 +4602,7 @@ msgstr "Le composant avec valeur \"%s\" a une r
#: pcbnew/specctra_export.cpp:728
#, c-format
msgid "Multiple components have identical reference IDs of \"%s\"."
msgstr ""
msgstr "Multiple composants ont une reference identique \"%s\"."
#: pcbnew/class_drawsegment.cpp:161
msgid "Shape"
@ -5607,9 +5605,9 @@ msgid "Warning HLabel %s not connected to SheetLabel"
msgstr "Attention HLabel %s non connecté a SheetLabel"
#: eeschema/erc.cpp:562
#, fuzzy, c-format
#, c-format
msgid "Warning SheetLabel %s not connected to HLabel"
msgstr "Warning SheetLabel %s non connecté a GLabel"
msgstr "Warning SheetLabel %s non connecté a HLabel"
#: eeschema/erc.cpp:576
#, c-format
@ -5645,22 +5643,21 @@ msgid "ERC control"
msgstr "Controle ERC"
#: eeschema/erc.cpp:742
#, fuzzy
msgid ""
"\n"
"***** Sheet Root\n"
msgstr ""
"\n"
"***** feuille %d (%s)\n"
"***** Feuillet Racine\n"
#: eeschema/erc.cpp:745
#, fuzzy, c-format
#, c-format
msgid ""
"\n"
"***** Sheet %s\n"
msgstr ""
"\n"
"***** feuille %d (%s)\n"
"***** Feuille %s\n"
#: eeschema/erc.cpp:762
#, c-format
@ -6119,14 +6116,14 @@ msgstr ""
"#Cmp ( ordre = Valeur )"
#: eeschema/dialog_build_BOM.cpp:1315
#, fuzzy, c-format
#, c-format
msgid "> %-28.28s %s (Sheet %s) pos: %3.3f, %3.3f\n"
msgstr "> %-28.28s Global (feuille %.2d) pos: %3.3f, %3.3f\n"
msgstr "> %-28.28s %s (Feuille %s) pos: %3.3f, %3.3f\n"
#: eeschema/dialog_build_BOM.cpp:1335
#, fuzzy, c-format
#, c-format
msgid "> %-28.28s Sheet %-7.7s (Sheet %s) pos: %3.3f, %3.3f\n"
msgstr "> %-28.28s Sheet %-7.7s (feuille %.2d) pos: %3.3f, %3.3f\n"
msgstr "> %-28.28s Sheet %-7.7s (Feuillet %s) pos: %3.3f, %3.3f\n"
#: eeschema/dialog_build_BOM.cpp:1349
msgid "#End labels\n"
@ -6834,7 +6831,7 @@ msgstr "Visualisateur des librairies"
#: eeschema/sheet.cpp:162
msgid "Filename (will be created upon save if it does not already exist):"
msgstr ""
msgstr "Nom Fichier (sera crée à la sauvegarde si il n'existe pas déjà):"
#: eeschema/sheet.cpp:174
msgid "Sheetname:"
@ -7099,26 +7096,22 @@ msgid "Place the bus to bus entry"
msgstr "Addition d'entrées de bus (type bus vers bus)"
#: eeschema/menubar.cpp:254
#, fuzzy
msgid "No connect flag"
msgstr "Addition de symboles de non connexion"
msgstr "Symbole de Non Connexion"
#: eeschema/menubar.cpp:255
#: eeschema/tool_sch.cpp:189
#, fuzzy
msgid "Place the no connect flag"
msgstr "Addition de symboles de non connexion"
msgstr "Placer le symbole de non connexion"
#: eeschema/menubar.cpp:264
#, fuzzy
msgid "Net name"
msgstr "Net Name"
#: eeschema/menubar.cpp:265
#: eeschema/tool_sch.cpp:193
#, fuzzy
msgid "Place the net name"
msgstr "Place Feuille"
msgstr "Placer le nom de net"
#: eeschema/menubar.cpp:272
msgid "Global label"
@ -7126,7 +7119,7 @@ msgstr "Label Global"
#: eeschema/menubar.cpp:273
msgid "Place the global label. Warning: all global labels with the same name are connected in whole hierarchy"
msgstr ""
msgstr "Placerun label global. Attention: tous les labels globaux avec le même nom sont connectés dans toute la hierarchie"
#: eeschema/menubar.cpp:282
#: eeschema/eelayer.h:85
@ -7215,9 +7208,8 @@ msgid "&Edit"
msgstr "&Editer"
#: eeschema/menubar.cpp:407
#, fuzzy
msgid "&View"
msgstr "&ViewLogic"
msgstr "&Voir"
#: eeschema/menubar.cpp:408
msgid "&Place"
@ -10562,7 +10554,6 @@ msgid "SheetLabel (Pin Sheet)"
msgstr "Supprimer Connecteur de hiérarchie"
#: eeschema/eelayer.h:195
#, fuzzy
msgid "Hierarchical Label"
msgstr "Label Hiérarchique"