LibrePCB Developers Documentation
pickplaceoutputjob.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_PICKPLACEOUTPUTJOB_H
21#define LIBREPCB_CORE_PICKPLACEOUTPUTJOB_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 PickPlaceOutputJob
40 ******************************************************************************/
41
45class PickPlaceOutputJob final : public OutputJob {
46 Q_DECLARE_TR_FUNCTIONS(PickPlaceOutputJob)
47
48public:
49 // Types
52
53 enum class Technology : int {
54 Tht = (1 << 0),
55 Smt = (1 << 1),
56 Mixed = (1 << 2),
57 Fiducial = (1 << 3),
58 Other = (1 << 4),
59 All = Tht | Smt | Mixed | Fiducial | Other,
60 };
61 Q_DECLARE_FLAGS(Technologies, Technology)
62
63 // Constructors / Destructor
64 PickPlaceOutputJob() noexcept;
65 PickPlaceOutputJob(const PickPlaceOutputJob& other) noexcept;
66 explicit PickPlaceOutputJob(const SExpression& node);
67 virtual ~PickPlaceOutputJob() noexcept;
68
69 // Getters
70 virtual QString getTypeTr() const noexcept override;
71 virtual QIcon getTypeIcon() const noexcept override;
72 Technologies getTechnologies() const noexcept { return mTechnologies; }
73 bool getIncludeComment() const noexcept { return mIncludeComment; }
74 const BoardSet& getBoards() const noexcept { return mBoards; }
75 const AssemblyVariantSet& getAssemblyVariants() const noexcept {
76 return mAssemblyVariants;
77 }
78 bool getCreateTop() const noexcept { return mCreateTop; }
79 bool getCreateBottom() const noexcept { return mCreateBottom; }
80 bool getCreateBoth() const noexcept { return mCreateBoth; }
81 const QString& getOutputPathTop() const noexcept { return mOutputPathTop; }
82 const QString& getOutputPathBottom() const noexcept {
83 return mOutputPathBottom;
84 }
85 const QString& getOutputPathBoth() const noexcept { return mOutputPathBoth; }
86
87 // Setters
88 void setTechnologies(Technologies technologies) noexcept;
89 void setIncludeComment(bool include) noexcept;
90 void setBoards(const BoardSet& boards) noexcept;
91 void setAssemblyVariants(const AssemblyVariantSet& avs) noexcept;
92 void setCreateTop(bool create) noexcept;
93 void setCreateBottom(bool create) noexcept;
94 void setCreateBoth(bool create) noexcept;
95 void setOutputPathTop(const QString& path) noexcept;
96 void setOutputPathBottom(const QString& path) noexcept;
97 void setOutputPathBoth(const QString& path) noexcept;
98
99 // General Methods
100 static QString getTypeName() noexcept { return "pnp"; }
101 static QString getTypeTrStatic() noexcept {
102 return tr("Pick&Place") % " (*.csv)";
103 }
104 virtual std::shared_ptr<OutputJob> cloneShared() const noexcept override;
105
106 // Operator Overloadings
107 PickPlaceOutputJob& operator=(const PickPlaceOutputJob& rhs) = delete;
108
109private: // Methods
110 virtual void serializeDerived(SExpression& root) const override;
111 virtual bool equals(const OutputJob& rhs) const noexcept override;
112
113private: // Data
114 Technologies mTechnologies;
124};
125
126} // namespace librepcb
127
128Q_DECLARE_OPERATORS_FOR_FLAGS(librepcb::PickPlaceOutputJob::Technologies)
129
130/*******************************************************************************
131 * End of File
132 ******************************************************************************/
133
134#endif
Base class for all output job types.
Definition: outputjob.h:50
Pick&Place output job.
Definition: pickplaceoutputjob.h:45
bool getCreateBottom() const noexcept
Definition: pickplaceoutputjob.h:79
QString mOutputPathBottom
Definition: pickplaceoutputjob.h:122
BoardSet mBoards
Definition: pickplaceoutputjob.h:116
void setCreateTop(bool create) noexcept
Definition: pickplaceoutputjob.cpp:140
virtual QString getTypeTr() const noexcept override
Definition: pickplaceoutputjob.cpp:99
bool getIncludeComment() const noexcept
Definition: pickplaceoutputjob.h:73
void setCreateBoth(bool create) noexcept
Definition: pickplaceoutputjob.cpp:154
virtual bool equals(const OutputJob &rhs) const noexcept override
Definition: pickplaceoutputjob.cpp:220
bool getCreateBoth() const noexcept
Definition: pickplaceoutputjob.h:80
static QString getTypeName() noexcept
Definition: pickplaceoutputjob.h:100
void setOutputPathTop(const QString &path) noexcept
Definition: pickplaceoutputjob.cpp:161
const QString & getOutputPathBottom() const noexcept
Definition: pickplaceoutputjob.h:82
void setTechnologies(Technologies technologies) noexcept
Definition: pickplaceoutputjob.cpp:111
const AssemblyVariantSet & getAssemblyVariants() const noexcept
Definition: pickplaceoutputjob.h:75
const QString & getOutputPathTop() const noexcept
Definition: pickplaceoutputjob.h:81
static QString getTypeTrStatic() noexcept
Definition: pickplaceoutputjob.h:101
bool mCreateBottom
Definition: pickplaceoutputjob.h:119
bool mIncludeComment
Definition: pickplaceoutputjob.h:115
ObjectSet< Uuid > AssemblyVariantSet
Definition: pickplaceoutputjob.h:51
void setAssemblyVariants(const AssemblyVariantSet &avs) noexcept
Definition: pickplaceoutputjob.cpp:132
bool mCreateTop
Definition: pickplaceoutputjob.h:118
const BoardSet & getBoards() const noexcept
Definition: pickplaceoutputjob.h:74
virtual QIcon getTypeIcon() const noexcept override
Definition: pickplaceoutputjob.cpp:103
virtual void serializeDerived(SExpression &root) const override
Definition: pickplaceoutputjob.cpp:194
Technologies getTechnologies() const noexcept
Definition: pickplaceoutputjob.h:72
void setOutputPathBottom(const QString &path) noexcept
Definition: pickplaceoutputjob.cpp:168
ObjectSet< Uuid > BoardSet
Definition: pickplaceoutputjob.h:50
PickPlaceOutputJob() noexcept
Definition: pickplaceoutputjob.cpp:37
Technology
Definition: pickplaceoutputjob.h:53
void setOutputPathBoth(const QString &path) noexcept
Definition: pickplaceoutputjob.cpp:175
QString mOutputPathBoth
Definition: pickplaceoutputjob.h:123
QString mOutputPathTop
Definition: pickplaceoutputjob.h:121
virtual std::shared_ptr< OutputJob > cloneShared() const noexcept override
Definition: pickplaceoutputjob.cpp:186
const QString & getOutputPathBoth() const noexcept
Definition: pickplaceoutputjob.h:85
void setIncludeComment(bool include) noexcept
Definition: pickplaceoutputjob.cpp:118
bool mCreateBoth
Definition: pickplaceoutputjob.h:120
Technologies mTechnologies
Definition: pickplaceoutputjob.h:114
void setCreateBottom(bool create) noexcept
Definition: pickplaceoutputjob.cpp:147
bool getCreateTop() const noexcept
Definition: pickplaceoutputjob.h:78
AssemblyVariantSet mAssemblyVariants
Definition: pickplaceoutputjob.h:117
void setBoards(const BoardSet &boards) noexcept
Definition: pickplaceoutputjob.cpp:125
The SExpression class.
Definition: sexpression.h:69
Definition: occmodel.cpp:77
Definition: outputjob.h:65