22#include <magic_enum.hpp>
55 m_params.emplace_back(
new JOB_PARAM<wxString>(
"drawing_sheet", &m_drawingSheet, m_drawingSheet ) );
57 m_params.emplace_back(
new JOB_PARAM<int>(
"precision", &m_precision, m_precision ) );
59 m_params.emplace_back(
new JOB_PARAM<bool>(
"check_zones", &m_checkZonesBeforeExport,
60 m_checkZonesBeforeExport ) );
70 if( aToken.IsEmpty() )
74 return magic_enum::enum_cast<DATA_SET>( std::string( aToken.ToUTF8() ), magic_enum::case_insensitive )
81 nlohmann::json token = aDataSet;
84 return token.is_string() ? token.get<std::string>() : std::string();
92 if( !aJson.contains(
"variant_names" ) )
94 wxString legacy = aJson.value(
"variant", wxString() );
96 if( !legacy.IsEmpty() )
103 wxString sections = aJson.value(
"sections", wxString() );
105 if( !sections.IsEmpty() || aJson.value(
"custom_sections",
false ) )
116 aJson[
"sections"] =
m_sections.value_or( wxString() );
void FromJson(const nlohmann::json &aJson) override
DATA_SET
Columns of the IPC-2581C function mode table, Table 4 p 80.
static std::string DataSetToken(DATA_SET aDataSet)
Lower case token that the job file and the CLI use for aDataSet Empty when it has none.
JOB_EXPORT_PCB_FAB(const std::string &aType)
void ToJson(nlohmann::json &aJson) const override
std::optional< wxString > m_sections
Section key that replaces the optional sections of the data set Unset lets the data set select them a...
static DATA_SET DataSetFromToken(const wxString &aToken)
Read a data set token in upper case or in lower case An empty token is USERDEF.
NET_NAMES
An anonymous name keeps the connections.
std::vector< wxString > m_variantNames
An simple container class that lets us dispatch output jobs to kifaces.
virtual void FromJson(const nlohmann::json &j)
virtual void ToJson(nlohmann::json &j) const
NLOHMANN_JSON_SERIALIZE_ENUM(JOB_EXPORT_PCB_FAB::UNITS, { { JOB_EXPORT_PCB_FAB::UNITS::INCH, "in" }, { JOB_EXPORT_PCB_FAB::UNITS::MM, "mm" }, }) NLOHMANN_JSON_SERIALIZE_ENUM(JOB_EXPORT_PCB_FAB