Commit 6abf0e9f authored by jean-pierre charras's avatar jean-pierre charras

Eeschema: Bug fix (move component field was not undoable)

Minor enhancement in popup menus for wire and bus.
Kicad: stm32f0discovery template: very minor fix.
parent 28f238e3
...@@ -95,17 +95,18 @@ enum id_eeschema_frm ...@@ -95,17 +95,18 @@ enum id_eeschema_frm
ID_POPUP_START_RANGE, ID_POPUP_START_RANGE,
ID_POPUP_SCH_DELETE, ID_POPUP_SCH_DELETE,
ID_POPUP_SCH_BREAK_WIRE, ID_POPUP_SCH_BREAK_WIRE,
ID_POPUP_SCH_BEGIN_WIRE,
ID_POPUP_SCH_BEGIN_BUS,
ID_POPUP_END_LINE,
ID_POPUP_SCH_DELETE_CONNECTION, ID_POPUP_SCH_DELETE_CONNECTION,
ID_POPUP_SCH_DELETE_NODE, ID_POPUP_SCH_DELETE_NODE,
ID_POPUP_SCH_DELETE_CMP, ID_POPUP_SCH_DELETE_CMP,
ID_POPUP_SCH_UNUSED_2,
ID_POPUP_SCH_ENTRY_SELECT_SLASH, ID_POPUP_SCH_ENTRY_SELECT_SLASH,
ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH, ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH,
ID_POPUP_SCH_INIT_CMP, ID_POPUP_SCH_INIT_CMP,
ID_POPUP_SCH_SET_SHAPE_TEXT, ID_POPUP_SCH_SET_SHAPE_TEXT,
ID_POPUP_END_LINE,
ID_POPUP_SCH_END_SHEET, ID_POPUP_SCH_END_SHEET,
ID_POPUP_SCH_RESIZE_SHEET, ID_POPUP_SCH_RESIZE_SHEET,
ID_POPUP_SCH_CLEANUP_SHEET, ID_POPUP_SCH_CLEANUP_SHEET,
......
...@@ -130,14 +130,17 @@ static EDA_HOTKEY HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_SHIFT + GR_KB_CTRL + 'Z' ...@@ -130,14 +130,17 @@ static EDA_HOTKEY HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_SHIFT + GR_KB_CTRL + 'Z'
#endif #endif
// Schematic editor // Schematic editor
static EDA_HOTKEY HkBeginWire( wxT( "Begin Wire" ), HK_BEGIN_WIRE, 'W', ID_WIRE_BUTT );
static EDA_HOTKEY HkBeginBus( wxT( "Begin Bus" ), HK_BEGIN_BUS, 'B', ID_BUS_BUTT );
static EDA_HOTKEY HkEndLineWireBus( wxT( "End Line Wire Bus" ), HK_END_CURR_LINEWIREBUS, 'K',
ID_POPUP_END_LINE );
static EDA_HOTKEY HkAddLabel( wxT( "Add Label" ), HK_ADD_LABEL, 'L', ID_LABEL_BUTT ); static EDA_HOTKEY HkAddLabel( wxT( "Add Label" ), HK_ADD_LABEL, 'L', ID_LABEL_BUTT );
static EDA_HOTKEY HkAddHierarchicalLabel( wxT( "Add Hierarchical Label" ), HK_ADD_HLABEL, 'H', static EDA_HOTKEY HkAddHierarchicalLabel( wxT( "Add Hierarchical Label" ), HK_ADD_HLABEL, 'H',
ID_HIERLABEL_BUTT ); ID_HIERLABEL_BUTT );
static EDA_HOTKEY HkAddGlobalLabel( wxT( "Add Global Label" ), HK_ADD_GLABEL, GR_KB_CTRL + 'L', static EDA_HOTKEY HkAddGlobalLabel( wxT( "Add Global Label" ), HK_ADD_GLABEL, GR_KB_CTRL + 'L',
ID_GLABEL_BUTT ); ID_GLABEL_BUTT );
static EDA_HOTKEY HkAddJunction( wxT( "Add Junction" ), HK_ADD_JUNCTION, 'J', ID_JUNCTION_BUTT ); static EDA_HOTKEY HkAddJunction( wxT( "Add Junction" ), HK_ADD_JUNCTION, 'J', ID_JUNCTION_BUTT );
static EDA_HOTKEY HkBeginWire( wxT( "Draw Wire" ), HK_BEGIN_WIRE, 'W', ID_WIRE_BUTT );
static EDA_HOTKEY HkBeginBus( wxT( "Draw Bus" ), HK_BEGIN_BUS, 'B', ID_BUS_BUTT );
static EDA_HOTKEY HkAddComponent( wxT( "Add Component" ), HK_ADD_NEW_COMPONENT, 'A', static EDA_HOTKEY HkAddComponent( wxT( "Add Component" ), HK_ADD_NEW_COMPONENT, 'A',
ID_SCH_PLACE_COMPONENT ); ID_SCH_PLACE_COMPONENT );
static EDA_HOTKEY HkAddPower( wxT( "Add Power" ), HK_ADD_NEW_POWER, 'P', static EDA_HOTKEY HkAddPower( wxT( "Add Power" ), HK_ADD_NEW_POWER, 'P',
...@@ -240,6 +243,7 @@ EDA_HOTKEY* s_Schematic_Hotkey_List[] = ...@@ -240,6 +243,7 @@ EDA_HOTKEY* s_Schematic_Hotkey_List[] =
&HkEditComponentFootprint, &HkEditComponentFootprint,
&HkBeginWire, &HkBeginWire,
&HkBeginBus, &HkBeginBus,
&HkEndLineWireBus,
&HkAddLabel, &HkAddLabel,
&HkAddHierarchicalLabel, &HkAddHierarchicalLabel,
&HkAddGlobalLabel, &HkAddGlobalLabel,
...@@ -373,13 +377,21 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, ...@@ -373,13 +377,21 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
case HK_DELETE: case HK_DELETE:
if( notBusy ) if( notBusy )
DeleteItemAtCrossHair( aDC ); DeleteItemAtCrossHair( aDC );
break; break;
case HK_REPEAT_LAST: case HK_REPEAT_LAST:
if( notBusy && m_itemToRepeat && ( m_itemToRepeat->GetFlags() == 0 ) ) if( notBusy && m_itemToRepeat && ( m_itemToRepeat->GetFlags() == 0 ) )
RepeatDrawItem( aDC ); RepeatDrawItem( aDC );
break;
case HK_END_CURR_LINEWIREBUS:
// this key terminates a new line/bus/wire in progress
if( aItem && aItem->IsNew() &&
aItem->Type() == SCH_LINE_T )
{
cmd.SetId( hotKey->m_IdMenuEvent );
GetEventHandler()->ProcessEvent( cmd );
}
break; break;
case HK_UNDO: case HK_UNDO:
...@@ -390,7 +402,6 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, ...@@ -390,7 +402,6 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
cmd.SetId( hotKey->m_IdMenuEvent ); cmd.SetId( hotKey->m_IdMenuEvent );
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
} }
break; break;
case HK_FIND_NEXT_ITEM: case HK_FIND_NEXT_ITEM:
......
...@@ -34,6 +34,7 @@ enum hotkey_id_commnand { ...@@ -34,6 +34,7 @@ enum hotkey_id_commnand {
HK_ADD_NEW_POWER, HK_ADD_NEW_POWER,
HK_BEGIN_WIRE, HK_BEGIN_WIRE,
HK_BEGIN_BUS, HK_BEGIN_BUS,
HK_END_CURR_LINEWIREBUS,
HK_ADD_WIRE_ENTRY, HK_ADD_WIRE_ENTRY,
HK_ADD_BUS_ENTRY, HK_ADD_BUS_ENTRY,
HK_ADD_LABEL, HK_ADD_LABEL,
......
...@@ -99,7 +99,8 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -99,7 +99,8 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
} }
} }
// If Command in progress: add "cancel" and "end tool" menu // If a command is in progress: add "cancel" and "end tool" menu
// If
if( GetToolId() != ID_NO_TOOL_SELECTED ) if( GetToolId() != ID_NO_TOOL_SELECTED )
{ {
if( item && item->GetFlags() ) if( item && item->GetFlags() )
...@@ -114,6 +115,24 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -114,6 +115,24 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
} }
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
switch( GetToolId() )
{
case ID_WIRE_BUTT:
AddMenusForWire( PopMenu, NULL, this );
if( item == NULL )
PopMenu->AppendSeparator();
break;
case ID_BUS_BUTT:
AddMenusForBus( PopMenu, NULL, this );
if( item == NULL )
PopMenu->AppendSeparator();
break;
default:
break;
}
} }
else else
{ {
...@@ -533,14 +552,22 @@ void SCH_EDIT_FRAME::addJunctionMenuEntries( wxMenu* aMenu, SCH_JUNCTION* aJunct ...@@ -533,14 +552,22 @@ void SCH_EDIT_FRAME::addJunctionMenuEntries( wxMenu* aMenu, SCH_JUNCTION* aJunct
void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame ) void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame )
{ {
bool is_new = Wire->IsNew();
SCH_SCREEN* screen = frame->GetScreen(); SCH_SCREEN* screen = frame->GetScreen();
wxPoint pos = screen->GetCrossHairPosition(); wxPoint pos = screen->GetCrossHairPosition();
wxString msg; wxString msg;
if( Wire == NULL )
{
msg = AddHotkeyName( _( "Begin Wire" ), s_Schematic_Hokeys_Descr, HK_BEGIN_WIRE );
AddMenuItem( PopMenu, ID_POPUP_SCH_BEGIN_WIRE, msg, KiBitmap( add_line_xpm ) );
return;
}
bool is_new = Wire->IsNew();
if( is_new ) if( is_new )
{ {
AddMenuItem( PopMenu, ID_POPUP_END_LINE, _( "Wire End" ), KiBitmap( apply_xpm ) ); msg = AddHotkeyName( _( "Wire End" ), s_Schematic_Hokeys_Descr, HK_END_CURR_LINEWIREBUS );
AddMenuItem( PopMenu, ID_POPUP_END_LINE, msg, KiBitmap( apply_xpm ) );
return; return;
} }
...@@ -576,13 +603,21 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame ) ...@@ -576,13 +603,21 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame )
void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, SCH_EDIT_FRAME* frame ) void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, SCH_EDIT_FRAME* frame )
{ {
bool is_new = Bus->IsNew();
wxPoint pos = frame->GetScreen()->GetCrossHairPosition(); wxPoint pos = frame->GetScreen()->GetCrossHairPosition();
wxString msg; wxString msg;
if( Bus == NULL )
{
msg = AddHotkeyName( _( "Begin Bus" ), s_Schematic_Hokeys_Descr, HK_BEGIN_BUS );
AddMenuItem( PopMenu, ID_POPUP_SCH_BEGIN_BUS, msg, KiBitmap( add_bus_xpm ) );
return;
}
bool is_new = Bus->IsNew();
if( is_new ) if( is_new )
{ {
AddMenuItem( PopMenu, ID_POPUP_END_LINE, _( "Bus End" ), KiBitmap( apply_xpm ) ); msg = AddHotkeyName( _( "Bus End" ), s_Schematic_Hokeys_Descr, HK_END_CURR_LINEWIREBUS );
AddMenuItem( PopMenu, ID_POPUP_END_LINE, msg, KiBitmap( apply_xpm ) );
return; return;
} }
......
...@@ -68,6 +68,8 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -68,6 +68,8 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND:
case ID_POPUP_SCH_ENTRY_SELECT_SLASH: case ID_POPUP_SCH_ENTRY_SELECT_SLASH:
case ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH: case ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH:
case ID_POPUP_SCH_BEGIN_WIRE:
case ID_POPUP_SCH_BEGIN_BUS:
case ID_POPUP_END_LINE: case ID_POPUP_END_LINE:
case ID_POPUP_SCH_SET_SHAPE_TEXT: case ID_POPUP_SCH_SET_SHAPE_TEXT:
case ID_POPUP_SCH_CLEANUP_SHEET: case ID_POPUP_SCH_CLEANUP_SHEET:
...@@ -161,8 +163,17 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -161,8 +163,17 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
EndSegment( &dc ); EndSegment( &dc );
break; break;
case ID_POPUP_SCH_SET_SHAPE_TEXT: case ID_POPUP_SCH_BEGIN_WIRE:
m_canvas->MoveCursorToCrossHair();
OnLeftClick( &dc, screen->GetCrossHairPosition() );
break;
case ID_POPUP_SCH_BEGIN_BUS:
m_canvas->MoveCursorToCrossHair();
OnLeftClick( &dc, screen->GetCrossHairPosition() );
break;
case ID_POPUP_SCH_SET_SHAPE_TEXT:
// Not used // Not used
break; break;
......
...@@ -902,6 +902,16 @@ void SCH_EDIT_FRAME::addCurrentItemToList( wxDC* aDC ) ...@@ -902,6 +902,16 @@ void SCH_EDIT_FRAME::addCurrentItemToList( wxDC* aDC )
undoItem = sheet; undoItem = sheet;
} }
else if( item->Type() == SCH_FIELD_T )
{
SCH_COMPONENT* cmp = (SCH_COMPONENT*) item->GetParent();
wxCHECK_RET( (cmp != NULL) && (cmp->Type() == SCH_COMPONENT_T),
wxT( "Cannot place field in invalid schematic component object." ) );
undoItem = cmp;
}
if( item->IsNew() ) if( item->IsNew() )
{ {
if( item->Type() == SCH_SHEET_T ) if( item->Type() == SCH_SHEET_T )
...@@ -932,8 +942,18 @@ void SCH_EDIT_FRAME::addCurrentItemToList( wxDC* aDC ) ...@@ -932,8 +942,18 @@ void SCH_EDIT_FRAME::addCurrentItemToList( wxDC* aDC )
} }
else else
{ {
// Here, item is not a basic schematic item, but an item inside
// a parent basic schematic item,
// currently: sheet pin or component field.
// currently, only a sheet pin can be found as new item,
// because new component fields have a specific handling, and do not appears here
SaveCopyInUndoList( undoItem, UR_CHANGED ); SaveCopyInUndoList( undoItem, UR_CHANGED );
( (SCH_SHEET*)undoItem )->AddPin( (SCH_SHEET_PIN*) item );
if( item->Type() == SCH_SHEET_PIN_T )
( (SCH_SHEET*)undoItem )->AddPin( (SCH_SHEET_PIN*) item );
else
wxLogMessage(wxT( "addCurrentItemToList: expected type = SCH_SHEET_PIN_T, actual type = %d" ),
item->Type() );
} }
} }
else else
......
...@@ -13,7 +13,8 @@ This project includes a PCB edge defined as the same size as the STM32F100 Disco ...@@ -13,7 +13,8 @@ This project includes a PCB edge defined as the same size as the STM32F100 Disco
board with the connectors placed correctly to align the two boards. All IO present on the board with the connectors placed correctly to align the two boards. All IO present on the
Discovery board is connected to the project through 0.1" expansion headers. Discovery board is connected to the project through 0.1" expansion headers.
<br><br> <br><br>
<P><IMG SRC="stm32f0discovery.png" NAME="brd" ALIGN=BOTTOM BORDER=0><BR><BR><BR><BR> <P ALIGN=CENTER><IMG SRC="board_stm32vl_discovery.png" NAME="brd" ALIGN=BOTTOM
BORDER=0><BR><BR><BR><BR>
</P> </P>
(c)2012 Kerusey Karyu<br> (c)2012 Kerusey Karyu<br>
</body> </body>
......
PCBNEW-BOARD Version 1 date 2012-10-20 20:10:51 PCBNEW-BOARD Version 1 date 22/10/2012 08:11:40
# Created by Pcbnew(2012-10-17 BZR 3773)-testing # Created by Pcbnew(2012-10-20 BZR 3775)-testing
$GENERAL $GENERAL
encoding utf-8 encoding utf-8
...@@ -21,7 +21,7 @@ $EndGENERAL ...@@ -21,7 +21,7 @@ $EndGENERAL
$SHEETDESCR $SHEETDESCR
Sheet A3 16535 11693 Sheet A3 16535 11693
Title "STM32 Value Line Discovery - Shiled board" Title "STM32 Value Line Discovery - Shiled board"
Date "20 oct 2012" Date "22 oct 2012"
Rev "1.0" Rev "1.0"
Comp "" Comp ""
Comment1 "" Comment1 ""
...@@ -32,8 +32,8 @@ $EndSHEETDESCR ...@@ -32,8 +32,8 @@ $EndSHEETDESCR
$SETUP $SETUP
Layers 2 Layers 2
Layer[0] Dolna signal Layer[0] Back signal
Layer[15] Gorna signal Layer[15] Front signal
TrackWidth 100 TrackWidth 100
TrackClearence 100 TrackClearence 100
ZoneClearence 200 ZoneClearence 200
......
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