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
8be73ad0
Commit
8be73ad0
authored
Mar 31, 2015
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KiCad assistant.
parent
a6172bb7
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1187 additions
and
0 deletions
+1187
-0
CMakeLists.txt
bitmaps_png/CMakeLists.txt
+1
-0
paperclip.cpp
bitmaps_png/cpp_other/paperclip.cpp
+826
-0
paperclip.png
bitmaps_png/sources/paperclip.png
+0
-0
tool_dispatcher.cpp
common/tool/tool_dispatcher.cpp
+7
-0
bitmaps.h
include/bitmaps.h
+1
-0
wxPcbStruct.h
include/wxPcbStruct.h
+5
-0
CMakeLists.txt
pcbnew/CMakeLists.txt
+1
-0
board_undo_redo.cpp
pcbnew/board_undo_redo.cpp
+5
-0
dialog_assistant.cpp
pcbnew/dialogs/dialog_assistant.cpp
+251
-0
dialog_assistant.h
pcbnew/dialogs/dialog_assistant.h
+76
-0
pcbframe.cpp
pcbnew/pcbframe.cpp
+6
-0
router_tool.cpp
pcbnew/router/router_tool.cpp
+4
-0
edit_tool.cpp
pcbnew/tools/edit_tool.cpp
+4
-0
No files found.
bitmaps_png/CMakeLists.txt
View file @
8be73ad0
...
@@ -581,6 +581,7 @@ set( BMAPS_OTHER
...
@@ -581,6 +581,7 @@ set( BMAPS_OTHER
tune_diff_pair_length_legend
tune_diff_pair_length_legend
tune_diff_pair_skew_legend
tune_diff_pair_skew_legend
tune_single_track_length_legend
tune_single_track_length_legend
paperclip
)
)
...
...
bitmaps_png/cpp_other/paperclip.cpp
0 → 100644
View file @
8be73ad0
This diff is collapsed.
Click to expand it.
bitmaps_png/sources/paperclip.png
0 → 100644
View file @
8be73ad0
common/tool/tool_dispatcher.cpp
View file @
8be73ad0
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
#include <boost/optional.hpp>
#include <boost/optional.hpp>
#include <boost/foreach.hpp>
#include <boost/foreach.hpp>
#include <dialogs/dialog_assistant.h>
///> Stores information about a mouse button state
///> Stores information about a mouse button state
struct
TOOL_DISPATCHER
::
BUTTON_STATE
struct
TOOL_DISPATCHER
::
BUTTON_STATE
{
{
...
@@ -330,7 +332,12 @@ void TOOL_DISPATCHER::DispatchWxCommand( wxCommandEvent& aEvent )
...
@@ -330,7 +332,12 @@ void TOOL_DISPATCHER::DispatchWxCommand( wxCommandEvent& aEvent )
boost
::
optional
<
TOOL_EVENT
>
evt
=
COMMON_ACTIONS
::
TranslateLegacyId
(
aEvent
.
GetId
()
);
boost
::
optional
<
TOOL_EVENT
>
evt
=
COMMON_ACTIONS
::
TranslateLegacyId
(
aEvent
.
GetId
()
);
if
(
evt
)
if
(
evt
)
{
PCB_EDIT_FRAME
*
frame
=
dynamic_cast
<
PCB_EDIT_FRAME
*>
(
m_toolMgr
->
GetEditFrame
()
);
if
(
frame
)
frame
->
GetAssistant
()
->
RandomHint
(
KICAD_ASSISTANT
::
TIP_OF_THE_DAY
,
6000
,
10
);
m_toolMgr
->
ProcessEvent
(
*
evt
);
m_toolMgr
->
ProcessEvent
(
*
evt
);
}
else
else
aEvent
.
Skip
();
aEvent
.
Skip
();
}
}
include/bitmaps.h
View file @
8be73ad0
...
@@ -396,6 +396,7 @@ EXTERN_BITMAP( options_track_xpm )
...
@@ -396,6 +396,7 @@ EXTERN_BITMAP( options_track_xpm )
EXTERN_BITMAP
(
options_vias_xpm
)
EXTERN_BITMAP
(
options_vias_xpm
)
EXTERN_BITMAP
(
opt_show_polygon_xpm
)
EXTERN_BITMAP
(
opt_show_polygon_xpm
)
EXTERN_BITMAP
(
orient_xpm
)
EXTERN_BITMAP
(
orient_xpm
)
EXTERN_BITMAP
(
paperclip_xpm
)
EXTERN_BITMAP
(
pad_sketch_xpm
)
EXTERN_BITMAP
(
pad_sketch_xpm
)
EXTERN_BITMAP
(
pad_xpm
)
EXTERN_BITMAP
(
pad_xpm
)
EXTERN_BITMAP
(
pad_dimensions_xpm
)
EXTERN_BITMAP
(
pad_dimensions_xpm
)
...
...
include/wxPcbStruct.h
View file @
8be73ad0
...
@@ -64,6 +64,7 @@ class REPORTER;
...
@@ -64,6 +64,7 @@ class REPORTER;
struct
PARSE_ERROR
;
struct
PARSE_ERROR
;
struct
IO_ERROR
;
struct
IO_ERROR
;
class
FP_LIB_TABLE
;
class
FP_LIB_TABLE
;
class
KICAD_ASSISTANT
;
namespace
PCB
{
struct
IFACE
;
}
// KIFACE_I is in pcbnew.cpp
namespace
PCB
{
struct
IFACE
;
}
// KIFACE_I is in pcbnew.cpp
...
@@ -1729,6 +1730,10 @@ public:
...
@@ -1729,6 +1730,10 @@ public:
*/
*/
void
UpdateTitle
();
void
UpdateTitle
();
KICAD_ASSISTANT
*
GetAssistant
()
{
return
m_assistant
;
}
KICAD_ASSISTANT
*
m_assistant
;
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
...
...
pcbnew/CMakeLists.txt
View file @
8be73ad0
...
@@ -41,6 +41,7 @@ include_directories(
...
@@ -41,6 +41,7 @@ include_directories(
)
)
set
(
PCBNEW_DIALOGS
set
(
PCBNEW_DIALOGS
dialogs/dialog_assistant.cpp
dialogs/dialog_block_options_base.cpp
dialogs/dialog_block_options_base.cpp
dialogs/dialog_cleaning_options_base.cpp
dialogs/dialog_cleaning_options_base.cpp
dialogs/dialog_cleaning_options.cpp
dialogs/dialog_cleaning_options.cpp
...
...
pcbnew/board_undo_redo.cpp
View file @
8be73ad0
...
@@ -47,6 +47,8 @@
...
@@ -47,6 +47,8 @@
#include <tools/selection_tool.h>
#include <tools/selection_tool.h>
#include <tool/tool_manager.h>
#include <tool/tool_manager.h>
#include <dialogs/dialog_assistant.h>
/* Functions to undo and redo edit commands.
/* Functions to undo and redo edit commands.
* commands to undo are stored in CurrentScreen->m_UndoList
* commands to undo are stored in CurrentScreen->m_UndoList
* commands to redo are stored in CurrentScreen->m_RedoList
* commands to redo are stored in CurrentScreen->m_RedoList
...
@@ -640,6 +642,9 @@ void PCB_EDIT_FRAME::RestoreCopyFromUndoList( wxCommandEvent& aEvent )
...
@@ -640,6 +642,9 @@ void PCB_EDIT_FRAME::RestoreCopyFromUndoList( wxCommandEvent& aEvent )
TOOL_EVENT
event
(
TC_MESSAGE
,
TA_UNDO_REDO
,
AS_GLOBAL
);
TOOL_EVENT
event
(
TC_MESSAGE
,
TA_UNDO_REDO
,
AS_GLOBAL
);
m_toolManager
->
ProcessEvent
(
event
);
m_toolManager
->
ProcessEvent
(
event
);
if
(
IsGalCanvasActive
()
)
GetAssistant
()
->
RandomHint
(
KICAD_ASSISTANT
::
UNDO
,
6000
,
10
);
/* Get the old list */
/* Get the old list */
PICKED_ITEMS_LIST
*
List
=
GetScreen
()
->
PopCommandFromUndoList
();
PICKED_ITEMS_LIST
*
List
=
GetScreen
()
->
PopCommandFromUndoList
();
/* Undo the command */
/* Undo the command */
...
...
pcbnew/dialogs/dialog_assistant.cpp
0 → 100644
View file @
8be73ad0
This diff is collapsed.
Click to expand it.
pcbnew/dialogs/dialog_assistant.h
0 → 100644
View file @
8be73ad0
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __DIALOG_ASSISTANT_H__
#define __DIALOG_ASSISTANT_H__
#include <map>
#include <vector>
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/statbmp.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/dialog.h>
#include <wx/frame.h>
#define ASSISTANT_STYLE wxFRAME_TOOL_WINDOW|wxSTAY_ON_TOP|wxFRAME_NO_TASKBAR|wxCLOSE_BOX
class
HINT
;
class
KICAD_ASSISTANT
:
public
wxFrame
{
public
:
enum
HINT_CATEGORY
{
WELCOME
,
TIP_OF_THE_DAY
,
ROUTING
,
UNDO
,
MOVING
};
KICAD_ASSISTANT
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
wxT
(
"KiCad Assistant"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxDefaultSize
,
long
style
=
ASSISTANT_STYLE
|
wxCAPTION
);
~
KICAD_ASSISTANT
();
void
DisplayHint
(
const
wxString
&
aMsg
,
int
aTimeout
=
0
,
int
aChance
=
100
);
void
RandomHint
(
HINT_CATEGORY
aCategory
,
int
aTimeout
=
0
,
int
aChance
=
100
);
void
OnClose
(
wxCloseEvent
&
event
);
void
OnMove
(
wxMoveEvent
&
event
);
void
onButton
(
wxMouseEvent
&
aEvent
);
private
:
protected
:
wxStaticBitmap
*
m_imgPaperclip
;
std
::
map
<
HINT_CATEGORY
,
std
::
vector
<
wxString
>
>
m_hints
;
HINT
*
m_hint
;
wxWindow
*
m_parent
;
};
#endif //__DIALOG_ASSISTANT_H__
pcbnew/pcbframe.cpp
View file @
8be73ad0
...
@@ -53,6 +53,7 @@
...
@@ -53,6 +53,7 @@
#include <module_editor_frame.h>
#include <module_editor_frame.h>
#include <dialog_helpers.h>
#include <dialog_helpers.h>
#include <dialog_plot.h>
#include <dialog_plot.h>
#include <dialog_assistant.h>
#include <convert_from_iu.h>
#include <convert_from_iu.h>
#include <view/view.h>
#include <view/view.h>
#include <view/view_controls.h>
#include <view/view_controls.h>
...
@@ -453,6 +454,10 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
...
@@ -453,6 +454,10 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
setupTools
();
setupTools
();
Zoom_Automatique
(
false
);
Zoom_Automatique
(
false
);
m_assistant
=
new
KICAD_ASSISTANT
(
this
);
m_assistant
->
Show
();
m_assistant
->
RandomHint
(
KICAD_ASSISTANT
::
WELCOME
,
10000
);
}
}
...
@@ -697,6 +702,7 @@ void PCB_EDIT_FRAME::SwitchCanvas( wxCommandEvent& aEvent )
...
@@ -697,6 +702,7 @@ void PCB_EDIT_FRAME::SwitchCanvas( wxCommandEvent& aEvent )
case
ID_MENU_CANVAS_OPENGL
:
case
ID_MENU_CANVAS_OPENGL
:
use_gal
=
GetGalCanvas
()
->
SwitchBackend
(
EDA_DRAW_PANEL_GAL
::
GAL_TYPE_OPENGL
);
use_gal
=
GetGalCanvas
()
->
SwitchBackend
(
EDA_DRAW_PANEL_GAL
::
GAL_TYPE_OPENGL
);
GetAssistant
()
->
DisplayHint
(
"Wooow! OpenGL!
\n
That's cool, it was not here the last time.."
,
5000
);
break
;
break
;
}
}
...
...
pcbnew/router/router_tool.cpp
View file @
8be73ad0
...
@@ -49,6 +49,8 @@
...
@@ -49,6 +49,8 @@
#include "pns_router.h"
#include "pns_router.h"
#include "trace.h"
#include "trace.h"
#include <dialogs/dialog_assistant.h>
using
namespace
KIGFX
;
using
namespace
KIGFX
;
using
boost
::
optional
;
using
boost
::
optional
;
...
@@ -514,6 +516,8 @@ void ROUTER_TOOL::performRouting()
...
@@ -514,6 +516,8 @@ void ROUTER_TOOL::performRouting()
updateEndItem
(
*
evt
);
updateEndItem
(
*
evt
);
bool
needLayerSwitch
=
m_router
->
IsPlacingVia
();
bool
needLayerSwitch
=
m_router
->
IsPlacingVia
();
m_frame
->
GetAssistant
()
->
RandomHint
(
KICAD_ASSISTANT
::
ROUTING
,
6000
,
10
);
if
(
m_router
->
FixRoute
(
m_endSnapPoint
,
m_endItem
)
)
if
(
m_router
->
FixRoute
(
m_endSnapPoint
,
m_endItem
)
)
break
;
break
;
...
...
pcbnew/tools/edit_tool.cpp
View file @
8be73ad0
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
#include <dialogs/dialog_create_array.h>
#include <dialogs/dialog_create_array.h>
#include <dialogs/dialog_move_exact.h>
#include <dialogs/dialog_move_exact.h>
#include <dialogs/dialog_assistant.h>
EDIT_TOOL
::
EDIT_TOOL
()
:
EDIT_TOOL
::
EDIT_TOOL
()
:
TOOL_INTERACTIVE
(
"pcbnew.InteractiveEdit"
),
m_selectionTool
(
NULL
),
TOOL_INTERACTIVE
(
"pcbnew.InteractiveEdit"
),
m_selectionTool
(
NULL
),
...
@@ -248,6 +249,9 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
...
@@ -248,6 +249,9 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
}
}
else
// Prepare to start dragging
else
// Prepare to start dragging
{
{
if
(
!
m_editModules
)
static_cast
<
PCB_EDIT_FRAME
*>
(
editFrame
)
->
GetAssistant
()
->
RandomHint
(
KICAD_ASSISTANT
::
MOVING
,
6000
,
10
);
m_selectionTool
->
SanitizeSelection
();
m_selectionTool
->
SanitizeSelection
();
if
(
selection
.
Empty
()
)
if
(
selection
.
Empty
()
)
...
...
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