Commit 2f5c24ae authored by jean-pierre charras's avatar jean-pierre charras Committed by jp

added track posture pacth from lorenzo marcantonio

parent 700dc818
...@@ -65,6 +65,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -65,6 +65,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_STOP_CURRENT_DRAWING: case ID_POPUP_PCB_STOP_CURRENT_DRAWING:
case ID_POPUP_PCB_END_TRACK: case ID_POPUP_PCB_END_TRACK:
case ID_POPUP_PCB_PLACE_VIA: case ID_POPUP_PCB_PLACE_VIA:
case ID_POPUP_PCB_SWITCH_TRACK_POSTURE:
case ID_POPUP_PCB_PLACE_MICROVIA: case ID_POPUP_PCB_PLACE_MICROVIA:
case ID_POPUP_PCB_IMPORT_PAD_SETTINGS: case ID_POPUP_PCB_IMPORT_PAD_SETTINGS:
case ID_POPUP_PCB_EXPORT_PAD_SETTINGS: case ID_POPUP_PCB_EXPORT_PAD_SETTINGS:
...@@ -339,6 +340,13 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -339,6 +340,13 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
} }
break; break;
case ID_POPUP_PCB_SWITCH_TRACK_POSTURE:
/* XXX POSTURE XXX */
ShowNewTrackWhenMovingCursor( DrawPanel, &dc, true );
g_Alternate_Track_Posture = !g_Alternate_Track_Posture;
ShowNewTrackWhenMovingCursor( DrawPanel, &dc, false );
break;
case ID_POPUP_PCB_PLACE_MICROVIA: case ID_POPUP_PCB_PLACE_MICROVIA:
if( !IsMicroViaAcceptable() ) if( !IsMicroViaAcceptable() )
break; break;
......
...@@ -906,11 +906,16 @@ void ComputeBreakPoint( TRACK* track, int SegmentCount, wxPoint end ) ...@@ -906,11 +906,16 @@ void ComputeBreakPoint( TRACK* track, int SegmentCount, wxPoint end )
TRACK* lastTrack = track ? track->Back() : NULL; TRACK* lastTrack = track ? track->Back() : NULL;
if( lastTrack ) if( lastTrack )
{ {
if( (lastTrack->m_End.x == lastTrack->m_Start.x) if(( (lastTrack->m_End.x == lastTrack->m_Start.x)
|| (lastTrack->m_End.y == lastTrack->m_Start.y) ) || (lastTrack->m_End.y == lastTrack->m_Start.y) )
&& !g_Alternate_Track_Posture)
{ {
iAngle = 45; iAngle = 45;
} }
} else {
if (g_Alternate_Track_Posture) {
iAngle = 45;
}
} }
if( iAngle == 0 ) if( iAngle == 0 )
......
...@@ -67,6 +67,8 @@ static Ki_HotkeyInfo HkBackspace( wxT( "Delete track segment" ), HK_BACK_SPACE, ...@@ -67,6 +67,8 @@ static Ki_HotkeyInfo HkBackspace( wxT( "Delete track segment" ), HK_BACK_SPACE,
WXK_BACK ); WXK_BACK );
static Ki_HotkeyInfo HkAddNewTrack( wxT( "Add new track" ), HK_ADD_NEW_TRACK, 'X' ); static Ki_HotkeyInfo HkAddNewTrack( wxT( "Add new track" ), HK_ADD_NEW_TRACK, 'X' );
static Ki_HotkeyInfo HkAddVia( wxT( "Add Via" ), HK_ADD_VIA, 'V' ); static Ki_HotkeyInfo HkAddVia( wxT( "Add Via" ), HK_ADD_VIA, 'V' );
static Ki_HotkeyInfo HkSwitchTrackPosture( wxT( "Switch Track Posture" ),
HK_SWITCH_TRACK_POSTURE, '/' );
static Ki_HotkeyInfo HkAddMicroVia( wxT( "Add MicroVia" ), HK_ADD_MICROVIA, 'V' static Ki_HotkeyInfo HkAddMicroVia( wxT( "Add MicroVia" ), HK_ADD_MICROVIA, 'V'
+ GR_KB_CTRL ); + GR_KB_CTRL );
static Ki_HotkeyInfo HkEndTrack( wxT( "End Track" ), HK_END_TRACK, WXK_END ); static Ki_HotkeyInfo HkEndTrack( wxT( "End Track" ), HK_END_TRACK, WXK_END );
...@@ -157,6 +159,7 @@ Ki_HotkeyInfo* s_board_edit_Hotkey_List[] = ...@@ -157,6 +159,7 @@ Ki_HotkeyInfo* s_board_edit_Hotkey_List[] =
&HkTrackDisplayMode, &HkDelete, &HkTrackDisplayMode, &HkDelete,
&HkBackspace, &HkBackspace,
&HkAddNewTrack, &HkAddVia, &HkAddMicroVia, &HkAddNewTrack, &HkAddVia, &HkAddMicroVia,
&HkSwitchTrackPosture,
&HkEndTrack, &HkMoveFootprint, &HkEndTrack, &HkMoveFootprint,
&HkFlipFootprint, &HkRotateFootprint, &HkDragFootprint, &HkFlipFootprint, &HkRotateFootprint, &HkDragFootprint,
&HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile, &HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile,
...@@ -496,6 +499,12 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ...@@ -496,6 +499,12 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
DrawPanel->Refresh(); DrawPanel->Refresh();
break; break;
case HK_SWITCH_TRACK_POSTURE: // change the position of initial segment when creating new tracks
ShowNewTrackWhenMovingCursor( DrawPanel, DC, false );
g_Alternate_Track_Posture = !g_Alternate_Track_Posture;
ShowNewTrackWhenMovingCursor( DrawPanel, DC, false );
break;
case HK_ADD_NEW_TRACK: // Start new track case HK_ADD_NEW_TRACK: // Start new track
if( getActiveLayer() > LAYER_N_FRONT ) if( getActiveLayer() > LAYER_N_FRONT )
break; break;
......
...@@ -22,6 +22,7 @@ enum hotkey_id_commnand { ...@@ -22,6 +22,7 @@ enum hotkey_id_commnand {
HK_ADD_NEW_TRACK, HK_ADD_NEW_TRACK,
HK_ADD_VIA, HK_ADD_VIA,
HK_ADD_MICROVIA, HK_ADD_MICROVIA,
HK_SWITCH_TRACK_POSTURE,
HK_END_TRACK, HK_END_TRACK,
HK_SAVE_BOARD, HK_LOAD_BOARD, HK_SAVE_BOARD, HK_LOAD_BOARD,
HK_SWITCH_UNITS, HK_SWITCH_UNITS,
......
...@@ -448,6 +448,9 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) ...@@ -448,6 +448,9 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
msg = AddHotkeyName( _( "Place Via" ), s_Board_Editor_Hokeys_Descr, HK_ADD_VIA ); msg = AddHotkeyName( _( "Place Via" ), s_Board_Editor_Hokeys_Descr, HK_ADD_VIA );
PopMenu->Append( ID_POPUP_PCB_PLACE_VIA, msg ); PopMenu->Append( ID_POPUP_PCB_PLACE_VIA, msg );
msg = AddHotkeyName( _( "Switch Track Posture" ), s_Board_Editor_Hokeys_Descr, HK_SWITCH_TRACK_POSTURE );
PopMenu->Append( ID_POPUP_PCB_SWITCH_TRACK_POSTURE, msg );
// See if we can place a Micro Via (4 or more layers, and start from an external layer): // See if we can place a Micro Via (4 or more layers, and start from an external layer):
if( IsMicroViaAcceptable() ) if( IsMicroViaAcceptable() )
{ {
......
...@@ -43,6 +43,7 @@ bool g_Drag_Pistes_On; ...@@ -43,6 +43,7 @@ bool g_Drag_Pistes_On;
bool g_Show_Module_Ratsnest; bool g_Show_Module_Ratsnest;
bool g_Show_Pads_Module_in_Move = true; bool g_Show_Pads_Module_in_Move = true;
bool g_Raccord_45_Auto = true; bool g_Raccord_45_Auto = true;
bool g_Alternate_Track_Posture = false;
bool g_Track_45_Only_Allowed = true; // True to allow horiz, vert. and 45deg only tracks bool g_Track_45_Only_Allowed = true; // True to allow horiz, vert. and 45deg only tracks
bool Segments_45_Only; // True to allow horiz, vert. and 45deg only graphic segments bool Segments_45_Only; // True to allow horiz, vert. and 45deg only graphic segments
bool g_TwoSegmentTrackBuild = true; bool g_TwoSegmentTrackBuild = true;
......
...@@ -61,6 +61,7 @@ extern const wxString g_FootprintLibFileWildcard; // Wildcard for footprint li ...@@ -61,6 +61,7 @@ extern const wxString g_FootprintLibFileWildcard; // Wildcard for footprint li
extern bool g_Track_45_Only_Allowed; extern bool g_Track_45_Only_Allowed;
extern bool g_Alternate_Track_Posture;
extern bool Segments_45_Only; extern bool Segments_45_Only;
extern wxString g_Shapes3DExtBuffer; extern wxString g_Shapes3DExtBuffer;
extern wxString g_DocModulesFileName; extern wxString g_DocModulesFileName;
......
...@@ -101,6 +101,7 @@ enum pcbnew_ids ...@@ -101,6 +101,7 @@ enum pcbnew_ids
ID_POPUP_PCB_END_TRACK, ID_POPUP_PCB_END_TRACK,
ID_POPUP_PCB_PLACE_VIA, ID_POPUP_PCB_PLACE_VIA,
ID_POPUP_PCB_PLACE_MICROVIA, ID_POPUP_PCB_PLACE_MICROVIA,
ID_POPUP_PCB_SWITCH_TRACK_POSTURE,
ID_POPUP_PCB_IMPORT_PAD_SETTINGS, ID_POPUP_PCB_IMPORT_PAD_SETTINGS,
ID_POPUP_PCB_EXPORT_PAD_SETTINGS, ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
......
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