mirror of https://github.com/KLayout/klayout.git
FEATURE: Added Layout#error_layer.
This commit is contained in:
parent
647a52dc70
commit
969ceb84bb
|
|
@ -176,10 +176,10 @@ unsigned int
|
||||||
LayoutLayers::error_layer () const
|
LayoutLayers::error_layer () const
|
||||||
{
|
{
|
||||||
if (m_error_layer < 0) {
|
if (m_error_layer < 0) {
|
||||||
// create the waste layer (since that layer is cached we can do
|
// create the error layer (since that layer is cached we can do
|
||||||
// this in a "const" fashion.
|
// this in a "const" fashion.
|
||||||
db::LayoutLayers *self = const_cast<db::LayoutLayers *> (this);
|
db::LayoutLayers *self = const_cast<db::LayoutLayers *> (this);
|
||||||
self->m_error_layer = (int) self->insert_special_layer (db::LayerProperties ("WASTE"));
|
self->m_error_layer = (int) self->insert_special_layer (db::LayerProperties ("ERROR"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (unsigned int) m_error_layer;
|
return (unsigned int) m_error_layer;
|
||||||
|
|
|
||||||
|
|
@ -1670,6 +1670,12 @@ Class<db::Layout> decl_Layout ("db", "Layout",
|
||||||
"\n"
|
"\n"
|
||||||
"This method has been added in version 0.22.\n"
|
"This method has been added in version 0.22.\n"
|
||||||
) +
|
) +
|
||||||
|
gsi::method ("error_layer", &db::Layout::error_layer,
|
||||||
|
"@brief Returns the index of the error layer\n"
|
||||||
|
"The error layer is used to place error texts on it, for example when a PCell evaluation fails.\n"
|
||||||
|
"\n"
|
||||||
|
"This method has been added in version 0.23.13.\n"
|
||||||
|
) +
|
||||||
gsi::method ("insert_special_layer", (unsigned int (db::Layout::*) (const db::LayerProperties &)) &db::Layout::insert_special_layer, gsi::arg ("props"),
|
gsi::method ("insert_special_layer", (unsigned int (db::Layout::*) (const db::LayerProperties &)) &db::Layout::insert_special_layer, gsi::arg ("props"),
|
||||||
"@brief Inserts a new special layer with the given properties\n"
|
"@brief Inserts a new special layer with the given properties\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|
|
||||||
|
|
@ -795,3 +795,16 @@ TEST(8_MetaInfo)
|
||||||
EXPECT_EQ (ly.has_context_info (ci), false);
|
EXPECT_EQ (ly.has_context_info (ci), false);
|
||||||
EXPECT_EQ (ly.meta_info (ci, "a").value.to_string (), "nil");
|
EXPECT_EQ (ly.meta_info (ci, "a").value.to_string (), "nil");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(9_ErrorLayer)
|
||||||
|
{
|
||||||
|
db::Manager m;
|
||||||
|
db::Layout l (&m);
|
||||||
|
|
||||||
|
EXPECT_EQ (l.is_valid_layer (0), false);
|
||||||
|
EXPECT_EQ (l.guiding_shape_layer (), (unsigned int) 0);
|
||||||
|
EXPECT_EQ (l.is_valid_layer (1), false);
|
||||||
|
EXPECT_EQ (l.error_layer (), (unsigned int) 1);
|
||||||
|
EXPECT_EQ (l.is_special_layer (1), true);
|
||||||
|
EXPECT_EQ (int (l.layers ()), 2);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue