KiCad PCB EDA Suite
Loading...
Searching...
No Matches
jobs_runner.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 (C) 2024 Mark Roszko <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
24
25class JOBSET;
27struct JOBSET_JOB;
28class KIWAY;
29class REPORTER;
31class PROJECT;
32
34{
35public:
36 JOBS_PROGRESS_REPORTER(wxWindow* aParent, const wxString& aTitle ) :
37 WX_PROGRESS_REPORTER( aParent, aTitle, 1000, PR_NO_ABORT )
38 {}
39
40 void AdvancePhase() override
41 {
42 }
43
44 void AdvanceJob( const wxString& aMessage )
45 {
46 m_jobStatus = aMessage;
48 }
49
50 void Report( const wxString& aMessage ) override
51 {
52 WX_PROGRESS_REPORTER::Report( m_jobStatus + wxS( "\n" ) + aMessage );
53 }
54
55private:
56 wxString m_jobStatus;
57};
58
59
61{
62public:
63 JOBS_RUNNER( KIWAY* aKiway, JOBSET* aJobsFile, PROJECT* aProject,
64 REPORTER& aReporter, JOBS_PROGRESS_REPORTER* aProgressReporter );
65
66 bool RunJobsAllDestinations( bool aBail = false );
67 bool RunJobsForDestination( JOBSET_DESTINATION* aDestination, bool aBail = false );
68
69private:
70 int runSpecialExecute( const JOBSET_JOB* aJob, PROJECT* aProject );
71 int runSpecialCopyFiles( const JOBSET_JOB* aJob, PROJECT* aProject );
72
73private:
79};
Definition: jobset.h:108
JOBS_PROGRESS_REPORTER(wxWindow *aParent, const wxString &aTitle)
Definition: jobs_runner.h:36
void AdvanceJob(const wxString &aMessage)
Definition: jobs_runner.h:44
void AdvancePhase() override
Use the next available virtual zone of the dialog progress bar.
Definition: jobs_runner.h:40
void Report(const wxString &aMessage) override
Display aMessage in the progress bar dialog.
Definition: jobs_runner.h:50
bool RunJobsAllDestinations(bool aBail=false)
Definition: jobs_runner.cpp:48
REPORTER & m_reporter
Definition: jobs_runner.h:76
KIWAY * m_kiway
Definition: jobs_runner.h:74
JOBSET * m_jobsFile
Definition: jobs_runner.h:75
JOBS_PROGRESS_REPORTER * m_progressReporter
Definition: jobs_runner.h:77
bool RunJobsForDestination(JOBSET_DESTINATION *aDestination, bool aBail=false)
int runSpecialExecute(const JOBSET_JOB *aJob, PROJECT *aProject)
Definition: jobs_runner.cpp:59
PROJECT * m_project
Definition: jobs_runner.h:78
int runSpecialCopyFiles(const JOBSET_JOB *aJob, PROJECT *aProject)
Definition: jobs_runner.cpp:99
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:286
A progress reporter interface for use in multi-threaded environments.
virtual void Report(const wxString &aMessage)=0
Display aMessage in the progress bar dialog.
Container for project specific data.
Definition: project.h:65
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:73
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
#define PR_NO_ABORT