LibrePCB Developers Documentation
pickplacecsvwriter.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_PICKPLACECSVWRITER_H
21#define LIBREPCB_CORE_PICKPLACECSVWRITER_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "pickplacedata.h"
27
28#include <QtCore>
29
30#include <memory>
31
32/*******************************************************************************
33 * Namespace / Forward Declarations
34 ******************************************************************************/
35namespace librepcb {
36
37class CsvFile;
38
39/*******************************************************************************
40 * Class PickPlaceCsvWriter
41 ******************************************************************************/
42
46class PickPlaceCsvWriter final {
47 Q_DECLARE_TR_FUNCTIONS(PickPlaceCsvWriter)
48
49public:
50 enum class BoardSide { Top, Bottom, Both };
51
52 // Constructors / Destructor
54 PickPlaceCsvWriter(const PickPlaceCsvWriter& other) = delete;
55 explicit PickPlaceCsvWriter(const PickPlaceData& data) noexcept;
56 ~PickPlaceCsvWriter() noexcept;
57
58 // Setters
59 void setBoardSide(BoardSide side) noexcept { mBoardSide = side; }
60 void setTypeFilter(const QSet<PickPlaceDataItem::Type>& filter) noexcept {
61 mTypeFilter = filter;
62 }
63 void setIncludeMetadataComment(bool include) noexcept {
65 }
66 void setIncludeNonMountedParts(bool include) noexcept {
68 }
69
70 // General Methods
71 std::shared_ptr<CsvFile> generateCsv() const;
72
73 // Operator Overloadings
75
76private: // Methods
77 static bool isOnBoardSide(const PickPlaceDataItem& item,
78 BoardSide side) noexcept;
79 static QString boardSideToString(BoardSide side) noexcept;
80
81private: // Data
84 QSet<PickPlaceDataItem::Type> mTypeFilter;
87};
88
89/*******************************************************************************
90 * End of File
91 ******************************************************************************/
92
93} // namespace librepcb
94
95#endif
The PickPlaceCsvWriter class.
Definition: pickplacecsvwriter.h:46
const PickPlaceData & mData
Definition: pickplacecsvwriter.h:82
bool mIncludeMetadataComment
Definition: pickplacecsvwriter.h:85
static QString boardSideToString(BoardSide side) noexcept
Definition: pickplacecsvwriter.cpp:152
void setIncludeNonMountedParts(bool include) noexcept
Definition: pickplacecsvwriter.h:66
bool mIncludeNonMountedParts
Definition: pickplacecsvwriter.h:86
BoardSide
Definition: pickplacecsvwriter.h:50
static bool isOnBoardSide(const PickPlaceDataItem &item, BoardSide side) noexcept
Definition: pickplacecsvwriter.cpp:140
BoardSide mBoardSide
Definition: pickplacecsvwriter.h:83
void setBoardSide(BoardSide side) noexcept
Definition: pickplacecsvwriter.h:59
QSet< PickPlaceDataItem::Type > mTypeFilter
Definition: pickplacecsvwriter.h:84
~PickPlaceCsvWriter() noexcept
Definition: pickplacecsvwriter.cpp:54
std::shared_ptr< CsvFile > generateCsv() const
Definition: pickplacecsvwriter.cpp:61
PickPlaceCsvWriter & operator=(const PickPlaceCsvWriter &rhs)=delete
void setIncludeMetadataComment(bool include) noexcept
Definition: pickplacecsvwriter.h:63
PickPlaceCsvWriter(const PickPlaceCsvWriter &other)=delete
void setTypeFilter(const QSet< PickPlaceDataItem::Type > &filter) noexcept
Definition: pickplacecsvwriter.h:60
The librepcb::PickPlaceData class represents the content of a pick&place file.
Definition: pickplacedata.h:141
The librepcb::PickPlaceDataItem class represents one item of a pick&place file.
Definition: pickplacedata.h:47
Definition: occmodel.cpp:77