KiCad PCB EDA Suite
Loading...
Searching...
No Matches
database_lib_settings.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2022 Jon Evans <[email protected]>
5 * Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef KICAD_DATABASE_LIB_SETTINGS_H
22#define KICAD_DATABASE_LIB_SETTINGS_H
23
25#include <wx/string.h>
26
27
29{
30 ODBC,
32};
33
34
36{
38 std::string dsn;
39 std::string username;
40 std::string password;
42 std::string connection_string;
43};
44
45
47{
48 std::string column;
49 std::string name;
50 wxString name_wx;
53 bool show_name;
55
56 explicit DATABASE_FIELD_MAPPING( std::string aColumn, std::string aName, bool aVisibleOnAdd,
57 bool aVisibleInChooser, bool aShowName,
58 bool aInheritProperties );
59};
60
61
63{
64 std::string description;
65 std::string footprint_filters;
66 std::string keywords;
67 std::string exclude_from_sim;
68 std::string exclude_from_bom;
69 std::string exclude_from_board;
70};
71
72
87{
88 std::string name;
89 std::string table;
90 std::string key_col;
91 std::string symbols_col;
92 std::string footprints_col;
93
95 std::vector<DATABASE_FIELD_MAPPING> fields;
96};
97
98
100{
103};
104
105
107{
108public:
109 DATABASE_LIB_SETTINGS( const std::string& aFilename );
110
112
114
115 std::vector<DATABASE_LIB_TABLE> m_Tables;
116
118
119protected:
120 wxString getFileExt() const override;
121};
122
123#endif //KICAD_DATABASE_LIB_SETTINGS_H
std::vector< DATABASE_LIB_TABLE > m_Tables
DATABASE_CACHE_SETTINGS m_Cache
DATABASE_SOURCE_TYPE
#define KICOMMON_API
Definition: kicommon.h:28
int max_age
Max age of cached rows before they expire, in seconds.
int max_size
Maximum number of single-row results to cache.
bool visible_in_chooser
Whether the column is shown by default in the chooser.
std::string column
Database column name.
std::string name
KiCad field name.
bool inherit_properties
Whether or not to inherit properties from symbol field.
bool visible_on_add
Whether to show the field when placing the symbol.
bool show_name
Whether or not to show the field name as well as its value.
wxString name_wx
KiCad field name (converted)
A database library table will be mapped to a sub-library provided by the database library entry in th...
std::string key_col
Unique key column name (will form part of the LIB_ID)
std::string name
KiCad library nickname (will form part of the LIB_ID)
std::string symbols_col
Column name containing KiCad symbol refs.
std::string footprints_col
Column name containing KiCad footprint refs.
std::vector< DATABASE_FIELD_MAPPING > fields
std::string table
Database table to pull content from.
MAPPABLE_SYMBOL_PROPERTIES properties
std::string connection_string
DATABASE_SOURCE_TYPE type