KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pads_common.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef PADS_COMMON_H
21#define PADS_COMMON_H
22
23#include <kiid.h>
24#include <string>
25
26#include <stroke_params.h>
27#include <wx/string.h>
28
37
38namespace PADS_COMMON
39{
40
55KIID GenerateDeterministicUuid( const std::string& aIdentifier );
56
57
67
68
73{
74 wxString pcbFile;
75 wxString schematicFile;
76
77 bool HasPcb() const { return !pcbFile.IsEmpty(); }
78 bool HasSchematic() const { return !schematicFile.IsEmpty(); }
79 bool HasBoth() const { return HasPcb() && HasSchematic(); }
80};
81
82
89PADS_FILE_TYPE DetectPadsFileType( const wxString& aFilePath );
90
91
104RELATED_FILES FindRelatedPadsFiles( const wxString& aFilePath );
105
106
111int ParseInt( const std::string& aStr, int aDefault = 0, const std::string& aContext = {} );
112
117double ParseDouble( const std::string& aStr, double aDefault = 0.0,
118 const std::string& aContext = {} );
119
133wxString ConvertInvertedNetName( const std::string& aNetName );
134
141LINE_STYLE PadsLineStyleToKiCad( int aPadsStyle );
142
143} // namespace PADS_COMMON
144
145#endif // PADS_COMMON_H
PADS_FILE_TYPE
Types of PADS files that can be detected.
Definition pads_common.h:62
@ PCB_ASCII
PADS PowerPCB ASCII (.asc)
Definition pads_common.h:64
@ SCHEMATIC_ASCII
PADS Logic ASCII (.asc or .txt)
Definition pads_common.h:65
RELATED_FILES FindRelatedPadsFiles(const wxString &aFilePath)
Find related PADS project files from a given source file.
int ParseInt(const std::string &aStr, int aDefault, const std::string &aContext)
Parse integer from string with error context.
PADS_FILE_TYPE DetectPadsFileType(const wxString &aFilePath)
Detect the type of a PADS file by examining its header.
wxString ConvertInvertedNetName(const std::string &aNetName)
Convert a PADS net name to KiCad format, handling inverted signal notation.
LINE_STYLE PadsLineStyleToKiCad(int aPadsStyle)
Convert a PADS line style integer to a KiCad LINE_STYLE enum value.
KIID GenerateDeterministicUuid(const std::string &aIdentifier)
Generate a deterministic KIID from a PADS component identifier.
double ParseDouble(const std::string &aStr, double aDefault, const std::string &aContext)
Parse double from string with error context.
LINE_STYLE
Dashed line types.
Result of detecting related PADS project files.
Definition pads_common.h:73
wxString schematicFile
Path to schematic file if found.
Definition pads_common.h:75
wxString pcbFile
Path to PCB file if found.
Definition pads_common.h:74