diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index .. 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -114,6 +114,7 @@ ui->m_type_cb->addItem(tr("Puissance"), QVariant("power")); ui->m_type_cb->addItem(tr("Temporisé travail"), QVariant("delayOn")); ui->m_type_cb->addItem(tr("Temporisé repos"), QVariant("delayOff")); + ui->m_type_cb->addItem(tr("Temporisé travail repos"), QVariant("delayOnOff")); //Master option ui->m_master_type_cb->addItem(tr("Bobine"), QVariant("coil")); diff --git a/sources/qetgraphicsitem/crossrefitem.cpp b/sources/qetgraphicsitem/crossrefitem.cpp index .. 100644 --- a/sources/qetgraphicsitem/crossrefitem.cpp +++ b/sources/qetgraphicsitem/crossrefitem.cpp @@ -552,6 +552,7 @@ if (type == "power") option += Power; else if (type == "delayOn") option += DelayOn; else if (type == "delayOff") option += DelayOff; + else if (type == "delayOnOff") option += DelayOnOff; QRectF br = drawContact(painter, option, elmt); bounding_rect = bounding_rect.united(br); @@ -655,6 +656,24 @@ } } + // draw half circle for delay contact + if (flags &DelayOnOff) { + // for delay on contact + if (flags &NO) { + painter.drawLine(12, offset+8, 12, offset+11); + QRectF r(9.5, offset+11.7, 5, 3); + painter.drawArc(r, 0, 180*16); + QRectF rl(9.5, offset+9, 5, 3); + painter.drawArc(rl, 180*16, 180*16); + } + if (flags &NC) { + painter.drawLine(QPointF(12.5, offset+5), QPointF(12.5, offset+8)); + QRectF r(9.5, offset+10.7, 5, 3); + painter.drawArc(r, 0, 180*16); + QRectF rl(9.5, offset+8, 5, 3); + painter.drawArc(rl, 180*16, 180*16); + } + } QRectF text_rect = painter.boundingRect(QRectF(30, offset, 5, 10), Qt::AlignLeft | Qt::AlignVCenter, str); painter.drawText(text_rect, Qt::AlignLeft | Qt::AlignVCenter, str); @@ -707,7 +726,15 @@ QRectF r(9.5, offset+16.5, 5, 3); painter.drawArc(r, 0, 180*16); } + + else if (flags &DelayOnOff) { + QRectF r(9.5, offset+16.5, 5, 3); + painter.drawArc(r, 0, 180*16); + QRectF rl(9.5, offset+12.5, 5, 3); + painter.drawArc(rl, 180*16, 180*16); + } + } //Draw position text QRectF text_rect = painter.boundingRect(QRectF(30, offset+5, 5, 10), Qt::AlignLeft | Qt::AlignVCenter, str); diff --git a/sources/qetgraphicsitem/crossrefitem.h b/sources/qetgraphicsitem/crossrefitem.h index .. 100644 --- a/sources/qetgraphicsitem/crossrefitem.h +++ b/sources/qetgraphicsitem/crossrefitem.h @@ -63,7 +63,8 @@ Power = 8, DelayOn = 16, DelayOff = 32, - Delay = 48 + Delay = 48, + DelayOnOff = 64 }; QRectF boundingRect () const override;