2024-07-15 18:20:13 -04:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2024 Mark Roszko <mark.roszko@gmail.com>
|
2025-01-01 13:30:11 -08:00
|
|
|
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
2024-07-15 18:20:13 -04: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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2025-06-28 14:30:24 -06:00
|
|
|
#include <widgets/wx_progress_reporters.h>
|
|
|
|
|
2024-07-15 18:20:13 -04:00
|
|
|
class JOBSET;
|
2025-03-03 18:34:20 +00:00
|
|
|
struct JOBSET_DESTINATION;
|
2024-10-05 19:36:43 -04:00
|
|
|
struct JOBSET_JOB;
|
2024-07-15 18:20:13 -04:00
|
|
|
class KIWAY;
|
|
|
|
class REPORTER;
|
2025-06-28 14:30:24 -06:00
|
|
|
class PROGRESS_REPORTER;
|
2024-12-24 11:44:22 -05:00
|
|
|
class PROJECT;
|
2024-07-15 18:20:13 -04:00
|
|
|
|
2025-06-28 14:30:24 -06:00
|
|
|
class JOBS_PROGRESS_REPORTER : public WX_PROGRESS_REPORTER
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
JOBS_PROGRESS_REPORTER(wxWindow* aParent, const wxString& aTitle ) :
|
|
|
|
WX_PROGRESS_REPORTER( aParent, aTitle, 1000, PR_NO_ABORT )
|
|
|
|
{}
|
|
|
|
|
|
|
|
void AdvancePhase() override
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void AdvanceJob( const wxString& aMessage )
|
|
|
|
{
|
|
|
|
m_jobStatus = aMessage;
|
|
|
|
WX_PROGRESS_REPORTER::Report( aMessage );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Report( const wxString& aMessage ) override
|
|
|
|
{
|
|
|
|
WX_PROGRESS_REPORTER::Report( m_jobStatus + wxS( "\n" ) + aMessage );
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxString m_jobStatus;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2024-07-15 18:20:13 -04:00
|
|
|
class JOBS_RUNNER
|
|
|
|
{
|
|
|
|
public:
|
2024-12-24 11:44:22 -05:00
|
|
|
JOBS_RUNNER( KIWAY* aKiway, JOBSET* aJobsFile, PROJECT* aProject,
|
2025-06-28 14:30:24 -06:00
|
|
|
REPORTER& aReporter, JOBS_PROGRESS_REPORTER* aProgressReporter );
|
2024-07-15 18:20:13 -04:00
|
|
|
|
2025-03-03 18:34:20 +00:00
|
|
|
bool RunJobsAllDestinations( bool aBail = false );
|
|
|
|
bool RunJobsForDestination( JOBSET_DESTINATION* aDestination, bool aBail = false );
|
2024-07-15 18:20:13 -04:00
|
|
|
|
2024-10-05 19:36:43 -04:00
|
|
|
private:
|
2025-08-20 13:58:30 +03:00
|
|
|
int runSpecialExecute( const JOBSET_JOB* aJob, REPORTER* aReporter, PROJECT* aProject );
|
2025-01-01 23:57:14 -05:00
|
|
|
int runSpecialCopyFiles( const JOBSET_JOB* aJob, PROJECT* aProject );
|
2024-10-05 19:36:43 -04:00
|
|
|
|
2024-07-15 18:20:13 -04:00
|
|
|
private:
|
2025-06-28 14:30:24 -06:00
|
|
|
KIWAY* m_kiway;
|
|
|
|
JOBSET* m_jobsFile;
|
|
|
|
REPORTER& m_reporter;
|
|
|
|
JOBS_PROGRESS_REPORTER* m_progressReporter;
|
|
|
|
PROJECT* m_project;
|
2024-07-15 18:20:13 -04:00
|
|
|
};
|