[qet] qet/qet: [5848] Add new slave type : delay on/off |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 5848
Author: blacksun
Date: 2019-04-29 18:41:06 +0200 (Mon, 29 Apr 2019)
Log Message:
-----------
Add new slave type : delay on/off
Modified Paths:
--------------
trunk/elements/10_electric/10_allpole/310_relays_contactors&contacts/02_contacts_cross_referencing/11_delayed_contacts/inverseur_tempo_travail_repos.elmt
trunk/sources/editor/ui/elementpropertieseditorwidget.cpp
trunk/sources/qetgraphicsitem/crossrefitem.cpp
trunk/sources/qetgraphicsitem/crossrefitem.h
Modified: trunk/elements/10_electric/10_allpole/310_relays_contactors&contacts/02_contacts_cross_referencing/11_delayed_contacts/inverseur_tempo_travail_repos.elmt
===================================================================
--- trunk/elements/10_electric/10_allpole/310_relays_contactors&contacts/02_contacts_cross_referencing/11_delayed_contacts/inverseur_tempo_travail_repos.elmt 2019-04-28 12:32:20 UTC (rev 5847)
+++ trunk/elements/10_electric/10_allpole/310_relays_contactors&contacts/02_contacts_cross_referencing/11_delayed_contacts/inverseur_tempo_travail_repos.elmt 2019-04-29 16:41:06 UTC (rev 5848)
@@ -7,7 +7,7 @@
<kindInformations>
<kindInformation show="1" name="number">1</kindInformation>
<kindInformation show="1" name="state">SW</kindInformation>
- <kindInformation show="1" name="type">simple</kindInformation>
+ <kindInformation show="1" name="type">delayOnOff</kindInformation>
</kindInformations>
<informations>Author: The QElectroTech team
License: see http://qelectrotech.org/wiki/doc/elements_license</informations>
Modified: trunk/sources/editor/ui/elementpropertieseditorwidget.cpp
===================================================================
--- trunk/sources/editor/ui/elementpropertieseditorwidget.cpp 2019-04-28 12:32:20 UTC (rev 5847)
+++ trunk/sources/editor/ui/elementpropertieseditorwidget.cpp 2019-04-29 16:41:06 UTC (rev 5848)
@@ -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"));
Modified: trunk/sources/qetgraphicsitem/crossrefitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/crossrefitem.cpp 2019-04-28 12:32:20 UTC (rev 5847)
+++ trunk/sources/qetgraphicsitem/crossrefitem.cpp 2019-04-29 16:41:06 UTC (rev 5848)
@@ -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);
@@ -625,9 +626,9 @@
painter.drawArc(arc, 0, 180*16);
}
- // draw half circle for delay contact
+ // draw half circle for delay contact
if(flags &Delay) {
- // for delay on contact
+ // for delay on contact
if (flags &DelayOn) {
if (flags &NO) {
painter.drawLine(12, offset+8, 12, offset+11);
@@ -640,8 +641,8 @@
painter.drawArc(r, 180*16, 180*16);
}
}
- // for delay off contact
- else {
+ // for delay off contact
+ else if ( flags &DelayOff){
if (flags &NO) {
painter.drawLine(12, offset+8, 12, offset+9.5);
QRectF r(9.5, offset+9.5, 5, 3);
@@ -654,6 +655,23 @@
}
}
+ else {
+ // 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);
@@ -707,6 +725,12 @@
QRectF r(9.5, offset+16.5, 5, 3);
painter.drawArc(r, 0, 180*16);
}
+ else if (flags &DelayOnOff) {
+ QRectF r(9.5, offset+14, 5, 3);
+ painter.drawArc(r, 180*16, 180*16);
+ QRectF rr(9.5, offset+17, 5, 3);
+ painter.drawArc(rr, 0, 180*16);
+ }
}
//Draw position text
Modified: trunk/sources/qetgraphicsitem/crossrefitem.h
===================================================================
--- trunk/sources/qetgraphicsitem/crossrefitem.h 2019-04-28 12:32:20 UTC (rev 5847)
+++ trunk/sources/qetgraphicsitem/crossrefitem.h 2019-04-29 16:41:06 UTC (rev 5848)
@@ -63,7 +63,8 @@
Power = 8,
DelayOn = 16,
DelayOff = 32,
- Delay = 48
+ DelayOnOff = 64,
+ Delay = 112
};
QRectF boundingRect () const override;