LibrePCB Developers Documentation
bomoutputjob.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_CORE_BOMOUTPUTJOB_H
21#define LIBREPCB_CORE_BOMOUTPUTJOB_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "outputjob.h"
27
28#include <optional/tl/optional.hpp>
29
30#include <QtCore>
31#include <QtGui>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38/*******************************************************************************
39 * Class BomOutputJob
40 ******************************************************************************/
41
45class BomOutputJob final : public OutputJob {
46 Q_DECLARE_TR_FUNCTIONS(BomOutputJob)
47
48public:
51
52 // Constructors / Destructor
53 BomOutputJob() noexcept;
54 BomOutputJob(const BomOutputJob& other) noexcept;
55 explicit BomOutputJob(const SExpression& node);
56 virtual ~BomOutputJob() noexcept;
57
58 // Getters
59 virtual QString getTypeTr() const noexcept override;
60 virtual QIcon getTypeIcon() const noexcept override;
61 const QStringList& getCustomAttributes() const noexcept {
62 return mCustomAttributes;
63 }
64 const BoardSet& getBoards() const noexcept { return mBoards; }
65 const AssemblyVariantSet& getAssemblyVariants() const noexcept {
66 return mAssemblyVariants;
67 }
68 const QString& getOutputPath() const noexcept { return mOutputPath; }
69
70 // Setters
71 void setCustomAttributes(const QStringList& attrs) noexcept;
72 void setBoards(const BoardSet& boards) noexcept;
73 void setAssemblyVariants(const AssemblyVariantSet& avs) noexcept;
74 void setOutputPath(const QString& path) noexcept;
75
76 // General Methods
77 static QString getTypeName() noexcept { return "bom"; }
78 static QString getTypeTrStatic() noexcept {
79 return tr("Bill Of Materials") % " (*.csv)";
80 }
81 virtual std::shared_ptr<OutputJob> cloneShared() const noexcept override;
82
83 // Operator Overloadings
84 BomOutputJob& operator=(const BomOutputJob& rhs) = delete;
85
86private: // Methods
87 virtual void serializeDerived(SExpression& root) const override;
88 virtual bool equals(const OutputJob& rhs) const noexcept override;
89
90private: // Data
91 QStringList mCustomAttributes;
94 QString mOutputPath;
95};
96
97/*******************************************************************************
98 * End of File
99 ******************************************************************************/
100
101} // namespace librepcb
102
103#endif
BOM output job.
Definition: bomoutputjob.h:45
BoardSet mBoards
Definition: bomoutputjob.h:92
virtual QString getTypeTr() const noexcept override
Definition: bomoutputjob.cpp:73
void setOutputPath(const QString &path) noexcept
Definition: bomoutputjob.cpp:106
void setCustomAttributes(const QStringList &attrs) noexcept
Definition: bomoutputjob.cpp:85
virtual bool equals(const OutputJob &rhs) const noexcept override
Definition: bomoutputjob.cpp:138
static QString getTypeName() noexcept
Definition: bomoutputjob.h:77
const AssemblyVariantSet & getAssemblyVariants() const noexcept
Definition: bomoutputjob.h:65
static QString getTypeTrStatic() noexcept
Definition: bomoutputjob.h:78
QString mOutputPath
Definition: bomoutputjob.h:94
ObjectSet< Uuid > AssemblyVariantSet
Definition: bomoutputjob.h:50
void setAssemblyVariants(const AssemblyVariantSet &avs) noexcept
Definition: bomoutputjob.cpp:99
const BoardSet & getBoards() const noexcept
Definition: bomoutputjob.h:64
virtual QIcon getTypeIcon() const noexcept override
Definition: bomoutputjob.cpp:77
virtual void serializeDerived(SExpression &root) const override
Definition: bomoutputjob.cpp:125
QStringList mCustomAttributes
Definition: bomoutputjob.h:91
const QString & getOutputPath() const noexcept
Definition: bomoutputjob.h:68
virtual std::shared_ptr< OutputJob > cloneShared() const noexcept override
Definition: bomoutputjob.cpp:117
ObjectSet< tl::optional< Uuid > > BoardSet
Definition: bomoutputjob.h:49
BomOutputJob() noexcept
Definition: bomoutputjob.cpp:37
const QStringList & getCustomAttributes() const noexcept
Definition: bomoutputjob.h:61
AssemblyVariantSet mAssemblyVariants
Definition: bomoutputjob.h:93
void setBoards(const BoardSet &boards) noexcept
Definition: bomoutputjob.cpp:92
Base class for all output job types.
Definition: outputjob.h:50
The SExpression class.
Definition: sexpression.h:69
Definition: occmodel.cpp:77
Definition: outputjob.h:65