개정판 bc2007f3
issue #000 Equipment 및 Instrument 데이터 입력 시, Content의 내용만 입력된 로직에서 Label의 Position 입력되는 함수로 변경.
HYTOS/HYTOS/Shapes/SymbolSvgItem.py | ||
---|---|---|
337 | 337 |
|
338 | 338 |
def get_label_pos_of_connector(self, conn, label): |
339 | 339 |
"""return label position of given connector""" |
340 |
|
|
341 | 340 |
res = None |
342 | 341 |
|
343 |
app_doc_data = AppDocData.instance() |
|
344 | 342 |
if conn.data.pos: |
345 | 343 |
res = QPointF(conn.data.pos[0], conn.data.pos[1]) |
346 | 344 |
else: |
347 | 345 |
label_rect = label.boundingRect() |
348 | 346 |
conn_rect = conn.mapRectFromParent(conn.boundingRect()) |
349 | 347 |
dx, dy = conn.dir() |
350 |
|
|
351 | 348 |
if dx == 1: |
352 | 349 |
res = QPointF(conn_rect.x() + conn_rect.width() * 0.5, conn_rect.y()) |
353 | 350 |
elif dy == -1: |
... | ... | |
356 | 353 |
res = QPointF(conn_rect.x() + conn_rect.width() * 0.5, conn_rect.y() + conn_rect.height() * 0.5) |
357 | 354 |
elif dx == -1: |
358 | 355 |
res = QPointF(conn_rect.x() - label_rect.width(), conn_rect.y() + conn_rect.height() * 0.5) |
359 |
|
|
360 | 356 |
return res |
361 | 357 |
|
362 | 358 |
def build_label(self): |
... | ... | |
1486 | 1482 |
dialog = QAirFinCooler() |
1487 | 1483 |
modified = dialog.show_dialog(self) |
1488 | 1484 |
if modified: |
1489 |
self.update_label_contents()
|
|
1485 |
self.build_label()
|
|
1490 | 1486 |
self.validate() |
1491 | 1487 |
self.change_output_font_color() |
1492 | 1488 |
|
... | ... | |
1496 | 1492 |
dialog = QFilter() |
1497 | 1493 |
modified = dialog.show_dialog(self) |
1498 | 1494 |
if modified: |
1499 |
self.update_label_contents()
|
|
1495 |
self.build_label()
|
|
1500 | 1496 |
self.validate() |
1501 | 1497 |
self.change_output_font_color() |
1502 | 1498 |
|
... | ... | |
1506 | 1502 |
dialog = QCoil() |
1507 | 1503 |
modified = dialog.show_dialog(self) |
1508 | 1504 |
if modified: |
1509 |
self.update_label_contents()
|
|
1505 |
self.build_label()
|
|
1510 | 1506 |
self.validate() |
1511 | 1507 |
self.change_output_font_color() |
1512 | 1508 |
|
... | ... | |
1516 | 1512 |
dialog = QDP_Equipment() |
1517 | 1513 |
modified = dialog.show_dialog(self) |
1518 | 1514 |
if modified: |
1519 |
self.update_label_contents()
|
|
1515 |
self.build_label()
|
|
1520 | 1516 |
self.validate() |
1521 | 1517 |
self.change_output_font_color() |
1522 | 1518 |
|
... | ... | |
1526 | 1522 |
dialog = QReactor() |
1527 | 1523 |
modified = dialog.show_dialog(self) |
1528 | 1524 |
if modified: |
1529 |
self.update_label_contents()
|
|
1525 |
self.build_label()
|
|
1530 | 1526 |
self.validate() |
1531 | 1527 |
self.change_output_font_color() |
1532 | 1528 |
|
... | ... | |
1536 | 1532 |
dialog = QStrainer_T() |
1537 | 1533 |
modified = dialog.show_dialog(self) |
1538 | 1534 |
if modified: |
1539 |
self.update_label_contents()
|
|
1535 |
self.build_label()
|
|
1540 | 1536 |
self.validate() |
1541 | 1537 |
self.change_output_font_color() |
1542 | 1538 |
|
... | ... | |
1546 | 1542 |
dialog = QStrainer_Y() |
1547 | 1543 |
modified = dialog.show_dialog(self) |
1548 | 1544 |
if modified: |
1549 |
self.update_label_contents()
|
|
1545 |
self.build_label()
|
|
1550 | 1546 |
self.validate() |
1551 | 1547 |
self.change_output_font_color() |
1552 | 1548 |
|
... | ... | |
1556 | 1552 |
dialog = QBatteryLimit() |
1557 | 1553 |
modified = dialog.show_dialog(self) |
1558 | 1554 |
if modified: |
1559 |
self.update_label_contents()
|
|
1555 |
self.build_label()
|
|
1560 | 1556 |
self.validate() |
1561 | 1557 |
self.change_output_font_color() |
1562 | 1558 |
|
... | ... | |
1566 | 1562 |
dialog = QTray() |
1567 | 1563 |
modified = dialog.show_dialog(self) |
1568 | 1564 |
if modified: |
1569 |
self.update_label_contents()
|
|
1565 |
self.build_label()
|
|
1570 | 1566 |
self.validate() |
1571 | 1567 |
self.change_output_font_color() |
1572 | 1568 |
|
... | ... | |
1576 | 1572 |
dialog = QSinglePacked() |
1577 | 1573 |
modified = dialog.show_dialog(self) |
1578 | 1574 |
if modified: |
1579 |
self.update_label_contents()
|
|
1575 |
self.build_label()
|
|
1580 | 1576 |
self.validate() |
1581 | 1577 |
self.change_output_font_color() |
1582 | 1578 |
|
... | ... | |
1586 | 1582 |
dialog = QDualPacked() |
1587 | 1583 |
modified = dialog.show_dialog(self) |
1588 | 1584 |
if modified: |
1589 |
self.update_label_contents()
|
|
1585 |
self.build_label()
|
|
1590 | 1586 |
self.validate() |
1591 | 1587 |
self.change_output_font_color() |
1592 | 1588 |
|
... | ... | |
1596 | 1592 |
dialog = QDrum_Horizontal() |
1597 | 1593 |
modified = dialog.show_dialog(self) |
1598 | 1594 |
if modified: |
1599 |
self.update_label_contents()
|
|
1595 |
self.build_label()
|
|
1600 | 1596 |
self.validate() |
1601 | 1597 |
self.change_output_font_color() |
1602 | 1598 |
|
... | ... | |
1606 | 1602 |
dialog = QDrum_Vertical() |
1607 | 1603 |
modified = dialog.show_dialog(self) |
1608 | 1604 |
if modified: |
1609 |
self.update_label_contents()
|
|
1605 |
self.build_label()
|
|
1610 | 1606 |
self.validate() |
1611 | 1607 |
self.change_output_font_color() |
1612 | 1608 |
|
... | ... | |
1616 | 1612 |
dialog = QPlateHeatExchanger() |
1617 | 1613 |
modified = dialog.show_dialog(self) |
1618 | 1614 |
if modified: |
1619 |
self.update_label_contents()
|
|
1615 |
self.build_label()
|
|
1620 | 1616 |
self.validate() |
1621 | 1617 |
self.change_output_font_color() |
1622 | 1618 |
|
... | ... | |
1626 | 1622 |
dialog = QEquipment() |
1627 | 1623 |
modified = dialog.show_dialog(self) |
1628 | 1624 |
if modified: |
1629 |
self.update_label_contents()
|
|
1625 |
self.build_label()
|
|
1630 | 1626 |
self.validate() |
1631 | 1627 |
self.change_output_font_color() |
1632 | 1628 |
|
... | ... | |
1636 | 1632 |
dialog = QBall() |
1637 | 1633 |
modified = dialog.show_dialog(self) |
1638 | 1634 |
if modified: |
1639 |
self.update_label_contents()
|
|
1635 |
self.build_label()
|
|
1640 | 1636 |
self.validate() |
1641 | 1637 |
self.change_output_font_color() |
1642 | 1638 |
|
... | ... | |
1646 | 1642 |
dialog = QShlTubHeatExchanger() |
1647 | 1643 |
modified = dialog.show_dialog(self) |
1648 | 1644 |
if modified: |
1649 |
self.update_label_contents()
|
|
1645 |
self.build_label()
|
|
1650 | 1646 |
self.validate() |
1651 | 1647 |
self.change_output_font_color() |
1652 | 1648 |
|
... | ... | |
1656 | 1652 |
dialog = QConeRoof() |
1657 | 1653 |
modified = dialog.show_dialog(self) |
1658 | 1654 |
if modified: |
1659 |
self.update_label_contents()
|
|
1655 |
self.build_label()
|
|
1660 | 1656 |
self.validate() |
1661 | 1657 |
self.change_output_font_color() |
1662 | 1658 |
|
... | ... | |
1666 | 1662 |
dialog = QDomeRoof() |
1667 | 1663 |
modified = dialog.show_dialog(self) |
1668 | 1664 |
if modified: |
1669 |
self.update_label_contents()
|
|
1665 |
self.build_label()
|
|
1670 | 1666 |
self.validate() |
1671 | 1667 |
self.change_output_font_color() |
1672 | 1668 |
|
... | ... | |
1676 | 1672 |
dialog = QCompressor() |
1677 | 1673 |
modified = dialog.show_dialog(self) |
1678 | 1674 |
if modified: |
1679 |
self.update_label_contents()
|
|
1675 |
self.build_label()
|
|
1680 | 1676 |
self.validate() |
1681 | 1677 |
self.change_output_font_color() |
1682 | 1678 |
|
... | ... | |
1686 | 1682 |
dialog = QKompressor() |
1687 | 1683 |
modified = dialog.show_dialog(self) |
1688 | 1684 |
if modified: |
1689 |
self.update_label_contents()
|
|
1685 |
self.build_label()
|
|
1690 | 1686 |
self.validate() |
1691 | 1687 |
self.change_output_font_color() |
1692 | 1688 |
|
... | ... | |
1696 | 1692 |
dialog = QPump() |
1697 | 1693 |
modified = dialog.show_dialog(self) |
1698 | 1694 |
if modified: |
1699 |
self.update_label_contents()
|
|
1695 |
self.build_label()
|
|
1700 | 1696 |
self.validate() |
1701 | 1697 |
self.change_output_font_color() |
1702 | 1698 |
|
... | ... | |
1706 | 1702 |
dialog = QValve_Control() |
1707 | 1703 |
modified = dialog.show_dialog(self) |
1708 | 1704 |
if modified: |
1709 |
self.update_label_contents()
|
|
1705 |
self.build_label()
|
|
1710 | 1706 |
self.validate() |
1711 | 1707 |
self.change_output_font_color() |
1712 | 1708 |
|
... | ... | |
1716 | 1712 |
dialog = QValve_Manual() |
1717 | 1713 |
modified = dialog.show_dialog(self) |
1718 | 1714 |
if modified: |
1719 |
self.update_label_contents()
|
|
1715 |
self.build_label()
|
|
1720 | 1716 |
self.validate() |
1721 | 1717 |
self.change_output_font_color() |
1722 | 1718 |
|
... | ... | |
1726 | 1722 |
dialog = QLineSplitter() |
1727 | 1723 |
modified = dialog.show_dialog(self) |
1728 | 1724 |
if modified: |
1729 |
self.update_label_contents()
|
|
1725 |
self.build_label()
|
|
1730 | 1726 |
self.validate() |
1731 | 1727 |
self.change_output_font_color() |
1732 | 1728 |
|
... | ... | |
1736 | 1732 |
dialog = QFlowmeter() |
1737 | 1733 |
modified = dialog.show_dialog(self) |
1738 | 1734 |
if modified: |
1739 |
self.update_label_contents()
|
|
1735 |
self.build_label()
|
|
1740 | 1736 |
self.validate() |
1741 | 1737 |
self.change_output_font_color() |
1742 | 1738 |
|
... | ... | |
1746 | 1742 |
dialog = QReducer() |
1747 | 1743 |
modified = dialog.show_dialog(self) |
1748 | 1744 |
if modified: |
1749 |
self.update_label_contents()
|
|
1745 |
self.build_label()
|
|
1750 | 1746 |
self.validate() |
1751 | 1747 |
self.change_output_font_color() |
1752 | 1748 |
|
내보내기 Unified diff