diff --git a/src/db/db/dbD25TechnologyComponent.cc b/src/db/db/dbD25TechnologyComponent.cc index f710d829a..1ab0ed2ea 100644 --- a/src/db/db/dbD25TechnologyComponent.cc +++ b/src/db/db/dbD25TechnologyComponent.cc @@ -237,8 +237,31 @@ D25TechnologyComponent::compile_from_source (const std::string &src) info.set_zstop (z1.to_double ()); } } else if (args.size () == 1) { - info.set_zstop ((! z0.is_nil () ? z0.to_double () : info.zstart ()) + args[0]); + if (! h.is_nil ()) { + if (! z0.is_nil ()) { + throw tl::Exception (tl::to_string (tr ("Rundundant parameters: zstart already given"))); + } + if (! z1.is_nil ()) { + throw tl::Exception (tl::to_string (tr ("Rundundant parameters: zstop implicitly given"))); + } + info.set_zstart (args[0]); + info.set_zstop (args[0] + h.to_double ()); + } else { + if (! z1.is_nil ()) { + throw tl::Exception (tl::to_string (tr ("Rundundant parameters: zstop implicitly given"))); + } + info.set_zstop ((! z0.is_nil () ? z0.to_double () : info.zstart ()) + args[0]); + } } else if (args.size () == 2) { + if (! z0.is_nil ()) { + throw tl::Exception (tl::to_string (tr ("Rundundant parameters: zstart already given"))); + } + if (! z1.is_nil ()) { + throw tl::Exception (tl::to_string (tr ("Rundundant parameters: zstop already given"))); + } + if (! h.is_nil ()) { + throw tl::Exception (tl::to_string (tr ("Rundundant parameters: height implicitly given"))); + } info.set_zstart (args[0]); info.set_zstop (args[1]); } else { diff --git a/src/db/unit_tests/dbD25TechnologyComponentTests.cc b/src/db/unit_tests/dbD25TechnologyComponentTests.cc index 3dc872953..181ccb92a 100644 --- a/src/db/unit_tests/dbD25TechnologyComponentTests.cc +++ b/src/db/unit_tests/dbD25TechnologyComponentTests.cc @@ -39,6 +39,9 @@ TEST(1) comp.compile_from_source ("1/0: zstart=1.0 height=0.5"); EXPECT_EQ (comp.to_string (), "1/0: zstart=1, zstop=1.5"); + comp.compile_from_source ("1/0: 1.0 height=0.5"); + EXPECT_EQ (comp.to_string (), "1/0: zstart=1, zstop=1.5"); + comp.compile_from_source ("1/0: zstop=1.5 height=0.5"); EXPECT_EQ (comp.to_string (), "1/0: zstart=1, zstop=1.5"); diff --git a/src/laybasic/laybasic/D25TechnologyComponentEditor.ui b/src/laybasic/laybasic/D25TechnologyComponentEditor.ui index 5a8b631cd..b1901ba63 100644 --- a/src/laybasic/laybasic/D25TechnologyComponentEditor.ui +++ b/src/laybasic/laybasic/D25TechnologyComponentEditor.ui @@ -13,15 +13,31 @@ Settings - - + + 2.5d Vertical Stack Information - + + + + + 0 + 0 + + + + Line + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + diff --git a/src/laybasic/laybasic/layD25TechnologyComponent.cc b/src/laybasic/laybasic/layD25TechnologyComponent.cc index 4935360f1..c004b4a1f 100644 --- a/src/laybasic/laybasic/layD25TechnologyComponent.cc +++ b/src/laybasic/laybasic/layD25TechnologyComponent.cc @@ -52,6 +52,15 @@ D25TechnologyComponentEditor::D25TechnologyComponentEditor (QWidget *parent) input.close (); hl->setDocument (src_te->document ()); + + connect (src_te, SIGNAL (cursorPositionChanged ()), this, SLOT (cursor_position_changed ())); +} + +void +D25TechnologyComponentEditor::cursor_position_changed () +{ + int line = src_te->textCursor ().block ().firstLineNumber () + 1; + lnum_label->setText (tl::to_qstring (tl::sprintf (tl::to_string (tr ("Line %d")), line))); } void diff --git a/src/laybasic/laybasic/layD25TechnologyComponent.h b/src/laybasic/laybasic/layD25TechnologyComponent.h index aeec28b7e..206838b70 100644 --- a/src/laybasic/laybasic/layD25TechnologyComponent.h +++ b/src/laybasic/laybasic/layD25TechnologyComponent.h @@ -44,6 +44,9 @@ public: void commit (); void setup (); +private slots: + void cursor_position_changed (); + private: std::auto_ptr mp_hl_attributes, mp_hl_basic_attributes; }; diff --git a/src/laybasic/laybasic/syntax/d25_text.xml b/src/laybasic/laybasic/syntax/d25_text.xml index 654dd7c93..5e0877b74 100644 --- a/src/laybasic/laybasic/syntax/d25_text.xml +++ b/src/laybasic/laybasic/syntax/d25_text.xml @@ -63,7 +63,7 @@ - +