KiCad PCB EDA Suite
Loading...
Searching...
No Matches
project_downgrade.h File Reference
#include <vector>
#include <compatibility_report.h>
#include <wx/string.h>

Go to the source code of this file.

Functions

bool ClassifyProjectForDowngrade (KIWAY &aKiway, const wxString &aProjectDir, const wxString &aProjectName, const wxString &aTargetName, COMPATIBILITY_REPORT &aReport, wxString &aError, std::vector< wxString > *aFoundVariants=nullptr, bool aDropInsteadOfApproximate=false, const wxString &aVariant=wxEmptyString)
 Run the board and schematic classification for a whole project without writing anything.
 
bool ExportProjectForDowngrade (KIWAY &aKiway, const wxString &aProjectDir, const wxString &aProjectName, const wxString &aTargetName, const wxString &aDestDir, wxString &aError, const wxString &aVariant=wxEmptyString, bool aDropInsteadOfApproximate=false)
 Export a downgraded copy of the project into aDestDir.
 

Function Documentation

◆ ClassifyProjectForDowngrade()

bool ClassifyProjectForDowngrade ( KIWAY & aKiway,
const wxString & aProjectDir,
const wxString & aProjectName,
const wxString & aTargetName,
COMPATIBILITY_REPORT & aReport,
wxString & aError,
std::vector< wxString > * aFoundVariants = nullptr,
bool aDropInsteadOfApproximate = false,
const wxString & aVariant = wxEmptyString )

Run the board and schematic classification for a whole project without writing anything.

Returns false with aError set when a document or requested variant cannot be exported. When the target drops variants, aFoundVariants receives the schematic's variant names for a picker. Use the same aVariant and aDropInsteadOfApproximate policy for the preview and the real export.

Definition at line 307 of file project_downgrade.cpp.

References _, COMPATIBILITY_REPORT::Add(), BLOCK, FILEEXT::DesignRulesFileExtension, DowngradeProjectFileJson(), DROP, KIWAY::FACE_PCB, KIWAY::FACE_SCH, FilterDrcRulesForTarget(), FindDowngradeTarget(), COMPATIBILITY_REPORT::IsBlocked(), FILEEXT::KiCadPcbFileExtension, FILEEXT::KiCadSchematicFileExtension, legacyLibraryTables(), JOB_PCB_DOWNGRADE::m_dropInsteadOfApproximate, JOB_SCH_DOWNGRADE::m_dropInsteadOfApproximate, DRC_RULES_FILTER_RESULT::m_dropped, JOB_PCB_DOWNGRADE::m_dryRun, JOB_SCH_DOWNGRADE::m_dryRun, DRC_RULES_FILTER_RESULT::m_error, JOB_PCB_DOWNGRADE::m_filename, JOB_SCH_DOWNGRADE::m_filename, JOB_SCH_DOWNGRADE::m_foundVariants, JOB_PCB_DOWNGRADE::m_libraryDir, JOB_SCH_DOWNGRADE::m_libraryDir, JOB_PCB_DOWNGRADE::m_report, JOB_SCH_DOWNGRADE::m_report, JOB_PCB_DOWNGRADE::m_target, JOB_SCH_DOWNGRADE::m_target, JOB_PCB_DOWNGRADE::m_variant, JOB_SCH_DOWNGRADE::m_variant, COMPATIBILITY_REPORT::Merge(), name, KIWAY::ProcessJob(), FILEEXT::ProjectFileExtension, reporter, and text.

Referenced by CLI::PROJECT_DOWNGRADE_COMMAND::doPerform(), and KICAD_MANAGER_CONTROL::ExportForOlderVersion().

◆ ExportProjectForDowngrade()

bool ExportProjectForDowngrade ( KIWAY & aKiway,
const wxString & aProjectDir,
const wxString & aProjectName,
const wxString & aTargetName,
const wxString & aDestDir,
wxString & aError,
const wxString & aVariant = wxEmptyString,
bool aDropInsteadOfApproximate = false )

Export a downgraded copy of the project into aDestDir.

The destination must be a new or empty folder. Copies design files only, downgrades them in the copy, and verifies the result. Fails closed: on any failure the destination is removed and aError explains why. The caller is expected to have classified first and obtained user consent. A non-empty aVariant is flattened into the export.

Definition at line 425 of file project_downgrade.cpp.

References _, FILEEXT::DesignRulesFileExtension, downgradeProjectFileOnDisk(), DowngradeTargetNames(), KIWAY::FACE_PCB, KIWAY::FACE_SCH, FilterDrcRulesForTarget(), FindDowngradeTarget(), firstTooNewFile(), IsDowngradeDesignFile(), IsDowngradeWorkingArtifact(), FILEEXT::KiCadPcbFileExtension, FILEEXT::KiCadSchematicFileExtension, legacyLibraryTables(), JOB_PCB_DOWNGRADE::m_dropInsteadOfApproximate, JOB_SCH_DOWNGRADE::m_dropInsteadOfApproximate, DRC_RULES_FILTER_RESULT::m_error, JOB_PCB_DOWNGRADE::m_filename, JOB_SCH_DOWNGRADE::m_filename, JOB_PCB_DOWNGRADE::m_force, JOB_SCH_DOWNGRADE::m_force, JOB_PCB_DOWNGRADE::m_inPlace, JOB_SCH_DOWNGRADE::m_inPlace, JOB_PCB_DOWNGRADE::m_libraryDir, JOB_SCH_DOWNGRADE::m_libraryDir, DOWNGRADE_TARGET::m_name, JOB_PCB_DOWNGRADE::m_outputFile, JOB_PCB_DOWNGRADE::m_target, JOB_SCH_DOWNGRADE::m_target, DRC_RULES_FILTER_RESULT::m_text, JOB_PCB_DOWNGRADE::m_variant, JOB_SCH_DOWNGRADE::m_variant, KIWAY::ProcessJob(), FILEEXT::ProjectFileExtension, reporter, source, and text.

Referenced by CLI::PROJECT_DOWNGRADE_COMMAND::doPerform(), and KICAD_MANAGER_CONTROL::ExportForOlderVersion().