2024-09-14 15:34:51 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2025-01-01 13:30:11 -08:00
|
|
|
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
2024-09-14 15:34:51 +00:00
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2025-08-10 15:57:20 +01:00
|
|
|
#pragma once
|
|
|
|
|
2024-09-14 15:34:51 +00:00
|
|
|
#include "dialog_export_odbpp_base.h"
|
|
|
|
|
|
|
|
class PCB_EDIT_FRAME;
|
2024-12-02 10:53:01 -05:00
|
|
|
class JOB_EXPORT_PCB_ODB;
|
|
|
|
class REPORTER;
|
|
|
|
class PROGRESS_REPORTER;
|
|
|
|
class BOARD;
|
2024-09-14 15:34:51 +00:00
|
|
|
|
|
|
|
class DIALOG_EXPORT_ODBPP : public DIALOG_EXPORT_ODBPP_BASE
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DIALOG_EXPORT_ODBPP( PCB_EDIT_FRAME* aParent );
|
2024-12-02 10:53:01 -05:00
|
|
|
DIALOG_EXPORT_ODBPP( JOB_EXPORT_PCB_ODB* aJob, PCB_EDIT_FRAME* aEditFrame, wxWindow* aParent );
|
2024-09-14 15:34:51 +00:00
|
|
|
|
|
|
|
wxString GetOutputPath() const { return m_outputFileName->GetValue(); }
|
|
|
|
|
|
|
|
wxString GetUnitsString() const
|
|
|
|
{
|
|
|
|
if( m_choiceUnits->GetSelection() == 0 )
|
|
|
|
return wxT( "mm" );
|
|
|
|
else
|
|
|
|
return wxT( "inch" );
|
|
|
|
}
|
|
|
|
|
2024-12-02 10:53:01 -05:00
|
|
|
int GetPrecision() const { return m_precision->GetValue(); }
|
2024-09-14 15:34:51 +00:00
|
|
|
|
2024-12-29 17:01:27 +00:00
|
|
|
int GetCompressFormat() const { return m_choiceCompress->GetSelection(); }
|
2024-09-14 15:34:51 +00:00
|
|
|
|
2024-12-02 10:53:01 -05:00
|
|
|
// Runs the actual generation process; shared between GUI and CLI system
|
|
|
|
static void GenerateODBPPFiles( const JOB_EXPORT_PCB_ODB& aJob, BOARD* aBoard,
|
|
|
|
PCB_EDIT_FRAME* aParentFrame = nullptr,
|
|
|
|
PROGRESS_REPORTER* aProgressReporter = nullptr,
|
|
|
|
REPORTER* aErrorReporter = nullptr );
|
|
|
|
|
2024-09-14 15:34:51 +00:00
|
|
|
private:
|
|
|
|
void onBrowseClicked( wxCommandEvent& event ) override;
|
2024-12-29 17:01:27 +00:00
|
|
|
void onFormatChoice( wxCommandEvent& event ) override;
|
2024-09-14 15:34:51 +00:00
|
|
|
void onOKClick( wxCommandEvent& event ) override;
|
|
|
|
|
2024-12-29 17:01:27 +00:00
|
|
|
void OnFmtChoiceOptionChanged();
|
|
|
|
|
2025-08-10 15:57:20 +01:00
|
|
|
bool TransferDataToWindow() override;
|
2024-09-14 15:34:51 +00:00
|
|
|
bool TransferDataFromWindow() override;
|
|
|
|
|
2025-08-10 15:57:20 +01:00
|
|
|
private:
|
|
|
|
PCB_EDIT_FRAME* m_parent;
|
2024-12-02 10:53:01 -05:00
|
|
|
JOB_EXPORT_PCB_ODB* m_job;
|
2024-09-14 15:34:51 +00:00
|
|
|
};
|