From 937e557564a45bbc1a5b333c4d1322894bebdbd0 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 19 Oct 2025 13:36:07 +0200 Subject: [PATCH] Implemented a fix for issue #2191 (LIBNAME not saved) The fix consists of moving that options into the case-specific options like DBU, instead of having it in the format-specific, default writer options. So they can be specified on a per-case basis and taken from the current layout by default. Specifically: * SaveLayoutOptions#gds2_libname is deprecated and replaced by SaveLayoutOptions#libname * -ol (buddy tools) is no longer format specific * The GDS writer takes SaveLayoutOptions#libname, and if empty, substitutes by the current libname. As last resort, "LIB" is used, because LIBNAME cannot be an empty string. * The libname got removed from the global writer options UI * In the "Save As" options dialog, it now is part of the global options and initialized with the current layout's libname. --- src/buddies/src/bd/bdWriterOptions.cc | 14 +- src/buddies/src/bd/bdWriterOptions.h | 2 +- src/buddies/unit_tests/bdBasicTests.cc | 7 +- src/db/db/dbSaveLayoutOptions.cc | 9 +- src/db/db/dbSaveLayoutOptions.h | 14 ++ src/db/db/gsiDeclDbLayout.cc | 22 +++- src/lay/lay/layMainWindow.cc | 9 ++ src/laybasic/laybasic/layCellView.cc | 1 - src/laybasic/laybasic/layStream.h | 12 -- src/layui/layui/SaveLayoutAsOptionsDialog.ui | 120 ++++++++++-------- src/layui/layui/laySaveLayoutOptionsDialog.cc | 4 +- .../streamers/gds2/db_plugin/dbGDS2.cc | 3 +- .../streamers/gds2/db_plugin/dbGDS2Format.h | 8 -- .../gds2/db_plugin/dbGDS2WriterBase.cc | 15 ++- .../gds2/db_plugin/dbGDS2WriterBase.h | 1 + .../streamers/gds2/db_plugin/gsiDeclDbGDS2.cc | 22 ---- .../gds2/lay_plugin/GDS2WriterOptionPage.ui | 111 ++++++++-------- .../gds2/lay_plugin/layGDS2WriterPlugin.cc | 17 --- 18 files changed, 194 insertions(+), 197 deletions(-) diff --git a/src/buddies/src/bd/bdWriterOptions.cc b/src/buddies/src/bd/bdWriterOptions.cc index b863a7bb0..87d519ff6 100644 --- a/src/buddies/src/bd/bdWriterOptions.cc +++ b/src/buddies/src/bd/bdWriterOptions.cc @@ -35,6 +35,7 @@ GenericWriterOptions::GenericWriterOptions () db::SaveLayoutOptions save_options; m_dbu = save_options.get_option_by_name ("dbu").to_double (); + m_libname = save_options.get_option_by_name ("libname").to_string (); m_dont_write_empty_cells = save_options.get_option_by_name ("no_empty_cells").to_bool (); m_keep_instances = save_options.get_option_by_name ("keep_instances").to_bool (); @@ -45,7 +46,6 @@ GenericWriterOptions::GenericWriterOptions () m_gds2_multi_xy_records = save_options.get_option_by_name ("gds2_multi_xy_records").to_bool (); m_gds2_resolve_skew_arrays = save_options.get_option_by_name ("gds2_resolve_skew_arrays").to_bool (); m_gds2_max_cellname_length = save_options.get_option_by_name ("gds2_max_cellname_length").to_uint (); - m_gds2_libname = save_options.get_option_by_name ("gds2_libname").to_string (); m_gds2_user_units = save_options.get_option_by_name ("gds2_user_units").to_double (); m_gds2_write_timestamps = save_options.get_option_by_name ("gds2_write_timestamps").to_bool (); m_gds2_write_cell_properties = save_options.get_option_by_name ("gds2_write_cell_properties").to_bool (); @@ -98,6 +98,11 @@ GenericWriterOptions::add_options (tl::CommandLineOptions &cmd, const std::strin "change physically because internally, the coordinates are scaled to match the " "new database unit." ); + cmd << tl::arg (group + + "-ol|--libname=libname", &m_libname, "Uses the given library name", + "This option can specify the LIBNAME for the output file. By default, the original LIBNAME is " + "written. This option is generic, but currently only supported by GDS2." + ); } cmd << tl::arg (group + @@ -178,11 +183,6 @@ GenericWriterOptions::add_options (tl::CommandLineOptions &cmd, const std::strin "-on|--cellname-length=length", &m_gds2_max_cellname_length, "Limits cell names to the given length", "If this option is given, long cell names will truncated if their length exceeds the given length." ) - << tl::arg (group + - "-ol|--libname=libname", &m_gds2_libname, "Uses the given library name", - "This option can specify the GDS2 LIBNAME for the output file. By default, the original LIBNAME is " - "written." - ) << tl::arg (group + "#--user-units=unit", &m_gds2_user_units, "Specifies the user unit to use", "Specifies the GDS2 user unit. By default micrometers are used for the user unit." @@ -374,6 +374,7 @@ GenericWriterOptions::configure (db::SaveLayoutOptions &save_options, const db:: { save_options.set_scale_factor (m_scale_factor); save_options.set_dbu (m_dbu); + save_options.set_libname (m_libname); save_options.set_dont_write_empty_cells (m_dont_write_empty_cells); save_options.set_keep_instances (m_keep_instances); save_options.set_write_context_info (m_write_context_info); @@ -383,7 +384,6 @@ GenericWriterOptions::configure (db::SaveLayoutOptions &save_options, const db:: save_options.set_option_by_name ("gds2_multi_xy_records", m_gds2_multi_xy_records); save_options.set_option_by_name ("gds2_resolve_skew_arrays", m_gds2_resolve_skew_arrays); save_options.set_option_by_name ("gds2_max_cellname_length", m_gds2_max_cellname_length); - save_options.set_option_by_name ("gds2_libname", m_gds2_libname); save_options.set_option_by_name ("gds2_user_units", m_gds2_user_units); save_options.set_option_by_name ("gds2_write_timestamps", m_gds2_write_timestamps); save_options.set_option_by_name ("gds2_write_cell_properties", m_gds2_write_cell_properties); diff --git a/src/buddies/src/bd/bdWriterOptions.h b/src/buddies/src/bd/bdWriterOptions.h index 0d03c411b..a5811bdb5 100644 --- a/src/buddies/src/bd/bdWriterOptions.h +++ b/src/buddies/src/bd/bdWriterOptions.h @@ -118,7 +118,7 @@ private: bool m_gds2_multi_xy_records; bool m_gds2_resolve_skew_arrays; unsigned int m_gds2_max_cellname_length; - std::string m_gds2_libname; + std::string m_libname; double m_gds2_user_units; bool m_gds2_write_timestamps; bool m_gds2_write_cell_properties; diff --git a/src/buddies/unit_tests/bdBasicTests.cc b/src/buddies/unit_tests/bdBasicTests.cc index 4c3fb38bd..991196af3 100644 --- a/src/buddies/unit_tests/bdBasicTests.cc +++ b/src/buddies/unit_tests/bdBasicTests.cc @@ -43,13 +43,13 @@ TEST(1) "--drop-empty-cells", "--keep-instances", "--no-context-info", + "-ol=MYLIBNAME", // CIF "--blank-separator", "--dummy-calls", // DXF "-op=2", // GDS2 - "-ol=MYLIBNAME", "-ov=250", "--multi-xy-records", "--no-timestamps", @@ -77,7 +77,7 @@ TEST(1) EXPECT_EQ (stream_opt.get_option_by_name ("cif_blank_separator").to_bool (), false); EXPECT_EQ (stream_opt.get_option_by_name ("cif_dummy_calls").to_bool (), false); EXPECT_EQ (stream_opt.get_option_by_name ("dxf_polygon_mode").to_int (), 0); - EXPECT_EQ (stream_opt.get_option_by_name ("gds2_libname").to_string (), "LIB"); + EXPECT_EQ (stream_opt.get_option_by_name ("libname").to_string (), ""); EXPECT_EQ (stream_opt.get_option_by_name ("gds2_max_vertex_count").to_uint (), (unsigned int) 8000); EXPECT_EQ (stream_opt.get_option_by_name ("gds2_multi_xy_records").to_bool (), false); EXPECT_EQ (stream_opt.get_option_by_name ("gds2_write_timestamps").to_bool (), true); @@ -100,10 +100,11 @@ TEST(1) EXPECT_EQ (stream_opt.dont_write_empty_cells (), true); EXPECT_EQ (stream_opt.keep_instances (), true); EXPECT_EQ (stream_opt.write_context_info (), false); + EXPECT_EQ (stream_opt.libname (), "MYLIBNAME"); + EXPECT_EQ (stream_opt.get_option_by_name ("libname").to_string (), "MYLIBNAME"); EXPECT_EQ (stream_opt.get_option_by_name ("cif_blank_separator").to_bool (), true); EXPECT_EQ (stream_opt.get_option_by_name ("cif_dummy_calls").to_bool (), true); EXPECT_EQ (stream_opt.get_option_by_name ("dxf_polygon_mode").to_int (), 2); - EXPECT_EQ (stream_opt.get_option_by_name ("gds2_libname").to_string (), "MYLIBNAME"); EXPECT_EQ (stream_opt.get_option_by_name ("gds2_max_vertex_count").to_uint (), (unsigned int) 250); EXPECT_EQ (stream_opt.get_option_by_name ("gds2_multi_xy_records").to_bool (), true); EXPECT_EQ (stream_opt.get_option_by_name ("gds2_write_timestamps").to_bool (), false); diff --git a/src/db/db/dbSaveLayoutOptions.cc b/src/db/db/dbSaveLayoutOptions.cc index 9bd8e5014..a7f990a67 100644 --- a/src/db/db/dbSaveLayoutOptions.cc +++ b/src/db/db/dbSaveLayoutOptions.cc @@ -61,6 +61,7 @@ SaveLayoutOptions::operator= (const SaveLayoutOptions &d) m_all_cells = d.m_all_cells; m_dbu = d.m_dbu; m_scale_factor = d.m_scale_factor; + m_libname = d.m_libname; m_keep_instances = d.m_keep_instances; m_write_context_info = d.m_write_context_info; m_dont_write_empty_cells = d.m_dont_write_empty_cells; @@ -220,7 +221,13 @@ SaveLayoutOptions::set_dbu (double dbu) m_dbu = dbu; } -void +void +SaveLayoutOptions::set_libname (const std::string &libname) +{ + m_libname = libname; +} + +void SaveLayoutOptions::set_scale_factor (double f) { m_scale_factor = f; diff --git a/src/db/db/dbSaveLayoutOptions.h b/src/db/db/dbSaveLayoutOptions.h index fb5fbb60c..9916cf4c0 100644 --- a/src/db/db/dbSaveLayoutOptions.h +++ b/src/db/db/dbSaveLayoutOptions.h @@ -194,6 +194,19 @@ public: return m_scale_factor; } + /** + * @brief Sets the libname + */ + void set_libname (const std::string &libname); + + /** + * @brief Gets the libname + */ + const std::string &libname () const + { + return m_libname; + } + /** * @brief Set the "don't write empty cells flag" */ @@ -440,6 +453,7 @@ private: bool m_all_cells; double m_dbu; double m_scale_factor; + std::string m_libname; bool m_keep_instances; bool m_write_context_info; bool m_dont_write_empty_cells; diff --git a/src/db/db/gsiDeclDbLayout.cc b/src/db/db/gsiDeclDbLayout.cc index c222a74ac..72a7a498f 100644 --- a/src/db/db/gsiDeclDbLayout.cc +++ b/src/db/db/gsiDeclDbLayout.cc @@ -2972,7 +2972,7 @@ Class decl_SaveLayoutOptions ("db", "SaveLayoutOptions", "This method was introduced in version 0.23.\n" ) + gsi::method ("dbu=", &db::SaveLayoutOptions::set_dbu, gsi::arg ("dbu"), - "@brief Set the database unit to be used in the stream file\n" + "@brief Sets the database unit to be used in the stream file\n" "\n" "By default, the database unit of the layout is used. This method allows one to explicitly use a different\n" "database unit. A scale factor is introduced automatically which scales all layout objects accordingly so their physical dimensions remain the same. " @@ -2980,7 +2980,7 @@ Class decl_SaveLayoutOptions ("db", "SaveLayoutOptions", "layout may become slightly distorted." ) + gsi::method ("dbu", &db::SaveLayoutOptions::dbu, - "@brief Get the explicit database unit if one is set\n" + "@brief Gets the explicit database unit if one is set\n" "\n" "See \\dbu= for a description of that attribute.\n" ) + @@ -2994,8 +2994,24 @@ Class decl_SaveLayoutOptions ("db", "SaveLayoutOptions", gsi::method ("no_empty_cells?", &db::SaveLayoutOptions::dont_write_empty_cells, "@brief Returns a flag indicating whether empty cells are not written.\n" ) + + gsi::method ("libname=|#gds2_libname=", &db::SaveLayoutOptions::set_libname, gsi::arg ("libname"), + "@brief Sets the library name\n" + "\n" + "The library name is an attribute and specifies a formal name for a library, if the layout files is to be used as one.\n" + "Currently, this attribute is only supported by the GDS2 format. Hence the alias.\n" + "\n" + "By default or if the libname is an empty string, the current library name of the layout or 'LIB' is used.\n" + "\n" + "The 'libname' alias has been introduced in version 0.30.5. The original name \\gds2_libname= is still available." + ) + + gsi::method ("libname|#gds2_libname", &db::SaveLayoutOptions::libname, + "@brief Gets the library name\n" + "\n" + "See \\libname= for details.\n" + "The 'libname' alias has been introduced in version 0.30.5. The original name \\gds2_libname is still available." + ) + gsi::method ("scale_factor=", &db::SaveLayoutOptions::set_scale_factor, gsi::arg ("scale_factor"), - "@brief Set the scaling factor for the saving \n" + "@brief Sets the scaling factor for the saving \n" "\n" "Using a scaling factor will scale all objects accordingly. " "This scale factor adds to a potential scaling implied by using an explicit database unit.\n" diff --git a/src/lay/lay/layMainWindow.cc b/src/lay/lay/layMainWindow.cc index 72430e410..943287218 100644 --- a/src/lay/lay/layMainWindow.cc +++ b/src/lay/lay/layMainWindow.cc @@ -2315,8 +2315,17 @@ MainWindow::do_save (bool as) options.set_format (cv->save_options ().format ()); } + // preconfigure options with current values + options.set_dbu (cv->layout ().dbu ()); + if (cv->layout ().has_meta_info ("libname")) { + tl::Variant libname = cv->layout ().meta_info ("libname").value; + if (libname.is_a_string ()) { + options.set_libname (libname.to_stdstring ()); + } + } + if (as || options.format ().empty ()) { options.set_format_from_filename (fn); } diff --git a/src/laybasic/laybasic/layCellView.cc b/src/laybasic/laybasic/layCellView.cc index 4ee9379d0..84cbde12c 100644 --- a/src/laybasic/laybasic/layCellView.cc +++ b/src/laybasic/laybasic/layCellView.cc @@ -319,7 +319,6 @@ LayoutHandle::update_save_options (db::SaveLayoutOptions &options) } if (specific_options.get ()) { - decl->initialize_options_from_layout_handle (specific_options.get (), *this); options.set_options (specific_options.release ()); } diff --git a/src/laybasic/laybasic/layStream.h b/src/laybasic/laybasic/layStream.h index 91d5a43aa..f51bd7fbc 100644 --- a/src/laybasic/laybasic/layStream.h +++ b/src/laybasic/laybasic/layStream.h @@ -258,18 +258,6 @@ public: { return 0; } - - /** - * @brief Initialize the writer options from a layout handle - * - * The layout handle carries information about meta data read and similar. This - * method gives the plugin a chance to modify the options based on the meta data - * of the layout. - */ - virtual void initialize_options_from_layout_handle (db::FormatSpecificWriterOptions * /*options*/, const lay::LayoutHandle & /*lh*/) const - { - // the default implementation does nothing. - } }; } diff --git a/src/layui/layui/SaveLayoutAsOptionsDialog.ui b/src/layui/layui/SaveLayoutAsOptionsDialog.ui index 90863d2ce..1f65588ae 100644 --- a/src/layui/layui/SaveLayoutAsOptionsDialog.ui +++ b/src/layui/layui/SaveLayoutAsOptionsDialog.ui @@ -152,10 +152,10 @@ 6 - - + + - µm + Cell context @@ -166,16 +166,23 @@ - - - - - 0 - 0 - - + + - 1.0 + Store PCell and library context information (format specific) + + + true + + + + + + + Cell tree + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop @@ -195,14 +202,7 @@ - - - - Scaling factor - - - - + QFrame::NoFrame @@ -278,6 +278,46 @@ + + + + µm + + + + + + + Scaling factor + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + 1.0 + + + @@ -304,29 +344,6 @@ - - - - Cell tree - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -337,20 +354,13 @@ - - - - Store PCell and library context information (format specific) - - - true - - + + - - + + - Cell context + Library name diff --git a/src/layui/layui/laySaveLayoutOptionsDialog.cc b/src/layui/layui/laySaveLayoutOptionsDialog.cc index 0117efb23..7d89c39db 100644 --- a/src/layui/layui/laySaveLayoutOptionsDialog.cc +++ b/src/layui/layui/laySaveLayoutOptionsDialog.cc @@ -462,6 +462,7 @@ SaveLayoutAsOptionsDialog::get_options (lay::LayoutViewBase *view, unsigned int mp_ui->compression->setCurrentIndex (om_to_index (om)); mp_ui->dbu_le->setText (tl::to_qstring (tl::to_string (options.dbu ()))); + mp_ui->libname_le->setText (tl::to_qstring (options.libname ())); mp_ui->fmt_cbx->setCurrentIndex (0); fmt_cbx_changed (0); @@ -490,8 +491,6 @@ SaveLayoutAsOptionsDialog::get_options (lay::LayoutViewBase *view, unsigned int specific_options.reset (decl->create_specific_options ()); } - decl->initialize_options_from_layout_handle (specific_options.get (), *cv.handle ()); - if (page->first) { page->first->setup (specific_options.get (), mp_tech); } @@ -524,6 +523,7 @@ SaveLayoutAsOptionsDialog::get_options (lay::LayoutViewBase *view, unsigned int options.set_dbu (dbu); options.set_scale_factor (sf); + options.set_libname (tl::to_string (mp_ui->libname_le->text ())); options.set_dont_write_empty_cells (mp_ui->no_empty_cells_cb->isChecked ()); options.set_keep_instances (mp_ui->keep_instances_cb->isChecked ()); options.set_write_context_info (mp_ui->store_context_cb->isChecked ()); diff --git a/src/plugins/streamers/gds2/db_plugin/dbGDS2.cc b/src/plugins/streamers/gds2/db_plugin/dbGDS2.cc index f296c2204..09a0fdf99 100644 --- a/src/plugins/streamers/gds2/db_plugin/dbGDS2.cc +++ b/src/plugins/streamers/gds2/db_plugin/dbGDS2.cc @@ -77,8 +77,7 @@ class GDS2FormatDeclaration tl::make_member (&db::GDS2WriterOptions::multi_xy_records, "multi-xy-records") + tl::make_member (&db::GDS2WriterOptions::resolve_skew_arrays, "resolve-skew-arrays") + tl::make_member (&db::GDS2WriterOptions::max_vertex_count, "max-vertex-count") + - tl::make_member (&db::GDS2WriterOptions::max_cellname_length, "max-cellname-length") + - tl::make_member (&db::GDS2WriterOptions::libname, "libname") + tl::make_member (&db::GDS2WriterOptions::max_cellname_length, "max-cellname-length") ); } diff --git a/src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h b/src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h index 94a8419f6..2422a3c75 100644 --- a/src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h +++ b/src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h @@ -111,7 +111,6 @@ public: multi_xy_records (false), resolve_skew_arrays (false), max_cellname_length (32000), - libname ("LIB"), user_units (1.0), write_timestamps (true), write_cell_properties (false), @@ -163,13 +162,6 @@ public: */ unsigned int max_cellname_length; - /** - * @brief The library name - * - * This property describes that library name written to the LIBNAME record. - */ - std::string libname; - /** * @brief The user units to use * diff --git a/src/plugins/streamers/gds2/db_plugin/dbGDS2WriterBase.cc b/src/plugins/streamers/gds2/db_plugin/dbGDS2WriterBase.cc index 50429eb08..55bd3448c 100644 --- a/src/plugins/streamers/gds2/db_plugin/dbGDS2WriterBase.cc +++ b/src/plugins/streamers/gds2/db_plugin/dbGDS2WriterBase.cc @@ -435,9 +435,20 @@ GDS2WriterBase::write (db::Layout &layout, tl::OutputStream &stream, const db::S db::GDS2WriterOptions gds2_options = options.get_options (); + m_libname = options.libname (); + if (m_libname.empty () && layout.has_meta_info ("libname")) { + tl::Variant libname = layout.meta_info ("libname").value; + if (libname.is_a_string ()) { + m_libname = libname.to_stdstring (); + } + } + if (m_libname.empty ()) { + m_libname = "LIB"; + } + layout.add_meta_info ("dbuu", MetaInfo (tl::to_string (tr ("Database unit in user units")), tl::to_string (m_dbu / std::max (1e-9, gds2_options.user_units)))); layout.add_meta_info ("dbum", MetaInfo (tl::to_string (tr ("Database unit in meter")), tl::to_string (m_dbu * 1e-6))); - layout.add_meta_info ("libname", MetaInfo (tl::to_string (tr ("Library name")), gds2_options.libname)); + layout.add_meta_info ("libname", MetaInfo (tl::to_string (tr ("Library name")), m_libname)); std::vector > layers; options.get_valid_layers (layout, layers, db::SaveLayoutOptions::LP_AssignNumber); @@ -517,7 +528,7 @@ GDS2WriterBase::write (db::Layout &layout, tl::OutputStream &stream, const db::S write_time (time_data); try { - write_string_record (sLIBNAME, gds2_options.libname); + write_string_record (sLIBNAME, m_libname); } catch (tl::Exception &ex) { throw tl::Exception (ex.msg () + tl::to_string (tr (", writing LIBNAME"))); } diff --git a/src/plugins/streamers/gds2/db_plugin/dbGDS2WriterBase.h b/src/plugins/streamers/gds2/db_plugin/dbGDS2WriterBase.h index ff1b2898c..95bb17906 100644 --- a/src/plugins/streamers/gds2/db_plugin/dbGDS2WriterBase.h +++ b/src/plugins/streamers/gds2/db_plugin/dbGDS2WriterBase.h @@ -168,6 +168,7 @@ protected: private: db::WriterCellNameMap m_cell_name_map; double m_dbu; + std::string m_libname; bool m_resolve_skew_arrays; bool m_multi_xy; bool m_no_zero_length_paths; diff --git a/src/plugins/streamers/gds2/db_plugin/gsiDeclDbGDS2.cc b/src/plugins/streamers/gds2/db_plugin/gsiDeclDbGDS2.cc index 3898ddb73..bf1e218cd 100644 --- a/src/plugins/streamers/gds2/db_plugin/gsiDeclDbGDS2.cc +++ b/src/plugins/streamers/gds2/db_plugin/gsiDeclDbGDS2.cc @@ -126,16 +126,6 @@ static tl::Variant get_gds2_default_text_size (const db::SaveLayoutOptions *opti return ts < 0.0 ? tl::Variant () : tl::Variant (ts); } -static void set_gds2_libname (db::SaveLayoutOptions *options, const std::string &n) -{ - options->get_options ().libname = n; -} - -static std::string get_gds2_libname (const db::SaveLayoutOptions *options) -{ - return options->get_options ().libname; -} - static void set_gds2_user_units (db::SaveLayoutOptions *options, double n) { options->get_options ().user_units = n; @@ -263,18 +253,6 @@ gsi::ClassExt gds2_writer_options ( "See \\gds2_max_cellname_length= method for a description of the maximum cell name length." "\nThis property has been added in version 0.18.\n" ) + - gsi::method_ext ("gds2_libname=", &set_gds2_libname, gsi::arg ("libname"), - "@brief Set the library name\n" - "\n" - "The library name is the string written into the LIBNAME records of the GDS file.\n" - "The library name should not be an empty string and is subject to certain limitations in the character choice.\n" - "\nThis property has been added in version 0.18.\n" - ) + - gsi::method_ext ("gds2_libname", &get_gds2_libname, - "@brief Get the library name\n" - "See \\gds2_libname= method for a description of the library name." - "\nThis property has been added in version 0.18.\n" - ) + gsi::method_ext ("gds2_user_units=", &set_gds2_user_units, gsi::arg ("uu"), "@brief Set the users units to write into the GDS file\n" "\n" diff --git a/src/plugins/streamers/gds2/lay_plugin/GDS2WriterOptionPage.ui b/src/plugins/streamers/gds2/lay_plugin/GDS2WriterOptionPage.ui index ac838890e..3f9931695 100644 --- a/src/plugins/streamers/gds2/lay_plugin/GDS2WriterOptionPage.ui +++ b/src/plugins/streamers/gds2/lay_plugin/GDS2WriterOptionPage.ui @@ -50,55 +50,45 @@ 6 - - - - - + + - Max. cell name length + µm (empty for no size) - - - - - - - Eliminate zero-length paths (convert to BOUNDARY) - - - - - - - (<4000 recommended, absolute limit 8191) - - - - + Resolve skew (non-orthogonal) arrays into single instances - + + + + Default text size + + + + + + + + + + Max. cell name length + + + + Write current time to time stamps (BGNLIB, BGNSTR) - - - - Library name - - - - + Multi-XY record mode for boundaries @@ -106,24 +96,7 @@ - - - - (keep empty for unspecified limit) - - - - - - - Max. vertices - - - - - - - + QFrame::NoFrame @@ -188,20 +161,37 @@ - - - - - + + - Default text size + Max. vertices - - + + + + + - µm (empty for no size) + (<4000 recommended, absolute limit 8191) + + + + + + + Eliminate zero-length paths (convert to BOUNDARY) + + + + + + + + + + (keep empty for unspecified limit) @@ -224,7 +214,6 @@ - libname_le cell_name_length_le max_vertex_le multi_xy_cbx diff --git a/src/plugins/streamers/gds2/lay_plugin/layGDS2WriterPlugin.cc b/src/plugins/streamers/gds2/lay_plugin/layGDS2WriterPlugin.cc index 760906cd1..c30f1cb84 100644 --- a/src/plugins/streamers/gds2/lay_plugin/layGDS2WriterPlugin.cc +++ b/src/plugins/streamers/gds2/lay_plugin/layGDS2WriterPlugin.cc @@ -66,7 +66,6 @@ GDS2WriterOptionPage::setup (const db::FormatSpecificWriterOptions *o, const db: mp_ui->max_vertex_le->setText (tl::to_qstring (tl::to_string (options->max_vertex_count))); mp_ui->cell_name_length_le->setText (tl::to_qstring (tl::to_string (options->max_cellname_length))); mp_ui->default_text_size_le->setText (tl::to_qstring (options->default_text_size >= 0.0 ? tl::to_string (options->default_text_size) : std::string ())); - mp_ui->libname_le->setText (tl::to_qstring (tl::to_string (options->libname))); } } @@ -118,8 +117,6 @@ GDS2WriterOptionPage::commit (db::FormatSpecificWriterOptions *o, const db::Tech } options->max_cellname_length = n; - options->libname = tl::to_string (mp_ui->libname_le->text ()); - } } @@ -153,20 +150,6 @@ public: { return new db::GDS2WriterOptions (); } - - void initialize_options_from_layout_handle (db::FormatSpecificWriterOptions *o, const lay::LayoutHandle &lh) const - { - // Initialize the libname property from meta data with key "libname". - db::GDS2WriterOptions *options = dynamic_cast (o); - if (options) { - db::Layout::meta_info_name_id_type libname_name_id = lh.layout().meta_info_name_id ("libname"); - for (db::Layout::meta_info_iterator meta = lh.layout().begin_meta (); meta != lh.layout().end_meta (); ++meta) { - if (meta->first == libname_name_id && !meta->second.value.is_nil ()) { - options->libname = meta->second.value.to_string (); - } - } - } - } }; }