2020-07-12 16:58:35 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2020-09-06 17:00:02 +00:00
|
|
|
* Copyright (C) 2020 Roberto Fernandez Bautista <roberto.fer.bau@gmail.com>
|
2020-07-12 16:58:35 +00:00
|
|
|
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file cadstar_pcb_archive_plugin.h
|
2020-12-18 15:40:13 +00:00
|
|
|
* @brief Pcbnew #PLUGIN for CADSTAR PCB Archive (*.cpa) format: an ASCII format
|
2020-07-12 16:58:35 +00:00
|
|
|
* based on S-expressions.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CADSTAR_ARCHIVE_PLUGIN_H_
|
|
|
|
#define CADSTAR_ARCHIVE_PLUGIN_H_
|
|
|
|
|
|
|
|
|
|
|
|
#include <io_mgr.h>
|
2020-10-01 22:47:38 +00:00
|
|
|
#include <layers_id_colors_and_visibility.h> // PCB_LAYER_ID
|
2020-10-09 16:58:21 +00:00
|
|
|
#include <plugins/common/plugin_common_layer_mapping.h>
|
2020-10-01 22:47:38 +00:00
|
|
|
|
|
|
|
|
2020-10-09 16:58:21 +00:00
|
|
|
class CADSTAR_PCB_ARCHIVE_PLUGIN : public PLUGIN, public LAYER_REMAPPABLE_PLUGIN
|
2020-07-12 16:58:35 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
const wxString PluginName() const override;
|
|
|
|
|
|
|
|
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe,
|
2021-06-23 22:53:08 +00:00
|
|
|
const PROPERTIES* aProperties = nullptr, PROJECT* aProject = nullptr,
|
|
|
|
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
2020-07-12 16:58:35 +00:00
|
|
|
|
|
|
|
const wxString GetFileExtension() const override;
|
|
|
|
|
|
|
|
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
|
|
|
|
{
|
|
|
|
// No support for libraries....
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-01-31 21:55:51 +00:00
|
|
|
std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
|
|
|
|
|
2020-10-01 22:47:38 +00:00
|
|
|
/**
|
2020-12-18 15:40:13 +00:00
|
|
|
* Return the automapped layers.
|
|
|
|
*
|
2020-10-09 16:58:21 +00:00
|
|
|
* @param aInputLayerDescriptionVector
|
2020-10-01 22:47:38 +00:00
|
|
|
* @return Auto-mapped layers
|
|
|
|
*/
|
2020-10-09 16:58:21 +00:00
|
|
|
static std::map<wxString, PCB_LAYER_ID> DefaultLayerMappingCallback(
|
2020-10-01 22:47:38 +00:00
|
|
|
const std::vector<INPUT_LAYER_DESC>& aInputLayerDescriptionVector );
|
|
|
|
|
|
|
|
/**
|
2020-12-18 15:40:13 +00:00
|
|
|
* Register a different handler to be called when mapping of Cadstar to KiCad layers occurs.
|
|
|
|
*
|
2020-10-09 16:58:21 +00:00
|
|
|
* @param aLayerMappingHandler
|
2020-10-01 22:47:38 +00:00
|
|
|
*/
|
2020-10-09 16:58:21 +00:00
|
|
|
void RegisterLayerMappingCallback( LAYER_MAPPING_HANDLER aLayerMappingHandler ) override;
|
2020-10-01 22:47:38 +00:00
|
|
|
|
2020-07-12 16:58:35 +00:00
|
|
|
CADSTAR_PCB_ARCHIVE_PLUGIN();
|
|
|
|
~CADSTAR_PCB_ARCHIVE_PLUGIN();
|
|
|
|
|
|
|
|
private:
|
2021-01-31 21:55:51 +00:00
|
|
|
void clearLoadedFootprints();
|
|
|
|
|
|
|
|
const PROPERTIES* m_props;
|
|
|
|
BOARD* m_board;
|
|
|
|
std::vector<FOOTPRINT*> m_loaded_footprints;
|
|
|
|
bool m_show_layer_mapping_warnings;
|
2020-07-12 16:58:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CADSTAR_ARCHIVE_PLUGIN_H_
|