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
51fc26e1
Commit
51fc26e1
authored
Aug 14, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mouse synchronization from PCBNEW to EESCHEMA
parent
b0b3a6d5
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1436 additions
and
1250 deletions
+1436
-1250
eda_dde.cpp
common/eda_dde.cpp
+153
-146
controle.cpp
eeschema/controle.cpp
+362
-323
eeschema.cpp
eeschema/eeschema.cpp
+9
-2
find.cpp
eeschema/find.cpp
+496
-431
protos.h
eeschema/protos.h
+4
-0
schframe.cpp
eeschema/schframe.cpp
+3
-0
appl_wxstruct.h
include/appl_wxstruct.h
+70
-72
common.h
include/common.h
+235
-238
eda_dde.h
include/eda_dde.h
+11
-8
wxstruct.h
include/wxstruct.h
+19
-1
class_text_mod.h
pcbnew/class_text_mod.h
+8
-0
controle.cpp
pcbnew/controle.cpp
+34
-26
edit.cpp
pcbnew/edit.cpp
+28
-1
files.cpp
pcbnew/files.cpp
+3
-1
protos.h
pcbnew/protos.h
+1
-1
No files found.
common/eda_dde.cpp
View file @
51fc26e1
This diff is collapsed.
Click to expand it.
eeschema/controle.cpp
View file @
51fc26e1
This diff is collapsed.
Click to expand it.
eeschema/eeschema.cpp
View file @
51fc26e1
...
...
@@ -20,10 +20,10 @@
#include "netlist.h"
#include "worksheet.h"
#include "trigo.h"
#include "protos.h"
#include "bitmaps.h"
#include "eda_dde.h"
/* Routines locales */
static
void
CreateScreens
(
void
);
...
...
@@ -72,6 +72,13 @@ wxString FFileName;
SetTopWindow
(
SchematicFrame
);
SchematicFrame
->
Show
(
TRUE
);
if
(
CreateServer
(
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
);
/* Load file specified in the command line. */
...
...
eeschema/find.cpp
View file @
51fc26e1
This diff is collapsed.
Click to expand it.
eeschema/protos.h
View file @
51fc26e1
...
...
@@ -456,4 +456,8 @@ void InstallFindFrame(WinEDA_SchematicFrame *parent, wxPoint &pos);
/***************/
void
DisplayOptionFrame
(
WinEDA_DrawFrame
*
parent
,
const
wxPoint
&
framepos
);
/****************/
/* CONTROLE.CPP */
/****************/
void
RemoteCommand
(
const
char
*
cmdline
);
eeschema/schframe.cpp
View file @
51fc26e1
...
...
@@ -26,6 +26,9 @@
BEGIN_EVENT_TABLE
(
WinEDA_SchematicFrame
,
wxFrame
)
COMMON_EVENTS_DRAWFRAME
EVT_SOCKET
(
ID_EDA_SOCKET_EVENT_SERV
,
WinEDA_DrawFrame
::
OnSockRequestServer
)
EVT_SOCKET
(
ID_EDA_SOCKET_EVENT
,
WinEDA_DrawFrame
::
OnSockRequest
)
EVT_CLOSE
(
WinEDA_SchematicFrame
::
OnCloseWindow
)
EVT_SIZE
(
WinEDA_SchematicFrame
::
OnSize
)
...
...
include/appl_wxstruct.h
View file @
51fc26e1
/************************************************************/
/* appl_wxstruct.h: */
/* descriptions des principales classes derivees utilisees: */
/* Class "EDA_Appl: classe de l'application generale */
/************************************************************/
/************************************************************/
/* appl_wxstruct.h: */
/* descriptions des principales classes derivees utilisees: */
/* Class "EDA_Appl: classe de l'application generale */
/************************************************************/
/* Ce fichier doit etre inclus dans "wxstruct.h"
*/
*/
#ifndef APPL_WXSTRUCT_H
#define APPL_WXSTRUCT_H
...
...
@@ -15,79 +15,77 @@
#endif
/**********************************************/
/* Class representing the entire Application */
/**********************************************/
eda_global
WinEDA_App
*
EDA_Appl
;
/* application representant le programme */
/**********************************************/
/* Class representing the entire Application */
/**********************************************/
eda_global
WinEDA_App
*
EDA_Appl
;
/* application representant le programme */
class
WinEDA_App
:
public
wxApp
class
WinEDA_App
:
public
wxApp
{
public
:
wxString
m_Project
;
wxSingleInstanceChecker
*
m_Checker
;
WinEDA_MainFrame
*
m_MainFrame
;
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_CvpcbFrame
*
m_CvpcbFrame
;
wxPoint
m_HelpPos
;
wxSize
m_HelpSize
;
wxHtmlHelpController
*
m_HtmlCtrl
;
wxConfig
*
m_EDA_Config
;
// Config courante (tailles et positions fenetres ...*/
wxConfig
*
m_EDA_CommonConfig
;
// common setup (language ...) */
wxString
m_HelpFileName
;
wxString
m_CurrentOptionFile
;
// dernier fichier .cnf utilis
wxString
m_CurrentOptionFileDateAndTime
;
wxString
m_BinDir
;
/* Chemin ou reside l'executable
(utilis si KICAD non dfini)*/
wxArrayString
m_LastProject
;
/* liste des derniers projets chargs */
unsigned
int
m_LastProjectMaxCount
;
/* Max histhory file length */
wxString
m_KicadEnv
;
/* Chemin de kicad dfini dans la variable
d'environnement KICAD,
typiquement /usr/local/kicad ou c:\kicad */
bool
m_Env_Defined
;
// TRUE si variable d'environnement KICAD definie
wxLocale
*
m_Locale
;
// Gestion de la localisation
int
m_LanguageId
;
// indicateur de choix du langage ( 0 = defaut)
wxMenu
*
m_Language_Menu
;
// List menu for languages
wxString
m_PdfBrowser
;
// Name of the selected browser, for browsing pdf datasheets
bool
m_PdfBrowserIsDefault
;
// True if the pdf browser is the default (m_PdfBrowser not used)
wxString
m_Project
;
wxSingleInstanceChecker
*
m_Checker
;
WinEDA_MainFrame
*
m_MainFrame
;
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_CvpcbFrame
*
m_CvpcbFrame
;
wxPoint
m_HelpPos
;
wxSize
m_HelpSize
;
wxHtmlHelpController
*
m_HtmlCtrl
;
wxConfig
*
m_EDA_Config
;
// Config courante (tailles et positions fenetres ...*/
wxConfig
*
m_EDA_CommonConfig
;
// common setup (language ...) */
wxString
m_HelpFileName
;
wxString
m_CurrentOptionFile
;
// dernier fichier .cnf utilis
wxString
m_CurrentOptionFileDateAndTime
;
wxString
m_BinDir
;
/* Chemin ou reside l'executable
*
(utilis si KICAD non dfini)*/
wxArrayString
m_LastProject
;
/* liste des derniers projets chargs */
unsigned
int
m_LastProjectMaxCount
;
/* Max histhory file length */
wxString
m_KicadEnv
;
/* Chemin de kicad dfini dans la variable
*
d'environnement KICAD,
*
typiquement /usr/local/kicad ou c:\kicad */
bool
m_Env_Defined
;
// TRUE si variable d'environnement KICAD definie
wxLocale
*
m_Locale
;
// Gestion de la localisation
int
m_LanguageId
;
// indicateur de choix du langage ( 0 = defaut)
wxMenu
*
m_Language_Menu
;
// List menu for languages
wxString
m_PdfBrowser
;
// Name of the selected browser, for browsing pdf datasheets
bool
m_PdfBrowserIsDefault
;
// True if the pdf browser is the default (m_PdfBrowser not used)
public
:
WinEDA_App
(
void
);
~
WinEDA_App
(
void
);
bool
OnInit
(
void
);
int
OnRun
(
void
);
bool
SetBinDir
(
void
);
void
InitEDA_Appl
(
const
wxString
&
name
);
bool
SetLanguage
(
bool
first_time
=
FALSE
);
wxMenu
*
SetLanguageList
(
wxMenu
*
MasterMenu
);
void
SetLanguageIdentifier
(
int
menu_id
);
void
InitOnLineHelp
(
void
);
// Sauvegarde de configurations et options:
void
GetSettings
(
void
);
void
SaveSettings
(
void
);
void
SetLastProject
(
const
wxString
&
FullFileName
);
void
WriteProjectConfig
(
const
wxString
&
local_config_filename
,
const
wxString
&
GroupName
,
PARAM_CFG_BASE
**
List
);
bool
ReadProjectConfig
(
const
wxString
&
local_config_filename
,
const
wxString
&
GroupName
,
PARAM_CFG_BASE
**
List
,
bool
Load_Only_if_New
);
void
ReadPdfBrowserInfos
(
void
);
void
WritePdfBrowserInfos
(
void
);
WinEDA_App
(
void
);
~
WinEDA_App
(
void
);
bool
OnInit
(
void
);
int
OnRun
(
void
);
bool
SetBinDir
(
void
);
void
InitEDA_Appl
(
const
wxString
&
name
);
bool
SetLanguage
(
bool
first_time
=
FALSE
);
wxMenu
*
SetLanguageList
(
wxMenu
*
MasterMenu
);
void
SetLanguageIdentifier
(
int
menu_id
);
void
InitOnLineHelp
(
void
);
// Sauvegarde de configurations et options:
void
GetSettings
(
void
);
void
SaveSettings
(
void
);
void
SetLastProject
(
const
wxString
&
FullFileName
);
void
WriteProjectConfig
(
const
wxString
&
local_config_filename
,
const
wxString
&
GroupName
,
PARAM_CFG_BASE
**
List
);
bool
ReadProjectConfig
(
const
wxString
&
local_config_filename
,
const
wxString
&
GroupName
,
PARAM_CFG_BASE
**
List
,
bool
Load_Only_if_New
);
void
ReadPdfBrowserInfos
(
void
);
void
WritePdfBrowserInfos
(
void
);
};
#endif
/* APPL_WXSTRUCT_H */
include/common.h
View file @
51fc26e1
This diff is collapsed.
Click to expand it.
include/eda_dde.h
View file @
51fc26e1
...
...
@@ -11,17 +11,20 @@
#define WinEDA_Server wxSocketServer
/********************/
/* autres fonctions */
/********************/
WinEDA_Server
*
CreateServer
(
wxWindow
*
window
,
int
service
);
bool
SendCommand
(
int
service
,
char
*
cmdline
);
void
SetupServerFunction
(
void
(
*
remotefct
)(
char
*
remotecmd
)
);
// TCP/IP ports used by PCBNEW and EESCHEMA respectively.
#define KICAD_PCB_PORT_SERVICE_NUMBER 4242 ///< PCBNEW listens on this port for commands from EESCHEMA
#define KICAD_SCH_PORT_SERVICE_NUMBER 4243 ///< EESCHEMA listens on this port for commands from PCBNEW
#define MSG_TO_PCB KICAD_PCB_PORT_SERVICE_NUMBER
#define MSG_TO_SCH KICAD_SCH_PORT_SERVICE_NUMBER
/********************/
/* autres fonctions */
/********************/
WinEDA_Server
*
CreateServer
(
wxWindow
*
window
,
int
port
);
bool
SendCommand
(
int
port
,
const
char
*
cmdline
);
void
SetupServerFunction
(
void
(
*
remotefct
)
(
const
char
*
remotecmd
)
);
include/wxstruct.h
View file @
51fc26e1
...
...
@@ -700,6 +700,14 @@ public:
// divers
void
InstallFindFrame
(
const
wxPoint
&
pos
,
wxDC
*
DC
);
/**
* Function SendMessageToEESCHEMA
* sends a message to the schematic editor so that it may move its cursor
* to a part with the same reference as the objectToSync
* @param objectToSync The object whose reference is used to syncronize eeschema.
*/
void
SendMessageToEESCHEMA
(
EDA_BaseStruct
*
objectToSync
);
/* Special micro_ondes */
void
Edit_Gap
(
wxDC
*
DC
,
MODULE
*
Module
);
MODULE
*
Create_MuWaveBasicShape
(
wxDC
*
DC
,
const
wxString
&
name
,
int
pad_count
);
...
...
@@ -974,7 +982,17 @@ public:
bool
LoadOneSheet
(
SCH_SCREEN
*
screen
,
const
wxString
&
FullFileName
);
// General search:
EDA_BaseStruct
*
FindSchematicItem
(
const
wxString
&
pattern
,
int
SearchType
);
/**
* Function FindSchematicItem
* finds a string in the schematic.
* @param pattern The text to search for, either in value, reference or elsewhere.
* @param SearchType: 0 => Search is made in current sheet
* 1 => the whole hierarchy
* 2 => or for the next item
* @param mouseWarp If true, then move the mouse cursor to the item.
*/
EDA_BaseStruct
*
FindSchematicItem
(
const
wxString
&
pattern
,
int
SearchType
,
bool
mouseWarp
=
true
);
EDA_BaseStruct
*
FindMarker
(
int
SearchType
);
private
:
...
...
pcbnew/class_text_mod.h
View file @
51fc26e1
...
...
@@ -2,6 +2,11 @@
/* class_text_module.h : texts module description */
/***************************************************/
#ifndef TEXT_MODULE_H
#define TEXT_MODULE_H
/* Description des Textes sur Modules : */
#define TEXT_is_REFERENCE 0
#define TEXT_is_VALUE 1
...
...
@@ -80,3 +85,6 @@ public:
virtual
void
Show
(
int
nestLevel
,
std
::
ostream
&
os
);
#endif
};
#endif // TEXT_MODULE_H
pcbnew/controle.cpp
View file @
51fc26e1
...
...
@@ -22,53 +22,57 @@
/* Variables Locales */
/**********************************/
void
RemoteCommand
(
char
*
cmdline
)
void
RemoteCommand
(
c
onst
c
har
*
cmdline
)
/**********************************/
/* Read a remote command send by eeschema via a socket,
* port KICAD_PCB_PORT_SERVICE_NUMBER (currently 4242)
*/
{
char
L
ine
[
1024
];
char
l
ine
[
1024
];
wxString
msg
;
char
*
idcmd
,
*
text
;
WinEDA_PcbFrame
*
frame
=
EDA_Appl
->
m_PcbFrame
;
strncpy
(
Line
,
cmdline
,
sizeof
(
L
ine
)
-
1
);
msg
=
CONV_FROM_UTF8
(
L
ine
);
strncpy
(
line
,
cmdline
,
sizeof
(
l
ine
)
-
1
);
msg
=
CONV_FROM_UTF8
(
l
ine
);
idcmd
=
strtok
(
L
ine
,
"
\n\r
"
);
idcmd
=
strtok
(
l
ine
,
"
\n\r
"
);
text
=
strtok
(
NULL
,
"
\n\r
"
);
if
(
(
idcmd
==
NULL
)
||
(
text
==
NULL
)
)
return
;
if
(
strcmp
(
idcmd
,
"$PART:"
)
==
0
)
{
MODULE
*
Module
;
msg
=
CONV_FROM_UTF8
(
text
);
Module
=
ReturnModule
(
frame
->
m_Pcb
,
msg
);
MODULE
*
module
=
ReturnModule
(
frame
->
m_Pcb
,
msg
);
msg
.
Printf
(
_
(
"Locate module %s %s"
),
msg
.
GetData
(),
Module
?
wxT
(
"Ok"
)
:
wxT
(
"not found"
)
);
module
?
wxT
(
"Ok"
)
:
wxT
(
"not found"
)
);
frame
->
Affiche_Message
(
msg
);
if
(
M
odule
)
if
(
m
odule
)
{
wxClientDC
dc
(
frame
->
DrawPanel
);
frame
->
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
frame
->
DrawPanel
->
CursorOff
(
&
dc
);
frame
->
GetScreen
()
->
m_Curseur
=
M
odule
->
m_Pos
;
frame
->
GetScreen
()
->
m_Curseur
=
m
odule
->
m_Pos
;
frame
->
DrawPanel
->
CursorOn
(
&
dc
);
}
}
if
(
idcmd
&&
strcmp
(
idcmd
,
"$PIN:"
)
==
0
)
{
wxString
PinName
,
M
odName
;
MODULE
*
M
odule
;
D_PAD
*
Pad
=
NULL
;
wxString
pinName
,
m
odName
;
MODULE
*
m
odule
;
D_PAD
*
pad
=
NULL
;
int
netcode
=
-
1
;
PinName
=
CONV_FROM_UTF8
(
text
);
text
=
strtok
(
NULL
,
"
\n\r
"
);
pinName
=
CONV_FROM_UTF8
(
text
);
text
=
strtok
(
NULL
,
"
\n\r
"
);
if
(
text
&&
strcmp
(
text
,
"$PART:"
)
==
0
)
text
=
strtok
(
NULL
,
"
\n\r
"
);
...
...
@@ -76,30 +80,34 @@ void RemoteCommand( char* cmdline )
frame
->
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
ModName
=
CONV_FROM_UTF8
(
text
);
Module
=
ReturnModule
(
frame
->
m_Pcb
,
ModName
);
if
(
Module
)
Pad
=
ReturnPad
(
Module
,
PinName
);
if
(
Pad
)
netcode
=
Pad
->
m_NetCode
;
modName
=
CONV_FROM_UTF8
(
text
);
module
=
ReturnModule
(
frame
->
m_Pcb
,
modName
);
if
(
module
)
pad
=
ReturnPad
(
module
,
pinName
);
if
(
pad
)
netcode
=
pad
->
m_NetCode
;
if
(
netcode
>
0
)
{
/* effacement surbrillance ancienne */
if
(
g_HightLigt_Status
)
frame
->
Hight_Light
(
&
dc
);
g_HightLigth_NetCode
=
netcode
;
frame
->
Hight_Light
(
&
dc
);
frame
->
DrawPanel
->
CursorOff
(
&
dc
);
frame
->
GetScreen
()
->
m_Curseur
=
P
ad
->
m_Pos
;
frame
->
GetScreen
()
->
m_Curseur
=
p
ad
->
m_Pos
;
frame
->
DrawPanel
->
CursorOn
(
&
dc
);
}
if
(
M
odule
==
NULL
)
if
(
m
odule
==
NULL
)
msg
.
Printf
(
_
(
"module %s not found"
),
text
);
else
if
(
P
ad
==
NULL
)
msg
.
Printf
(
_
(
"Pin %s (module %s) not found"
),
PinName
.
GetData
(),
M
odName
.
GetData
()
);
else
if
(
p
ad
==
NULL
)
msg
.
Printf
(
_
(
"Pin %s (module %s) not found"
),
pinName
.
GetData
(),
m
odName
.
GetData
()
);
else
msg
.
Printf
(
_
(
"Locate Pin %s (module %s)"
),
PinName
.
GetData
(),
M
odName
.
GetData
()
);
msg
.
Printf
(
_
(
"Locate Pin %s (module %s)"
),
pinName
.
GetData
(),
m
odName
.
GetData
()
);
frame
->
Affiche_Message
(
msg
);
}
}
...
...
pcbnew/edit.cpp
View file @
51fc26e1
...
...
@@ -11,8 +11,9 @@
#include "autorout.h"
#include "id.h"
#include "protos.h"
#include "eda_dde.h"
#define CURRENT_ITEM (GetScreen()->m_CurrentItem)
...
...
@@ -94,6 +95,8 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
else
{
DrawStruct
=
PcbGeneralLocateAndDisplay
();
if
(
DrawStruct
)
SendMessageToEESCHEMA
(
DrawStruct
);
}
}
...
...
@@ -128,6 +131,9 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
DrawStruct
=
m_Pcb
->
FindPadOrModule
(
GetScreen
()
->
RefPos
(
true
),
GetScreen
()
->
m_Active_Layer
);
Show_1_Ratsnest
(
DrawStruct
,
DC
);
if
(
DrawStruct
)
SendMessageToEESCHEMA
(
DrawStruct
);
break
;
case
ID_PCB_MIRE_BUTT
:
...
...
@@ -311,6 +317,27 @@ out:
}
// see wxstruct.h
void
WinEDA_PcbFrame
::
SendMessageToEESCHEMA
(
EDA_BaseStruct
*
objectToSync
)
{
char
cmd
[
1024
];
MODULE
*
module
=
NULL
;
if
(
objectToSync
->
m_StructType
==
TYPEMODULE
)
module
=
(
MODULE
*
)
objectToSync
;
else
if
(
objectToSync
->
m_StructType
==
TYPEPAD
)
module
=
(
MODULE
*
)((
D_PAD
*
)
objectToSync
)
->
m_Parent
;
// 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
)
/*********************************************************************/
...
...
pcbnew/files.cpp
View file @
51fc26e1
...
...
@@ -235,7 +235,9 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC* DC, boo
g_SaveTime
=
time
(
NULL
);
#if defined(DEBUG)
#if 0 && defined(DEBUG)
// note this seems to freeze up pcbnew when run under the kicad project
// manager. runs fine from command prompt.
// output the board object tree to stdout:
m_Pcb->Show( 0, std::cout );
#endif
...
...
pcbnew/protos.h
View file @
51fc26e1
...
...
@@ -394,7 +394,7 @@ TRACK * CreateLockPoint(int *pX, int *pY, TRACK * ptsegm, TRACK * refsegm);
/****************/
/* CONTROLE.CPP */
/****************/
void
RemoteCommand
(
char
*
cmdline
);
void
RemoteCommand
(
const
char
*
cmdline
);
/*************/
/* STRUCT.CPP */
...
...
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