diff --git a/src/edt/edt/InstPropertiesPage.ui b/src/edt/edt/InstPropertiesPage.ui index 5742e7095..94d2f3e4a 100644 --- a/src/edt/edt/InstPropertiesPage.ui +++ b/src/edt/edt/InstPropertiesPage.ui @@ -456,31 +456,38 @@ 6 - - - - Column vector (x,y) + + + + QFrame::NoFrame - - - - - - x = - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 1 - 0 - + + QFrame::Raised + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 1 + 0 + + + + + @@ -493,207 +500,8 @@ - - - - y = - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 1 - 0 - - - - - - - - x = - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Row vector (x,y) - - - - - - - Rows/Columns - - - - - - - columns = - - - - - - - - 1 - 0 - - - - - - - - rows = - - - - - - - - 1 - 0 - - - - - - - - This is instance [r,c] of array with - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - <b>Warning</b>: although row and column vectors can be arbitrary combination, some design systems and mask makers only accept orthogonal (rectangular) arrays. Set the gray fields to 0 in this case. - - - true - - - - - - - - - - 0 - 0 - 0 - - - - - - - 85 - 87 - 83 - - - - - - - 243 - 243 - 243 - - - - - - - - - 0 - 0 - 0 - - - - - - - 85 - 87 - 83 - - - - - - - 243 - 243 - 243 - - - - - - - - - 190 - 190 - 190 - - - - - - - 190 - 190 - 190 - - - - - - - 239 - 239 - 239 - - - - - - QFrame::NoFrame @@ -726,99 +534,82 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + y = + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Rows/Columns + + + + + + + QFrame::NoFrame + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 1 + 0 + + + + + + + + + + + + 1 + 0 + + + + - - - - - - - 0 - 0 - 0 - - - - - - - 85 - 87 - 83 - - - - - - - 243 - 243 - 243 - - - - - - - - - 0 - 0 - 0 - - - - - - - 85 - 87 - 83 - - - - - - - 243 - 243 - 243 - - - - - - - - - 190 - 190 - 190 - - - - - - - 190 - 190 - 190 - - - - - - - 239 - 239 - 239 - - - - - - QFrame::NoFrame @@ -851,6 +642,115 @@ + + + + Column vector (x,y) + + + + + + + x = + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + x = + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + This is instance [r,c] of array with + + + + + + + + 1 + 0 + + + + + + + + columns = + + + + + + + rows = + + + + + + + Row vector (x,y) + + + + + + + false + + + QFrame::NoFrame + + + QFrame::Raised + + + + + + + 0 + 0 + + + + + + + :/warn.png + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Although row and column vectors can be arbitrary combinations, some design systems and mask makers only accept arrays where row and column vectors are orthogonal and parallel to x and y axes. + + + true + + + + + + @@ -978,14 +878,19 @@ browse_pb lib_cbx param_tab_widget + cw_le + ch_le pos_x_le pos_y_le angle_le mirror_cbx mag_le + array_grp rows_le columns_le row_x_le + row_y_le + column_x_le column_y_le dbu_cb abs_cb @@ -993,6 +898,8 @@ sel_pb inst_pb - + + + diff --git a/src/edt/edt/edtInstPropertiesPage.cc b/src/edt/edt/edtInstPropertiesPage.cc index 4034061fe..3ba054717 100644 --- a/src/edt/edt/edtInstPropertiesPage.cc +++ b/src/edt/edt/edtInstPropertiesPage.cc @@ -45,6 +45,12 @@ namespace edt // ------------------------------------------------------------------------- // InstPropertiesPage implementation +static bool is_orthogonal (const db::DVector &rv, const db::DVector &cv) +{ + return (db::coord_traits::equal (rv.x (), 0) && db::coord_traits::equal (cv.y (), 0)) || + (db::coord_traits::equal (rv.y (), 0) && db::coord_traits::equal (cv.x (), 0)); +} + InstPropertiesPage::InstPropertiesPage (edt::Service *service, db::Manager *manager, QWidget *parent) : lay::PropertiesPage (parent, manager, service), mp_service (service), m_enable_cb_callback (true), mp_pcell_parameters (0) { @@ -323,6 +329,8 @@ InstPropertiesPage::update () } + ortho_warning_frame->setEnabled (! is_orthogonal (db::CplxTrans (dbu) * rowv, db::CplxTrans (dbu) * columnv)); + } else { array_grp->setChecked (false); @@ -334,6 +342,8 @@ InstPropertiesPage::update () column_y_le->setText (QString ()); inst_lbl->setText (QString ()); + ortho_warning_frame->setEnabled (false); + } pos_x_le->setText (tl::to_qstring (coord_to_string ((gt * db::ICplxTrans (t)).disp ().x (), dbu, du))); @@ -562,8 +572,10 @@ InstPropertiesPage::create_applicator (db::Cell & /*cell*/, const db::Instance & has_error = true; } - db::DVector rv = db::DVector (dpoint_from_dpoint (db::DPoint (rx, ry), dbu, du, t)); - db::DVector cv = db::DVector (dpoint_from_dpoint (db::DPoint (cx, cy), dbu, du, t)); + db::DVector rv = dvector_from_dvector (db::DVector (rx, ry), dbu, du, t); + db::DVector cv = dvector_from_dvector (db::DVector (cx, cy), dbu, du, t); + + ortho_warning_frame->setEnabled (! is_orthogonal (rv, cv)); bool set_a = (! rv.equal (a_org * dbu) || ! is_array_org); bool set_na = (rows != na_org || ! is_array_org); diff --git a/src/edt/edt/edtPropertiesPageUtils.h b/src/edt/edt/edtPropertiesPageUtils.h index e2fcb3a72..dc173b3b1 100644 --- a/src/edt/edt/edtPropertiesPageUtils.h +++ b/src/edt/edt/edtPropertiesPageUtils.h @@ -438,6 +438,20 @@ db::DCoord dcoord_from_dcoord (double d, double dbu, bool du, const db::CplxTran */ db::DPoint dpoint_from_dpoint (const db::DPoint &dp, double dbu, bool du, const db::DCplxTrans &t); +/** + * @brief Converts a micron or DBU vector to a micron point + * + * @param dp The point to convert + * @param dbu The database unit + * @param du A flag indicating whether the input point is given in database units (du = true) or micron (du = false) + * @param t A transformation (in DBU space) to apply to the point + * @return The micron-unit point + * + * The transformation is intended to be a global-to-local transformation so the output value is + * a point in local-cell micron units. + */ +db::DVector dvector_from_dvector (const db::DVector &dp, double dbu, bool du, const db::DCplxTrans &t); + /** * @brief Gets a dimension value from a string *