In the component, an m_unit/m_convert element is 1-indexed as opposed to
the library where they are 0-indexed. The 0-index in the library is
reserved for those elements that are shared across all conversion/unit
whereas it is invalid for the component.
Fixes: lp:1824764
* https://bugs.launchpad.net/kicad/+bug/1824764
The dialog was using a LIB_ALIAS from library cache to show the symbol to the canvas without making a local copy.
Unfortunately, the library viewer is doing the same thing.
Now the GAL is used in Eeschema, a link to the VIEW used by the GAL canvas is stored in this class.
When The selector symbol dialog is used to choose a symbol to display in the Library viewer,
a race condition between the Library viewer GAL canvas and the dtor dialog that destroyed this link in the same instancied class.
Now, the SYMBOL_PREVIEW_WIDGET used in the dialog works on a local copy of the symbol to display.
Also removes parallel implementation in favour of using the
normal one (with a new wxGauge-backed PROGRESS_REPORTER).
Fixes: lp:1764196
* https://bugs.launchpad.net/kicad/+bug/1764196
Change all of the component tree helper objects to use LIB_IDs instead of
LIB_ALIAS pointers. LIB_ALIAS pointers are dangerous to use because they
can be deleted in the symbol library editor while the component chooser
dialog has copies of them. With LIB_IDs, the LIB_ALIAS pointer is found
on demand and can be guaranteed to be valid.
Update the chooser dialog to load the symbol library table instead of the
libraries defined in the project file and return a LIB_ID instead of a
LIB_ALIAS pointer.
Modify SCH_BASE_FRAME::SelectComponentFromLibrary() to handle the LIB_IDs
returned from the component chooser dialog.
Remove all instances of PART_LIBS and replace them with SYMBOL_LIB_TABLE
except for the CMP_TREE_MODEL_ADAPTER which requires updating as well.
Return the selected symbol using the LIB_NICKNAME:SYMBOL_NAME format when
viewer is launched as modal.
Add code to SYMBOL_LIB_TABLE object to allow enumerating symbol library
power symbols only.
Add a non-const version of LIB_TABLE::findRow().
Remove redundant information from Doxygen comments.
- DIALOG_CHOOSE_COMPONENT has footprint select widget
- FOOTPRINT_SELECT_WIDGET
- FOOTPRINT_CHOICE widget (customized wxComboCtrl)
- FOOTPRINT_FILTER class
- FOOTPRINT_INFO rework:
- FOOTPRINT_ASYNC_LOADER to load without freezing UI
- Rewrite loader threads as queue-driven thread pool
- Make FOOTPRINT_INFO available via kiway
- FP_LIB_TABLE::PrefetchLib
- Access to global fp-lib-table via kiway
- SYNC_QUEUE threadsafe queue template
- Remove KICAD_FOOTPRINT_SELECTOR build option
This refactors COMPONENT_TREE_SEARCH_CONTAINER into a Model-View-Adapter
architecture comprising:
- eeschema/cmp_tree_model.h
- CMP_TREE_NODE: Base class representing a searchable library
set with scoring and sorting
- CMP_TREE_NODE_UNIT
- CMP_TREE_NODE_ALIAS
- CMP_TREE_NODE_LIB
- CMP_TREE_NODE_ROOT
- eeschema/cmp_tree_model_adapter.h
- CMP_TREE_MODEL_ADAPTER: mediator between wxDataViewCtrl (via
wxDataViewModel) and CMP_TREE_NODE*
+---+ +------------------+
+---+ Generates | A | | VIEW |
| M | from libs | D | wxDataViewModel |------------------|
| O | <---------- | A | <------------------> | wxDataViewCtrl |
| D | | P | |------------------|
| E | <---------> | T | <------------------- | wxTextCtrl |
| L | UpdateScore | E | UpdateSearchString() |------------------|
+---+ | R | | |
+---+ +------------------+
Representing the data with a proper model allows the wxDataViewCtrl to
be updated in bulk, which is significantly faster than the old method of
populating it one item at a time. This also adds flexibility if more
data is to be added in the future (which may come in handy with the
upcoming .sweet format, as that adds more ways components can be related
to each other).
Replacing the wxTreeListCtrl with a wxDataViewCtrl also significantly
reduces the general GUI quirkiness, as wxDataViewCtrl is much more well
behaved.
LIB_ID was changing the symbol name due to the parser dropping everything
past the first '/' character which is interpreted by LIB_ID as the item
version. Add flag to ignore this in LIB_ID::SetLibItemName() and add a
new ctor so the library nickname, item name, and revision can be set as
required to prevent the standard LIB_ID parsing.
Fix a few places where PART_LIBS functions FindLibraryAlias() and
FindLibPar() were translating wxString symbol names to LIB_IDs where the
LIB_ID parser was truncating the symbol name.
Select the first library in the list and the first symbol in the first
library if they exist the first time the symbol viewer is opened.
Prevent clicking on the next or previous toolbar buttons from wrapping
past the end of the symbol list to mimic the behavior of the up and down
arrow key strokes.opens a select
library dialog.
Use incriminating or decrementing the current symbol selection when using
the next and previous symbol toolbar buttons rather looking up the next
symbol in the library. Just use the next or previous symbol name in the
list.
Replace the select library and select symbol from library list dialogs
which where redundant with the symbol search dialog used in place symbol
tool in the schematic editor. This gives the user type ahead search and
selects the library and symbol in one dialog.
Move updating toolbar buttons from the ReCreateHToolbar() function into
dedicated wxUpdateUIEvents.
Break Process_Special_Functions() into individual event handlers.
Remove PART_LIB::GetNextEntry() and PART_LIB::GetPreviousEntry() as they
are no longer required due to the changes to the symbol library viewer.
Purge wxT() macros from all modified source files.
Rename PART_LIB GetEntryNames() and RemoveEntry() to GetAliasNames() and
RemoveAlias() respectively for improved readability.
Rename PART_LIBS FindLibraryEntry() to FindLibraryAlias() improved
readability.
Remove commented out PART_LIBS::FindLibraryEntries().
Remove PART_LIB::GetFirstEntry() and update all effect code accordingly.
Remove unused PART_LIB::SetFileName() method.
Remove unused PART_LIBS::RemoveAllLibraries() method.
* Rename redundant function PART_LIB::GetEntry() to PART_LIB::GetAlias() which
is more descriptive and move the GetAlias() function which was nothing more
than a call to GetEntry().
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
* EDA_DRAW_FRAME completely encapsulated except for DrawFrame member.
* Moved members specific to Pcbnew from EDA_DRAW_FRAME to PCB_BASE_FRAME
or PCB_EDIT_FRAME as appropriate.
* Replace EDA_TOOLBAR with wxAuiToolBar as EDA_TOOL bar provided no
additional functionality and made code less readable.
* Remove EDA_TOOLBAR class definition from wxstruct.h and delete file
wineda_toolbar.cpp.
* Rename tool bar members to something more descriptive since the
horizontal and vertical references wont mean anything once the
tool bars are movable.
* Lots of dead code removal.
* Move the hierarchical label connected test into the NETLIST_OBJECT class.
* ERC pin type strings can now be translated.
* Remove unused EDA_DRAW_PANEL attribute from all ERC test functions.
* Add get marker count method to SCH_SCREENS object.
* Redundant header removal.
* Lots of coding style policy fixes.
* Correct all user strings and comments for the correct capitalization of
application names according to JP. They are KiCad, Pcbnew, CvPcb,
Eeschema, and GerbView.
* Add a note the the user interface policy about the correct capitalization.
* Rename all member variables and methods that reference the cross hair
code in draw panel object from cursor to cross hair to eliminate confusion
between the two concepts.
* Rename cursor capture call backs in draw panel object to improve code
readability.
* Create helper class for turning off the cross hair while drawing.
* Remove redundant block clear code.
* Remove redundant mouse capture call back reset code when end capture
call back is called.
* Remove unused function definitions in base draw frame object.
* Lots of minor coding policy and doxygen comment fixes.
* Remove all occurrences if #ifdef USE_WX_ZOOM and all associated code within
the #else/#endif block ( old zoom code ).
* Removed the build option for USE_WX_ZOOM from CMakeList.txt and config.h.in.
* Removed all scaling code in base screen object.
* Fixed buffered paint and buffered client DC on Windows. Buffering works
properly on Linux and Windows.
* Modified kicad_device_context.h to automatically uses buffering on platforms
where double buffering is supported natively.
* Remove all of the scaled versions of the drawing functions in gr_basic.cpp
and any support code.
* Removed all traces of ActiveScreen global variable from eeschema and
gerbview.
* Renamed Recadre_Trace to RedrawScreen in draw frame object.
* Renamed PostDirtyRect to RefreshDrawingRect in draw panel object.
* Lots of code cleaning an Doxygen comment improvements.
* Use C++ map in component library instead of boost::ptr_vector.
* Drop Boost pointer containers for standard C++ containers.
* Moved duplicate name user interface elements from library object to
library editor.
* Added code to support direct addition and replacement of component
alias objects into libraries.
* Removed temporary strings used to add and remove alias objects.
* Libraries only store alias objects, components now accessed thru alias.
* Simplify library API for adding, removing, and replacing components.
* Updated edit component in library dialog and library editor to reflect
component library object changes.
* Fixed bug in library viewer when displaying alias name.
* Made a few header files compile stand alone per the new coding policy.
* Remove some dead code and the usual code formatting fixes.
* Remove redundant background redrawing RedrawActiveWindow.
* Remove redundant managed cursor callback in RedrawActiveWindow.
* Use refresh to redraw instead of directly calling RedrawActiveWindow.
* Remove unused SetDrawBgColor for drawframe.cpp.
* Fix compiler warning in cvpcb/cvframe.cpp.
* Fix menu spelling and syntax errors in pcbnew.
* Rename Trace_Curseur to DrawCursor in common/drawpanel.cpp.