mirror of https://github.com/KLayout/klayout.git
Merge branch 'wip'
This commit is contained in:
commit
b51caf5d39
|
|
@ -59,7 +59,7 @@ Library::~Library ()
|
|||
bool
|
||||
Library::is_for_technology (const std::string &name) const
|
||||
{
|
||||
return m_technologies.find (name) != m_technologies.end ();
|
||||
return (! m_technologies.empty () && name == "*") || m_technologies.find (name) != m_technologies.end ();
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -246,10 +246,13 @@ LibraryClass<db::Library> decl_Library ("db", "LibraryBase",
|
|||
"@brief Gets a library by name\n"
|
||||
"Returns the library object for the given name. If the name is not a valid library name, nil is returned.\n"
|
||||
"\n"
|
||||
"Different libraries can be registered under the same names for different technologies. When a technology name is given in 'for_technologies', "
|
||||
"the first library matching this technology is returned. If no technology is given, the first library is returned.\n"
|
||||
"Different libraries can be registered under the same names for different technologies. By specifying a technology, this method\n"
|
||||
"will return the first library matching both name and the given technology. It will also return libraries not bound to a specific\n"
|
||||
"technology in that case. Without a technology name given ('unspecific'), only libraries not bound to a technology are returned.\n"
|
||||
"You can also specify '*' for the technology - in that case, the first library with the given name is returned, regardless whether\n"
|
||||
"it is bound to a technology or not.\n"
|
||||
"\n"
|
||||
"The technology selector has been introduced in version 0.27."
|
||||
"The technology selector has been introduced in version 0.27. The '*' option for the technology has been added in version 0.30.8."
|
||||
) +
|
||||
gsi::method ("library_by_id", &library_by_id, gsi::arg ("id"),
|
||||
"@brief Gets the library object for the given ID\n"
|
||||
|
|
@ -375,8 +378,10 @@ LibraryClass<db::Library> decl_Library ("db", "LibraryBase",
|
|||
gsi::method ("is_for_technology", &db::Library::is_for_technology, gsi::arg ("tech"),
|
||||
"@brief Returns a value indicating whether the library is associated with the given technology.\n"
|
||||
"The method is equivalent to checking whether the \\technologies list is empty.\n"
|
||||
"As a special case, you can pass '*' for the 'tech' argument. In that case, this method\n"
|
||||
"will return true, if the library is bound to any technology.\n"
|
||||
"\n"
|
||||
"This method has been introduced in version 0.27"
|
||||
"This method has been introduced in version 0.27. The '*' option for the technology has been added in version 0.30.8."
|
||||
) +
|
||||
gsi::method ("for_technologies", &db::Library::for_technologies,
|
||||
"@brief Returns a value indicating whether the library is associated with any technology.\n"
|
||||
|
|
|
|||
|
|
@ -508,6 +508,16 @@ TEST(3)
|
|||
std::unique_ptr<LIBT_B> lib_b (new LIBT_B ());
|
||||
db::LibraryManager::instance ().register_lib (lib_b.get ());
|
||||
|
||||
EXPECT_EQ (lib_a->is_for_technology ("X"), false);
|
||||
EXPECT_EQ (lib_a->is_for_technology ("*"), false);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A").first, true);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "*").first, true);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "X").first, true);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "").first, true);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A").second, lib_a->get_id ());
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "X").second, lib_a->get_id ());
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "*").second, lib_a->get_id ());
|
||||
|
||||
// This test tests the ability to reference libraries out of other libraries ("B" references "A"),
|
||||
// the ability to persist that and whether this survives a write/read cycle.
|
||||
|
||||
|
|
@ -547,6 +557,15 @@ TEST(4)
|
|||
std::unique_ptr<LIBT_A> lib_a1_inst (new LIBT_A ());
|
||||
tl::weak_ptr<LIBT_A> lib_a1 (lib_a1_inst.get ());
|
||||
lib_a1->add_technology ("X");
|
||||
EXPECT_EQ (lib_a1->is_for_technology ("Z"), false);
|
||||
EXPECT_EQ (lib_a1->is_for_technology ("X"), true);
|
||||
EXPECT_EQ (lib_a1->is_for_technology ("XX"), false);
|
||||
EXPECT_EQ (lib_a1->is_for_technology ("*"), true);
|
||||
lib_a1->add_technology ("XX");
|
||||
EXPECT_EQ (lib_a1->is_for_technology ("Z"), false);
|
||||
EXPECT_EQ (lib_a1->is_for_technology ("X"), true);
|
||||
EXPECT_EQ (lib_a1->is_for_technology ("XX"), true);
|
||||
EXPECT_EQ (lib_a1->is_for_technology ("*"), true);
|
||||
|
||||
std::unique_ptr<LIBT_A> lib_a2_inst (new LIBT_A ());
|
||||
tl::weak_ptr<LIBT_A> lib_a2 (lib_a2_inst.get ());
|
||||
|
|
@ -554,12 +573,15 @@ TEST(4)
|
|||
|
||||
std::unique_ptr<LIBT_A> lib_a3_inst (new LIBT_A ());
|
||||
tl::weak_ptr<LIBT_A> lib_a3 (lib_a3_inst.get ());
|
||||
// same technologies as a1, so it can entirely replace it:
|
||||
lib_a3->add_technology ("X");
|
||||
lib_a3->add_technology ("XX");
|
||||
|
||||
std::unique_ptr<LIBT_A> lib_a4_inst (new LIBT_A ());
|
||||
tl::weak_ptr<LIBT_A> lib_a4 (lib_a4_inst.get ());
|
||||
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A").first, false);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "*").first, false);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "Z").first, false);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "").first, false);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "X").first, false);
|
||||
|
|
@ -567,20 +589,25 @@ TEST(4)
|
|||
db::LibraryManager::instance ().register_lib (lib_a1.get ());
|
||||
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A").first, false);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "*").first, true);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "Z").first, false);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "").first, false);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "X").first, true);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "X").second, lib_a1->get_id ());
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "XX").second, lib_a1->get_id ());
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "*").second, lib_a1->get_id ());
|
||||
|
||||
db::LibraryManager::instance ().register_lib (lib_a2.get ());
|
||||
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A").first, false);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "*").first, true);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "Z").first, false);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "").first, false);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "X").first, true);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "X").second, lib_a1->get_id ());
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "Y").first, true);
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "Y").second, lib_a2->get_id ());
|
||||
EXPECT_EQ (db::LibraryManager::instance ().lib_by_name ("A", "*").second, lib_a2->get_id ());
|
||||
|
||||
db::LibraryManager::instance ().register_lib (lib_a3.get ());
|
||||
// lib_a3 replaces lib_a1
|
||||
|
|
|
|||
|
|
@ -934,7 +934,9 @@ InstPropertiesPage::do_apply (bool current_only, bool relative)
|
|||
throw;
|
||||
}
|
||||
|
||||
mp_service->view ()->add_new_layers (layer_state);
|
||||
if (mp_service->view ()->auto_create_new_layers ()) {
|
||||
mp_service->view ()->add_new_layers (layer_state);
|
||||
}
|
||||
|
||||
// remove superfluous proxies
|
||||
for (unsigned int i = 0; i < mp_service->view ()->cellviews (); ++i) {
|
||||
|
|
|
|||
|
|
@ -332,7 +332,9 @@ InstService::make_cell (const lay::CellView &cv)
|
|||
|
||||
}
|
||||
|
||||
view ()->add_new_layers (layer_state);
|
||||
if (view ()->auto_create_new_layers ()) {
|
||||
view ()->add_new_layers (layer_state);
|
||||
}
|
||||
|
||||
m_has_valid_cell = true;
|
||||
m_current_cell = inst_cell_index;
|
||||
|
|
|
|||
|
|
@ -2727,7 +2727,9 @@ MainService::paste ()
|
|||
}
|
||||
|
||||
// Add new layers to the view if required.
|
||||
view ()->add_new_layers (new_layers, cv_index);
|
||||
if (mp_view->auto_create_new_layers ()) {
|
||||
view ()->add_new_layers (new_layers, cv_index);
|
||||
}
|
||||
view ()->update_content ();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -699,7 +699,9 @@ PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::P
|
|||
// initial callback
|
||||
|
||||
try {
|
||||
mp_pcell_decl->callback (mp_view->cellview (m_cv_index)->layout (), std::string (), m_states);
|
||||
if (mp_pcell_decl->layout ()) {
|
||||
mp_pcell_decl->callback (*mp_pcell_decl->layout (), std::string (), m_states);
|
||||
}
|
||||
} catch (tl::Exception &ex) {
|
||||
// potentially caused by script errors in callback implementation
|
||||
tl::error << ex.msg ();
|
||||
|
|
@ -788,7 +790,9 @@ PCellParametersPage::parameter_changed ()
|
|||
|
||||
// Note: checking for is_busy prevents callbacks during debugger execution
|
||||
if (! edit_error) {
|
||||
mp_pcell_decl->callback (mp_view->cellview (m_cv_index)->layout (), pd ? pd->get_name () : std::string (), states);
|
||||
if (mp_pcell_decl->layout ()) {
|
||||
mp_pcell_decl->callback (*mp_pcell_decl->layout (), pd ? pd->get_name () : std::string (), states);
|
||||
}
|
||||
m_states = states;
|
||||
}
|
||||
|
||||
|
|
@ -1014,7 +1018,9 @@ PCellParametersPage::get_parameters (db::ParameterStates &states, bool *ok)
|
|||
|
||||
auto parameters = parameter_from_states (states);
|
||||
auto before_coerce = parameters;
|
||||
mp_pcell_decl->coerce_parameters (mp_view->cellview (m_cv_index)->layout (), parameters);
|
||||
if (mp_pcell_decl->layout ()) {
|
||||
mp_pcell_decl->coerce_parameters (*mp_pcell_decl->layout (), parameters);
|
||||
}
|
||||
|
||||
if (parameters != before_coerce) {
|
||||
states_from_parameters (states, parameters);
|
||||
|
|
@ -1070,8 +1076,8 @@ PCellParametersPage::set_parameters (const std::vector<tl::Variant> ¶meters)
|
|||
states_from_parameters (m_states, parameters);
|
||||
|
||||
try {
|
||||
if (mp_view->cellview (m_cv_index).is_valid ()) {
|
||||
mp_pcell_decl->callback (mp_view->cellview (m_cv_index)->layout (), std::string (), m_states);
|
||||
if (mp_view->cellview (m_cv_index).is_valid () && mp_pcell_decl->layout ()) {
|
||||
mp_pcell_decl->callback (*mp_pcell_decl->layout (), std::string (), m_states);
|
||||
}
|
||||
} catch (tl::Exception &ex) {
|
||||
// potentially caused by script errors in callback implementation
|
||||
|
|
|
|||
|
|
@ -2434,18 +2434,12 @@ PartialService::end_move (const db::DPoint & /*p*/, lay::angle_constraint_type /
|
|||
|
||||
if (m_current != m_start) {
|
||||
|
||||
if (manager ()) {
|
||||
manager ()->transaction (tl::to_string (tr ("Partial move")));
|
||||
}
|
||||
db::Transaction transaction ((manager () && ! manager ()->transacting ()) ? manager () : 0, tl::to_string (tr ("Partial move")));
|
||||
|
||||
db::DTrans move_trans = db::DTrans (m_current - m_start);
|
||||
|
||||
transform_selection (move_trans);
|
||||
|
||||
if (manager ()) {
|
||||
manager ()->commit ();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (! m_keep_selection) {
|
||||
|
|
|
|||
|
|
@ -1295,7 +1295,6 @@ Object::box () const
|
|||
|
||||
// include landmarks
|
||||
for (std::vector <db::DPoint>::const_iterator l = m_landmarks.begin (); l != m_landmarks.end (); ++l) {
|
||||
|
||||
b += m_trans * *l;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -794,7 +794,7 @@ public:
|
|||
/**
|
||||
* @brief Set the transformation matrix
|
||||
*
|
||||
* This transformation matrix converts pixel coordinates (0,0 being the lower left corner and each pixel having the dimension of pixel_width and pixel_height)
|
||||
* This transformation matrix converts pixel coordinates (0,0 being the center and each pixel having the dimension of pixel_width and pixel_height)
|
||||
* to micron coordinates. The coordinate of the pixel is the lower left corner of the pixel.
|
||||
*/
|
||||
void set_matrix (const db::Matrix3d &trans);
|
||||
|
|
@ -802,7 +802,7 @@ public:
|
|||
/**
|
||||
* @brief Return the pixel-to-micron transformation
|
||||
*
|
||||
* This transformation converts pixel coordinates (0,0 being the lower left corner and each pixel having the dimension of pixel_width and pixel_height)
|
||||
* This transformation converts pixel coordinates (0,0 being the center and each pixel having the dimension of pixel_width and pixel_height)
|
||||
* to micron coordinates. The coordinate of the pixel is the lower left corner of the pixel.
|
||||
*/
|
||||
const db::Matrix3d &matrix () const
|
||||
|
|
|
|||
|
|
@ -1309,6 +1309,7 @@ Service::transient_select (const db::DPoint &pos)
|
|||
clear_transient_selection ();
|
||||
|
||||
bool any_selected = false;
|
||||
std::string data_string;
|
||||
|
||||
// compute search box
|
||||
double l = catch_distance ();
|
||||
|
|
@ -1336,12 +1337,41 @@ Service::transient_select (const db::DPoint &pos)
|
|||
mp_transient_view = new img::View (this, imin, img::View::mode_transient);
|
||||
}
|
||||
|
||||
if (mp_transient_view->image_object ()) {
|
||||
|
||||
const img::Object *image = mp_transient_view->image_object ();
|
||||
|
||||
db::DPoint pixel = image->matrix ().inverted ().trans (pos);
|
||||
if (pixel.x () > image->width () * -0.5 - 0.5 + db::epsilon && pixel.x () < image->width () * 0.5 + 0.5 - db::epsilon &&
|
||||
pixel.y () > image->height () * -0.5 - 0.5 + db::epsilon && pixel.y () < image->height () * 0.5 + 0.5 - db::epsilon) {
|
||||
|
||||
db::Point pixel_index = db::Point (pixel + db::DVector (image->width () * 0.5 - 0.5, image->height () * 0.5 - 0.5));
|
||||
|
||||
// check once again to account to rounding issues
|
||||
if (pixel_index.x () >= 0 && pixel_index.x () < image->width () &&
|
||||
pixel_index.y () >= 0 && pixel_index.y () < image->height ()) {
|
||||
|
||||
if (image->is_color ()) {
|
||||
data_string = tl::sprintf ("RGB: %.5g,%.5g,%.5g",
|
||||
image->pixel (pixel_index.x (), pixel_index.y (), 0),
|
||||
image->pixel (pixel_index.x (), pixel_index.y (), 1),
|
||||
image->pixel (pixel_index.x (), pixel_index.y (), 2));
|
||||
} else {
|
||||
data_string = tl::sprintf ("%.5g", image->pixel (pixel_index.x (), pixel_index.y ()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
any_selected = true;
|
||||
|
||||
}
|
||||
|
||||
if (any_selected && ! editables ()->has_selection ()) {
|
||||
display_status (true);
|
||||
display_status (true, data_string);
|
||||
}
|
||||
|
||||
return any_selected;
|
||||
|
|
@ -1464,11 +1494,13 @@ Service::select (const db::DBox &box, lay::Editable::SelectionMode mode)
|
|||
}
|
||||
|
||||
void
|
||||
Service::display_status (bool transient)
|
||||
Service::display_status (bool transient, const std::string &data_string)
|
||||
{
|
||||
View *selected_view = transient ? mp_transient_view : (m_selected_image_views.size () == 1 ? m_selected_image_views [0] : 0);
|
||||
if (! selected_view) {
|
||||
|
||||
view ()->message (std::string ());
|
||||
|
||||
} else {
|
||||
|
||||
const img::Object *image = selected_view->image_object ();
|
||||
|
|
@ -1478,6 +1510,9 @@ Service::display_status (bool transient)
|
|||
msg = tl::to_string (tr ("selected: "));
|
||||
}
|
||||
msg += tl::sprintf (tl::to_string (tr ("image(%dx%d)")), image->width (), image->height ());
|
||||
if (! data_string.empty ()) {
|
||||
msg += " [" + data_string + "]";
|
||||
}
|
||||
view ()->message (msg);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ private:
|
|||
/**
|
||||
* @brief Display a message about the current selection
|
||||
*/
|
||||
void display_status (bool transient);
|
||||
void display_status (bool transient, const std::string &data_string = std::string ());
|
||||
|
||||
/**
|
||||
* @brief Gets a value indicating the (new) top z position
|
||||
|
|
|
|||
|
|
@ -363,6 +363,7 @@ LayoutViewBase::init (db::Manager *mgr)
|
|||
m_clear_ruler_new_cell = false;
|
||||
m_dbu_coordinates = false;
|
||||
m_absolute_coordinates = false;
|
||||
m_auto_create_new_layers = true;
|
||||
m_drop_small_cells = false;
|
||||
m_drop_small_cells_value = 10;
|
||||
m_drop_small_cells_cond = DSC_Max;
|
||||
|
|
@ -1107,6 +1108,13 @@ LayoutViewBase::configure (const std::string &name, const std::string &value)
|
|||
absolute_coordinates (flag);
|
||||
return true;
|
||||
|
||||
} else if (name == cfg_auto_create_new_layers) {
|
||||
|
||||
bool flag;
|
||||
tl::from_string (value, flag);
|
||||
auto_create_new_layers (flag);
|
||||
return true;
|
||||
|
||||
} else if (name == cfg_guiding_shape_visible) {
|
||||
|
||||
bool v = false;
|
||||
|
|
@ -4989,7 +4997,13 @@ LayoutViewBase::absolute_coordinates (bool f)
|
|||
m_absolute_coordinates = f;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
LayoutViewBase::auto_create_new_layers (bool f)
|
||||
{
|
||||
m_auto_create_new_layers = f;
|
||||
}
|
||||
|
||||
void
|
||||
LayoutViewBase::select_cellviews_fit (const std::list <CellView> &cvs)
|
||||
{
|
||||
if (m_cellviews != cvs) {
|
||||
|
|
|
|||
|
|
@ -1904,6 +1904,22 @@ public:
|
|||
*/
|
||||
void absolute_coordinates (bool f);
|
||||
|
||||
/**
|
||||
* @brief Gets a value indicating whether new layer entries shall be created in the view
|
||||
*
|
||||
* Certain operations such as paste or creation of instances establish new layers.
|
||||
* This flag controls whether such new layers are automatically added to the layer list.
|
||||
*/
|
||||
bool auto_create_new_layers () const
|
||||
{
|
||||
return m_auto_create_new_layers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets a value indicating whether new layer entries shall be created in the view
|
||||
*/
|
||||
void auto_create_new_layers (bool f);
|
||||
|
||||
/**
|
||||
* @brief Gets the canvas object (where the layout is drawn and view objects are placed)
|
||||
*/
|
||||
|
|
@ -3113,6 +3129,7 @@ private:
|
|||
bool m_clear_ruler_new_cell;
|
||||
bool m_dbu_coordinates;
|
||||
bool m_absolute_coordinates;
|
||||
bool m_auto_create_new_layers;
|
||||
|
||||
bool m_dirty;
|
||||
bool m_prop_changed;
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ public:
|
|||
options.push_back (std::pair<std::string, std::string> (cfg_guiding_shape_color, cc.to_string (tl::Color ())));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_guiding_shape_vertex_size, "5"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_abs_units, "false"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_auto_create_new_layers, "true"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_dbu_units, "false"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_drawing_workers, "1"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_drop_small_cells, "false"));
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ static const std::string cfg_stipple_palette ("stipple-palette");
|
|||
static const std::string cfg_line_style_palette ("line-style-palette");
|
||||
static const std::string cfg_dbu_units ("dbu-units");
|
||||
static const std::string cfg_abs_units ("absolute-units");
|
||||
static const std::string cfg_auto_create_new_layers ("auto-create-new-layers");
|
||||
static const std::string cfg_drawing_workers ("drawing-workers");
|
||||
static const std::string cfg_drop_small_cells ("drop-small-cells");
|
||||
static const std::string cfg_drop_small_cells_cond ("drop-small-cells-condition");
|
||||
|
|
|
|||
|
|
@ -1,85 +1,86 @@
|
|||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>LayoutViewConfigPage5</class>
|
||||
<widget class="QFrame" name="LayoutViewConfigPage5" >
|
||||
<property name="geometry" >
|
||||
<widget class="QFrame" name="LayoutViewConfigPage5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>694</width>
|
||||
<height>301</height>
|
||||
<height>453</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>Application Settings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="lyp_file_gbx" >
|
||||
<property name="title" >
|
||||
<widget class="QGroupBox" name="lyp_file_gbx">
|
||||
<property name="title">
|
||||
<string>Use default layer properties file</string>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QToolButton" name="browse_pb" >
|
||||
<property name="text" >
|
||||
<item row="1" column="1">
|
||||
<widget class="QToolButton" name="browse_pb">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2" >
|
||||
<widget class="QCheckBox" name="add_other_layers_cb" >
|
||||
<property name="text" >
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="add_other_layers_cb">
|
||||
<property name="text">
|
||||
<string>Automatically add other layers</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLineEdit" name="lyp_file_le" />
|
||||
<item row="1" column="0">
|
||||
<widget class="QLineEdit" name="lyp_file_le"/>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2" >
|
||||
<widget class="QLabel" name="label_2" >
|
||||
<property name="text" >
|
||||
<string><html><body><b>Hint</b>: a technology or reader specific layer properties file (i.e. for PCB import) will override this setting.</p></body></html></string>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string><html><body><b>Hint</b>: a technology or reader specific layer properties file (i.e. for PCB import) will override this setting.</p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2" >
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>The following layer properties file is loaded into the layer view list every time a layout is opened or created:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<item row="3" column="0">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>5</height>
|
||||
|
|
@ -91,34 +92,34 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox" >
|
||||
<property name="title" >
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Layer properties display</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="source_display_cb" >
|
||||
<property name="text" >
|
||||
<widget class="QCheckBox" name="source_display_cb">
|
||||
<property name="text">
|
||||
<string>Always show layer source in layer list</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ld_display_cb" >
|
||||
<property name="text" >
|
||||
<widget class="QCheckBox" name="ld_display_cb">
|
||||
<property name="text">
|
||||
<string>Always show layer and datatype together with database name in layer source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ly_index_cb" >
|
||||
<property name="text" >
|
||||
<widget class="QCheckBox" name="ly_index_cb">
|
||||
<property name="text">
|
||||
<string>Always show layout index in layer source</string>
|
||||
</property>
|
||||
</widget>
|
||||
|
|
@ -126,9 +127,35 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>On new layers</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>New layers are created implicitly when new content is pasted or instances are placed.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="auto_create_new_layers_cb">
|
||||
<property name="text">
|
||||
<string>New layers are automatically added to the layer list</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<tabstops>
|
||||
<tabstop>lyp_file_gbx</tabstop>
|
||||
<tabstop>lyp_file_le</tabstop>
|
||||
|
|
|
|||
|
|
@ -1214,7 +1214,9 @@ HierarchyControlPanel::paste ()
|
|||
|
||||
// Add new layers to the view if required.
|
||||
if (! new_layers.empty ()) {
|
||||
mp_view->add_new_layers (new_layers, m_active_index);
|
||||
if (mp_view->auto_create_new_layers ()) {
|
||||
mp_view->add_new_layers (new_layers, m_active_index);
|
||||
}
|
||||
mp_view->update_content ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1024,6 +1024,10 @@ LayoutViewConfigPage5::setup (lay::Dispatcher *root)
|
|||
bool always_show_li = false;
|
||||
root->config_get (cfg_layers_always_show_layout_index, always_show_li);
|
||||
mp_ui->ly_index_cb->setChecked (always_show_li);
|
||||
|
||||
bool auto_create_new_layers = true;
|
||||
root->config_get (cfg_auto_create_new_layers, auto_create_new_layers);
|
||||
mp_ui->auto_create_new_layers_cb->setChecked (auto_create_new_layers);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1038,6 +1042,7 @@ LayoutViewConfigPage5::commit (lay::Dispatcher *root)
|
|||
root->config_set (cfg_layers_always_show_source, mp_ui->source_display_cb->isChecked ());
|
||||
root->config_set (cfg_layers_always_show_ld, mp_ui->ld_display_cb->isChecked ());
|
||||
root->config_set (cfg_layers_always_show_layout_index, mp_ui->ly_index_cb->isChecked ());
|
||||
root->config_set (cfg_auto_create_new_layers, mp_ui->auto_create_new_layers_cb->isChecked ());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Reference in New Issue