Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
06c9f9c8
Commit
06c9f9c8
authored
Oct 01, 2007
by
CHARRAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enhancements in pcbnew to eeschema cross-probing. removed change in drc.cpp
parent
6245ac52
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
757 additions
and
368 deletions
+757
-368
change_log.txt
change_log.txt
+14
-0
edaappl.cpp
common/edaappl.cpp
+3
-3
block.cpp
eeschema/block.cpp
+3
-3
cleanup.cpp
eeschema/cleanup.cpp
+1
-1
controle.cpp
eeschema/controle.cpp
+60
-23
delsheet.cpp
eeschema/delsheet.cpp
+1
-1
dialog_eeschema_config.cpp
eeschema/dialog_eeschema_config.cpp
+2
-2
eeconfig.cpp
eeschema/eeconfig.cpp
+4
-4
eeschema.cpp
eeschema/eeschema.cpp
+11
-11
find.cpp
eeschema/find.cpp
+279
-63
getpart.cpp
eeschema/getpart.cpp
+3
-3
libframe.cpp
eeschema/libframe.cpp
+1
-1
locate.cpp
eeschema/locate.cpp
+51
-6
protos.h
eeschema/protos.h
+2
-0
schedit.cpp
eeschema/schedit.cpp
+10
-10
schframe.cpp
eeschema/schframe.cpp
+3
-3
symbdraw.cpp
eeschema/symbdraw.cpp
+1
-1
viewlib_frame.cpp
eeschema/viewlib_frame.cpp
+1
-1
appl_wxstruct.h
include/appl_wxstruct.h
+3
-3
wxstruct.h
include/wxstruct.h
+107
-91
controle.cpp
pcbnew/controle.cpp
+33
-28
drc.cpp
pcbnew/drc.cpp
+78
-75
edit.cpp
pcbnew/edit.cpp
+70
-24
drawframe.cpp
share/drawframe.cpp
+16
-11
No files found.
change_log.txt
View file @
06c9f9c8
...
...
@@ -4,6 +4,19 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Oct-01 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ pcbnew/eeschema
Cross-probing pcbnew to eeschema:
A left click on a pad in pcbnew moves the eeschema cursor on the corresponding component pin
A left click on a footprint ref or value in pcbnew moves the eeschema cursor on the corresponding component ref or value
A left ckick on a footprint moves the eeschema cursor on the corresponding component anchor
+ pcbnew
removed drc.cpp change line 584, and translate comments in english.
nothing broken:
-> a pad with its netcode = 0 means the pad ** must be left unconnected ** (not attached to * a net).
-> a track with its netcode = 0 means the track is not attached to a net (cannot be connected to any pad).
2007-Sep-30 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
...
...
@@ -22,6 +35,7 @@ email address.
* beautification, house keeping.
2007-Sep-29 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ pcbnew
...
...
common/edaappl.cpp
View file @
06c9f9c8
...
...
@@ -62,9 +62,9 @@ WinEDA_App::WinEDA_App()
m_MainFrame
=
NULL
;
m_PcbFrame
=
NULL
;
m_ModuleEditFrame
=
NULL
;
// Edition des modules
SchematicFrame
=
NULL
;
// Edition des Schemas
LibeditFrame
=
NULL
;
// Edition des composants
ViewlibFrame
=
NULL
;
// Visualisation des composants
m_
SchematicFrame
=
NULL
;
// Edition des Schemas
m_
LibeditFrame
=
NULL
;
// Edition des composants
m_
ViewlibFrame
=
NULL
;
// Visualisation des composants
m_CvpcbFrame
=
NULL
;
m_GerberFrame
=
NULL
;
// ecran de visualisation GERBER
...
...
eeschema/block.cpp
View file @
06c9f9c8
...
...
@@ -681,7 +681,7 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
MirrorYPoint
(
px
,
Center
);
px
.
x
-=
dx
;
EDA_Appl
->
SchematicFrame
->
PutOnGrid
(
&
px
);
EDA_Appl
->
m_
SchematicFrame
->
PutOnGrid
(
&
px
);
DrawText
->
m_Pos
.
x
=
px
.
x
;
break
;
...
...
@@ -696,14 +696,14 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
px
=
DrawText
->
m_Pos
;
MirrorYPoint
(
px
,
Center
);
EDA_Appl
->
SchematicFrame
->
PutOnGrid
(
&
px
);
EDA_Appl
->
m_
SchematicFrame
->
PutOnGrid
(
&
px
);
DrawText
->
m_Pos
.
x
=
px
.
x
;
break
;
case
DRAW_LIB_ITEM_STRUCT_TYPE
:
DrawLibItem
=
(
EDA_SchComponentStruct
*
)
DrawStruct
;
dx
=
DrawLibItem
->
m_Pos
.
x
;
EDA_Appl
->
SchematicFrame
->
CmpRotationMiroir
(
DrawLibItem
,
EDA_Appl
->
m_
SchematicFrame
->
CmpRotationMiroir
(
DrawLibItem
,
NULL
,
CMP_MIROIR_Y
);
MirrorYPoint
(
DrawLibItem
->
m_Pos
,
Center
);
dx
-=
DrawLibItem
->
m_Pos
.
x
;
...
...
eeschema/cleanup.cpp
View file @
06c9f9c8
...
...
@@ -63,7 +63,7 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
}
}
EDA_Appl
->
SchematicFrame
->
TestDanglingEnds
(
EEDrawList
,
DC
);
EDA_Appl
->
m_
SchematicFrame
->
TestDanglingEnds
(
EEDrawList
,
DC
);
return
Modify
;
}
...
...
eeschema/controle.cpp
View file @
06c9f9c8
...
...
@@ -22,33 +22,71 @@
/* variables externes */
/**********************************/
/***************************************************************/
void
RemoteCommand
(
const
char
*
cmdline
)
/**********************************/
/**********************************
*****************************
/
/*
Read a remote command sent from pcbnew
, so when user selects a module
/*
* Read a remote command sent by pcbnew (via a socket connection)
, so when user selects a module
* or pin in pcbnew, eeschema shows that same component or pin.
* The cursor is put on the item
* @param cmdline = received command from pcbnew
* commands are:
* $PART: "reference" put cursor on component
* $PART: "reference" $REF: "ref" put cursor on reference component
* $PART: "reference" $VAL: "value" put cursor on value component
* $PART: "reference" $PAD: "pin name" put cursor on the component pin
*/
{
char
line
[
1024
];
char
*
idcmd
;
char
*
text
;
char
line
[
1024
];
char
*
idcmd
;
char
*
text
;
WinEDA_SchematicFrame
*
frame
=
EDA_Appl
->
m_SchematicFrame
;
wxString
part_ref
,
msg
;
strncpy
(
line
,
cmdline
,
sizeof
(
line
)
-
1
);
idcmd
=
strtok
(
line
,
"
\n\r
"
);
text
=
strtok
(
NULL
,
"
\n\r
"
);
text
=
strtok
(
NULL
,
"
\"
\n\r
"
);
if
(
(
idcmd
==
NULL
)
||
(
text
==
NULL
)
)
return
;
if
(
strcmp
(
idcmd
,
"$PART:"
)
==
0
)
if
(
strcmp
(
idcmd
,
"$PART:"
)
!=
0
)
return
;
part_ref
=
CONV_FROM_UTF8
(
text
);
/* look for a complement */
idcmd
=
strtok
(
NULL
,
"
\n\r
"
);
if
(
idcmd
==
NULL
)
// component only
{
frame
->
FindComponentAndItem
(
part_ref
,
true
,
0
,
wxEmptyString
,
false
);
return
;
}
text
=
strtok
(
NULL
,
"
\"\n\r
"
);
if
(
text
==
NULL
)
return
;
msg
=
CONV_FROM_UTF8
(
text
);
if
(
strcmp
(
idcmd
,
"$REF:"
)
==
0
)
{
frame
->
FindComponentAndItem
(
part_ref
,
true
,
2
,
msg
,
false
);
}
else
if
(
strcmp
(
idcmd
,
"$VAL:"
)
==
0
)
{
WinEDA_SchematicFrame
*
frame
=
EDA_Appl
->
SchematicFrame
;
wxString
msg
=
CONV_FROM_UTF8
(
text
);
frame
->
FindSchematicItem
(
msg
,
1
,
false
);
frame
->
FindComponentAndItem
(
part_ref
,
true
,
3
,
msg
,
false
);
}
else
if
(
strcmp
(
idcmd
,
"$PAD:"
)
==
0
)
{
frame
->
FindComponentAndItem
(
part_ref
,
true
,
1
,
msg
,
false
);
}
else
frame
->
FindComponentAndItem
(
part_ref
,
true
,
0
,
wxEmptyString
,
false
);
}
...
...
@@ -76,7 +114,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
wxPoint
mouse_position
=
GetScreen
()
->
m_MousePosition
;
LibDrawPin
*
Pin
=
NULL
;
EDA_SchComponentStruct
*
LibItem
=
NULL
;
char
Line
[
1024
];
char
Line
[
1024
];
DrawStruct
=
SchematicGeneralLocateAndDisplay
(
mouse_position
,
IncludePin
);
if
(
!
DrawStruct
&&
(
mouse_position
!=
GetScreen
()
->
m_Curseur
)
)
...
...
@@ -101,7 +139,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
case
DRAW_LIB_ITEM_STRUCT_TYPE
:
Pin
=
LocateAnyPin
(
m_CurrentScreen
->
EEDrawList
,
GetScreen
()
->
m_Curseur
,
&
LibItem
);
if
(
Pin
)
break
;
// Priority is probing a pin first
break
;
// Priority is probing a pin first
LibItem
=
(
EDA_SchComponentStruct
*
)
DrawStruct
;
sprintf
(
Line
,
"$PART: %s"
,
CONV_TO_UTF8
(
LibItem
->
m_Field
[
REFERENCE
].
m_Text
)
);
SendCommand
(
MSG_TO_PCB
,
Line
);
...
...
@@ -157,16 +195,16 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
* return:
* an EDA_BaseStruct pointer on the item
* a Null pointer if no item found
*
*
* For some items, caracteristics are displayed on the screen.
*/
{
EDA_BaseStruct
*
DrawStruct
;
LibDrawPin
*
Pin
;
EDA_SchComponentStruct
*
LibItem
;
wxString
Text
;
wxString
msg
;
int
ii
;
wxString
Text
;
wxString
msg
;
int
ii
;
DrawStruct
=
PickStruct
(
refpoint
,
GetScreen
()
->
EEDrawList
,
MARKERITEM
);
if
(
DrawStruct
)
...
...
@@ -317,17 +355,17 @@ void WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels
curpos
=
m_CurrentScreen
->
m_Curseur
;
break
;
case
EDA_ZOOM_IN_FROM_MOUSE
:
case
EDA_ZOOM_IN_FROM_MOUSE
:
OnZoom
(
ID_ZOOM_PLUS_KEY
);
curpos
=
m_CurrentScreen
->
m_Curseur
;
break
;
case
EDA_ZOOM_OUT_FROM_MOUSE
:
case
EDA_ZOOM_OUT_FROM_MOUSE
:
OnZoom
(
ID_ZOOM_MOINS_KEY
);
curpos
=
m_CurrentScreen
->
m_Curseur
;
break
;
case
EDA_ZOOM_CENTER_FROM_MOUSE
:
case
EDA_ZOOM_CENTER_FROM_MOUSE
:
OnZoom
(
ID_ZOOM_CENTER_KEY
);
curpos
=
m_CurrentScreen
->
m_Curseur
;
break
;
...
...
@@ -396,5 +434,4 @@ void WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels
}
Affiche_Status_Box
();
/* Affichage des coord curseur */
}
eeschema/delsheet.cpp
View file @
06c9f9c8
...
...
@@ -24,7 +24,7 @@ void DeleteSubHierarchy(DrawSheetStruct * FirstSheet, bool confirm_deletion)
{
EDA_BaseStruct
*
DrawStruct
;
EDA_BaseStruct
*
EEDrawList
;
WinEDA_SchematicFrame
*
frame
=
EDA_Appl
->
SchematicFrame
;
WinEDA_SchematicFrame
*
frame
=
EDA_Appl
->
m_
SchematicFrame
;
wxString
msg
;
if
(
FirstSheet
==
NULL
)
return
;
...
...
eeschema/dialog_eeschema_config.cpp
View file @
06c9f9c8
...
...
@@ -295,8 +295,8 @@ void KiConfigEeschemaFrame::OnCloseWindow(wxCloseEvent & event)
if
(
m_LibListChanged
)
{
LoadLibraries
(
m_Parent
);
if
(
m_Parent
->
m_Parent
->
ViewlibFrame
)
m_Parent
->
m_Parent
->
ViewlibFrame
->
ReCreateListLib
();
if
(
m_Parent
->
m_Parent
->
m_
ViewlibFrame
)
m_Parent
->
m_Parent
->
m_
ViewlibFrame
->
ReCreateListLib
();
}
EndModal
(
0
);
}
...
...
eeschema/eeconfig.cpp
View file @
06c9f9c8
...
...
@@ -159,13 +159,13 @@ wxArrayString liblist_tmp = g_LibName_List;
g_LibName_List
.
Add
(
wxT
(
"device"
)
);
}
if
(
EDA_Appl
->
SchematicFrame
)
if
(
EDA_Appl
->
m_
SchematicFrame
)
{
EDA_Appl
->
SchematicFrame
->
SetDrawBgColor
(
g_DrawBgColor
);
EDA_Appl
->
SchematicFrame
->
m_Draw_Grid
=
g_ShowGrid
;
EDA_Appl
->
m_
SchematicFrame
->
SetDrawBgColor
(
g_DrawBgColor
);
EDA_Appl
->
m_
SchematicFrame
->
m_Draw_Grid
=
g_ShowGrid
;
}
LoadLibraries
(
EDA_Appl
->
SchematicFrame
);
LoadLibraries
(
EDA_Appl
->
m_
SchematicFrame
);
return
IsRead
;
}
...
...
eeschema/eeschema.cpp
View file @
06c9f9c8
...
...
@@ -66,41 +66,41 @@ bool WinEDA_App::OnInit()
/* init EESCHEMA */
GetSettings
();
// read current setup
SeedLayers
();
Read_Hotkey_Config
(
SchematicFrame
,
false
);
/* Must be called before creating the main frame
Read_Hotkey_Config
(
m_
SchematicFrame
,
false
);
/* Must be called before creating the main frame
* in order to display the real hotkeys in menus
* or tool tips */
// Create main frame (schematic frame) :
SchematicFrame
=
new
WinEDA_SchematicFrame
(
NULL
,
this
,
m_
SchematicFrame
=
new
WinEDA_SchematicFrame
(
NULL
,
this
,
wxT
(
"EESchema"
),
wxPoint
(
0
,
0
),
wxSize
(
600
,
400
)
);
SetTopWindow
(
SchematicFrame
);
SchematicFrame
->
Show
(
TRUE
);
SetTopWindow
(
m_
SchematicFrame
);
m_
SchematicFrame
->
Show
(
TRUE
);
if
(
CreateServer
(
SchematicFrame
,
KICAD_SCH_PORT_SERVICE_NUMBER
)
)
if
(
CreateServer
(
m_
SchematicFrame
,
KICAD_SCH_PORT_SERVICE_NUMBER
)
)
{
// RemoteCommand is in controle.cpp and is called when PCBNEW
// sends EESCHEMA a command
SetupServerFunction
(
RemoteCommand
);
}
SchematicFrame
->
Zoom_Automatique
(
TRUE
);
m_
SchematicFrame
->
Zoom_Automatique
(
TRUE
);
/* Load file specified in the command line. */
if
(
!
FFileName
.
IsEmpty
()
)
{
ChangeFileNameExt
(
FFileName
,
g_SchExtBuffer
);
wxSetWorkingDirectory
(
wxPathOnly
(
FFileName
)
);
if
(
SchematicFrame
->
DrawPanel
)
if
(
SchematicFrame
->
LoadOneEEProject
(
FFileName
,
FALSE
)
<=
0
)
SchematicFrame
->
DrawPanel
->
Refresh
(
TRUE
);
// File not found or error
if
(
m_
SchematicFrame
->
DrawPanel
)
if
(
m_
SchematicFrame
->
LoadOneEEProject
(
FFileName
,
FALSE
)
<=
0
)
m_
SchematicFrame
->
DrawPanel
->
Refresh
(
TRUE
);
// File not found or error
}
else
{
Read_Config
(
wxEmptyString
,
TRUE
);
// Read config file ici si pas de fichier a charger
if
(
SchematicFrame
->
DrawPanel
)
SchematicFrame
->
DrawPanel
->
Refresh
(
TRUE
);
if
(
m_
SchematicFrame
->
DrawPanel
)
m_
SchematicFrame
->
DrawPanel
->
Refresh
(
TRUE
);
}
return
TRUE
;
...
...
eeschema/find.cpp
View file @
06c9f9c8
This diff is collapsed.
Click to expand it.
eeschema/getpart.cpp
View file @
06c9f9c8
...
...
@@ -31,14 +31,14 @@ wxString SelectFromLibBrowser( WinEDA_DrawFrame* parent )
WinEDA_ViewlibFrame
*
Viewer
;
wxSemaphore
semaphore
(
0
,
1
);
Viewer
=
parent
->
m_Parent
->
ViewlibFrame
;
Viewer
=
parent
->
m_Parent
->
m_
ViewlibFrame
;
/* Close the current Lib browser, if open, and open a new one, in "modal" mode */
if
(
Viewer
)
Viewer
->
Destroy
();
Viewer
=
parent
->
m_Parent
->
ViewlibFrame
=
new
Viewer
=
parent
->
m_Parent
->
m_
ViewlibFrame
=
new
WinEDA_ViewlibFrame
(
parent
->
m_Parent
->
SchematicFrame
,
parent
->
m_Parent
->
m_
SchematicFrame
,
parent
->
m_Parent
,
NULL
,
&
semaphore
);
...
...
eeschema/libframe.cpp
View file @
06c9f9c8
...
...
@@ -88,7 +88,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
WinEDA_LibeditFrame
::~
WinEDA_LibeditFrame
()
/**********************************************/
{
m_Parent
->
LibeditFrame
=
NULL
;
m_Parent
->
m_
LibeditFrame
=
NULL
;
m_CurrentScreen
=
ScreenSch
;
}
...
...
eeschema/locate.cpp
View file @
06c9f9c8
...
...
@@ -1036,6 +1036,57 @@ int distance( int dx, int dy, int spot_cX, int spot_cY, int seuil )
return
0
;
}
/*******************************************************************/
LibDrawPin
*
LocatePinByNumber
(
const
wxString
&
ePin_Number
,
EDA_SchComponentStruct
*
eComponent
)
/*******************************************************************/
/** Find a PIN in a component
* @param pin_number = pin number (string)
* @param pin_number = pin number (string)
* @return a pointer on the pin, or NULL if not found
*/
{
LibEDA_BaseStruct
*
DrawItem
;
EDA_LibComponentStruct
*
Entry
;
LibDrawPin
*
Pin
;
int
Unit
,
Convert
;
Entry
=
FindLibPart
(
eComponent
->
m_ChipName
.
GetData
(),
wxEmptyString
,
FIND_ROOT
);
if
(
Entry
==
NULL
)
return
NULL
;
if
(
Entry
->
Type
!=
ROOT
)
{
DisplayError
(
NULL
,
wxT
(
"LocatePinByNumber() error: Entry is ALIAS"
)
);
return
NULL
;
}
Unit
=
eComponent
->
m_Multi
;
Convert
=
eComponent
->
m_Convert
;
DrawItem
=
Entry
->
m_Drawings
;
for
(
;
DrawItem
!=
NULL
;
DrawItem
=
DrawItem
->
Next
()
)
{
if
(
DrawItem
->
Type
()
==
COMPONENT_PIN_DRAW_TYPE
)
/* Pin Trouvee */
{
Pin
=
(
LibDrawPin
*
)
DrawItem
;
if
(
Unit
&&
DrawItem
->
m_Unit
&&
(
DrawItem
->
m_Unit
!=
Unit
)
)
continue
;
if
(
Convert
&&
DrawItem
->
m_Convert
&&
(
DrawItem
->
m_Convert
!=
Convert
)
)
continue
;
wxString
pNumber
;
Pin
->
ReturnPinStringNum
(
pNumber
);
if
(
ePin_Number
==
pNumber
)
return
Pin
;
}
}
return
NULL
;
}
/*******************************************************************/
LibEDA_BaseStruct
*
LocatePin
(
const
wxPoint
&
RefPos
,
...
...
@@ -1047,12 +1098,6 @@ LibEDA_BaseStruct* LocatePin( const wxPoint& RefPos,
* retourne un pointeur sur la pin, ou NULL si pas trouve
* Si Unit = 0, le numero d'unite n'est pas teste
* Si convert = 0, le numero convert n'est pas teste
*
* m_Transform = matrice de transformation.
* Si NULL: matrice de transformation " normale" [1 , 0 , 0 , -1]
* (la matrice de transformation " normale" etant [1 , 0 , 0 , -1]
* la coord dy doit etre inversee).
* PartX, PartY: coordonnees de positionnement du composant
*/
{
LibEDA_BaseStruct
*
DrawItem
;
...
...
eeschema/protos.h
View file @
06c9f9c8
...
...
@@ -118,6 +118,8 @@ bool DrawStructInBox(int x1, int y1, int x2, int y2,
/*************/
/* LOCATE.CPP */
/*************/
LibDrawPin
*
LocatePinByNumber
(
const
wxString
&
ePin_Number
,
EDA_SchComponentStruct
*
eComponent
);
EDA_SchComponentStruct
*
LocateSmallestComponent
(
SCH_SCREEN
*
Screen
);
/* Recherche du plus petit (en surface) composant pointe par la souris */
...
...
eeschema/schedit.cpp
View file @
06c9f9c8
...
...
@@ -182,19 +182,19 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
case
ID_TO_LIBRARY
:
if
(
m_Parent
->
LibeditFrame
)
if
(
m_Parent
->
m_
LibeditFrame
)
{
m_Parent
->
LibeditFrame
->
Show
(
TRUE
);
m_Parent
->
m_
LibeditFrame
->
Show
(
TRUE
);
}
else
{
m_Parent
->
LibeditFrame
=
new
WinEDA_LibeditFrame
(
m_Parent
->
SchematicFrame
,
m_Parent
->
m_
LibeditFrame
=
new
WinEDA_LibeditFrame
(
m_Parent
->
m_
SchematicFrame
,
m_Parent
,
wxT
(
"Library Editor"
),
wxPoint
(
-
1
,
-
1
),
wxSize
(
600
,
400
)
);
ActiveScreen
=
ScreenLib
;
m_Parent
->
LibeditFrame
->
AdjustScrollBars
();
m_Parent
->
m_
LibeditFrame
->
AdjustScrollBars
();
}
break
;
...
...
@@ -229,15 +229,15 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
}
case
ID_TO_LIBVIEW
:
if
(
m_Parent
->
ViewlibFrame
)
if
(
m_Parent
->
m_
ViewlibFrame
)
{
m_Parent
->
ViewlibFrame
->
Show
(
TRUE
);
m_Parent
->
m_
ViewlibFrame
->
Show
(
TRUE
);
}
else
{
m_Parent
->
ViewlibFrame
=
new
WinEDA_ViewlibFrame
(
m_Parent
->
SchematicFrame
,
m_Parent
);
m_Parent
->
ViewlibFrame
->
AdjustScrollBars
();
m_Parent
->
m_
ViewlibFrame
=
new
WinEDA_ViewlibFrame
(
m_Parent
->
m_
SchematicFrame
,
m_Parent
);
m_Parent
->
m_
ViewlibFrame
->
AdjustScrollBars
();
}
break
;
...
...
eeschema/schframe.cpp
View file @
06c9f9c8
...
...
@@ -154,7 +154,7 @@ WinEDA_SchematicFrame:: WinEDA_SchematicFrame(wxWindow * father, WinEDA_App *par
WinEDA_SchematicFrame
::~
WinEDA_SchematicFrame
()
{
m_Parent
->
SchematicFrame
=
NULL
;
m_Parent
->
m_
SchematicFrame
=
NULL
;
m_CurrentScreen
=
ScreenSch
;
}
...
...
@@ -164,9 +164,9 @@ void WinEDA_SchematicFrame::OnCloseWindow(wxCloseEvent & Event)
{
SCH_SCREEN
*
screen
;
if
(
m_Parent
->
LibeditFrame
)
// Can close component editor ?
if
(
m_Parent
->
m_
LibeditFrame
)
// Can close component editor ?
{
if
(
!
m_Parent
->
LibeditFrame
->
Close
()
)
return
;
if
(
!
m_Parent
->
m_
LibeditFrame
->
Close
()
)
return
;
}
screen
=
ScreenSch
;
...
...
eeschema/symbdraw.cpp
View file @
06c9f9c8
...
...
@@ -793,7 +793,7 @@ static void ComputeArc( LibDrawArc* DrawItem, wxPoint ArcCentre )
wxString
msg
;
angle
=
DrawItem
->
t2
-
DrawItem
->
t1
;
msg
.
Printf
(
_
(
"Arc %.1f deg"
),
(
float
)
angle
/
10
);
EDA_Appl
->
LibeditFrame
->
PrintMsg
(
msg
);
EDA_Appl
->
m_
LibeditFrame
->
PrintMsg
(
msg
);
while
(
(
DrawItem
->
t2
-
DrawItem
->
t1
)
>=
1800
)
{
...
...
eeschema/viewlib_frame.cpp
View file @
06c9f9c8
...
...
@@ -109,7 +109,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame(wxWindow * father, WinEDA_App *parent,
WinEDA_ViewlibFrame
::~
WinEDA_ViewlibFrame
()
{
delete
m_CurrentScreen
;
m_Parent
->
ViewlibFrame
=
NULL
;
m_Parent
->
m_
ViewlibFrame
=
NULL
;
}
/*****************************************************************/
...
...
include/appl_wxstruct.h
View file @
06c9f9c8
...
...
@@ -30,9 +30,9 @@ public:
WinEDA_PcbFrame
*
m_PcbFrame
;
WinEDA_ModuleEditFrame
*
m_ModuleEditFrame
;
WinEDA_GerberFrame
*
m_GerberFrame
;
WinEDA_SchematicFrame
*
SchematicFrame
;
// Edition des Schemas
WinEDA_LibeditFrame
*
LibeditFrame
;
// Edition des composants
WinEDA_ViewlibFrame
*
ViewlibFrame
;
// Visualisation des composants
WinEDA_SchematicFrame
*
m_
SchematicFrame
;
// Edition des Schemas
WinEDA_LibeditFrame
*
m_
LibeditFrame
;
// Edition des composants
WinEDA_ViewlibFrame
*
m_
ViewlibFrame
;
// Visualisation des composants
WinEDA_CvpcbFrame
*
m_CvpcbFrame
;
wxPoint
m_HelpPos
;
...
...
include/wxstruct.h
View file @
06c9f9c8
This diff is collapsed.
Click to expand it.
pcbnew/controle.cpp
View file @
06c9f9c8
...
...
@@ -17,23 +17,26 @@
#include "bitmaps.h"
/****************************************/
void
RemoteCommand
(
const
char
*
cmdline
)
/****************************************/
/****************************************
***
/
void
RemoteCommand
(
const
char
*
cmdline
)
/****************************************
***
/
/* Read a remote command send by eeschema via a socket,
/*
*
Read a remote command send by eeschema via a socket,
* port KICAD_PCB_PORT_SERVICE_NUMBER (currently 4242)
* @param cmdline = received command from eeschema
* Commands are
* $PART: "reference" put cursor on component
* $PIN: "pin name" $PART: "reference" put cursor on the footprint pin
*/
{
char
line
[
1024
];
wxString
msg
;
char
*
idcmd
;
char
*
text
;
WinEDA_PcbFrame
*
frame
=
EDA_Appl
->
m_PcbFrame
;
MODULE
*
module
=
0
;
WinEDA_PcbFrame
*
frame
=
EDA_Appl
->
m_PcbFrame
;
strncpy
(
line
,
cmdline
,
sizeof
(
line
)
-
1
);
msg
=
CONV_FROM_UTF8
(
line
);
idcmd
=
strtok
(
line
,
"
\n\r
"
);
text
=
strtok
(
NULL
,
"
\n\r
"
);
...
...
@@ -104,6 +107,7 @@ void RemoteCommand( const char* cmdline )
msg
.
Printf
(
_
(
"Pin %s (module %s) not found"
),
pinName
.
GetData
(),
modName
.
GetData
()
);
else
msg
.
Printf
(
_
(
"Locate Pin %s (module %s)"
),
pinName
.
GetData
(),
modName
.
GetData
()
);
frame
->
Affiche_Message
(
msg
);
}
...
...
@@ -180,9 +184,9 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
break
;
default
:
scanList
=
DisplayOpt
.
DisplayZones
?
GENERAL_COLLECTOR
::
AllBoardItems
:
GENERAL_COLLECTOR
::
AllButZones
;
scanList
=
DisplayOpt
.
DisplayZones
?
GENERAL_COLLECTOR
::
AllBoardItems
:
GENERAL_COLLECTOR
::
AllButZones
;
break
;
}
}
...
...
@@ -203,31 +207,33 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
break
;
default
:
scanList
=
DisplayOpt
.
DisplayZones
?
GENERAL_COLLECTOR
::
AllBoardItems
:
GENERAL_COLLECTOR
::
AllButZones
;
scanList
=
DisplayOpt
.
DisplayZones
?
GENERAL_COLLECTOR
::
AllBoardItems
:
GENERAL_COLLECTOR
::
AllButZones
;
}
}
m_Collector
->
Collect
(
m_Pcb
,
scanList
,
GetScreen
()
->
RefPos
(
true
),
guide
);
#if 0
#if 0
// debugging: print out the collected items, showing their priority order too.
for( int i
=
0; i<m_Collector->GetCount(); ++i )
for( int i
=
0; i<m_Collector->GetCount(); ++i )
(*m_Collector)[i]->Show( 0, std::cout );
#endif
#endif
/* Remove redundancies: most of time, zones are found twice,
* because zones are filled twice ( once by by horizontal and once by vertical segments )
*/
unsigned
long
timestampzone
=
0
;
for
(
int
ii
=
0
;
ii
<
m_Collector
->
GetCount
();
ii
++
)
{
item
=
(
*
m_Collector
)[
ii
];
if
(
item
->
Type
()
!=
TYPEZONE
)
continue
;
/* Found a TYPE ZONE */
if
(
item
->
m_TimeStamp
==
timestampzone
)
// Remove it, redundant, zone already found
{
...
...
@@ -243,22 +249,21 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
item
=
(
*
m_Collector
)[
0
];
SetCurItem
(
item
);
}
// If the count is 2, and first item is a pad or moduletext, and the 2nd item is its parent module:
else
if
(
m_Collector
->
GetCount
()
==
2
&&
(
(
*
m_Collector
)[
0
]
->
Type
()
==
TYPEPAD
||
(
*
m_Collector
)[
0
]
->
Type
()
==
TYPETEXTEMODULE
)
&&
(
*
m_Collector
)[
1
]
->
Type
()
==
TYPEMODULE
&&
(
*
m_Collector
)[
0
]
->
GetParent
()
==
(
*
m_Collector
)[
1
]
)
&&
(
(
*
m_Collector
)[
0
]
->
Type
()
==
TYPEPAD
||
(
*
m_Collector
)[
0
]
->
Type
()
==
TYPETEXTEMODULE
)
&&
(
*
m_Collector
)[
1
]
->
Type
()
==
TYPEMODULE
&&
(
*
m_Collector
)[
0
]
->
GetParent
()
==
(
*
m_Collector
)[
1
]
)
{
item
=
(
*
m_Collector
)[
0
];
SetCurItem
(
item
);
}
// if all are modules, find the smallest one amoung the primary choices
else
if
(
(
item
=
AllAreModulesAndReturnSmallestIfSo
(
m_Collector
)
)
!=
NULL
)
{
SetCurItem
(
item
);
}
else
// we can't figure out which item user wants, do popup menu so user can choose
{
wxMenu
itemMenu
;
...
...
@@ -281,12 +286,12 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
}
/* @todo: rather than assignment to TRUE, these should be increment and decrement operators throughout _everywhere_.
That way we can handle nesting.
But I tried that and found there cases where the assignment to TRUE (converted to a m_IgnoreMouseEvents++ )
was not balanced with the -- (now m_IgnoreMouseEvents=FALSE), so I had to revert.
Somebody should track down these and make them balanced.
DrawPanel->m_IgnoreMouseEvents = TRUE;
*/
*
That way we can handle nesting.
*
But I tried that and found there cases where the assignment to TRUE (converted to a m_IgnoreMouseEvents++ )
* was not balanced with the -- (now m_IgnoreMouseEvents=FALSE), so I had to revert.
*
Somebody should track down these and make them balanced.
*
DrawPanel->m_IgnoreMouseEvents = TRUE;
*/
// this menu's handler is void WinEDA_BasePcbFrame::ProcessItemSelection()
// and it calls SetCurItem() which in turn calls Display_Infos() on the item.
...
...
pcbnew/drc.cpp
View file @
06c9f9c8
This diff is collapsed.
Click to expand it.
pcbnew/edit.cpp
View file @
06c9f9c8
...
...
@@ -15,36 +15,78 @@
#include "eda_dde.h"
static
void
Process_Move_Item
(
WinEDA_PcbFrame
*
frame
,
EDA_BaseStruct
*
DrawStruct
,
wxDC
*
DC
);
// see wxstruct.h
/**************************************************************************/
void
WinEDA_PcbFrame
::
SendMessageToEESCHEMA
(
BOARD_ITEM
*
objectToSync
)
/**************************************************************************/
/** Send a remote command to eeschema via a socket,
* @param objectToSync = item to be located on schematic (module, pin or text)
* Commands are
* $PART: "reference" put cursor on component anchor
* $PART: "reference" $PAD: "pad number" put cursor on the component pin
* $PART: "reference" $REF: "reference" put cursor on the component ref
* $PART: "reference" $VAL: "value" put cursor on the component value
*/
{
char
cmd
[
1024
];
MODULE
*
module
=
NULL
;
if
(
objectToSync
==
NULL
)
char
cmd
[
1024
];
const
char
*
text_key
;
MODULE
*
module
=
NULL
;
D_PAD
*
pad
;
TEXTE_MODULE
*
text_mod
;
wxString
msg
;
if
(
objectToSync
==
NULL
)
return
;
if
(
objectToSync
->
Type
()
==
TYPEMODULE
)
switch
(
objectToSync
->
Type
()
)
{
case
TYPEMODULE
:
module
=
(
MODULE
*
)
objectToSync
;
else
if
(
objectToSync
->
Type
()
==
TYPEPAD
)
module
=
(
MODULE
*
)
objectToSync
->
GetParent
();
else
if
(
objectToSync
->
Type
()
==
TYPETEXTEMODULE
)
module
=
(
MODULE
*
)
objectToSync
->
GetParent
();
sprintf
(
cmd
,
"$PART:
\"
%s
\"
"
,
CONV_TO_UTF8
(
module
->
m_Reference
->
m_Text
)
);
break
;
case
TYPEPAD
:
module
=
(
MODULE
*
)
objectToSync
->
m_Parent
;
pad
=
(
D_PAD
*
)
objectToSync
;
msg
=
pad
->
ReturnStringPadName
();
sprintf
(
cmd
,
"$PART:
\"
%s
\"
$PAD:
\"
%s
\"
"
,
CONV_TO_UTF8
(
module
->
m_Reference
->
m_Text
),
CONV_TO_UTF8
(
msg
)
);
break
;
case
TYPETEXTEMODULE
:
#define REFERENCE 0
#define VALUE 1
module
=
(
MODULE
*
)
objectToSync
->
m_Parent
;
text_mod
=
(
TEXTE_MODULE
*
)
objectToSync
;
if
(
text_mod
->
m_Type
==
REFERENCE
)
text_key
=
"$REF:"
;
else
if
(
text_mod
->
m_Type
==
VALUE
)
text_key
=
"$VAL:"
;
else
break
;
sprintf
(
cmd
,
"$PART:
\"
%s
\"
%s
\"
%s
\"
"
,
CONV_TO_UTF8
(
module
->
m_Reference
->
m_Text
),
text_key
,
CONV_TO_UTF8
(
text_mod
->
m_Text
)
);
break
;
default
:
break
;
}
// ask only for the reference for now, maybe pins later.
if
(
module
)
{
sprintf
(
cmd
,
"$PART: %s"
,
CONV_TO_UTF8
(
module
->
m_Reference
->
m_Text
)
);
SendCommand
(
MSG_TO_SCH
,
cmd
);
}
}
/*********************************************************************/
void
WinEDA_PcbFrame
::
Process_Special_Functions
(
wxCommandEvent
&
event
)
/*********************************************************************/
...
...
@@ -59,7 +101,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel
->
CursorOff
(
&
dc
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
wxGetMousePosition
(
&
pos
.
x
,
&
pos
.
y
);
pos
.
y
+=
20
;
...
...
@@ -189,12 +231,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case
ID_OPEN_MODULE_EDITOR
:
if
(
m_Parent
->
m_ModuleEditFrame
==
NULL
)
{
m_Parent
->
m_ModuleEditFrame
=
m_Parent
->
m_ModuleEditFrame
=
new
WinEDA_ModuleEditFrame
(
this
,
m_Parent
,
_
(
"Module Editor"
),
wxPoint
(
-
1
,
-
1
),
wxSize
(
600
,
400
)
);
m_Parent
,
_
(
"Module Editor"
),
wxPoint
(
-
1
,
-
1
),
wxSize
(
600
,
400
)
);
m_Parent
->
m_ModuleEditFrame
->
Show
(
TRUE
);
m_Parent
->
m_ModuleEditFrame
->
Zoom_Automatique
(
TRUE
);
}
...
...
@@ -262,6 +304,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
case
ID_GET_TOOLS
:
// InstalloolsFrame(this, wxPoint(-1,-1) );
break
;
...
...
@@ -336,6 +379,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case
ID_POPUP_END_LINE
:
DrawPanel
->
MouseToCursorSchema
();
// EndSegment(&dc);
break
;
...
...
@@ -519,7 +563,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
// If the current Item is a pad, text module ...: Get the parent
if
(
GetCurItem
()
->
Type
()
!=
TYPEMODULE
)
SetCurItem
(
GetCurItem
()
->
GetParent
()
);
if
(
!
GetCurItem
()
||
GetCurItem
()
->
Type
()
!=
TYPEMODULE
)
break
;
if
(
Delete_Module
(
(
MODULE
*
)
GetCurItem
(),
&
dc
)
)
...
...
@@ -534,7 +578,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
// If the current Item is a pad, text module ...: Get the parent
if
(
GetCurItem
()
->
Type
()
!=
TYPEMODULE
)
SetCurItem
(
GetCurItem
()
->
GetParent
()
);
if
(
!
GetCurItem
()
||
GetCurItem
()
->
Type
()
!=
TYPEMODULE
)
break
;
Rotate_Module
(
&
dc
,
(
MODULE
*
)
GetCurItem
(),
-
900
,
TRUE
);
...
...
@@ -564,6 +608,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
case
ID_POPUP_PCB_EDIT_MODULE
:
// If the current Item is a pad, text module ...: Get the parent
if
(
GetCurItem
()
->
Type
()
!=
TYPEMODULE
)
SetCurItem
(
GetCurItem
()
->
GetParent
()
);
...
...
@@ -624,7 +669,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
case
ID_POPUP_PCB_DELETE_TEXTMODULE
:
DeleteTextModule
(
(
TEXTE_MODULE
*
)
GetCurItem
(),
&
dc
);
DeleteTextModule
(
(
TEXTE_MODULE
*
)
GetCurItem
(),
&
dc
);
SetCurItem
(
NULL
);
DrawPanel
->
MouseToCursorSchema
();
break
;
...
...
@@ -752,7 +797,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
if
(
GetCurItem
()
&&
(
GetCurItem
()
->
m_Flags
&
IS_NEW
)
)
{
SetCurItem
(
Del_SegmEdgeZone
(
&
dc
,
(
EDGE_ZONE
*
)
GetCurItem
()
)
);
(
EDGE_ZONE
*
)
GetCurItem
()
)
);
}
break
;
...
...
@@ -931,6 +976,7 @@ static void Process_Move_Item( WinEDA_PcbFrame* frame,
}
}
/***************************************************************/
void
WinEDA_PcbFrame
::
RemoveStruct
(
EDA_BaseStruct
*
Item
,
wxDC
*
DC
)
/***************************************************************/
...
...
@@ -987,7 +1033,7 @@ void WinEDA_PcbFrame::RemoveStruct( EDA_BaseStruct* Item, wxDC* DC )
{
wxString
Line
;
Line
.
Printf
(
wxT
(
"Remove: StructType %d Inattendu"
),
Item
->
Type
()
);
Item
->
Type
()
);
DisplayError
(
this
,
Line
);
}
break
;
...
...
share/drawframe.cpp
View file @
06c9f9c8
...
...
@@ -56,7 +56,7 @@ WinEDA_DrawFrame::WinEDA_DrawFrame( wxWindow* father, int idtype,
DrawPanel
=
NULL
;
MsgPanel
=
NULL
;
m_CurrentScreen
=
NULL
;
m_MenuBar
=
NULL
;
// m
enu du haut d'ecran
m_MenuBar
=
NULL
;
// m
ain meun frame
m_ID_current_state
=
0
;
m_HTOOL_current_state
=
0
;
m_Draw_Axis
=
FALSE
;
// TRUE pour avoir les axes dessines
...
...
@@ -66,8 +66,8 @@ WinEDA_DrawFrame::WinEDA_DrawFrame( wxWindow* father, int idtype,
m_Draw_Auxiliary_Axis
=
FALSE
;
// TRUE pour avoir les axes auxiliares dessines
m_UnitType
=
INTERNAL_UNIT_TYPE
;
// Internal unit = inch
//
nombre d'unites internes pour 1 pouce
// = 1000
pour schema, = 10000 pou
r PCB
//
Internal units per inch
// = 1000
for schema, = 10000 fo
r PCB
m_InternalUnits
=
EESCHEMA_INTERNAL_UNIT
;
if
(
(
m_Ident
==
PCB_FRAME
)
||
(
m_Ident
==
GERBER_FRAME
)
||
(
m_Ident
==
CVPCB_DISPLAY_FRAME
)
...
...
@@ -111,7 +111,7 @@ WinEDA_DrawFrame::WinEDA_DrawFrame( wxWindow* father, int idtype,
WinEDA_DrawFrame
::~
WinEDA_DrawFrame
()
/****************************************/
{
if
(
DrawPanel
)
//
for WinEDA3D_DrawFrame
DrawPanel == NULL !
if
(
DrawPanel
)
//
Required: in WinEDA3D_DrawFrame,
DrawPanel == NULL !
m_Parent
->
m_EDA_Config
->
Write
(
wxT
(
"AutoPAN"
),
DrawPanel
->
m_AutoPAN_Enable
);
}
...
...
@@ -177,7 +177,7 @@ void WinEDA_DrawFrame::Affiche_Message( const wxString& message )
/**************************************************************/
/*
*
Affiche un message en bas de l'ecran
*
Dispaly the meesage on yhe bottomon the frame
*/
{
SetStatusText
(
message
);
...
...
@@ -216,40 +216,45 @@ void WinEDA_DrawFrame::OnMenuOpen( wxMenuEvent& event )
/*******************************************************/
void
WinEDA_DrawFrame
::
ReCreateAuxiliaryToolbar
()
// fonction virtuelle
void
WinEDA_DrawFrame
::
ReCreateAuxiliaryToolbar
()
/*******************************************************/
// Virtual function
{
}
/********************************************/
void
WinEDA_DrawFrame
::
ReCreateMenuBar
()
// fonction virtuelle
void
WinEDA_DrawFrame
::
ReCreateMenuBar
()
/********************************************/
// Virtual function
{
}
/****************************************************/
void
WinEDA_DrawFrame
::
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
)
// fonction virtuelle
EDA_BaseStruct
*
DrawStruct
)
/****************************************************/
// Virtual function
{
}
/**************************************************************/
void
WinEDA_DrawFrame
::
ToolOnRightClick
(
wxCommandEvent
&
event
)
// fonction virtuelle
void
WinEDA_DrawFrame
::
ToolOnRightClick
(
wxCommandEvent
&
event
)
/**************************************************************/
// Virtual function
{
}
/********************************************************/
void
WinEDA_DrawFrame
::
OnSelectGrid
(
wxCommandEvent
&
event
)
// fonction virtuelle
void
WinEDA_DrawFrame
::
OnSelectGrid
(
wxCommandEvent
&
event
)
/********************************************************/
// Virtual function
{
if
(
m_SelGridBox
==
NULL
)
return
;
//
Ne devrait pas se produire!
return
;
//
Should not occurs
int
id
=
m_SelGridBox
->
GetChoice
();
if
(
id
<
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment