mirror of https://github.com/KLayout/klayout.git
WIP: turned Gerber and LEF/DEF import into plugins.
This commit is contained in:
parent
5421f77e61
commit
9ca011d138
|
|
@ -8,70 +8,46 @@ DEFINES += MAKE_EXT_LIBRARY
|
|||
|
||||
HEADERS += \
|
||||
extBooleanOperationsDialogs.h \
|
||||
extDEFImporter.h \
|
||||
extDiffToolDialog.h \
|
||||
extGerberDrillFileReader.h \
|
||||
extGerberImportDialog.h \
|
||||
extGerberImporter.h \
|
||||
extLEFDEFImportDialogs.h \
|
||||
extLEFDEFImporter.h \
|
||||
extLEFImporter.h \
|
||||
extNetTracer.h \
|
||||
extNetTracerConfig.h \
|
||||
extNetTracerDialog.h \
|
||||
extNetTracerIO.h \
|
||||
extRS274XApertures.h \
|
||||
extRS274XReader.h \
|
||||
extStreamImportDialog.h \
|
||||
extStreamImporter.h \
|
||||
extXORToolDialog.h \
|
||||
extCommon.h \
|
||||
extForceLink.h \
|
||||
extXORProgress.h
|
||||
extCommon.h \
|
||||
extForceLink.h \
|
||||
extXORProgress.h
|
||||
|
||||
FORMS += \
|
||||
BooleanOptionsDialog.ui \
|
||||
DiffToolDialog.ui \
|
||||
GerberImportDialog.ui \
|
||||
LEFDEFImportOptionsDialog.ui \
|
||||
LEFDEFTechnologyComponentEditor.ui \
|
||||
NetTracerConfigPage.ui \
|
||||
NetTracerDialog.ui \
|
||||
NetTracerTechComponentEditor.ui \
|
||||
SizingOptionsDialog.ui \
|
||||
StreamImportDialog.ui \
|
||||
MergeOptionsDialog.ui \
|
||||
XORToolDialog.ui
|
||||
XORToolDialog.ui
|
||||
|
||||
SOURCES += \
|
||||
extBooleanOperationsDialogs.cc \
|
||||
extBooleanOperationsPlugin.cc \
|
||||
extDEFImporter.cc \
|
||||
extDiffPlugin.cc \
|
||||
extDiffToolDialog.cc \
|
||||
extForceLink.cc \
|
||||
extGerberDrillFileReader.cc \
|
||||
extGerberImport.cc \
|
||||
extGerberImportDialog.cc \
|
||||
extGerberImporter.cc \
|
||||
extLEFDEFImport.cc \
|
||||
extLEFDEFImportDialogs.cc \
|
||||
extLEFDEFImporter.cc \
|
||||
extLEFImporter.cc \
|
||||
extNetTracer.cc \
|
||||
extNetTracerConfig.cc \
|
||||
extNetTracerDialog.cc \
|
||||
extNetTracerIO.cc \
|
||||
extNetTracerPlugin.cc \
|
||||
extRS274XApertures.cc \
|
||||
extRS274XReader.cc \
|
||||
extStreamImport.cc \
|
||||
extStreamImportDialog.cc \
|
||||
extStreamImporter.cc \
|
||||
extXORPlugin.cc \
|
||||
extXORToolDialog.cc \
|
||||
extLEFDEFPlugin.cc \
|
||||
extXORProgress.cc
|
||||
extXORProgress.cc
|
||||
|
||||
INCLUDEPATH += $$TL_INC $$GSI_INC $$LAYBASIC_INC $$LAY_INC $$DB_INC $$RDB_INC $$ANT_INC $$EDT_INC
|
||||
DEPENDPATH += $$TL_INC $$GSI_INC $$LAYBASIC_INC $$LAY_INC $$DB_INC $$RDB_INC $$ANT_INC $$EDT_INC
|
||||
|
|
|
|||
|
|
@ -1,612 +0,0 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2018 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "tlTimer.h"
|
||||
#include "tlStream.h"
|
||||
#include "dbReader.h"
|
||||
#include "dbStream.h"
|
||||
#include "layPlugin.h"
|
||||
#include "layStream.h"
|
||||
#include "gsiDecl.h"
|
||||
|
||||
#include "extLEFDEFImportDialogs.h"
|
||||
#include "extLEFImporter.h"
|
||||
#include "extDEFImporter.h"
|
||||
#include "extLEFDEFImporter.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
|
||||
namespace ext
|
||||
{
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Plugin for the stream reader
|
||||
|
||||
/**
|
||||
* @brief Determines the format of the given stream
|
||||
* Returns true, if the stream has LEF format
|
||||
*/
|
||||
static bool is_lef_format (const std::string &fn)
|
||||
{
|
||||
static const char *suffixes[] = { ".lef", ".LEF", ".lef.gz", ".LEF.gz" };
|
||||
|
||||
// NOTE: there is no reliable way of (easily) detecting the format. Hence we use the file
|
||||
// name's suffix for the format hint.
|
||||
for (size_t i = 0; i < sizeof (suffixes) / sizeof (suffixes[0]); ++i) {
|
||||
std::string suffix = suffixes [i];
|
||||
if (fn.size () > suffix.size () && fn.find (suffix) == fn.size () - suffix.size ()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Determines the format of the given stream
|
||||
* Returns true, if the stream has DEF format
|
||||
*/
|
||||
static bool is_def_format (const std::string &fn)
|
||||
{
|
||||
static const char *suffixes[] = { ".def", ".DEF", ".def.gz", ".DEF.gz" };
|
||||
|
||||
// NOTE: there is no reliable way of (easily) detecting the format. Hence we use the file
|
||||
// name's suffix for the format hint.
|
||||
for (size_t i = 0; i < sizeof (suffixes) / sizeof (suffixes[0]); ++i) {
|
||||
std::string suffix = suffixes [i];
|
||||
if (fn.size () > suffix.size () && fn.find (suffix) == fn.size () - suffix.size ()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
class LEFDEFReader
|
||||
: public db::ReaderBase
|
||||
{
|
||||
public:
|
||||
|
||||
LEFDEFReader (tl::InputStream &s)
|
||||
: m_stream (s)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
virtual const db::LayerMap &read (db::Layout &layout, const db::LoadLayoutOptions &options) throw (tl::Exception)
|
||||
{
|
||||
return read_lefdef (layout, options, is_lef_format (m_stream.filename ()));
|
||||
}
|
||||
|
||||
virtual const db::LayerMap &read (db::Layout &layout) throw (tl::Exception)
|
||||
{
|
||||
return read_lefdef (layout, db::LoadLayoutOptions (), is_lef_format (m_stream.filename ()));
|
||||
}
|
||||
|
||||
virtual const char *format () const
|
||||
{
|
||||
return "LEFDEF";
|
||||
}
|
||||
private:
|
||||
tl::InputStream &m_stream;
|
||||
db::LayerMap m_layer_map;
|
||||
|
||||
std::string correct_path (const std::string &fn)
|
||||
{
|
||||
QFileInfo fi (tl::to_qstring (fn));
|
||||
if (! fi.isAbsolute ()) {
|
||||
QDir input_dir (QFileInfo (tl::to_qstring (m_stream.absolute_path ())).dir ());
|
||||
return tl::to_string (input_dir.filePath (fi.filePath ()));
|
||||
} else {
|
||||
return fn;
|
||||
}
|
||||
}
|
||||
|
||||
const db::LayerMap &read_lefdef (db::Layout &layout, const db::LoadLayoutOptions &options, bool import_lef) throw (tl::Exception)
|
||||
{
|
||||
const ext::LEFDEFReaderOptions *lefdef_options = dynamic_cast<const ext::LEFDEFReaderOptions *> (options.get_options (format ()));
|
||||
static ext::LEFDEFReaderOptions default_options;
|
||||
if (! lefdef_options) {
|
||||
lefdef_options = &default_options;
|
||||
}
|
||||
|
||||
// Take the layer map and the "read all layers" flag from the reader options - hence we override the
|
||||
ext::LEFDEFLayerDelegate layers (lefdef_options);
|
||||
layers.prepare (layout);
|
||||
layout.dbu (lefdef_options->dbu ());
|
||||
|
||||
if (import_lef) {
|
||||
|
||||
tl::SelfTimer timer (tl::verbosity () >= 11, tl::to_string (QObject::tr ("Reading LEF file")));
|
||||
|
||||
ext::LEFImporter importer;
|
||||
|
||||
for (std::vector<std::string>::const_iterator l = lefdef_options->begin_lef_files (); l != lefdef_options->end_lef_files (); ++l) {
|
||||
|
||||
std::string lp = correct_path (*l);
|
||||
|
||||
tl::InputStream lef_stream (lp);
|
||||
tl::log << tl::to_string (QObject::tr ("Reading")) << " " << lp;
|
||||
importer.read (lef_stream, layout, layers);
|
||||
|
||||
}
|
||||
|
||||
tl::log << tl::to_string (QObject::tr ("Reading")) << " " << m_stream.source ();
|
||||
importer.read (m_stream, layout, layers);
|
||||
|
||||
} else {
|
||||
|
||||
tl::SelfTimer timer (tl::verbosity () >= 11, tl::to_string (QObject::tr ("Reading DEF file")));
|
||||
|
||||
DEFImporter importer;
|
||||
|
||||
for (std::vector<std::string>::const_iterator l = lefdef_options->begin_lef_files (); l != lefdef_options->end_lef_files (); ++l) {
|
||||
|
||||
std::string lp = correct_path (*l);
|
||||
|
||||
tl::InputStream lef_stream (lp);
|
||||
tl::log << tl::to_string (QObject::tr ("Reading")) << " " << lp;
|
||||
importer.read_lef (lef_stream, layout, layers);
|
||||
|
||||
}
|
||||
|
||||
// Additionally read all LEF files next to the DEF file
|
||||
|
||||
QDir input_dir (QFileInfo (tl::to_qstring (m_stream.absolute_path ())).dir ());
|
||||
if (input_dir.exists () && input_dir.isReadable ()) {
|
||||
|
||||
QStringList entries = input_dir.entryList ();
|
||||
for (QStringList::const_iterator e = entries.begin (); e != entries.end (); ++e) {
|
||||
|
||||
if (is_lef_format (tl::to_string (*e))) {
|
||||
|
||||
std::string lp = tl::to_string (input_dir.filePath (*e));
|
||||
tl::InputStream lef_stream (lp);
|
||||
tl::log << tl::to_string (QObject::tr ("Reading")) << " " << lp;
|
||||
importer.read_lef (lef_stream, layout, layers);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tl::log << tl::to_string (QObject::tr ("Reading")) << " " << m_stream.source ();
|
||||
importer.read (m_stream, layout, layers);
|
||||
|
||||
}
|
||||
|
||||
layers.finish (layout);
|
||||
|
||||
m_layer_map = layers.layer_map ();
|
||||
return m_layer_map;
|
||||
}
|
||||
};
|
||||
|
||||
class LEFDEFFormatDeclaration
|
||||
: public db::StreamFormatDeclaration
|
||||
{
|
||||
virtual std::string format_name () const { return "LEFDEF"; }
|
||||
virtual std::string format_desc () const { return "LEF/DEF"; }
|
||||
virtual std::string format_title () const { return "LEF/DEF (unified reader)"; }
|
||||
virtual std::string file_format () const { return "LEF/DEF files (*.lef *.LEF *.lef.gz *.LEF.gz *.def *.DEF *.def.gz *.DEF.gz)"; }
|
||||
|
||||
virtual bool detect (tl::InputStream &stream) const
|
||||
{
|
||||
return is_lef_format (stream.filename ()) || is_def_format (stream.filename ());
|
||||
}
|
||||
|
||||
virtual db::ReaderBase *create_reader (tl::InputStream &s) const
|
||||
{
|
||||
return new LEFDEFReader (s);
|
||||
}
|
||||
|
||||
virtual db::WriterBase *create_writer () const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual bool can_read () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool can_write () const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
static tl::RegisteredClass<db::StreamFormatDeclaration> format_decl (new LEFDEFFormatDeclaration (), 500, "LEFDEF");
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// LEFDEFPluginDeclaration definition and implementation
|
||||
|
||||
class LEFDEFPluginDeclaration
|
||||
: public lay::StreamReaderPluginDeclaration
|
||||
{
|
||||
public:
|
||||
LEFDEFPluginDeclaration ()
|
||||
: lay::StreamReaderPluginDeclaration (LEFDEFReaderOptions ().format_name ())
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
lay::StreamReaderOptionsPage *format_specific_options_page (QWidget *parent) const
|
||||
{
|
||||
return new LEFDEFReaderOptionsEditor (parent);
|
||||
}
|
||||
|
||||
db::FormatSpecificReaderOptions *create_specific_options () const
|
||||
{
|
||||
return new LEFDEFReaderOptions ();
|
||||
}
|
||||
|
||||
virtual tl::XMLElementBase *xml_element () const
|
||||
{
|
||||
return new lay::ReaderOptionsXMLElement<LEFDEFReaderOptions> ("lefdef",
|
||||
tl::make_member (&LEFDEFReaderOptions::read_all_layers, &LEFDEFReaderOptions::set_read_all_layers, "read-all-layers") +
|
||||
tl::make_member (&LEFDEFReaderOptions::layer_map, &LEFDEFReaderOptions::set_layer_map, "layer-map") +
|
||||
tl::make_member (&LEFDEFReaderOptions::dbu, &LEFDEFReaderOptions::set_dbu, "dbu") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_net_names, &LEFDEFReaderOptions::set_produce_net_names, "produce-net-names") +
|
||||
tl::make_member (&LEFDEFReaderOptions::net_property_name, &LEFDEFReaderOptions::set_net_property_name, "net-property-name") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_inst_names, &LEFDEFReaderOptions::set_produce_inst_names, "produce-inst-names") +
|
||||
tl::make_member (&LEFDEFReaderOptions::inst_property_name, &LEFDEFReaderOptions::set_inst_property_name, "inst-property-name") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_cell_outlines, &LEFDEFReaderOptions::set_produce_cell_outlines, "produce-cell-outlines") +
|
||||
tl::make_member (&LEFDEFReaderOptions::cell_outline_layer, &LEFDEFReaderOptions::set_cell_outline_layer, "cell-outline-layer") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_placement_blockages, &LEFDEFReaderOptions::set_produce_placement_blockages, "produce-placement-blockages") +
|
||||
tl::make_member (&LEFDEFReaderOptions::placement_blockage_layer, &LEFDEFReaderOptions::set_placement_blockage_layer, "placement-blockage-layer") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_regions, &LEFDEFReaderOptions::set_produce_regions, "produce-regions") +
|
||||
tl::make_member (&LEFDEFReaderOptions::region_layer, &LEFDEFReaderOptions::set_region_layer, "region-layer") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_via_geometry, &LEFDEFReaderOptions::set_produce_via_geometry, "produce-via-geometry") +
|
||||
tl::make_member (&LEFDEFReaderOptions::via_geometry_suffix, &LEFDEFReaderOptions::set_via_geometry_suffix, "via-geometry-suffix") +
|
||||
tl::make_member (&LEFDEFReaderOptions::via_geometry_datatype, &LEFDEFReaderOptions::set_via_geometry_datatype, "via-geometry-datatype") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_pins, &LEFDEFReaderOptions::set_produce_pins, "produce-pins") +
|
||||
tl::make_member (&LEFDEFReaderOptions::pins_suffix, &LEFDEFReaderOptions::set_pins_suffix, "pins-suffix") +
|
||||
tl::make_member (&LEFDEFReaderOptions::pins_datatype, &LEFDEFReaderOptions::set_pins_datatype, "pins-datatype") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_obstructions, &LEFDEFReaderOptions::set_produce_obstructions, "produce-obstructions") +
|
||||
tl::make_member (&LEFDEFReaderOptions::obstructions_suffix, &LEFDEFReaderOptions::set_obstructions_suffix, "obstructions-suffix") +
|
||||
tl::make_member (&LEFDEFReaderOptions::obstructions_datatype, &LEFDEFReaderOptions::set_obstructions_datatype, "obstructions-datatype") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_blockages, &LEFDEFReaderOptions::set_produce_blockages, "produce-blockages") +
|
||||
tl::make_member (&LEFDEFReaderOptions::blockages_suffix, &LEFDEFReaderOptions::set_blockages_suffix, "blockages-suffix") +
|
||||
tl::make_member (&LEFDEFReaderOptions::blockages_datatype, &LEFDEFReaderOptions::set_blockages_datatype, "blockages-datatype") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_labels, &LEFDEFReaderOptions::set_produce_labels, "produce-labels") +
|
||||
tl::make_member (&LEFDEFReaderOptions::labels_suffix, &LEFDEFReaderOptions::set_labels_suffix, "labels-suffix") +
|
||||
tl::make_member (&LEFDEFReaderOptions::labels_datatype, &LEFDEFReaderOptions::set_labels_datatype, "labels-datatype") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_routing, &LEFDEFReaderOptions::set_produce_routing, "produce-routing") +
|
||||
tl::make_member (&LEFDEFReaderOptions::routing_suffix, &LEFDEFReaderOptions::set_routing_suffix, "routing-suffix") +
|
||||
tl::make_member (&LEFDEFReaderOptions::routing_datatype, &LEFDEFReaderOptions::set_routing_datatype, "routing-datatype") +
|
||||
tl::make_member (&LEFDEFReaderOptions::begin_lef_files, &LEFDEFReaderOptions::end_lef_files, &LEFDEFReaderOptions::push_lef_file, "lef-files")
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
static tl::RegisteredClass<lay::PluginDeclaration> plugin_decl (new LEFDEFPluginDeclaration (), 10001, "LEFDEFReader");
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// gsi Implementation of specific methods
|
||||
|
||||
static LEFDEFReaderOptions &get_lefdef_config (db::LoadLayoutOptions *options)
|
||||
{
|
||||
return options->get_options<LEFDEFReaderOptions> ();
|
||||
}
|
||||
|
||||
static void set_lefdef_config (db::LoadLayoutOptions *options, const LEFDEFReaderOptions &config)
|
||||
{
|
||||
options->set_options (config);
|
||||
}
|
||||
|
||||
// extend lay::LoadLayoutOptions with the GDS2 options
|
||||
static
|
||||
gsi::ClassExt<db::LoadLayoutOptions> decl_ext_lefdef_reader_options (
|
||||
gsi::method_ext ("lefdef_config", &get_lefdef_config,
|
||||
"@brief Gets a copy of the LEF/DEF reader configuration\n"
|
||||
"The LEF/DEF reader configuration is wrapped in a separate object of class \\LEFDEFReaderConfiguration. See there for details.\n"
|
||||
"This method will return a copy of the reader configuration. To modify the configuration, modify the copy and set the modified "
|
||||
"configuration with \\lefdef_config=.\n"
|
||||
"\n"
|
||||
"\nThis method has been added in version 0.25.\n"
|
||||
) +
|
||||
gsi::method_ext ("lefdef_config=", &set_lefdef_config, gsi::arg ("config"),
|
||||
"@brief Sets the LEF/DEF reader configuration\n"
|
||||
"\n"
|
||||
"\nThis method has been added in version 0.25.\n"
|
||||
)
|
||||
);
|
||||
|
||||
static tl::Variant get_net_property_name (const LEFDEFReaderOptions *config)
|
||||
{
|
||||
if (config->produce_net_names ()) {
|
||||
return config->net_property_name ();
|
||||
} else {
|
||||
return tl::Variant ();
|
||||
}
|
||||
}
|
||||
|
||||
static void set_net_property_name (LEFDEFReaderOptions *config, const tl::Variant &name)
|
||||
{
|
||||
config->set_produce_net_names (! name.is_nil ());
|
||||
config->set_net_property_name (name);
|
||||
}
|
||||
|
||||
static
|
||||
gsi::Class<LEFDEFReaderOptions> decl_lefdef_config ("lay", "LEFDEFReaderConfiguration",
|
||||
gsi::method ("layer_map", (db::LayerMap &(LEFDEFReaderOptions::*) ()) &LEFDEFReaderOptions::layer_map,
|
||||
"@brief Gets the layer map to be used for the LEF/DEF reader\n"
|
||||
"@return A reference to the layer map\n"
|
||||
"Because LEF/DEF layer mapping is substantially different than for normal layout files, the LEF/DEF reader "
|
||||
"employs a separate layer mapping table. The LEF/DEF specific layer mapping is stored within the "
|
||||
"LEF/DEF reader's configuration and can be accessed with this attribute. The layer mapping table of "
|
||||
"\\LoadLayoutOptions will be ignored for the LEF/DEF reader.\n"
|
||||
"\n"
|
||||
"The setter is \\layer_map=. \\create_other_layers= is available to control whether layers "
|
||||
"not specified in the layer mapping table shall be created automatically."
|
||||
) +
|
||||
gsi::method ("layer_map=", &LEFDEFReaderOptions::set_layer_map,
|
||||
"@brief Sets the layer map to be used for the LEF/DEF reader\n"
|
||||
"See \\layer_map for details."
|
||||
) +
|
||||
gsi::method ("create_other_layers", &LEFDEFReaderOptions::read_all_layers,
|
||||
"@brief Gets a value indicating whether layers not mapped in the layer map shall be created too\n"
|
||||
"See \\layer_map for details."
|
||||
) +
|
||||
gsi::method ("create_other_layers=", &LEFDEFReaderOptions::set_read_all_layers,
|
||||
"@brief Sets a value indicating whether layers not mapped in the layer map shall be created too\n"
|
||||
"See \\layer_map for details."
|
||||
) +
|
||||
gsi::method ("dbu", &LEFDEFReaderOptions::dbu,
|
||||
"@brief Gets the database unit to use for producing the layout.\n"
|
||||
"This value specifies the database to be used for the layout that is read. When a DEF file is specified with "
|
||||
"a different database unit, the layout is translated into this database unit.\n"
|
||||
) +
|
||||
gsi::method ("dbu=", &LEFDEFReaderOptions::set_dbu, gsi::arg ("dbu"),
|
||||
"@brief Sets the database unit to use for producing the layout.\n"
|
||||
"See \\dbu for details."
|
||||
) +
|
||||
gsi::method_ext ("net_property_name", &get_net_property_name,
|
||||
"@brief Gets a value indicating whether and how to produce net names as properties.\n"
|
||||
"If set to a value not nil, net names will be attached to the shapes and instances generated as user properties.\n"
|
||||
"This attribute then specifies the user property name to be used for attaching the net names.\n"
|
||||
"If set to nil, no net names will be produced.\n"
|
||||
"\n"
|
||||
"The corresponding setter is \\net_property_name=."
|
||||
) +
|
||||
gsi::method_ext ("net_property_name=", &set_net_property_name, gsi::arg ("name"),
|
||||
"@brief Sets a value indicating whether and how to produce net names as properties.\n"
|
||||
"See \\net_property_name for details."
|
||||
) +
|
||||
gsi::method ("produce_cell_outlines", &LEFDEFReaderOptions::produce_cell_outlines,
|
||||
"@brief Gets a value indicating whether to produce cell outlines.\n"
|
||||
"If set to true, cell outlines will be produced on the layer given by \\cell_outline_layer. "
|
||||
) +
|
||||
gsi::method ("produce_cell_outlines=", &LEFDEFReaderOptions::set_produce_cell_outlines, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether to produce cell outlines.\n"
|
||||
"See \\produce_cell_outlines for details.\n"
|
||||
) +
|
||||
gsi::method ("cell_outline_layer", &LEFDEFReaderOptions::cell_outline_layer,
|
||||
"@brief Gets the layer on which to produce the cell outline.\n"
|
||||
"This attribute is a string correspondig to the string representation of \\LayerInfo. "
|
||||
"This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \\LayerInfo for details.\n"
|
||||
"The setter for this attribute is \\cell_outline_layer=. See also \\produce_cell_outlines."
|
||||
) +
|
||||
gsi::method ("cell_outline_layer=", &LEFDEFReaderOptions::set_cell_outline_layer, gsi::arg ("spec"),
|
||||
"@brief Sets the layer on which to produce the cell outline.\n"
|
||||
"See \\cell_outline_layer for details.\n"
|
||||
) +
|
||||
gsi::method ("produce_placement_blockages", &LEFDEFReaderOptions::produce_placement_blockages,
|
||||
"@brief Gets a value indicating whether to produce placement blockage regions.\n"
|
||||
"If set to true, polygons will be produced representing the placement blockage region on the layer given by \\placement_blockage_layer. "
|
||||
) +
|
||||
gsi::method ("produce_placement_blockages=", &LEFDEFReaderOptions::set_produce_placement_blockages, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether to produce placement blockage regions.\n"
|
||||
"See \\produce_placement_blockages for details.\n"
|
||||
) +
|
||||
gsi::method ("placement_blockage_layer", &LEFDEFReaderOptions::placement_blockage_layer,
|
||||
"@brief Gets the layer on which to produce the placement blockage.\n"
|
||||
"This attribute is a string correspondig to the string representation of \\LayerInfo. "
|
||||
"This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \\LayerInfo for details."
|
||||
"The setter for this attribute is \\placement_blockage_layer=. See also \\produce_placement_blockages."
|
||||
) +
|
||||
gsi::method ("placement_blockage_layer=", &LEFDEFReaderOptions::set_placement_blockage_layer,
|
||||
"@brief Sets the layer on which to produce the placement blockage.\n"
|
||||
"See \\placement_blockage_layer for details.\n"
|
||||
) +
|
||||
gsi::method ("produce_via_geometry", &LEFDEFReaderOptions::produce_via_geometry,
|
||||
"@brief Sets a value indicating whether via geometries shall be produced.\n"
|
||||
"\n"
|
||||
"If set to true, shapes will be produced for each via. The layer to be produced will be determined from the "
|
||||
"via layer's name using the suffix provided by \\via_geometry_suffix. If there is a specific mapping in the "
|
||||
"layer mapping table for the via layer including the suffix, the layer/datatype will be taken from the layer "
|
||||
"mapping table. If there is a mapping to the undecorated via layer, the datatype will be substituted with "
|
||||
"the \\via_geometry_datatype value. If no mapping is defined, a unique number will be assigned to the layer "
|
||||
"number and the datatype will be taken from the \\via_geometry_datatype value.\n"
|
||||
"\n"
|
||||
"For example: the via layer is 'V1', \\via_geometry_suffix is 'GEO' and \\via_geometry_datatype is 1. Then:\n"
|
||||
"\n"
|
||||
"@li\n"
|
||||
"@ul If there is a mapping for 'V1.GEO', the layer and datatype will be taken from there. @/ul\n"
|
||||
"@ul If there is a mapping for 'V1', the layer will be taken from there and the datatype will be taken from \\via_geometry_datatype. "
|
||||
" The name of the produced layer will be 'V1.GEO'. @/ul\n"
|
||||
"@ul If there is no mapping for both, the layer number will be a unique value, the datatype will be taken from \\via_geometry_datatype "
|
||||
" and the layer name will be 'V1.GEO'. @/ul"
|
||||
"@/li\n"
|
||||
) +
|
||||
gsi::method ("produce_via_geometry=", &LEFDEFReaderOptions::set_produce_via_geometry, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether via geometries shall be produced.\n"
|
||||
"See \\produce_via_geometry for details.\n"
|
||||
) +
|
||||
gsi::method ("via_geometry_suffix", &LEFDEFReaderOptions::via_geometry_suffix,
|
||||
"@brief Gets the via geometry layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about this property.\n"
|
||||
) +
|
||||
gsi::method ("via_geometry_suffix=", &LEFDEFReaderOptions::set_via_geometry_suffix, gsi::arg ("suffix"),
|
||||
"@brief Sets the via geometry layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about this property.\n"
|
||||
) +
|
||||
gsi::method ("via_geometry_datatype", &LEFDEFReaderOptions::via_geometry_datatype,
|
||||
"@brief Gets the via geometry layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about this property.\n"
|
||||
) +
|
||||
gsi::method ("via_geometry_datatype=", &LEFDEFReaderOptions::set_via_geometry_datatype, gsi::arg ("datatype"),
|
||||
"@brief Sets the via geometry layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about this property.\n"
|
||||
) +
|
||||
gsi::method ("produce_pins", &LEFDEFReaderOptions::produce_pins,
|
||||
"@brief Gets a value indicating whether pin geometries shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_pins=", &LEFDEFReaderOptions::set_produce_pins, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether pin geometries shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("pins_suffix", &LEFDEFReaderOptions::pins_suffix,
|
||||
"@brief Gets the pin geometry layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("pins_suffix=", &LEFDEFReaderOptions::set_pins_suffix, gsi::arg ("suffix"),
|
||||
"@brief Sets the pin geometry layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("pins_datatype", &LEFDEFReaderOptions::pins_datatype,
|
||||
"@brief Gets the pin geometry layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("pins_datatype=", &LEFDEFReaderOptions::set_pins_datatype, gsi::arg ("datatype"),
|
||||
"@brief Sets the pin geometry layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_obstructions", &LEFDEFReaderOptions::produce_obstructions,
|
||||
"@brief Gets a value indicating whether obstruction markers shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_obstructions=", &LEFDEFReaderOptions::set_produce_obstructions, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether obstruction markers shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("obstructions_suffix", &LEFDEFReaderOptions::obstructions_suffix,
|
||||
"@brief Gets the obstruction marker layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("obstructions_suffix=", &LEFDEFReaderOptions::set_obstructions_suffix, gsi::arg ("suffix"),
|
||||
"@brief Sets the obstruction marker layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("obstructions_datatype", &LEFDEFReaderOptions::obstructions_datatype,
|
||||
"@brief Gets the obstruction marker layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("obstructions_datatype=", &LEFDEFReaderOptions::set_obstructions_datatype, gsi::arg ("datatype"),
|
||||
"@brief Sets the obstruction marker layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_blockages", &LEFDEFReaderOptions::produce_blockages,
|
||||
"@brief Gets a value indicating whether routing blockage markers shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_blockages=", &LEFDEFReaderOptions::set_produce_blockages, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether routing blockage markers shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("blockages_suffix", &LEFDEFReaderOptions::blockages_suffix,
|
||||
"@brief Gets the blockage marker layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("blockages_suffix=", &LEFDEFReaderOptions::set_blockages_suffix, gsi::arg ("suffix"),
|
||||
"@brief Sets the blockage marker layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("blockages_datatype", &LEFDEFReaderOptions::blockages_datatype,
|
||||
"@brief Gets the blockage marker layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("blockages_datatype=", &LEFDEFReaderOptions::set_blockages_datatype, gsi::arg ("datatype"),
|
||||
"@brief Sets the blockage marker layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_labels", &LEFDEFReaderOptions::produce_labels,
|
||||
"@brief Gets a value indicating whether labels shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_labels=", &LEFDEFReaderOptions::set_produce_labels, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether labels shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("labels_suffix", &LEFDEFReaderOptions::labels_suffix,
|
||||
"@brief Gets the label layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("labels_suffix=", &LEFDEFReaderOptions::set_labels_suffix, gsi::arg ("suffix"),
|
||||
"@brief Sets the label layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("labels_datatype", &LEFDEFReaderOptions::labels_datatype,
|
||||
"@brief Gets the labels layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("labels_datatype=", &LEFDEFReaderOptions::set_labels_datatype, gsi::arg ("datatype"),
|
||||
"@brief Sets the labels layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_routing", &LEFDEFReaderOptions::produce_routing,
|
||||
"@brief Gets a value indicating whether routing geometry shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_routing=", &LEFDEFReaderOptions::set_produce_routing, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether routing geometry shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("routing_suffix", &LEFDEFReaderOptions::routing_suffix,
|
||||
"@brief Gets the routing layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("routing_suffix=", &LEFDEFReaderOptions::set_routing_suffix, gsi::arg ("suffix"),
|
||||
"@brief Sets the routing layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("routing_datatype", &LEFDEFReaderOptions::routing_datatype,
|
||||
"@brief Gets the routing layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("routing_datatype=", &LEFDEFReaderOptions::set_routing_datatype, gsi::arg ("datatype"),
|
||||
"@brief Sets the routing layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("lef_files", &LEFDEFReaderOptions::lef_files,
|
||||
"@brief Gets the list technology LEF files to additionally import\n"
|
||||
"Returns a list of path names for technology LEF files to read in addition to the primary file. "
|
||||
"Relative paths are resolved relative to the file to read.\n"
|
||||
"\n"
|
||||
"The setter for this property is \\lef_files=."
|
||||
) +
|
||||
gsi::method ("lef_files=", &LEFDEFReaderOptions::set_lef_files,
|
||||
"@brief Sets the list technology LEF files to additionally import\n"
|
||||
"See \\lef_files for details."
|
||||
),
|
||||
"@brief Detailed LEF/DEF reader options\n"
|
||||
"This class is a aggregate belonging to the \\LoadLayoutOptions class. It provides options for the LEF/DEF reader. "
|
||||
"These options have been placed into a separate class to account for their complexity."
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -7,8 +7,6 @@ TARGET = ext_tests
|
|||
include($$PWD/../../lib_ut.pri)
|
||||
|
||||
SOURCES = \
|
||||
extGerberImport.cc \
|
||||
extLEFDEFImport.cc \
|
||||
extNetTracer.cc \
|
||||
|
||||
INCLUDEPATH += $$EXT_INC $$TL_INC $$LAYBASIC_INC $$DB_INC $$GSI_INC
|
||||
|
|
|
|||
|
|
@ -37,6 +37,24 @@
|
|||
#include "layCellTreeModel.h"
|
||||
#include "layQtTools.h"
|
||||
|
||||
#include "ui_LayerSourceDialog.h"
|
||||
#include "ui_NewLayoutPropertiesDialog.h"
|
||||
#include "ui_NewLayerPropertiesDialog.h"
|
||||
#include "ui_NewCellPropertiesDialog.h"
|
||||
#include "ui_MoveOptionsDialog.h"
|
||||
#include "ui_MoveToOptionsDialog.h"
|
||||
#include "ui_DeleteCellModeDialog.h"
|
||||
#include "ui_CopyCellModeDialog.h"
|
||||
#include "ui_ReplaceCellOptionsDialog.h"
|
||||
#include "ui_ClearLayerModeDialog.h"
|
||||
#include "ui_OpenLayoutModeDialog.h"
|
||||
#include "ui_RenameCellDialog.h"
|
||||
#include "ui_DuplicateLayerDialog.h"
|
||||
#include "ui_AlignCellOptionsDialog.h"
|
||||
#include "ui_FlattenInstOptionsDialog.h"
|
||||
#include "ui_UserPropertiesForm.h"
|
||||
#include "ui_UserPropertiesEditForm.h"
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
||||
|
|
@ -47,17 +65,25 @@ LayerSourceDialog::LayerSourceDialog (QWidget *parent)
|
|||
: QDialog (parent)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("layer_source_dialog"));
|
||||
Ui::LayerSourceDialog::setupUi (this);
|
||||
|
||||
activate_help_links (helpLabel);
|
||||
mp_ui = new Ui::LayerSourceDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
activate_help_links (mp_ui->helpLabel);
|
||||
}
|
||||
|
||||
LayerSourceDialog::~LayerSourceDialog ()
|
||||
{
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
LayerSourceDialog::exec_dialog (std::string &s)
|
||||
{
|
||||
sourceString->setText (tl::to_qstring (s));
|
||||
mp_ui->sourceString->setText (tl::to_qstring (s));
|
||||
if (QDialog::exec ()) {
|
||||
s = tl::to_string (sourceString->text ());
|
||||
s = tl::to_string (mp_ui->sourceString->text ());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
@ -71,33 +97,37 @@ NewLayoutPropertiesDialog::NewLayoutPropertiesDialog (QWidget *parent)
|
|||
: QDialog (parent)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("new_layout_properties_dialog"));
|
||||
Ui::NewLayoutPropertiesDialog::setupUi (this);
|
||||
connect (tech_cbx, SIGNAL (currentIndexChanged (int)), this, SLOT (tech_changed ()));
|
||||
|
||||
mp_ui = new Ui::NewLayoutPropertiesDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
connect (mp_ui->tech_cbx, SIGNAL (currentIndexChanged (int)), this, SLOT (tech_changed ()));
|
||||
}
|
||||
|
||||
NewLayoutPropertiesDialog::~NewLayoutPropertiesDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
void
|
||||
NewLayoutPropertiesDialog::tech_changed ()
|
||||
{
|
||||
double dbu = 0.001;
|
||||
int technology_index = tech_cbx->currentIndex ();
|
||||
int technology_index = mp_ui->tech_cbx->currentIndex ();
|
||||
if (technology_index >= 0 && technology_index < (int) lay::Technologies::instance ()->technologies ()) {
|
||||
dbu = lay::Technologies::instance ()->begin () [technology_index].dbu ();
|
||||
}
|
||||
|
||||
#if QT_VERSION >= 0x40700
|
||||
dbu_le->setPlaceholderText (tl::to_qstring (tl::to_string (dbu)));
|
||||
mp_ui->dbu_le->setPlaceholderText (tl::to_qstring (tl::to_string (dbu)));
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
NewLayoutPropertiesDialog::exec_dialog (std::string &technology, std::string &cell_name, double &dbu, double &size, bool ¤t_panel)
|
||||
{
|
||||
tech_cbx->clear ();
|
||||
mp_ui->tech_cbx->clear ();
|
||||
unsigned int technology_index = 0;
|
||||
for (lay::Technologies::const_iterator t = lay::Technologies::instance ()->begin (); t != lay::Technologies::instance ()->end (); ++t, ++technology_index) {
|
||||
|
||||
|
|
@ -107,40 +137,40 @@ NewLayoutPropertiesDialog::exec_dialog (std::string &technology, std::string &ce
|
|||
}
|
||||
d += t->description ();
|
||||
|
||||
tech_cbx->addItem (tl::to_qstring (d));
|
||||
mp_ui->tech_cbx->addItem (tl::to_qstring (d));
|
||||
if (t->name () == technology) {
|
||||
tech_cbx->setCurrentIndex (technology_index);
|
||||
mp_ui->tech_cbx->setCurrentIndex (technology_index);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
window_le->setText (tl::to_qstring (tl::to_string (size)));
|
||||
mp_ui->window_le->setText (tl::to_qstring (tl::to_string (size)));
|
||||
if (dbu > 1e-10) {
|
||||
dbu_le->setText (tl::to_qstring (tl::to_string (dbu)));
|
||||
mp_ui->dbu_le->setText (tl::to_qstring (tl::to_string (dbu)));
|
||||
} else {
|
||||
dbu_le->setText (QString ());
|
||||
mp_ui->dbu_le->setText (QString ());
|
||||
}
|
||||
topcell_le->setText (tl::to_qstring (cell_name));
|
||||
current_panel_cb->setChecked (current_panel);
|
||||
mp_ui->topcell_le->setText (tl::to_qstring (cell_name));
|
||||
mp_ui->current_panel_cb->setChecked (current_panel);
|
||||
|
||||
if (QDialog::exec ()) {
|
||||
|
||||
// get the selected technology name
|
||||
int technology_index = tech_cbx->currentIndex ();
|
||||
int technology_index = mp_ui->tech_cbx->currentIndex ();
|
||||
if (technology_index >= 0 && technology_index < (int) lay::Technologies::instance ()->technologies ()) {
|
||||
technology = lay::Technologies::instance ()->begin () [technology_index].name ();
|
||||
} else {
|
||||
technology = std::string ();
|
||||
}
|
||||
|
||||
tl::from_string (tl::to_string (window_le->text ()), size);
|
||||
if (! dbu_le->text ().isEmpty ()) {
|
||||
tl::from_string (tl::to_string (dbu_le->text ()), dbu);
|
||||
tl::from_string (tl::to_string (mp_ui->window_le->text ()), size);
|
||||
if (! mp_ui->dbu_le->text ().isEmpty ()) {
|
||||
tl::from_string (tl::to_string (mp_ui->dbu_le->text ()), dbu);
|
||||
} else {
|
||||
dbu = 0.0;
|
||||
}
|
||||
cell_name = tl::to_string (topcell_le->text ());
|
||||
current_panel = current_panel_cb->isChecked ();
|
||||
cell_name = tl::to_string (mp_ui->topcell_le->text ());
|
||||
current_panel = mp_ui->current_panel_cb->isChecked ();
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
|
@ -154,12 +184,12 @@ NewLayoutPropertiesDialog::accept ()
|
|||
BEGIN_PROTECTED;
|
||||
|
||||
double x = 0.0;
|
||||
tl::from_string (tl::to_string (window_le->text ()), x);
|
||||
if (!dbu_le->text ().isEmpty ()) {
|
||||
tl::from_string (tl::to_string (dbu_le->text ()), x);
|
||||
tl::from_string (tl::to_string (mp_ui->window_le->text ()), x);
|
||||
if (!mp_ui->dbu_le->text ().isEmpty ()) {
|
||||
tl::from_string (tl::to_string (mp_ui->dbu_le->text ()), x);
|
||||
}
|
||||
|
||||
if (topcell_le->text ().isEmpty ()) {
|
||||
if (mp_ui->topcell_le->text ().isEmpty ()) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("The topcell must be specified")));
|
||||
}
|
||||
|
||||
|
|
@ -176,12 +206,15 @@ NewCellPropertiesDialog::NewCellPropertiesDialog (QWidget *parent)
|
|||
mp_layout (0)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("new_cell_properties_dialog"));
|
||||
Ui::NewCellPropertiesDialog::setupUi (this);
|
||||
|
||||
mp_ui = new Ui::NewCellPropertiesDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
}
|
||||
|
||||
NewCellPropertiesDialog::~NewCellPropertiesDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -189,13 +222,13 @@ NewCellPropertiesDialog::exec_dialog (const db::Layout *layout, std::string &cel
|
|||
{
|
||||
mp_layout = layout;
|
||||
|
||||
name_le->setText (tl::to_qstring (cell_name));
|
||||
window_le->setText (tl::to_qstring (tl::to_string (size)));
|
||||
mp_ui->name_le->setText (tl::to_qstring (cell_name));
|
||||
mp_ui->window_le->setText (tl::to_qstring (tl::to_string (size)));
|
||||
|
||||
if (QDialog::exec ()) {
|
||||
|
||||
tl::from_string (tl::to_string (window_le->text ()), size);
|
||||
cell_name = tl::to_string (name_le->text ());
|
||||
tl::from_string (tl::to_string (mp_ui->window_le->text ()), size);
|
||||
cell_name = tl::to_string (mp_ui->name_le->text ());
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
|
@ -209,10 +242,10 @@ NewCellPropertiesDialog::accept ()
|
|||
BEGIN_PROTECTED;
|
||||
|
||||
double x = 0.0;
|
||||
tl::from_string (tl::to_string (window_le->text ()), x);
|
||||
tl::from_string (tl::to_string (mp_ui->window_le->text ()), x);
|
||||
|
||||
if (mp_layout->cell_by_name (tl::to_string (name_le->text ()).c_str ()).first) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("A cell with that name already exists: %s")), tl::to_string (name_le->text ()));
|
||||
if (mp_layout->cell_by_name (tl::to_string (mp_ui->name_le->text ()).c_str ()).first) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("A cell with that name already exists: %s")), tl::to_string (mp_ui->name_le->text ()));
|
||||
}
|
||||
|
||||
QDialog::accept ();
|
||||
|
|
@ -227,12 +260,15 @@ NewLayerPropertiesDialog::NewLayerPropertiesDialog (QWidget *parent)
|
|||
: QDialog (parent)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("new_layer_properties_dialog"));
|
||||
Ui::NewLayerPropertiesDialog::setupUi (this);
|
||||
|
||||
mp_ui = new Ui::NewLayerPropertiesDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
}
|
||||
|
||||
NewLayerPropertiesDialog::~NewLayerPropertiesDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -245,23 +281,23 @@ bool
|
|||
NewLayerPropertiesDialog::exec_dialog (const lay::CellView &cv, db::LayerProperties &src)
|
||||
{
|
||||
if (cv.is_valid ()) {
|
||||
layout_lbl->setText (tl::to_qstring ((tl::to_string (QObject::tr ("Layer for layout: ")) + cv->name ())));
|
||||
layout_lbl->show ();
|
||||
mp_ui->layout_lbl->setText (tl::to_qstring ((tl::to_string (QObject::tr ("Layer for layout: ")) + cv->name ())));
|
||||
mp_ui->layout_lbl->show ();
|
||||
} else {
|
||||
layout_lbl->hide ();
|
||||
mp_ui->layout_lbl->hide ();
|
||||
}
|
||||
|
||||
if (src.layer >= 0) {
|
||||
layer_le->setText (tl::to_qstring (tl::to_string (src.layer)));
|
||||
mp_ui->layer_le->setText (tl::to_qstring (tl::to_string (src.layer)));
|
||||
} else {
|
||||
layer_le->setText (QString ());
|
||||
mp_ui->layer_le->setText (QString ());
|
||||
}
|
||||
if (src.datatype >= 0) {
|
||||
datatype_le->setText (tl::to_qstring (tl::to_string (src.datatype)));
|
||||
mp_ui->datatype_le->setText (tl::to_qstring (tl::to_string (src.datatype)));
|
||||
} else {
|
||||
datatype_le->setText (QString ());
|
||||
mp_ui->datatype_le->setText (QString ());
|
||||
}
|
||||
name_le->setText (tl::to_qstring (src.name));
|
||||
mp_ui->name_le->setText (tl::to_qstring (src.name));
|
||||
|
||||
if (QDialog::exec ()) {
|
||||
get (src);
|
||||
|
|
@ -274,21 +310,21 @@ NewLayerPropertiesDialog::exec_dialog (const lay::CellView &cv, db::LayerPropert
|
|||
void
|
||||
NewLayerPropertiesDialog::get (db::LayerProperties &src)
|
||||
{
|
||||
if (! layer_le->text ().isEmpty ()) {
|
||||
if (! mp_ui->layer_le->text ().isEmpty ()) {
|
||||
int l = -1;
|
||||
tl::from_string (tl::to_string (layer_le->text ()), l);
|
||||
tl::from_string (tl::to_string (mp_ui->layer_le->text ()), l);
|
||||
src.layer = l;
|
||||
} else {
|
||||
src.layer = -1;
|
||||
}
|
||||
if (! datatype_le->text ().isEmpty ()) {
|
||||
if (! mp_ui->datatype_le->text ().isEmpty ()) {
|
||||
int d = -1;
|
||||
tl::from_string (tl::to_string (datatype_le->text ()), d);
|
||||
tl::from_string (tl::to_string (mp_ui->datatype_le->text ()), d);
|
||||
src.datatype = d;
|
||||
} else {
|
||||
src.datatype = -1;
|
||||
}
|
||||
src.name = tl::to_string (name_le->text ());
|
||||
src.name = tl::to_string (mp_ui->name_le->text ());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -316,25 +352,28 @@ MoveOptionsDialog::MoveOptionsDialog (QWidget *parent)
|
|||
: QDialog (parent)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("move_options_dialog"));
|
||||
Ui::MoveOptionsDialog::setupUi (this);
|
||||
|
||||
mp_ui = new Ui::MoveOptionsDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
}
|
||||
|
||||
MoveOptionsDialog::~MoveOptionsDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
MoveOptionsDialog::exec_dialog (db::DVector &disp)
|
||||
{
|
||||
disp_x_le->setText (tl::to_qstring (tl::to_string (disp.x ())));
|
||||
disp_y_le->setText (tl::to_qstring (tl::to_string (disp.y ())));
|
||||
mp_ui->disp_x_le->setText (tl::to_qstring (tl::to_string (disp.x ())));
|
||||
mp_ui->disp_y_le->setText (tl::to_qstring (tl::to_string (disp.y ())));
|
||||
|
||||
if (QDialog::exec ()) {
|
||||
|
||||
double x = 0.0, y = 0.0;
|
||||
tl::from_string (tl::to_string (disp_x_le->text ()), x);
|
||||
tl::from_string (tl::to_string (disp_y_le->text ()), y);
|
||||
tl::from_string (tl::to_string (mp_ui->disp_x_le->text ()), x);
|
||||
tl::from_string (tl::to_string (mp_ui->disp_y_le->text ()), y);
|
||||
|
||||
disp = db::DVector (x, y);
|
||||
|
||||
|
|
@ -350,8 +389,8 @@ MoveOptionsDialog::accept ()
|
|||
{
|
||||
BEGIN_PROTECTED;
|
||||
double x = 0.0;
|
||||
tl::from_string (tl::to_string (disp_x_le->text ()), x);
|
||||
tl::from_string (tl::to_string (disp_y_le->text ()), x);
|
||||
tl::from_string (tl::to_string (mp_ui->disp_x_le->text ()), x);
|
||||
tl::from_string (tl::to_string (mp_ui->disp_y_le->text ()), x);
|
||||
QDialog::accept ();
|
||||
END_PROTECTED;
|
||||
}
|
||||
|
|
@ -363,9 +402,11 @@ MoveToOptionsDialog::MoveToOptionsDialog (QWidget *parent)
|
|||
: QDialog (parent)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("move_to_options_dialog"));
|
||||
Ui::MoveToOptionsDialog::setupUi (this);
|
||||
|
||||
QToolButton *buttons[3][3] = { { lb, cb, rb }, { lc, cc, rc }, { lt, ct, rt } };
|
||||
mp_ui = new Ui::MoveToOptionsDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
QToolButton *buttons[3][3] = { { mp_ui->lb, mp_ui->cb, mp_ui->rb }, { mp_ui->lc, mp_ui->cc, mp_ui->rc }, { mp_ui->lt, mp_ui->ct, mp_ui->rt } };
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
|
|
@ -376,16 +417,17 @@ MoveToOptionsDialog::MoveToOptionsDialog (QWidget *parent)
|
|||
|
||||
MoveToOptionsDialog::~MoveToOptionsDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
MoveToOptionsDialog::exec_dialog (int &mode_x, int &mode_y, db::DPoint &target)
|
||||
{
|
||||
x_le->setText (tl::to_qstring (tl::to_string (target.x ())));
|
||||
y_le->setText (tl::to_qstring (tl::to_string (target.y ())));
|
||||
mp_ui->x_le->setText (tl::to_qstring (tl::to_string (target.x ())));
|
||||
mp_ui->y_le->setText (tl::to_qstring (tl::to_string (target.y ())));
|
||||
|
||||
QToolButton *buttons[3][3] = { { lb, cb, rb }, { lc, cc, rc }, { lt, ct, rt } };
|
||||
QToolButton *buttons[3][3] = { { mp_ui->lb, mp_ui->cb, mp_ui->rb }, { mp_ui->lc, mp_ui->cc, mp_ui->rc }, { mp_ui->lt, mp_ui->ct, mp_ui->rt } };
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
|
|
@ -405,8 +447,8 @@ MoveToOptionsDialog::exec_dialog (int &mode_x, int &mode_y, db::DPoint &target)
|
|||
}
|
||||
|
||||
double x = 0.0, y = 0.0;
|
||||
tl::from_string (tl::to_string (x_le->text ()), x);
|
||||
tl::from_string (tl::to_string (y_le->text ()), y);
|
||||
tl::from_string (tl::to_string (mp_ui->x_le->text ()), x);
|
||||
tl::from_string (tl::to_string (mp_ui->y_le->text ()), y);
|
||||
|
||||
target = db::DPoint (x, y);
|
||||
|
||||
|
|
@ -422,8 +464,8 @@ MoveToOptionsDialog::accept ()
|
|||
{
|
||||
BEGIN_PROTECTED;
|
||||
double x = 0.0;
|
||||
tl::from_string (tl::to_string (x_le->text ()), x);
|
||||
tl::from_string (tl::to_string (y_le->text ()), x);
|
||||
tl::from_string (tl::to_string (mp_ui->x_le->text ()), x);
|
||||
tl::from_string (tl::to_string (mp_ui->y_le->text ()), x);
|
||||
QDialog::accept ();
|
||||
END_PROTECTED;
|
||||
}
|
||||
|
|
@ -431,7 +473,7 @@ END_PROTECTED;
|
|||
void
|
||||
MoveToOptionsDialog::button_clicked ()
|
||||
{
|
||||
QToolButton *buttons[3][3] = { { lb, cb, rb }, { lc, cc, rc }, { lt, ct, rt } };
|
||||
QToolButton *buttons[3][3] = { { mp_ui->lb, mp_ui->cb, mp_ui->rb }, { mp_ui->lc, mp_ui->cc, mp_ui->rc }, { mp_ui->lt, mp_ui->ct, mp_ui->rt } };
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
|
|
@ -449,22 +491,25 @@ RenameCellDialog::RenameCellDialog (QWidget *parent)
|
|||
: QDialog (parent), mp_layout (0)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("rename_cell_dialog"));
|
||||
Ui::RenameCellDialog::setupUi (this);
|
||||
|
||||
mp_ui = new Ui::RenameCellDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
}
|
||||
|
||||
RenameCellDialog::~RenameCellDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
void
|
||||
RenameCellDialog::accept ()
|
||||
{
|
||||
BEGIN_PROTECTED;
|
||||
if (name_le->text ().isEmpty ()) {
|
||||
if (mp_ui->name_le->text ().isEmpty ()) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("A name must be given")));
|
||||
}
|
||||
if (mp_layout->cell_by_name (tl::to_string (name_le->text ()).c_str ()).first) {
|
||||
if (mp_layout->cell_by_name (tl::to_string (mp_ui->name_le->text ()).c_str ()).first) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("A cell with that name already exists")));
|
||||
}
|
||||
QDialog::accept ();
|
||||
|
|
@ -475,9 +520,9 @@ bool
|
|||
RenameCellDialog::exec_dialog (const db::Layout &layout, std::string &name)
|
||||
{
|
||||
mp_layout = &layout;
|
||||
name_le->setText (tl::to_qstring (name));
|
||||
mp_ui->name_le->setText (tl::to_qstring (name));
|
||||
if (QDialog::exec ()) {
|
||||
name = tl::to_string (name_le->text ());
|
||||
name = tl::to_string (mp_ui->name_le->text ());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
@ -491,18 +536,21 @@ CopyCellModeDialog::CopyCellModeDialog (QWidget *parent)
|
|||
: QDialog (parent)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("copy_cell_mode_dialog"));
|
||||
Ui::CopyCellModeDialog::setupUi (this);
|
||||
|
||||
mp_ui = new Ui::CopyCellModeDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
}
|
||||
|
||||
CopyCellModeDialog::~CopyCellModeDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
CopyCellModeDialog::exec_dialog (int ©_mode)
|
||||
{
|
||||
QRadioButton *buttons [] = { shallow_rb, deep_rb };
|
||||
QRadioButton *buttons [] = { mp_ui->shallow_rb, mp_ui->deep_rb };
|
||||
|
||||
for (int i = 0; i < int (sizeof (buttons) / sizeof (buttons [0])); ++i) {
|
||||
buttons [i]->setChecked (copy_mode == i);
|
||||
|
|
@ -527,18 +575,21 @@ DeleteCellModeDialog::DeleteCellModeDialog (QWidget *parent)
|
|||
: QDialog (parent)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("delete_cell_mode_dialog"));
|
||||
Ui::DeleteCellModeDialog::setupUi (this);
|
||||
|
||||
mp_ui = new Ui::DeleteCellModeDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
}
|
||||
|
||||
DeleteCellModeDialog::~DeleteCellModeDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
DeleteCellModeDialog::exec_dialog (int &delete_mode)
|
||||
{
|
||||
QRadioButton *buttons [] = { shallow_rb, deep_rb, full_rb };
|
||||
QRadioButton *buttons [] = { mp_ui->shallow_rb, mp_ui->deep_rb, mp_ui->full_rb };
|
||||
|
||||
for (int i = 0; i < int (sizeof (buttons) / sizeof (buttons [0])); ++i) {
|
||||
buttons [i]->setChecked (delete_mode == i);
|
||||
|
|
@ -563,26 +614,29 @@ ReplaceCellOptionsDialog::ReplaceCellOptionsDialog (QWidget *parent)
|
|||
: QDialog (parent)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("replace_cell_options_dialog"));
|
||||
Ui::ReplaceCellOptionsDialog::setupUi (this);
|
||||
|
||||
mp_ui = new Ui::ReplaceCellOptionsDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
}
|
||||
|
||||
ReplaceCellOptionsDialog::~ReplaceCellOptionsDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
ReplaceCellOptionsDialog::exec_dialog (const lay::CellView &cv, int &replace_mode, db::cell_index_type &cell_index)
|
||||
{
|
||||
QRadioButton *buttons [] = { shallow_rb, deep_rb, full_rb };
|
||||
QRadioButton *buttons [] = { mp_ui->shallow_rb, mp_ui->deep_rb, mp_ui->full_rb };
|
||||
|
||||
for (int i = 0; i < int (sizeof (buttons) / sizeof (buttons [0])); ++i) {
|
||||
buttons [i]->setChecked (replace_mode == i);
|
||||
}
|
||||
|
||||
lay::CellTreeModel *model = new lay::CellTreeModel (cell_selection_cbx, &cv->layout (), lay::CellTreeModel::Flat | lay::CellTreeModel::NoPadding);
|
||||
cell_selection_cbx->setModel (model);
|
||||
cell_selection_cbx->setEditText (tl::to_qstring (cv->layout ().cell_name (cell_index)));
|
||||
lay::CellTreeModel *model = new lay::CellTreeModel (mp_ui->cell_selection_cbx, &cv->layout (), lay::CellTreeModel::Flat | lay::CellTreeModel::NoPadding);
|
||||
mp_ui->cell_selection_cbx->setModel (model);
|
||||
mp_ui->cell_selection_cbx->setEditText (tl::to_qstring (cv->layout ().cell_name (cell_index)));
|
||||
|
||||
if (QDialog::exec ()) {
|
||||
|
||||
|
|
@ -592,7 +646,7 @@ ReplaceCellOptionsDialog::exec_dialog (const lay::CellView &cv, int &replace_mod
|
|||
}
|
||||
}
|
||||
|
||||
std::string cn = tl::to_string (cell_selection_cbx->lineEdit ()->text ());
|
||||
std::string cn = tl::to_string (mp_ui->cell_selection_cbx->lineEdit ()->text ());
|
||||
std::pair<bool, db::cell_index_type> cc = cv->layout ().cell_by_name (cn.c_str ());
|
||||
cell_index = cc.second;
|
||||
|
||||
|
|
@ -608,9 +662,9 @@ ReplaceCellOptionsDialog::accept ()
|
|||
{
|
||||
BEGIN_PROTECTED;
|
||||
|
||||
lay::CellTreeModel *model = dynamic_cast<lay::CellTreeModel *> (cell_selection_cbx->model ());
|
||||
lay::CellTreeModel *model = dynamic_cast<lay::CellTreeModel *> (mp_ui->cell_selection_cbx->model ());
|
||||
if (model) {
|
||||
std::string cn = tl::to_string (cell_selection_cbx->lineEdit ()->text ());
|
||||
std::string cn = tl::to_string (mp_ui->cell_selection_cbx->lineEdit ()->text ());
|
||||
std::pair<bool, db::cell_index_type> cc = model->layout ()->cell_by_name (cn.c_str ());
|
||||
if (! cc.first) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("Not a valid cell name: ")) + cn);
|
||||
|
|
@ -629,18 +683,21 @@ ClearLayerModeDialog::ClearLayerModeDialog (QWidget *parent)
|
|||
: QDialog (parent)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("clear_layer_mode_dialog"));
|
||||
Ui::ClearLayerModeDialog::setupUi (this);
|
||||
|
||||
mp_ui = new Ui::ClearLayerModeDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
}
|
||||
|
||||
ClearLayerModeDialog::~ClearLayerModeDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
ClearLayerModeDialog::exec_dialog (int &clear_mode)
|
||||
{
|
||||
QRadioButton *buttons [3] = { local_rb, hierarchically_rb, layout_rb };
|
||||
QRadioButton *buttons [3] = { mp_ui->local_rb, mp_ui->hierarchically_rb, mp_ui->layout_rb };
|
||||
|
||||
for (int i = 0; i < int (sizeof (buttons) / sizeof (buttons [0])); ++i) {
|
||||
buttons [i]->setChecked (clear_mode == i);
|
||||
|
|
@ -665,18 +722,21 @@ OpenLayoutModeDialog::OpenLayoutModeDialog (QWidget *parent)
|
|||
: QDialog (parent)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("open_layout_mode_dialog"));
|
||||
Ui::OpenLayoutModeDialog::setupUi (this);
|
||||
|
||||
mp_ui = new Ui::OpenLayoutModeDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
}
|
||||
|
||||
OpenLayoutModeDialog::~OpenLayoutModeDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
OpenLayoutModeDialog::exec_dialog (int &open_mode)
|
||||
{
|
||||
QRadioButton *buttons [3] = { replace_rb, new_rb, add_rb };
|
||||
QRadioButton *buttons [3] = { mp_ui->replace_rb, mp_ui->new_rb, mp_ui->add_rb };
|
||||
|
||||
for (int i = 0; i < int (sizeof (buttons) / sizeof (buttons [0])); ++i) {
|
||||
buttons [i]->setChecked (open_mode == i);
|
||||
|
|
@ -702,15 +762,18 @@ DuplicateLayerDialog::DuplicateLayerDialog (QWidget *parent)
|
|||
mp_view (0)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("merge_options_dialog"));
|
||||
Ui::DuplicateLayerDialog::setupUi (this);
|
||||
|
||||
connect (cv_cbx, SIGNAL (activated (int)), this, SLOT (cv_changed (int)));
|
||||
connect (cvr_cbx, SIGNAL (activated (int)), this, SLOT (cv_changed (int)));
|
||||
mp_ui = new Ui::DuplicateLayerDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
connect (mp_ui->cv_cbx, SIGNAL (activated (int)), this, SLOT (cv_changed (int)));
|
||||
connect (mp_ui->cvr_cbx, SIGNAL (activated (int)), this, SLOT (cv_changed (int)));
|
||||
}
|
||||
|
||||
DuplicateLayerDialog::~DuplicateLayerDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -720,8 +783,8 @@ DuplicateLayerDialog::cv_changed (int)
|
|||
return;
|
||||
}
|
||||
|
||||
layer_cbx->set_view (mp_view, cv_cbx->currentIndex ());
|
||||
layerr_cbx->set_view (mp_view, cvr_cbx->currentIndex ());
|
||||
mp_ui->layer_cbx->set_view (mp_view, mp_ui->cv_cbx->currentIndex ());
|
||||
mp_ui->layerr_cbx->set_view (mp_view, mp_ui->cvr_cbx->currentIndex ());
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -730,28 +793,28 @@ DuplicateLayerDialog::exec_dialog (lay::LayoutView *view, int &cv, int &layer, i
|
|||
mp_view = view;
|
||||
|
||||
bool res = false;
|
||||
cv_cbx->set_layout_view (view);
|
||||
cv_cbx->set_current_cv_index (cv);
|
||||
cvr_cbx->set_layout_view (view);
|
||||
cvr_cbx->set_current_cv_index (cv_r);
|
||||
mp_ui->cv_cbx->set_layout_view (view);
|
||||
mp_ui->cv_cbx->set_current_cv_index (cv);
|
||||
mp_ui->cvr_cbx->set_layout_view (view);
|
||||
mp_ui->cvr_cbx->set_current_cv_index (cv_r);
|
||||
|
||||
cv_changed (0 /*dummy*/);
|
||||
|
||||
layer_cbx->set_current_layer (layer);
|
||||
layerr_cbx->set_current_layer (layer_r);
|
||||
mp_ui->layer_cbx->set_current_layer (layer);
|
||||
mp_ui->layerr_cbx->set_current_layer (layer_r);
|
||||
|
||||
hier_mode_cbx->setCurrentIndex (hier_mode);
|
||||
clear_cb->setChecked (clear_before);
|
||||
mp_ui->hier_mode_cbx->setCurrentIndex (hier_mode);
|
||||
mp_ui->clear_cb->setChecked (clear_before);
|
||||
|
||||
if (QDialog::exec ()) {
|
||||
|
||||
cv = cv_cbx->current_cv_index ();
|
||||
cv_r = cvr_cbx->current_cv_index ();
|
||||
layer = layer_cbx->current_layer ();
|
||||
layer_r = layerr_cbx->current_layer ();
|
||||
cv = mp_ui->cv_cbx->current_cv_index ();
|
||||
cv_r = mp_ui->cvr_cbx->current_cv_index ();
|
||||
layer = mp_ui->layer_cbx->current_layer ();
|
||||
layer_r = mp_ui->layerr_cbx->current_layer ();
|
||||
|
||||
hier_mode = hier_mode_cbx->currentIndex ();
|
||||
clear_before = clear_cb->isChecked ();
|
||||
hier_mode = mp_ui->hier_mode_cbx->currentIndex ();
|
||||
clear_before = mp_ui->clear_cb->isChecked ();
|
||||
|
||||
res = true;
|
||||
|
||||
|
|
@ -766,12 +829,12 @@ DuplicateLayerDialog::accept ()
|
|||
{
|
||||
BEGIN_PROTECTED;
|
||||
|
||||
int cv = cv_cbx->current_cv_index ();
|
||||
int cv = mp_ui->cv_cbx->current_cv_index ();
|
||||
if (cv < 0) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("No layout specified for source")));
|
||||
}
|
||||
|
||||
int cv_r = cvr_cbx->current_cv_index ();
|
||||
int cv_r = mp_ui->cvr_cbx->current_cv_index ();
|
||||
if (cv_r < 0) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("No layout specified for result")));
|
||||
}
|
||||
|
|
@ -780,19 +843,19 @@ BEGIN_PROTECTED;
|
|||
throw tl::Exception (tl::to_string (QObject::tr ("Source and result layouts must have the same database unit")));
|
||||
}
|
||||
|
||||
if (layer_cbx->current_layer () < 0) {
|
||||
if (mp_ui->layer_cbx->current_layer () < 0) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("No layer specified for source")));
|
||||
}
|
||||
if (layerr_cbx->current_layer () < 0) {
|
||||
if (mp_ui->layerr_cbx->current_layer () < 0) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("No layer specified for result")));
|
||||
}
|
||||
|
||||
if (hier_mode_cbx->currentIndex () == 2 &&
|
||||
cv_cbx->current_cv_index () != cvr_cbx->current_cv_index ()) {
|
||||
if (mp_ui->hier_mode_cbx->currentIndex () == 2 &&
|
||||
mp_ui->cv_cbx->current_cv_index () != mp_ui->cvr_cbx->current_cv_index ()) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("Source layout and result layout must be same in 'cell by cell' mode")));
|
||||
}
|
||||
|
||||
if (cv_cbx->current_cv_index () == cvr_cbx->current_cv_index () && layer_cbx->current_layer () == layerr_cbx->current_layer ()) {
|
||||
if (mp_ui->cv_cbx->current_cv_index () == mp_ui->cvr_cbx->current_cv_index () && mp_ui->layer_cbx->current_layer () == mp_ui->layerr_cbx->current_layer ()) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("Source and target layer must not be identical")));
|
||||
}
|
||||
|
||||
|
|
@ -807,9 +870,11 @@ AlignCellOptionsDialog::AlignCellOptionsDialog (QWidget *parent)
|
|||
: QDialog (parent)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("align_cell_options_dialog"));
|
||||
Ui::AlignCellOptionsDialog::setupUi (this);
|
||||
|
||||
QToolButton *buttons[3][3] = { { lb, cb, rb }, { lc, cc, rc }, { lt, ct, rt } };
|
||||
mp_ui = new Ui::AlignCellOptionsDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
QToolButton *buttons[3][3] = { { mp_ui->lb, mp_ui->cb, mp_ui->rb }, { mp_ui->lc, mp_ui->cc, mp_ui->rc }, { mp_ui->lt, mp_ui->ct, mp_ui->rt } };
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
|
|
@ -820,16 +885,17 @@ AlignCellOptionsDialog::AlignCellOptionsDialog (QWidget *parent)
|
|||
|
||||
AlignCellOptionsDialog::~AlignCellOptionsDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
AlignCellOptionsDialog::exec_dialog (int &mode_x, int &mode_y, bool &visible_only, bool &adjust_calls)
|
||||
{
|
||||
vis_only_cbx->setChecked (visible_only);
|
||||
adjust_calls_cbx->setChecked (adjust_calls);
|
||||
mp_ui->vis_only_cbx->setChecked (visible_only);
|
||||
mp_ui->adjust_calls_cbx->setChecked (adjust_calls);
|
||||
|
||||
QToolButton *buttons[3][3] = { { lb, cb, rb }, { lc, cc, rc }, { lt, ct, rt } };
|
||||
QToolButton *buttons[3][3] = { { mp_ui->lb, mp_ui->cb, mp_ui->rb }, { mp_ui->lc, mp_ui->cc, mp_ui->rc }, { mp_ui->lt, mp_ui->ct, mp_ui->rt } };
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
|
|
@ -839,8 +905,8 @@ AlignCellOptionsDialog::exec_dialog (int &mode_x, int &mode_y, bool &visible_onl
|
|||
|
||||
if (QDialog::exec ()) {
|
||||
|
||||
visible_only = vis_only_cbx->isChecked ();
|
||||
adjust_calls = adjust_calls_cbx->isChecked ();
|
||||
visible_only = mp_ui->vis_only_cbx->isChecked ();
|
||||
adjust_calls = mp_ui->adjust_calls_cbx->isChecked ();
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
|
|
@ -861,7 +927,7 @@ AlignCellOptionsDialog::exec_dialog (int &mode_x, int &mode_y, bool &visible_onl
|
|||
void
|
||||
AlignCellOptionsDialog::button_clicked ()
|
||||
{
|
||||
QToolButton *buttons[3][3] = { { lb, cb, rb }, { lc, cc, rc }, { lt, ct, rt } };
|
||||
QToolButton *buttons[3][3] = { { mp_ui->lb, mp_ui->cb, mp_ui->rb }, { mp_ui->lc, mp_ui->cc, mp_ui->rc }, { mp_ui->lt, mp_ui->ct, mp_ui->rt } };
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
|
|
@ -878,43 +944,50 @@ AlignCellOptionsDialog::button_clicked ()
|
|||
FlattenInstOptionsDialog::FlattenInstOptionsDialog (QWidget *parent, bool enable_pruning)
|
||||
: QDialog (parent)
|
||||
{
|
||||
setupUi (this);
|
||||
mp_ui = new Ui::FlattenInstOptionsDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
if (! enable_pruning) {
|
||||
prune_cb->setChecked (false);
|
||||
prune_cb->hide ();
|
||||
mp_ui->prune_cb->setChecked (false);
|
||||
mp_ui->prune_cb->hide ();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
FlattenInstOptionsDialog::~FlattenInstOptionsDialog ()
|
||||
{
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
FlattenInstOptionsDialog::exec_dialog (int &levels, bool &prune)
|
||||
{
|
||||
first_level_rb->setChecked (false);
|
||||
all_levels_rb->setChecked (false);
|
||||
spec_levels_rb->setChecked (false);
|
||||
levels_sb->setValue ((levels < 0 || levels > levels_sb->maximum ()) ? levels_sb->maximum () : levels);
|
||||
mp_ui->first_level_rb->setChecked (false);
|
||||
mp_ui->all_levels_rb->setChecked (false);
|
||||
mp_ui->spec_levels_rb->setChecked (false);
|
||||
mp_ui->levels_sb->setValue ((levels < 0 || levels > mp_ui->levels_sb->maximum ()) ? mp_ui->levels_sb->maximum () : levels);
|
||||
|
||||
if (levels == 1) {
|
||||
first_level_rb->setChecked (true);
|
||||
mp_ui->first_level_rb->setChecked (true);
|
||||
} else if (levels < 0 || levels == std::numeric_limits<int>::max ()) {
|
||||
all_levels_rb->setChecked (true);
|
||||
mp_ui->all_levels_rb->setChecked (true);
|
||||
} else {
|
||||
spec_levels_rb->setChecked (true);
|
||||
mp_ui->spec_levels_rb->setChecked (true);
|
||||
}
|
||||
|
||||
prune_cb->setChecked (prune);
|
||||
mp_ui->prune_cb->setChecked (prune);
|
||||
|
||||
if (QDialog::exec ()) {
|
||||
|
||||
prune = prune_cb->isChecked ();
|
||||
prune = mp_ui->prune_cb->isChecked ();
|
||||
|
||||
if (first_level_rb->isChecked ()) {
|
||||
if (mp_ui->first_level_rb->isChecked ()) {
|
||||
levels = 1;
|
||||
return true;
|
||||
} else if (spec_levels_rb->isChecked ()) {
|
||||
levels = levels_sb->value ();
|
||||
} else if (mp_ui->spec_levels_rb->isChecked ()) {
|
||||
levels = mp_ui->levels_sb->value ();
|
||||
return true;
|
||||
} else if (all_levels_rb->isChecked ()) {
|
||||
} else if (mp_ui->all_levels_rb->isChecked ()) {
|
||||
levels = std::numeric_limits<int>::max ();
|
||||
return true;
|
||||
}
|
||||
|
|
@ -931,15 +1004,22 @@ UserPropertiesForm::UserPropertiesForm (QWidget *parent)
|
|||
{
|
||||
setObjectName (QString::fromUtf8 ("user_properties_form"));
|
||||
|
||||
Ui::UserPropertiesForm::setupUi (this);
|
||||
mp_ui = new Ui::UserPropertiesForm ();
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
connect (add_pb, SIGNAL (clicked ()), this, SLOT (add ()));
|
||||
connect (remove_pb, SIGNAL (clicked ()), this, SLOT (remove ()));
|
||||
connect (edit_pb, SIGNAL (clicked ()), this, SLOT (edit ()));
|
||||
connect (prop_list, SIGNAL (itemDoubleClicked (QTreeWidgetItem *, int)), this, SLOT (dbl_clicked (QTreeWidgetItem *, int)));
|
||||
connect (mp_ui->add_pb, SIGNAL (clicked ()), this, SLOT (add ()));
|
||||
connect (mp_ui->remove_pb, SIGNAL (clicked ()), this, SLOT (remove ()));
|
||||
connect (mp_ui->edit_pb, SIGNAL (clicked ()), this, SLOT (edit ()));
|
||||
connect (mp_ui->prop_list, SIGNAL (itemDoubleClicked (QTreeWidgetItem *, int)), this, SLOT (dbl_clicked (QTreeWidgetItem *, int)));
|
||||
}
|
||||
|
||||
bool
|
||||
UserPropertiesForm::~UserPropertiesForm ()
|
||||
{
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
UserPropertiesForm::show (lay::LayoutView *view, unsigned int cv_index, db::properties_id_type &prop_id)
|
||||
{
|
||||
bool ret = false;
|
||||
|
|
@ -951,16 +1031,16 @@ BEGIN_PROTECTED
|
|||
|
||||
m_editable = cv->layout ().is_editable ();
|
||||
if (m_editable) {
|
||||
edit_frame->show ();
|
||||
mp_ui->edit_frame->show ();
|
||||
} else {
|
||||
edit_frame->hide ();
|
||||
mp_ui->edit_frame->hide ();
|
||||
}
|
||||
|
||||
prop_list->clear ();
|
||||
mp_ui->prop_list->clear ();
|
||||
|
||||
const db::PropertiesRepository::properties_set &props = prep.properties (prop_id);
|
||||
for (db::PropertiesRepository::properties_set::const_iterator p = props.begin (); p != props.end (); ++p) {
|
||||
QTreeWidgetItem *entry = new QTreeWidgetItem (prop_list);
|
||||
QTreeWidgetItem *entry = new QTreeWidgetItem (mp_ui->prop_list);
|
||||
entry->setText (0, tl::to_qstring (prep.prop_name (p->first).to_parsable_string ()));
|
||||
entry->setText (1, tl::to_qstring (p->second.to_parsable_string ()));
|
||||
}
|
||||
|
|
@ -969,7 +1049,7 @@ BEGIN_PROTECTED
|
|||
|
||||
db::PropertiesRepository::properties_set props;
|
||||
|
||||
QTreeWidgetItemIterator it (prop_list);
|
||||
QTreeWidgetItemIterator it (mp_ui->prop_list);
|
||||
while (*it) {
|
||||
|
||||
tl::Variant v, k;
|
||||
|
|
@ -1017,11 +1097,11 @@ BEGIN_PROTECTED
|
|||
UserPropertiesEditForm edit_form (this);
|
||||
if (edit_form.show (key, value)) {
|
||||
|
||||
QTreeWidgetItem *entry = new QTreeWidgetItem (prop_list);
|
||||
QTreeWidgetItem *entry = new QTreeWidgetItem (mp_ui->prop_list);
|
||||
entry->setText (0, key);
|
||||
entry->setText (1, value);
|
||||
|
||||
prop_list->setCurrentItem (entry);
|
||||
mp_ui->prop_list->setCurrentItem (entry);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1037,11 +1117,11 @@ BEGIN_PROTECTED
|
|||
return;
|
||||
}
|
||||
|
||||
if (prop_list->currentItem () == 0) {
|
||||
if (mp_ui->prop_list->currentItem () == 0) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("Select an item to delete")));
|
||||
}
|
||||
|
||||
delete prop_list->currentItem ();
|
||||
delete mp_ui->prop_list->currentItem ();
|
||||
|
||||
END_PROTECTED
|
||||
}
|
||||
|
|
@ -1061,17 +1141,17 @@ BEGIN_PROTECTED
|
|||
return;
|
||||
}
|
||||
|
||||
if (prop_list->currentItem () == 0) {
|
||||
if (mp_ui->prop_list->currentItem () == 0) {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("Select an item to edit")));
|
||||
}
|
||||
|
||||
QString key = prop_list->currentItem ()->text (0);
|
||||
QString value = prop_list->currentItem ()->text (1);
|
||||
QString key = mp_ui->prop_list->currentItem ()->text (0);
|
||||
QString value = mp_ui->prop_list->currentItem ()->text (1);
|
||||
|
||||
UserPropertiesEditForm edit_form (this);
|
||||
if (edit_form.show (key, value)) {
|
||||
prop_list->currentItem ()->setText (0, key);
|
||||
prop_list->currentItem ()->setText (1, value);
|
||||
mp_ui->prop_list->currentItem ()->setText (0, key);
|
||||
mp_ui->prop_list->currentItem ()->setText (1, value);
|
||||
}
|
||||
|
||||
END_PROTECTED
|
||||
|
|
@ -1085,12 +1165,19 @@ UserPropertiesEditForm::UserPropertiesEditForm (QWidget *parent)
|
|||
{
|
||||
setObjectName (QString::fromUtf8 ("user_properties_edit_form"));
|
||||
|
||||
Ui::UserPropertiesEditForm::setupUi (this);
|
||||
mp_ui = new Ui::UserPropertiesEditForm ();
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
activate_help_links (help_label);
|
||||
activate_help_links (mp_ui->help_label);
|
||||
}
|
||||
|
||||
static QString
|
||||
UserPropertiesEditForm::~UserPropertiesEditForm ()
|
||||
{
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
static QString
|
||||
normalize (const QString &s)
|
||||
{
|
||||
std::string st (tl::to_string (s));
|
||||
|
|
@ -1114,12 +1201,12 @@ UserPropertiesEditForm::show (QString &key, QString &value)
|
|||
{
|
||||
BEGIN_PROTECTED
|
||||
|
||||
key_le->setText (key);
|
||||
value_le->setText (value);
|
||||
mp_ui->key_le->setText (key);
|
||||
mp_ui->value_le->setText (value);
|
||||
|
||||
if (exec ()) {
|
||||
key = normalize (key_le->text ());
|
||||
value = normalize (value_le->text ());
|
||||
key = normalize (mp_ui->key_le->text ());
|
||||
value = normalize (mp_ui->value_le->text ());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1132,8 +1219,8 @@ UserPropertiesEditForm::accept ()
|
|||
{
|
||||
BEGIN_PROTECTED
|
||||
|
||||
normalize (key_le->text ());
|
||||
normalize (value_le->text ());
|
||||
normalize (mp_ui->key_le->text ());
|
||||
normalize (mp_ui->value_le->text ());
|
||||
|
||||
QDialog::accept ();
|
||||
|
||||
|
|
|
|||
|
|
@ -24,32 +24,40 @@
|
|||
#ifndef HDR_layDialogs
|
||||
#define HDR_layDialogs
|
||||
|
||||
#include "ui_LayerSourceDialog.h"
|
||||
#include "ui_NewLayoutPropertiesDialog.h"
|
||||
#include "ui_NewLayerPropertiesDialog.h"
|
||||
#include "ui_NewCellPropertiesDialog.h"
|
||||
#include "ui_MoveOptionsDialog.h"
|
||||
#include "ui_MoveToOptionsDialog.h"
|
||||
#include "ui_DeleteCellModeDialog.h"
|
||||
#include "ui_CopyCellModeDialog.h"
|
||||
#include "ui_ReplaceCellOptionsDialog.h"
|
||||
#include "ui_ClearLayerModeDialog.h"
|
||||
#include "ui_OpenLayoutModeDialog.h"
|
||||
#include "ui_RenameCellDialog.h"
|
||||
#include "ui_DuplicateLayerDialog.h"
|
||||
#include "ui_AlignCellOptionsDialog.h"
|
||||
#include "ui_FlattenInstOptionsDialog.h"
|
||||
#include "ui_UserPropertiesForm.h"
|
||||
#include "ui_UserPropertiesEditForm.h"
|
||||
|
||||
#include "dbPoint.h"
|
||||
#include "dbVector.h"
|
||||
#include "dbTypes.h"
|
||||
#include "laybasicCommon.h"
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class QTreeWidgetItem;
|
||||
|
||||
namespace db
|
||||
{
|
||||
class Layout;
|
||||
struct LayerProperties;
|
||||
}
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class LayerSourceDialog;
|
||||
class NewLayoutPropertiesDialog;
|
||||
class NewLayerPropertiesDialog;
|
||||
class NewCellPropertiesDialog;
|
||||
class MoveOptionsDialog;
|
||||
class MoveToOptionsDialog;
|
||||
class DeleteCellModeDialog;
|
||||
class CopyCellModeDialog;
|
||||
class ReplaceCellOptionsDialog;
|
||||
class ClearLayerModeDialog;
|
||||
class OpenLayoutModeDialog;
|
||||
class RenameCellDialog;
|
||||
class DuplicateLayerDialog;
|
||||
class AlignCellOptionsDialog;
|
||||
class FlattenInstOptionsDialog;
|
||||
class UserPropertiesForm;
|
||||
class UserPropertiesEditForm;
|
||||
}
|
||||
|
||||
namespace lay
|
||||
|
|
@ -62,23 +70,25 @@ class LayoutView;
|
|||
* @brief The layer source dialog
|
||||
*/
|
||||
class LAYBASIC_PUBLIC LayerSourceDialog
|
||||
: public QDialog,
|
||||
public Ui::LayerSourceDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
LayerSourceDialog (QWidget *parent);
|
||||
~LayerSourceDialog ();
|
||||
|
||||
bool exec_dialog (std::string &s);
|
||||
|
||||
private:
|
||||
Ui::LayerSourceDialog *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The new cell properties dialog
|
||||
*/
|
||||
class LAYBASIC_PUBLIC NewCellPropertiesDialog
|
||||
: public QDialog,
|
||||
public Ui::NewCellPropertiesDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -91,6 +101,7 @@ public:
|
|||
private:
|
||||
virtual void accept ();
|
||||
|
||||
Ui::NewCellPropertiesDialog *mp_ui;
|
||||
const db::Layout *mp_layout;
|
||||
};
|
||||
|
||||
|
|
@ -98,8 +109,7 @@ private:
|
|||
* @brief The new layer properties dialog
|
||||
*/
|
||||
class LAYBASIC_PUBLIC NewLayerPropertiesDialog
|
||||
: public QDialog,
|
||||
public Ui::NewLayerPropertiesDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -113,14 +123,15 @@ public:
|
|||
private:
|
||||
virtual void accept ();
|
||||
void get (db::LayerProperties &src);
|
||||
|
||||
Ui::NewLayerPropertiesDialog *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The move options dialog
|
||||
*/
|
||||
class LAYBASIC_PUBLIC MoveOptionsDialog
|
||||
: public QDialog,
|
||||
public Ui::MoveOptionsDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -132,14 +143,15 @@ public:
|
|||
|
||||
private:
|
||||
virtual void accept ();
|
||||
|
||||
Ui::MoveOptionsDialog *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The move "to" options dialog
|
||||
*/
|
||||
class LAYBASIC_PUBLIC MoveToOptionsDialog
|
||||
: public QDialog,
|
||||
public Ui::MoveToOptionsDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -149,19 +161,20 @@ public:
|
|||
|
||||
bool exec_dialog (int &mode_x, int &mode_y, db::DPoint &target);
|
||||
|
||||
private slots:
|
||||
void button_clicked ();
|
||||
|
||||
private:
|
||||
virtual void accept ();
|
||||
|
||||
private slots:
|
||||
void button_clicked ();
|
||||
Ui::MoveToOptionsDialog *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The rename cell options dialog
|
||||
*/
|
||||
class LAYBASIC_PUBLIC RenameCellDialog
|
||||
: public QDialog,
|
||||
public Ui::RenameCellDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -174,6 +187,7 @@ public:
|
|||
private:
|
||||
virtual void accept ();
|
||||
|
||||
Ui::RenameCellDialog *mp_ui;
|
||||
const db::Layout *mp_layout;
|
||||
};
|
||||
|
||||
|
|
@ -181,8 +195,7 @@ private:
|
|||
* @brief The replace cell options dialog
|
||||
*/
|
||||
class LAYBASIC_PUBLIC ReplaceCellOptionsDialog
|
||||
: public QDialog,
|
||||
public Ui::ReplaceCellOptionsDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -199,14 +212,16 @@ public:
|
|||
|
||||
protected:
|
||||
virtual void accept ();
|
||||
|
||||
private:
|
||||
Ui::ReplaceCellOptionsDialog *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The copy cell options dialog
|
||||
*/
|
||||
class LAYBASIC_PUBLIC CopyCellModeDialog
|
||||
: public QDialog,
|
||||
public Ui::CopyCellModeDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -220,14 +235,16 @@ public:
|
|||
* The mode is either 0 (for shallow), 1 (for deep)
|
||||
*/
|
||||
bool exec_dialog (int ©_mode);
|
||||
|
||||
private:
|
||||
Ui::CopyCellModeDialog *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The delete cell options dialog
|
||||
*/
|
||||
class LAYBASIC_PUBLIC DeleteCellModeDialog
|
||||
: public QDialog,
|
||||
public Ui::DeleteCellModeDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -241,14 +258,16 @@ public:
|
|||
* The mode is either 0 (for shallow), 1 (for deep) and 2 (for complete)
|
||||
*/
|
||||
bool exec_dialog (int &delete_mode);
|
||||
|
||||
private:
|
||||
Ui::DeleteCellModeDialog *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The delete cell options dialog
|
||||
*/
|
||||
class LAYBASIC_PUBLIC ClearLayerModeDialog
|
||||
: public QDialog,
|
||||
public Ui::ClearLayerModeDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -262,14 +281,16 @@ public:
|
|||
* The mode is either 0 (for locally), 1 (for hierarchically) and 2 (for all)
|
||||
*/
|
||||
bool exec_dialog (int &clear_mode);
|
||||
|
||||
private:
|
||||
Ui::ClearLayerModeDialog *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The open layout mode dialog
|
||||
*/
|
||||
class LAYBASIC_PUBLIC OpenLayoutModeDialog
|
||||
: public QDialog,
|
||||
public Ui::OpenLayoutModeDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -283,14 +304,16 @@ public:
|
|||
* The mode is either 0 (to replace current view), 1 (to create new view) and 2 (add to current view)
|
||||
*/
|
||||
bool exec_dialog (int &open_mode);
|
||||
|
||||
private:
|
||||
Ui::OpenLayoutModeDialog *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The new layout properties dialog
|
||||
*/
|
||||
class LAYBASIC_PUBLIC NewLayoutPropertiesDialog
|
||||
: public QDialog,
|
||||
public Ui::NewLayoutPropertiesDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -305,14 +328,15 @@ private slots:
|
|||
|
||||
private:
|
||||
virtual void accept ();
|
||||
|
||||
Ui::NewLayoutPropertiesDialog *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The duplicate layer operation options
|
||||
*/
|
||||
class LAYBASIC_PUBLIC DuplicateLayerDialog
|
||||
: public QDialog,
|
||||
public Ui::DuplicateLayerDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -328,6 +352,7 @@ public slots:
|
|||
private:
|
||||
virtual void accept ();
|
||||
|
||||
Ui::DuplicateLayerDialog *mp_ui;
|
||||
lay::LayoutView *mp_view;
|
||||
};
|
||||
|
||||
|
|
@ -335,8 +360,7 @@ private:
|
|||
* @brief The merge operation options
|
||||
*/
|
||||
class LAYBASIC_PUBLIC AlignCellOptionsDialog
|
||||
: public QDialog,
|
||||
public Ui::AlignCellOptionsDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -346,33 +370,39 @@ public:
|
|||
|
||||
bool exec_dialog (int &mode_x, int &mode_y, bool &visible_only, bool &adjust_calls);
|
||||
|
||||
public slots:
|
||||
private:
|
||||
void button_clicked ();
|
||||
|
||||
Ui::AlignCellOptionsDialog *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Options dialog for the "flatten instances" function
|
||||
*/
|
||||
class LAYBASIC_PUBLIC FlattenInstOptionsDialog
|
||||
: public QDialog,
|
||||
private Ui::FlattenInstOptionsDialog
|
||||
: public QDialog
|
||||
{
|
||||
public:
|
||||
FlattenInstOptionsDialog (QWidget *parent, bool enable_pruning = true);
|
||||
virtual ~FlattenInstOptionsDialog ();
|
||||
|
||||
bool exec_dialog (int &levels, bool &prune);
|
||||
|
||||
private:
|
||||
Ui::FlattenInstOptionsDialog *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The user properties report form
|
||||
*/
|
||||
class LAYBASIC_PUBLIC UserPropertiesForm
|
||||
: public QDialog,
|
||||
public Ui::UserPropertiesForm
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UserPropertiesForm (QWidget *parent);
|
||||
virtual ~UserPropertiesForm ();
|
||||
|
||||
bool show (lay::LayoutView *view, unsigned int cv_index, db::properties_id_type &prop_id);
|
||||
|
||||
|
|
@ -384,20 +414,25 @@ public slots:
|
|||
|
||||
private:
|
||||
bool m_editable;
|
||||
|
||||
Ui::UserPropertiesForm *mp_ui;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The user properties report form
|
||||
*/
|
||||
class LAYBASIC_PUBLIC UserPropertiesEditForm
|
||||
: public QDialog,
|
||||
public Ui::UserPropertiesEditForm
|
||||
: public QDialog
|
||||
{
|
||||
public:
|
||||
UserPropertiesEditForm (QWidget *parent);
|
||||
virtual ~UserPropertiesEditForm ();
|
||||
|
||||
bool show (QString &key, QString &value);
|
||||
virtual void accept ();
|
||||
|
||||
private:
|
||||
Ui::UserPropertiesEditForm *mp_ui;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include <QProxyStyle>
|
||||
#include <QPainter>
|
||||
#include <QPen>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "dbClipboard.h"
|
||||
#include "dbClipboardData.h"
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@
|
|||
#include "tlClassRegistry.h"
|
||||
#include "tlExceptions.h"
|
||||
|
||||
#include "ui_LoadLayoutOptionsDialog.h"
|
||||
#include "ui_SpecificLoadLayoutOptionsDialog.h"
|
||||
|
||||
#include <QScrollArea>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
|
|
@ -41,17 +44,18 @@ namespace lay
|
|||
{
|
||||
|
||||
LoadLayoutOptionsDialog::LoadLayoutOptionsDialog (QWidget *parent, const std::string &title)
|
||||
: QDialog (parent), Ui::LoadLayoutOptionsDialog (),
|
||||
: QDialog (parent),
|
||||
m_show_always (false), m_technology_index (-1)
|
||||
{
|
||||
setObjectName (QString::fromUtf8 ("load_layout_options_dialog"));
|
||||
|
||||
Ui::LoadLayoutOptionsDialog::setupUi (this);
|
||||
mp_ui = new Ui::LoadLayoutOptionsDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
setWindowTitle (tl::to_qstring (title));
|
||||
|
||||
while (options_tab->count () > 0) {
|
||||
options_tab->removeTab (0);
|
||||
while (mp_ui->options_tab->count () > 0) {
|
||||
mp_ui->options_tab->removeTab (0);
|
||||
}
|
||||
|
||||
bool any_option = false;
|
||||
|
|
@ -63,17 +67,17 @@ LoadLayoutOptionsDialog::LoadLayoutOptionsDialog (QWidget *parent, const std::st
|
|||
// obtain the config page from the plugin which we identify by format name
|
||||
const StreamReaderPluginDeclaration *decl = StreamReaderPluginDeclaration::plugin_for_format (fmt->format_name ());
|
||||
|
||||
QScrollArea *page_host = new QScrollArea (options_tab);
|
||||
QScrollArea *page_host = new QScrollArea (mp_ui->options_tab);
|
||||
page_host->setFrameStyle (QFrame::NoFrame);
|
||||
page_host->setWidgetResizable (true);
|
||||
|
||||
page = decl ? decl->format_specific_options_page (options_tab) : 0;
|
||||
page = decl ? decl->format_specific_options_page (mp_ui->options_tab) : 0;
|
||||
if (page) {
|
||||
page_host->setWidget (page);
|
||||
} else {
|
||||
#if 0
|
||||
// Show an empty page
|
||||
QLabel *empty = new QLabel (options_tab);
|
||||
QLabel *empty = new QLabel (mp_ui->options_tab);
|
||||
empty->setAlignment (Qt::AlignCenter);
|
||||
empty->setText (QObject::tr ("No specific options available for this format"));
|
||||
page_host->setWidget (empty);
|
||||
|
|
@ -85,7 +89,7 @@ LoadLayoutOptionsDialog::LoadLayoutOptionsDialog (QWidget *parent, const std::st
|
|||
}
|
||||
|
||||
if (page_host) {
|
||||
options_tab->addTab (page_host, tl::to_qstring (fmt->format_desc ()));
|
||||
mp_ui->options_tab->addTab (page_host, tl::to_qstring (fmt->format_desc ()));
|
||||
m_pages.push_back (std::make_pair (page, fmt->format_name ()));
|
||||
any_option = true;
|
||||
}
|
||||
|
|
@ -93,23 +97,24 @@ LoadLayoutOptionsDialog::LoadLayoutOptionsDialog (QWidget *parent, const std::st
|
|||
}
|
||||
|
||||
if (! any_option) {
|
||||
options_tab->hide ();
|
||||
mp_ui->options_tab->hide ();
|
||||
}
|
||||
|
||||
connect (buttonBox, SIGNAL (accepted ()), this, SLOT (ok_button_pressed ()));
|
||||
connect (buttonBox, SIGNAL (clicked (QAbstractButton *)), this, SLOT (button_pressed (QAbstractButton *)));
|
||||
connect (tech_cbx, SIGNAL (currentIndexChanged (int)), this, SLOT (current_tech_changed (int)));
|
||||
connect (mp_ui->buttonBox, SIGNAL (accepted ()), this, SLOT (ok_button_pressed ()));
|
||||
connect (mp_ui->buttonBox, SIGNAL (clicked (QAbstractButton *)), this, SLOT (button_pressed (QAbstractButton *)));
|
||||
connect (mp_ui->tech_cbx, SIGNAL (currentIndexChanged (int)), this, SLOT (current_tech_changed (int)));
|
||||
}
|
||||
|
||||
LoadLayoutOptionsDialog::~LoadLayoutOptionsDialog ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
}
|
||||
|
||||
void
|
||||
LoadLayoutOptionsDialog::button_pressed (QAbstractButton *button)
|
||||
{
|
||||
if (button == buttonBox->button (QDialogButtonBox::Reset)) {
|
||||
if (button == mp_ui->buttonBox->button (QDialogButtonBox::Reset)) {
|
||||
reset_button_pressed ();
|
||||
}
|
||||
}
|
||||
|
|
@ -182,7 +187,7 @@ LoadLayoutOptionsDialog::update ()
|
|||
}
|
||||
|
||||
const lay::Technology *tech = m_tech_array [m_technology_index];
|
||||
options_tab->setEnabled (tech && tech->is_persisted ());
|
||||
mp_ui->options_tab->setEnabled (tech && tech->is_persisted ());
|
||||
|
||||
for (std::vector< std::pair<StreamReaderOptionsPage *, std::string> >::iterator page = m_pages.begin (); page != m_pages.end (); ++page) {
|
||||
if (page->first) {
|
||||
|
|
@ -205,11 +210,11 @@ LoadLayoutOptionsDialog::edit_global_options (lay::PluginRoot *config_root, lay:
|
|||
} catch (...) {
|
||||
m_show_always = false;
|
||||
}
|
||||
always_cbx->setChecked (m_show_always);
|
||||
always_cbx->show ();
|
||||
mp_ui->always_cbx->setChecked (m_show_always);
|
||||
mp_ui->always_cbx->show ();
|
||||
|
||||
tech_cbx->blockSignals (true);
|
||||
tech_cbx->clear ();
|
||||
mp_ui->tech_cbx->blockSignals (true);
|
||||
mp_ui->tech_cbx->clear ();
|
||||
|
||||
unsigned int i = 0;
|
||||
m_technology_index = -1;
|
||||
|
|
@ -225,16 +230,16 @@ LoadLayoutOptionsDialog::edit_global_options (lay::PluginRoot *config_root, lay:
|
|||
m_opt_array.push_back (t->load_layout_options ());
|
||||
m_tech_array.push_back (t.operator-> ());
|
||||
|
||||
tech_cbx->addItem (tl::to_qstring (d));
|
||||
mp_ui->tech_cbx->addItem (tl::to_qstring (d));
|
||||
if (t->name () == technology) {
|
||||
tech_cbx->setCurrentIndex (i);
|
||||
mp_ui->tech_cbx->setCurrentIndex (i);
|
||||
m_technology_index = i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tech_cbx->blockSignals (false);
|
||||
tech_cbx->show ();
|
||||
mp_ui->tech_cbx->blockSignals (false);
|
||||
mp_ui->tech_cbx->show ();
|
||||
|
||||
if (get_options_internal ()) {
|
||||
|
||||
|
|
@ -246,7 +251,7 @@ LoadLayoutOptionsDialog::edit_global_options (lay::PluginRoot *config_root, lay:
|
|||
}
|
||||
config_root->config_set (cfg_initial_technology, technology);
|
||||
|
||||
m_show_always = always_cbx->isChecked ();
|
||||
m_show_always = mp_ui->always_cbx->isChecked ();
|
||||
config_root->config_set (cfg_reader_options_show_always, tl::to_string (m_show_always));
|
||||
|
||||
i = 0;
|
||||
|
|
@ -266,8 +271,8 @@ LoadLayoutOptionsDialog::edit_global_options (lay::PluginRoot *config_root, lay:
|
|||
bool
|
||||
LoadLayoutOptionsDialog::get_options (db::LoadLayoutOptions &options)
|
||||
{
|
||||
tech_cbx->hide ();
|
||||
always_cbx->hide ();
|
||||
mp_ui->tech_cbx->hide ();
|
||||
mp_ui->always_cbx->hide ();
|
||||
|
||||
m_opt_array.clear ();
|
||||
m_opt_array.push_back (options);
|
||||
|
|
@ -304,7 +309,8 @@ SpecificLoadLayoutOptionsDialog::SpecificLoadLayoutOptionsDialog (QWidget *paren
|
|||
{
|
||||
setObjectName (QString::fromUtf8 ("specific_load_layout_options_dialog"));
|
||||
|
||||
Ui::SpecificLoadLayoutOptionsDialog::setupUi (this);
|
||||
mp_ui = new Ui::SpecificLoadLayoutOptionsDialog ();
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
setWindowTitle (tl::to_qstring (tl::to_string (QObject::tr ("Edit Reader Options")) + " - " + format_name));
|
||||
|
||||
|
|
@ -314,13 +320,13 @@ SpecificLoadLayoutOptionsDialog::SpecificLoadLayoutOptionsDialog (QWidget *paren
|
|||
|
||||
mp_specific_options = specific_options->clone ();
|
||||
|
||||
mp_editor = decl->format_specific_options_page (content_frame);
|
||||
mp_editor = decl->format_specific_options_page (mp_ui->content_frame);
|
||||
if (mp_editor) {
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout (content_frame);
|
||||
QVBoxLayout *layout = new QVBoxLayout (mp_ui->content_frame);
|
||||
layout->addWidget (mp_editor);
|
||||
layout->setMargin (0);
|
||||
content_frame->setLayout (layout);
|
||||
mp_ui->content_frame->setLayout (layout);
|
||||
|
||||
mp_editor->show ();
|
||||
mp_editor->setup (specific_options, 0);
|
||||
|
|
@ -331,6 +337,9 @@ SpecificLoadLayoutOptionsDialog::SpecificLoadLayoutOptionsDialog (QWidget *paren
|
|||
|
||||
SpecificLoadLayoutOptionsDialog::~SpecificLoadLayoutOptionsDialog ()
|
||||
{
|
||||
delete mp_ui;
|
||||
mp_ui = 0;
|
||||
|
||||
delete mp_specific_options;
|
||||
mp_specific_options = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,22 +25,28 @@
|
|||
#ifndef HDR_layLoadLayoutOptionsDialog
|
||||
#define HDR_layLoadLayoutOptionsDialog
|
||||
|
||||
#include "ui_LoadLayoutOptionsDialog.h"
|
||||
#include "ui_SpecificLoadLayoutOptionsDialog.h"
|
||||
#include "dbStream.h"
|
||||
#include "dbLayout.h"
|
||||
#include "layStream.h"
|
||||
|
||||
#include <string>
|
||||
#include <QDialog>
|
||||
|
||||
class QScrollArea;
|
||||
class QWidget;
|
||||
class QAbstractButton;
|
||||
|
||||
namespace db
|
||||
{
|
||||
class LoadLayoutOptions;
|
||||
}
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class LoadLayoutOptionsDialog;
|
||||
class SpecificLoadLayoutOptionsDialog;
|
||||
}
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
||||
|
|
@ -50,7 +56,7 @@ class FileDialog;
|
|||
class Technologies;
|
||||
|
||||
class LAYBASIC_PUBLIC LoadLayoutOptionsDialog
|
||||
: public QDialog, private Ui::LoadLayoutOptionsDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -78,6 +84,7 @@ public slots:
|
|||
void current_tech_changed (int index);
|
||||
|
||||
private:
|
||||
Ui::LoadLayoutOptionsDialog *mp_ui;
|
||||
std::vector< std::pair<StreamReaderOptionsPage *, std::string> > m_pages;
|
||||
bool m_show_always;
|
||||
int m_technology_index;
|
||||
|
|
@ -90,8 +97,7 @@ private:
|
|||
};
|
||||
|
||||
class LAYBASIC_PUBLIC SpecificLoadLayoutOptionsDialog
|
||||
: public QDialog,
|
||||
private Ui::SpecificLoadLayoutOptionsDialog
|
||||
: public QDialog
|
||||
{
|
||||
public:
|
||||
SpecificLoadLayoutOptionsDialog (QWidget *parent, db::LoadLayoutOptions *options, const std::string &format_name);
|
||||
|
|
@ -101,6 +107,7 @@ protected:
|
|||
void accept ();
|
||||
|
||||
private:
|
||||
Ui::SpecificLoadLayoutOptionsDialog *mp_ui;
|
||||
std::string m_format_name;
|
||||
db::LoadLayoutOptions *mp_options;
|
||||
db::FormatSpecificReaderOptions *mp_specific_options;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,12 @@ DESTDIR = $$OUT_PWD/../../../../db_plugins
|
|||
include($$PWD/../../../db_plugin.pri)
|
||||
|
||||
HEADERS = \
|
||||
extDEFImporter.h \
|
||||
extLEFImporter.h \
|
||||
extLEFDEFImporter.h \
|
||||
|
||||
SOURCES = \
|
||||
|
||||
extDEFImporter.cc \
|
||||
extLEFDEFImporter.cc \
|
||||
extLEFImporter.cc \
|
||||
gsiDeclDbLEFDEF.cc \
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#ifndef HDR_extDEFImporter
|
||||
#define HDR_extDEFImporter
|
||||
|
||||
#include "dbCommon.h"
|
||||
#include "dbLayout.h"
|
||||
#include "tlStream.h"
|
||||
#include "extLEFImporter.h"
|
||||
|
|
@ -38,7 +39,7 @@ namespace ext
|
|||
/**
|
||||
* @brief The DEF importer object
|
||||
*/
|
||||
class EXT_PUBLIC DEFImporter
|
||||
class DB_PUBLIC DEFImporter
|
||||
: public LEFDEFImporter
|
||||
{
|
||||
public:
|
||||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
|
||||
#include "extLEFDEFImporter.h"
|
||||
#include "extLEFDEFImportDialogs.h"
|
||||
|
||||
#include "tlStream.h"
|
||||
#include "tlProgress.h"
|
||||
|
|
@ -24,13 +24,12 @@
|
|||
#ifndef HDR_extLEFDEFImporter
|
||||
#define HDR_extLEFDEFImporter
|
||||
|
||||
#include "extCommon.h"
|
||||
#include "dbCommon.h"
|
||||
#include "dbLayout.h"
|
||||
#include "dbReader.h"
|
||||
#include "dbStreamLayers.h"
|
||||
#include "tlStream.h"
|
||||
#include "tlVariant.h"
|
||||
#include "layTechnology.h"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
|
@ -47,7 +46,7 @@ namespace ext
|
|||
/**
|
||||
* @brief Generic base class of DXF reader exceptions
|
||||
*/
|
||||
class EXT_PUBLIC LEFDEFReaderException
|
||||
class DB_PUBLIC LEFDEFReaderException
|
||||
: public db::ReaderException
|
||||
{
|
||||
public:
|
||||
|
|
@ -61,7 +60,7 @@ public:
|
|||
*
|
||||
* This component provides technology specific information for the LEF/DEF importer.
|
||||
*/
|
||||
class EXT_PUBLIC LEFDEFReaderOptions
|
||||
class DB_PUBLIC LEFDEFReaderOptions
|
||||
: public db::FormatSpecificReaderOptions
|
||||
{
|
||||
public:
|
||||
|
|
@ -472,7 +471,7 @@ enum LayerPurpose
|
|||
*
|
||||
* This class will handle the creation and management of layers in the LEF/DEF reader context
|
||||
*/
|
||||
class EXT_PUBLIC LEFDEFLayerDelegate
|
||||
class DB_PUBLIC LEFDEFLayerDelegate
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
|
@ -537,7 +536,7 @@ private:
|
|||
/**
|
||||
* @brief The LEF importer object
|
||||
*/
|
||||
class EXT_PUBLIC LEFDEFImporter
|
||||
class DB_PUBLIC LEFDEFImporter
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
|
||||
#include "extLEFImporter.h"
|
||||
#include "extLEFDEFImportDialogs.h"
|
||||
|
||||
#include "tlStream.h"
|
||||
|
||||
|
|
@ -27,11 +27,11 @@
|
|||
|
||||
#include "extLEFDEFImporter.h"
|
||||
|
||||
#include "dbCommon.h"
|
||||
#include "dbLayout.h"
|
||||
#include "dbReader.h"
|
||||
#include "dbStreamLayers.h"
|
||||
#include "tlStream.h"
|
||||
#include "layTechnology.h"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
|
@ -43,7 +43,7 @@ namespace ext
|
|||
/**
|
||||
* @brief The LEF importer object
|
||||
*/
|
||||
class EXT_PUBLIC LEFImporter
|
||||
class DB_PUBLIC LEFImporter
|
||||
: public LEFDEFImporter
|
||||
{
|
||||
public:
|
||||
|
|
@ -0,0 +1,337 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2018 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "gsiDecl.h"
|
||||
|
||||
#include "extLEFImporter.h"
|
||||
#include "extDEFImporter.h"
|
||||
#include "extLEFDEFImporter.h"
|
||||
|
||||
namespace gsi
|
||||
{
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// gsi Implementation of specific methods
|
||||
|
||||
static ext::LEFDEFReaderOptions &get_lefdef_config (db::LoadLayoutOptions *options)
|
||||
{
|
||||
return options->get_options<ext::LEFDEFReaderOptions> ();
|
||||
}
|
||||
|
||||
static void set_lefdef_config (db::LoadLayoutOptions *options, const ext::LEFDEFReaderOptions &config)
|
||||
{
|
||||
options->set_options (config);
|
||||
}
|
||||
|
||||
// extend lay::LoadLayoutOptions with the GDS2 options
|
||||
static
|
||||
gsi::ClassExt<db::LoadLayoutOptions> decl_ext_lefdef_reader_options (
|
||||
gsi::method_ext ("lefdef_config", &get_lefdef_config,
|
||||
"@brief Gets a copy of the LEF/DEF reader configuration\n"
|
||||
"The LEF/DEF reader configuration is wrapped in a separate object of class \\LEFDEFReaderConfiguration. See there for details.\n"
|
||||
"This method will return a copy of the reader configuration. To modify the configuration, modify the copy and set the modified "
|
||||
"configuration with \\lefdef_config=.\n"
|
||||
"\n"
|
||||
"\nThis method has been added in version 0.25.\n"
|
||||
) +
|
||||
gsi::method_ext ("lefdef_config=", &set_lefdef_config, gsi::arg ("config"),
|
||||
"@brief Sets the LEF/DEF reader configuration\n"
|
||||
"\n"
|
||||
"\nThis method has been added in version 0.25.\n"
|
||||
)
|
||||
);
|
||||
|
||||
static tl::Variant get_net_property_name (const ext::LEFDEFReaderOptions *config)
|
||||
{
|
||||
if (config->produce_net_names ()) {
|
||||
return config->net_property_name ();
|
||||
} else {
|
||||
return tl::Variant ();
|
||||
}
|
||||
}
|
||||
|
||||
static void set_net_property_name (ext::LEFDEFReaderOptions *config, const tl::Variant &name)
|
||||
{
|
||||
config->set_produce_net_names (! name.is_nil ());
|
||||
config->set_net_property_name (name);
|
||||
}
|
||||
|
||||
static
|
||||
gsi::Class<ext::LEFDEFReaderOptions> decl_lefdef_config ("lay", "LEFDEFReaderConfiguration",
|
||||
gsi::method ("layer_map", (db::LayerMap &(ext::LEFDEFReaderOptions::*) ()) &ext::LEFDEFReaderOptions::layer_map,
|
||||
"@brief Gets the layer map to be used for the LEF/DEF reader\n"
|
||||
"@return A reference to the layer map\n"
|
||||
"Because LEF/DEF layer mapping is substantially different than for normal layout files, the LEF/DEF reader "
|
||||
"employs a separate layer mapping table. The LEF/DEF specific layer mapping is stored within the "
|
||||
"LEF/DEF reader's configuration and can be accessed with this attribute. The layer mapping table of "
|
||||
"\\LoadLayoutOptions will be ignored for the LEF/DEF reader.\n"
|
||||
"\n"
|
||||
"The setter is \\layer_map=. \\create_other_layers= is available to control whether layers "
|
||||
"not specified in the layer mapping table shall be created automatically."
|
||||
) +
|
||||
gsi::method ("layer_map=", &ext::LEFDEFReaderOptions::set_layer_map,
|
||||
"@brief Sets the layer map to be used for the LEF/DEF reader\n"
|
||||
"See \\layer_map for details."
|
||||
) +
|
||||
gsi::method ("create_other_layers", &ext::LEFDEFReaderOptions::read_all_layers,
|
||||
"@brief Gets a value indicating whether layers not mapped in the layer map shall be created too\n"
|
||||
"See \\layer_map for details."
|
||||
) +
|
||||
gsi::method ("create_other_layers=", &ext::LEFDEFReaderOptions::set_read_all_layers,
|
||||
"@brief Sets a value indicating whether layers not mapped in the layer map shall be created too\n"
|
||||
"See \\layer_map for details."
|
||||
) +
|
||||
gsi::method ("dbu", &ext::LEFDEFReaderOptions::dbu,
|
||||
"@brief Gets the database unit to use for producing the layout.\n"
|
||||
"This value specifies the database to be used for the layout that is read. When a DEF file is specified with "
|
||||
"a different database unit, the layout is translated into this database unit.\n"
|
||||
) +
|
||||
gsi::method ("dbu=", &ext::LEFDEFReaderOptions::set_dbu, gsi::arg ("dbu"),
|
||||
"@brief Sets the database unit to use for producing the layout.\n"
|
||||
"See \\dbu for details."
|
||||
) +
|
||||
gsi::method_ext ("net_property_name", &get_net_property_name,
|
||||
"@brief Gets a value indicating whether and how to produce net names as properties.\n"
|
||||
"If set to a value not nil, net names will be attached to the shapes and instances generated as user properties.\n"
|
||||
"This attribute then specifies the user property name to be used for attaching the net names.\n"
|
||||
"If set to nil, no net names will be produced.\n"
|
||||
"\n"
|
||||
"The corresponding setter is \\net_property_name=."
|
||||
) +
|
||||
gsi::method_ext ("net_property_name=", &set_net_property_name, gsi::arg ("name"),
|
||||
"@brief Sets a value indicating whether and how to produce net names as properties.\n"
|
||||
"See \\net_property_name for details."
|
||||
) +
|
||||
gsi::method ("produce_cell_outlines", &ext::LEFDEFReaderOptions::produce_cell_outlines,
|
||||
"@brief Gets a value indicating whether to produce cell outlines.\n"
|
||||
"If set to true, cell outlines will be produced on the layer given by \\cell_outline_layer. "
|
||||
) +
|
||||
gsi::method ("produce_cell_outlines=", &ext::LEFDEFReaderOptions::set_produce_cell_outlines, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether to produce cell outlines.\n"
|
||||
"See \\produce_cell_outlines for details.\n"
|
||||
) +
|
||||
gsi::method ("cell_outline_layer", &ext::LEFDEFReaderOptions::cell_outline_layer,
|
||||
"@brief Gets the layer on which to produce the cell outline.\n"
|
||||
"This attribute is a string correspondig to the string representation of \\LayerInfo. "
|
||||
"This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \\LayerInfo for details.\n"
|
||||
"The setter for this attribute is \\cell_outline_layer=. See also \\produce_cell_outlines."
|
||||
) +
|
||||
gsi::method ("cell_outline_layer=", &ext::LEFDEFReaderOptions::set_cell_outline_layer, gsi::arg ("spec"),
|
||||
"@brief Sets the layer on which to produce the cell outline.\n"
|
||||
"See \\cell_outline_layer for details.\n"
|
||||
) +
|
||||
gsi::method ("produce_placement_blockages", &ext::LEFDEFReaderOptions::produce_placement_blockages,
|
||||
"@brief Gets a value indicating whether to produce placement blockage regions.\n"
|
||||
"If set to true, polygons will be produced representing the placement blockage region on the layer given by \\placement_blockage_layer. "
|
||||
) +
|
||||
gsi::method ("produce_placement_blockages=", &ext::LEFDEFReaderOptions::set_produce_placement_blockages, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether to produce placement blockage regions.\n"
|
||||
"See \\produce_placement_blockages for details.\n"
|
||||
) +
|
||||
gsi::method ("placement_blockage_layer", &ext::LEFDEFReaderOptions::placement_blockage_layer,
|
||||
"@brief Gets the layer on which to produce the placement blockage.\n"
|
||||
"This attribute is a string correspondig to the string representation of \\LayerInfo. "
|
||||
"This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \\LayerInfo for details."
|
||||
"The setter for this attribute is \\placement_blockage_layer=. See also \\produce_placement_blockages."
|
||||
) +
|
||||
gsi::method ("placement_blockage_layer=", &ext::LEFDEFReaderOptions::set_placement_blockage_layer,
|
||||
"@brief Sets the layer on which to produce the placement blockage.\n"
|
||||
"See \\placement_blockage_layer for details.\n"
|
||||
) +
|
||||
gsi::method ("produce_via_geometry", &ext::LEFDEFReaderOptions::produce_via_geometry,
|
||||
"@brief Sets a value indicating whether via geometries shall be produced.\n"
|
||||
"\n"
|
||||
"If set to true, shapes will be produced for each via. The layer to be produced will be determined from the "
|
||||
"via layer's name using the suffix provided by \\via_geometry_suffix. If there is a specific mapping in the "
|
||||
"layer mapping table for the via layer including the suffix, the layer/datatype will be taken from the layer "
|
||||
"mapping table. If there is a mapping to the undecorated via layer, the datatype will be substituted with "
|
||||
"the \\via_geometry_datatype value. If no mapping is defined, a unique number will be assigned to the layer "
|
||||
"number and the datatype will be taken from the \\via_geometry_datatype value.\n"
|
||||
"\n"
|
||||
"For example: the via layer is 'V1', \\via_geometry_suffix is 'GEO' and \\via_geometry_datatype is 1. Then:\n"
|
||||
"\n"
|
||||
"@li\n"
|
||||
"@ul If there is a mapping for 'V1.GEO', the layer and datatype will be taken from there. @/ul\n"
|
||||
"@ul If there is a mapping for 'V1', the layer will be taken from there and the datatype will be taken from \\via_geometry_datatype. "
|
||||
" The name of the produced layer will be 'V1.GEO'. @/ul\n"
|
||||
"@ul If there is no mapping for both, the layer number will be a unique value, the datatype will be taken from \\via_geometry_datatype "
|
||||
" and the layer name will be 'V1.GEO'. @/ul"
|
||||
"@/li\n"
|
||||
) +
|
||||
gsi::method ("produce_via_geometry=", &ext::LEFDEFReaderOptions::set_produce_via_geometry, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether via geometries shall be produced.\n"
|
||||
"See \\produce_via_geometry for details.\n"
|
||||
) +
|
||||
gsi::method ("via_geometry_suffix", &ext::LEFDEFReaderOptions::via_geometry_suffix,
|
||||
"@brief Gets the via geometry layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about this property.\n"
|
||||
) +
|
||||
gsi::method ("via_geometry_suffix=", &ext::LEFDEFReaderOptions::set_via_geometry_suffix, gsi::arg ("suffix"),
|
||||
"@brief Sets the via geometry layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about this property.\n"
|
||||
) +
|
||||
gsi::method ("via_geometry_datatype", &ext::LEFDEFReaderOptions::via_geometry_datatype,
|
||||
"@brief Gets the via geometry layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about this property.\n"
|
||||
) +
|
||||
gsi::method ("via_geometry_datatype=", &ext::LEFDEFReaderOptions::set_via_geometry_datatype, gsi::arg ("datatype"),
|
||||
"@brief Sets the via geometry layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about this property.\n"
|
||||
) +
|
||||
gsi::method ("produce_pins", &ext::LEFDEFReaderOptions::produce_pins,
|
||||
"@brief Gets a value indicating whether pin geometries shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_pins=", &ext::LEFDEFReaderOptions::set_produce_pins, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether pin geometries shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("pins_suffix", &ext::LEFDEFReaderOptions::pins_suffix,
|
||||
"@brief Gets the pin geometry layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("pins_suffix=", &ext::LEFDEFReaderOptions::set_pins_suffix, gsi::arg ("suffix"),
|
||||
"@brief Sets the pin geometry layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("pins_datatype", &ext::LEFDEFReaderOptions::pins_datatype,
|
||||
"@brief Gets the pin geometry layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("pins_datatype=", &ext::LEFDEFReaderOptions::set_pins_datatype, gsi::arg ("datatype"),
|
||||
"@brief Sets the pin geometry layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_obstructions", &ext::LEFDEFReaderOptions::produce_obstructions,
|
||||
"@brief Gets a value indicating whether obstruction markers shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_obstructions=", &ext::LEFDEFReaderOptions::set_produce_obstructions, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether obstruction markers shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("obstructions_suffix", &ext::LEFDEFReaderOptions::obstructions_suffix,
|
||||
"@brief Gets the obstruction marker layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("obstructions_suffix=", &ext::LEFDEFReaderOptions::set_obstructions_suffix, gsi::arg ("suffix"),
|
||||
"@brief Sets the obstruction marker layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("obstructions_datatype", &ext::LEFDEFReaderOptions::obstructions_datatype,
|
||||
"@brief Gets the obstruction marker layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("obstructions_datatype=", &ext::LEFDEFReaderOptions::set_obstructions_datatype, gsi::arg ("datatype"),
|
||||
"@brief Sets the obstruction marker layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_blockages", &ext::LEFDEFReaderOptions::produce_blockages,
|
||||
"@brief Gets a value indicating whether routing blockage markers shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_blockages=", &ext::LEFDEFReaderOptions::set_produce_blockages, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether routing blockage markers shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("blockages_suffix", &ext::LEFDEFReaderOptions::blockages_suffix,
|
||||
"@brief Gets the blockage marker layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("blockages_suffix=", &ext::LEFDEFReaderOptions::set_blockages_suffix, gsi::arg ("suffix"),
|
||||
"@brief Sets the blockage marker layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("blockages_datatype", &ext::LEFDEFReaderOptions::blockages_datatype,
|
||||
"@brief Gets the blockage marker layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("blockages_datatype=", &ext::LEFDEFReaderOptions::set_blockages_datatype, gsi::arg ("datatype"),
|
||||
"@brief Sets the blockage marker layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_labels", &ext::LEFDEFReaderOptions::produce_labels,
|
||||
"@brief Gets a value indicating whether labels shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_labels=", &ext::LEFDEFReaderOptions::set_produce_labels, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether labels shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("labels_suffix", &ext::LEFDEFReaderOptions::labels_suffix,
|
||||
"@brief Gets the label layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("labels_suffix=", &ext::LEFDEFReaderOptions::set_labels_suffix, gsi::arg ("suffix"),
|
||||
"@brief Sets the label layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("labels_datatype", &ext::LEFDEFReaderOptions::labels_datatype,
|
||||
"@brief Gets the labels layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("labels_datatype=", &ext::LEFDEFReaderOptions::set_labels_datatype, gsi::arg ("datatype"),
|
||||
"@brief Sets the labels layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_routing", &ext::LEFDEFReaderOptions::produce_routing,
|
||||
"@brief Gets a value indicating whether routing geometry shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("produce_routing=", &ext::LEFDEFReaderOptions::set_produce_routing, gsi::arg ("produce"),
|
||||
"@brief Sets a value indicating whether routing geometry shall be produced.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("routing_suffix", &ext::LEFDEFReaderOptions::routing_suffix,
|
||||
"@brief Gets the routing layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("routing_suffix=", &ext::LEFDEFReaderOptions::set_routing_suffix, gsi::arg ("suffix"),
|
||||
"@brief Sets the routing layer name suffix.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("routing_datatype", &ext::LEFDEFReaderOptions::routing_datatype,
|
||||
"@brief Gets the routing layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("routing_datatype=", &ext::LEFDEFReaderOptions::set_routing_datatype, gsi::arg ("datatype"),
|
||||
"@brief Sets the routing layer datatype value.\n"
|
||||
"See \\produce_via_geometry for details about the layer production rules."
|
||||
) +
|
||||
gsi::method ("lef_files", &ext::LEFDEFReaderOptions::lef_files,
|
||||
"@brief Gets the list technology LEF files to additionally import\n"
|
||||
"Returns a list of path names for technology LEF files to read in addition to the primary file. "
|
||||
"Relative paths are resolved relative to the file to read.\n"
|
||||
"\n"
|
||||
"The setter for this property is \\lef_files=."
|
||||
) +
|
||||
gsi::method ("lef_files=", &ext::LEFDEFReaderOptions::set_lef_files,
|
||||
"@brief Sets the list technology LEF files to additionally import\n"
|
||||
"See \\lef_files for details."
|
||||
),
|
||||
"@brief Detailed LEF/DEF reader options\n"
|
||||
"This class is a aggregate belonging to the \\LoadLayoutOptions class. It provides options for the LEF/DEF reader. "
|
||||
"These options have been placed into a separate class to account for their complexity."
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
#ifndef HDR_extLEFImportDialog
|
||||
#define HDR_extLEFImportDialog
|
||||
|
||||
#include "extCommon.h"
|
||||
#include "layCommon.h"
|
||||
#include "layTechnology.h"
|
||||
#include "layStream.h"
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ namespace ext
|
|||
/**
|
||||
* @brief A structure containing the LEF importer data
|
||||
*/
|
||||
struct EXT_PUBLIC LEFDEFImportData
|
||||
struct LAY_PUBLIC LEFDEFImportData
|
||||
{
|
||||
LEFDEFImportData ();
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ struct EXT_PUBLIC LEFDEFImportData
|
|||
/**
|
||||
* @brief The LEF importer dialog
|
||||
*/
|
||||
class EXT_PUBLIC LEFDEFImportOptionsDialog
|
||||
class LAY_PUBLIC LEFDEFImportOptionsDialog
|
||||
: public QDialog,
|
||||
private Ui::LEFDEFImportOptionsDialog
|
||||
{
|
||||
|
|
@ -0,0 +1,308 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2018 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "tlTimer.h"
|
||||
#include "tlStream.h"
|
||||
#include "dbReader.h"
|
||||
#include "dbStream.h"
|
||||
#include "layPlugin.h"
|
||||
#include "layStream.h"
|
||||
#include "gsiDecl.h"
|
||||
|
||||
#include "extLEFDEFImportDialogs.h"
|
||||
#include "extLEFImporter.h"
|
||||
#include "extDEFImporter.h"
|
||||
#include "extLEFDEFImporter.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
|
||||
namespace ext
|
||||
{
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Plugin for the stream reader
|
||||
|
||||
/**
|
||||
* @brief Determines the format of the given stream
|
||||
* Returns true, if the stream has LEF format
|
||||
*/
|
||||
static bool is_lef_format (const std::string &fn)
|
||||
{
|
||||
static const char *suffixes[] = { ".lef", ".LEF", ".lef.gz", ".LEF.gz" };
|
||||
|
||||
// NOTE: there is no reliable way of (easily) detecting the format. Hence we use the file
|
||||
// name's suffix for the format hint.
|
||||
for (size_t i = 0; i < sizeof (suffixes) / sizeof (suffixes[0]); ++i) {
|
||||
std::string suffix = suffixes [i];
|
||||
if (fn.size () > suffix.size () && fn.find (suffix) == fn.size () - suffix.size ()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Determines the format of the given stream
|
||||
* Returns true, if the stream has DEF format
|
||||
*/
|
||||
static bool is_def_format (const std::string &fn)
|
||||
{
|
||||
static const char *suffixes[] = { ".def", ".DEF", ".def.gz", ".DEF.gz" };
|
||||
|
||||
// NOTE: there is no reliable way of (easily) detecting the format. Hence we use the file
|
||||
// name's suffix for the format hint.
|
||||
for (size_t i = 0; i < sizeof (suffixes) / sizeof (suffixes[0]); ++i) {
|
||||
std::string suffix = suffixes [i];
|
||||
if (fn.size () > suffix.size () && fn.find (suffix) == fn.size () - suffix.size ()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
class LEFDEFReader
|
||||
: public db::ReaderBase
|
||||
{
|
||||
public:
|
||||
|
||||
LEFDEFReader (tl::InputStream &s)
|
||||
: m_stream (s)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
virtual const db::LayerMap &read (db::Layout &layout, const db::LoadLayoutOptions &options) throw (tl::Exception)
|
||||
{
|
||||
return read_lefdef (layout, options, is_lef_format (m_stream.filename ()));
|
||||
}
|
||||
|
||||
virtual const db::LayerMap &read (db::Layout &layout) throw (tl::Exception)
|
||||
{
|
||||
return read_lefdef (layout, db::LoadLayoutOptions (), is_lef_format (m_stream.filename ()));
|
||||
}
|
||||
|
||||
virtual const char *format () const
|
||||
{
|
||||
return "LEFDEF";
|
||||
}
|
||||
private:
|
||||
tl::InputStream &m_stream;
|
||||
db::LayerMap m_layer_map;
|
||||
|
||||
std::string correct_path (const std::string &fn)
|
||||
{
|
||||
QFileInfo fi (tl::to_qstring (fn));
|
||||
if (! fi.isAbsolute ()) {
|
||||
QDir input_dir (QFileInfo (tl::to_qstring (m_stream.absolute_path ())).dir ());
|
||||
return tl::to_string (input_dir.filePath (fi.filePath ()));
|
||||
} else {
|
||||
return fn;
|
||||
}
|
||||
}
|
||||
|
||||
const db::LayerMap &read_lefdef (db::Layout &layout, const db::LoadLayoutOptions &options, bool import_lef) throw (tl::Exception)
|
||||
{
|
||||
const ext::LEFDEFReaderOptions *lefdef_options = dynamic_cast<const ext::LEFDEFReaderOptions *> (options.get_options (format ()));
|
||||
static ext::LEFDEFReaderOptions default_options;
|
||||
if (! lefdef_options) {
|
||||
lefdef_options = &default_options;
|
||||
}
|
||||
|
||||
// Take the layer map and the "read all layers" flag from the reader options - hence we override the
|
||||
ext::LEFDEFLayerDelegate layers (lefdef_options);
|
||||
layers.prepare (layout);
|
||||
layout.dbu (lefdef_options->dbu ());
|
||||
|
||||
if (import_lef) {
|
||||
|
||||
tl::SelfTimer timer (tl::verbosity () >= 11, tl::to_string (QObject::tr ("Reading LEF file")));
|
||||
|
||||
ext::LEFImporter importer;
|
||||
|
||||
for (std::vector<std::string>::const_iterator l = lefdef_options->begin_lef_files (); l != lefdef_options->end_lef_files (); ++l) {
|
||||
|
||||
std::string lp = correct_path (*l);
|
||||
|
||||
tl::InputStream lef_stream (lp);
|
||||
tl::log << tl::to_string (QObject::tr ("Reading")) << " " << lp;
|
||||
importer.read (lef_stream, layout, layers);
|
||||
|
||||
}
|
||||
|
||||
tl::log << tl::to_string (QObject::tr ("Reading")) << " " << m_stream.source ();
|
||||
importer.read (m_stream, layout, layers);
|
||||
|
||||
} else {
|
||||
|
||||
tl::SelfTimer timer (tl::verbosity () >= 11, tl::to_string (QObject::tr ("Reading DEF file")));
|
||||
|
||||
DEFImporter importer;
|
||||
|
||||
for (std::vector<std::string>::const_iterator l = lefdef_options->begin_lef_files (); l != lefdef_options->end_lef_files (); ++l) {
|
||||
|
||||
std::string lp = correct_path (*l);
|
||||
|
||||
tl::InputStream lef_stream (lp);
|
||||
tl::log << tl::to_string (QObject::tr ("Reading")) << " " << lp;
|
||||
importer.read_lef (lef_stream, layout, layers);
|
||||
|
||||
}
|
||||
|
||||
// Additionally read all LEF files next to the DEF file
|
||||
|
||||
QDir input_dir (QFileInfo (tl::to_qstring (m_stream.absolute_path ())).dir ());
|
||||
if (input_dir.exists () && input_dir.isReadable ()) {
|
||||
|
||||
QStringList entries = input_dir.entryList ();
|
||||
for (QStringList::const_iterator e = entries.begin (); e != entries.end (); ++e) {
|
||||
|
||||
if (is_lef_format (tl::to_string (*e))) {
|
||||
|
||||
std::string lp = tl::to_string (input_dir.filePath (*e));
|
||||
tl::InputStream lef_stream (lp);
|
||||
tl::log << tl::to_string (QObject::tr ("Reading")) << " " << lp;
|
||||
importer.read_lef (lef_stream, layout, layers);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tl::log << tl::to_string (QObject::tr ("Reading")) << " " << m_stream.source ();
|
||||
importer.read (m_stream, layout, layers);
|
||||
|
||||
}
|
||||
|
||||
layers.finish (layout);
|
||||
|
||||
m_layer_map = layers.layer_map ();
|
||||
return m_layer_map;
|
||||
}
|
||||
};
|
||||
|
||||
class LEFDEFFormatDeclaration
|
||||
: public db::StreamFormatDeclaration
|
||||
{
|
||||
virtual std::string format_name () const { return "LEFDEF"; }
|
||||
virtual std::string format_desc () const { return "LEF/DEF"; }
|
||||
virtual std::string format_title () const { return "LEF/DEF (unified reader)"; }
|
||||
virtual std::string file_format () const { return "LEF/DEF files (*.lef *.LEF *.lef.gz *.LEF.gz *.def *.DEF *.def.gz *.DEF.gz)"; }
|
||||
|
||||
virtual bool detect (tl::InputStream &stream) const
|
||||
{
|
||||
return is_lef_format (stream.filename ()) || is_def_format (stream.filename ());
|
||||
}
|
||||
|
||||
virtual db::ReaderBase *create_reader (tl::InputStream &s) const
|
||||
{
|
||||
return new LEFDEFReader (s);
|
||||
}
|
||||
|
||||
virtual db::WriterBase *create_writer () const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual bool can_read () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool can_write () const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
static tl::RegisteredClass<db::StreamFormatDeclaration> format_decl (new LEFDEFFormatDeclaration (), 500, "LEFDEF");
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// LEFDEFPluginDeclaration definition and implementation
|
||||
|
||||
class LEFDEFPluginDeclaration
|
||||
: public lay::StreamReaderPluginDeclaration
|
||||
{
|
||||
public:
|
||||
LEFDEFPluginDeclaration ()
|
||||
: lay::StreamReaderPluginDeclaration (LEFDEFReaderOptions ().format_name ())
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
lay::StreamReaderOptionsPage *format_specific_options_page (QWidget *parent) const
|
||||
{
|
||||
return new LEFDEFReaderOptionsEditor (parent);
|
||||
}
|
||||
|
||||
db::FormatSpecificReaderOptions *create_specific_options () const
|
||||
{
|
||||
return new LEFDEFReaderOptions ();
|
||||
}
|
||||
|
||||
virtual tl::XMLElementBase *xml_element () const
|
||||
{
|
||||
return new lay::ReaderOptionsXMLElement<LEFDEFReaderOptions> ("lefdef",
|
||||
tl::make_member (&LEFDEFReaderOptions::read_all_layers, &LEFDEFReaderOptions::set_read_all_layers, "read-all-layers") +
|
||||
tl::make_member (&LEFDEFReaderOptions::layer_map, &LEFDEFReaderOptions::set_layer_map, "layer-map") +
|
||||
tl::make_member (&LEFDEFReaderOptions::dbu, &LEFDEFReaderOptions::set_dbu, "dbu") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_net_names, &LEFDEFReaderOptions::set_produce_net_names, "produce-net-names") +
|
||||
tl::make_member (&LEFDEFReaderOptions::net_property_name, &LEFDEFReaderOptions::set_net_property_name, "net-property-name") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_inst_names, &LEFDEFReaderOptions::set_produce_inst_names, "produce-inst-names") +
|
||||
tl::make_member (&LEFDEFReaderOptions::inst_property_name, &LEFDEFReaderOptions::set_inst_property_name, "inst-property-name") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_cell_outlines, &LEFDEFReaderOptions::set_produce_cell_outlines, "produce-cell-outlines") +
|
||||
tl::make_member (&LEFDEFReaderOptions::cell_outline_layer, &LEFDEFReaderOptions::set_cell_outline_layer, "cell-outline-layer") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_placement_blockages, &LEFDEFReaderOptions::set_produce_placement_blockages, "produce-placement-blockages") +
|
||||
tl::make_member (&LEFDEFReaderOptions::placement_blockage_layer, &LEFDEFReaderOptions::set_placement_blockage_layer, "placement-blockage-layer") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_regions, &LEFDEFReaderOptions::set_produce_regions, "produce-regions") +
|
||||
tl::make_member (&LEFDEFReaderOptions::region_layer, &LEFDEFReaderOptions::set_region_layer, "region-layer") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_via_geometry, &LEFDEFReaderOptions::set_produce_via_geometry, "produce-via-geometry") +
|
||||
tl::make_member (&LEFDEFReaderOptions::via_geometry_suffix, &LEFDEFReaderOptions::set_via_geometry_suffix, "via-geometry-suffix") +
|
||||
tl::make_member (&LEFDEFReaderOptions::via_geometry_datatype, &LEFDEFReaderOptions::set_via_geometry_datatype, "via-geometry-datatype") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_pins, &LEFDEFReaderOptions::set_produce_pins, "produce-pins") +
|
||||
tl::make_member (&LEFDEFReaderOptions::pins_suffix, &LEFDEFReaderOptions::set_pins_suffix, "pins-suffix") +
|
||||
tl::make_member (&LEFDEFReaderOptions::pins_datatype, &LEFDEFReaderOptions::set_pins_datatype, "pins-datatype") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_obstructions, &LEFDEFReaderOptions::set_produce_obstructions, "produce-obstructions") +
|
||||
tl::make_member (&LEFDEFReaderOptions::obstructions_suffix, &LEFDEFReaderOptions::set_obstructions_suffix, "obstructions-suffix") +
|
||||
tl::make_member (&LEFDEFReaderOptions::obstructions_datatype, &LEFDEFReaderOptions::set_obstructions_datatype, "obstructions-datatype") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_blockages, &LEFDEFReaderOptions::set_produce_blockages, "produce-blockages") +
|
||||
tl::make_member (&LEFDEFReaderOptions::blockages_suffix, &LEFDEFReaderOptions::set_blockages_suffix, "blockages-suffix") +
|
||||
tl::make_member (&LEFDEFReaderOptions::blockages_datatype, &LEFDEFReaderOptions::set_blockages_datatype, "blockages-datatype") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_labels, &LEFDEFReaderOptions::set_produce_labels, "produce-labels") +
|
||||
tl::make_member (&LEFDEFReaderOptions::labels_suffix, &LEFDEFReaderOptions::set_labels_suffix, "labels-suffix") +
|
||||
tl::make_member (&LEFDEFReaderOptions::labels_datatype, &LEFDEFReaderOptions::set_labels_datatype, "labels-datatype") +
|
||||
tl::make_member (&LEFDEFReaderOptions::produce_routing, &LEFDEFReaderOptions::set_produce_routing, "produce-routing") +
|
||||
tl::make_member (&LEFDEFReaderOptions::routing_suffix, &LEFDEFReaderOptions::set_routing_suffix, "routing-suffix") +
|
||||
tl::make_member (&LEFDEFReaderOptions::routing_datatype, &LEFDEFReaderOptions::set_routing_datatype, "routing-datatype") +
|
||||
tl::make_member (&LEFDEFReaderOptions::begin_lef_files, &LEFDEFReaderOptions::end_lef_files, &LEFDEFReaderOptions::push_lef_file, "lef-files")
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
static tl::RegisteredClass<lay::PluginDeclaration> plugin_decl (new LEFDEFPluginDeclaration (), 10001, "LEFDEFReader");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -13,7 +13,13 @@ LIBS += -L$$DESTDIR/../db_plugins -llefdef
|
|||
}
|
||||
|
||||
HEADERS = \
|
||||
extLEFDEFImportDialogs.h \
|
||||
|
||||
SOURCES = \
|
||||
extLEFDEFImport.cc \
|
||||
extLEFDEFImportDialogs.cc \
|
||||
extLEFDEFPlugin.cc \
|
||||
|
||||
FORMS = \
|
||||
LEFDEFImportOptionsDialog.ui \
|
||||
LEFDEFTechnologyComponentEditor.ui \
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ TARGET = lefdef_tests
|
|||
include($$PWD/../../../../lib_ut.pri)
|
||||
|
||||
SOURCES = \
|
||||
extLEFDEFImport.cc \
|
||||
|
||||
INCLUDEPATH += $$LAY_INC $$TL_INC $$DB_INC $$GSI_INC $$PWD/../db_plugin
|
||||
DEPENDPATH += $$LAY_INC $$TL_INC $$DB_INC $$GSI_INC $$PWD/../db_plugin
|
||||
|
|
|
|||
|
|
@ -5,6 +5,13 @@ DESTDIR = $$OUT_PWD/../../../../db_plugins
|
|||
include($$PWD/../../../db_plugin.pri)
|
||||
|
||||
HEADERS = \
|
||||
extGerberDrillFileReader.h \
|
||||
extGerberImporter.h \
|
||||
extRS274XApertures.h \
|
||||
extRS274XReader.h \
|
||||
|
||||
SOURCES = \
|
||||
|
||||
extGerberDrillFileReader.cc \
|
||||
extGerberImporter.cc \
|
||||
extRS274XApertures.cc \
|
||||
extRS274XReader.cc \
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
#include "extGerberImporter.h"
|
||||
#include "extGerberDrillFileReader.h"
|
||||
#include "extRS274XReader.h"
|
||||
#include "layLayoutView.h"
|
||||
#include "tlStream.h"
|
||||
#include "tlString.h"
|
||||
#include "tlString.h"
|
||||
|
|
@ -24,9 +24,8 @@
|
|||
#ifndef HDR_extGerberImporter
|
||||
#define HDR_extGerberImporter
|
||||
|
||||
#include "extCommon.h"
|
||||
#include "dbCommon.h"
|
||||
|
||||
#include "layPlugin.h"
|
||||
#include "dbLayout.h"
|
||||
#include "dbTrans.h"
|
||||
#include "dbEdgeProcessor.h"
|
||||
|
|
@ -607,7 +606,7 @@ private:
|
|||
/**
|
||||
* @brief Represents one file in a Gerber stack.
|
||||
*/
|
||||
class EXT_PUBLIC GerberFile
|
||||
class DB_PUBLIC GerberFile
|
||||
{
|
||||
public:
|
||||
GerberFile ();
|
||||
|
|
@ -771,7 +770,7 @@ private:
|
|||
* This class provides a importer for Gerber layer stacks. It can be
|
||||
* loaded from project files and saved to such.
|
||||
*/
|
||||
class EXT_PUBLIC GerberImporter
|
||||
class DB_PUBLIC GerberImporter
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
|
@ -13,7 +13,11 @@ LIBS += -L$$DESTDIR/../db_plugins -lpcb
|
|||
}
|
||||
|
||||
HEADERS = \
|
||||
extGerberImportDialog.h \
|
||||
|
||||
SOURCES = \
|
||||
extGerberImport.cc \
|
||||
extGerberImportDialog.cc \
|
||||
|
||||
FORMS = \
|
||||
GerberImportDialog.ui \
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
#include "dbLayoutDiff.h"
|
||||
#include "dbWriter.h"
|
||||
#include "dbOASISWriter.h"
|
||||
#include "dbLoadLayoutOptions.h"
|
||||
#include "dbReader.h"
|
||||
#include "dbTestSupport.h"
|
||||
Loading…
Reference in New Issue