1625{
1626 switch (textID) {
1627 case ID_TXT_NAME: {
1628 if (FindTextElement(parentElement, DATA_NAME)) return false;
1629
1630 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(40, -30), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1631 newText->SetElement(parentElement);
1632 newText->SetDataType(DATA_NAME);
1633 newText->SetElementTypeText(parentElement->GetElementType());
1634 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1635
1636 m_textList.push_back(newText);
1637 } break;
1638 case ID_TXT_VOLTAGE: {
1639 if (FindTextElement(parentElement, DATA_VOLTAGE)) return false;
1640
1641 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(40, 15), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1642 newText->SetElement(parentElement);
1643 newText->SetDataType(DATA_VOLTAGE);
1644 if (unit == ElectricalUnit::UNIT_NONE)
1646 else
1647 newText->SetUnit(unit);
1648 newText->SetDecimalPlaces(precision);
1649 newText->SetElementTypeText(parentElement->GetElementType());
1650 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1651
1652 m_textList.emplace_back(newText);
1653 } break;
1654 case ID_TXT_ANGLE: {
1655 if (FindTextElement(parentElement, DATA_ANGLE)) return false;
1656
1657 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(40, 30), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1658 newText->SetElement(parentElement);
1659 newText->SetDataType(DATA_ANGLE);
1660 if (unit == ElectricalUnit::UNIT_NONE)
1662 else
1663 newText->SetUnit(unit);
1664 newText->SetDecimalPlaces(precision);
1665 newText->SetElementTypeText(parentElement->GetElementType());
1666 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1667
1668 m_textList.emplace_back(newText);
1669 } break;
1670 case ID_TXT_FAULTCURRENT: {
1671 if (FindTextElement(parentElement, DATA_SC_CURRENT)) return false;
1672
1673 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(-70, 30), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1674 newText->SetElement(parentElement);
1675 newText->SetDataType(DATA_SC_CURRENT);
1676 if (unit == ElectricalUnit::UNIT_NONE)
1678 else
1679 newText->SetUnit(unit);
1680 newText->SetDecimalPlaces(precision);
1681 newText->SetElementTypeText(parentElement->GetElementType());
1682 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1683
1684 m_textList.emplace_back(newText);
1685 } break;
1686 case ID_TXT_FAULTVOLTAGE: {
1687 if (FindTextElement(parentElement, DATA_SC_VOLTAGE)) return false;
1688
1689 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(-70, 75), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1690 newText->SetElement(parentElement);
1691 newText->SetDataType(DATA_SC_VOLTAGE);
1692 if (unit == ElectricalUnit::UNIT_NONE)
1694 else
1695 newText->SetUnit(unit);
1696 newText->SetDecimalPlaces(precision);
1697 newText->SetElementTypeText(parentElement->GetElementType());
1698 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1699
1700 m_textList.emplace_back(newText);
1701 } break;
1702 case ID_TXT_SCC: {
1703 if (FindTextElement(parentElement, DATA_SC_POWER)) return false;
1704 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(-50, -30), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1705 newText->SetElement(parentElement);
1706 newText->SetDataType(DATA_SC_POWER);
1708 if (unit == ElectricalUnit::UNIT_NONE)
1710 else
1711 newText->SetUnit(unit);
1712 newText->SetDecimalPlaces(precision);
1713 newText->SetElementTypeText(parentElement->GetElementType());
1714 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1715
1716 m_textList.emplace_back(newText);
1717 } break;
1718 case ID_TXT_THD: {
1719 if (FindTextElement(parentElement, DATA_PQ_THD)) return false;
1720 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(-50, -15), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1721 newText->SetElement(parentElement);
1722 newText->SetDataType(DATA_PQ_THD);
1723 newText->SetDecimalPlaces(precision);
1724 newText->SetElementTypeText(parentElement->GetElementType());
1725 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1726
1727 m_textList.emplace_back(newText);
1728 } break;
1729 case ID_TXT_ACTIVE_POWER: {
1730 if (FindTextElement(parentElement, DATA_ACTIVE_POWER)) return false;
1731 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(0, 35), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1732 newText->SetElement(parentElement);
1733 newText->SetDataType(DATA_ACTIVE_POWER);
1734 if (unit == ElectricalUnit::UNIT_NONE)
1736 else
1737 newText->SetUnit(unit);
1738 newText->SetDecimalPlaces(precision);
1739 newText->SetElementTypeText(parentElement->GetElementType());
1740 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1741
1742 m_textList.emplace_back(newText);
1743 } break;
1744 case ID_TXT_REACTIVE_POWER: {
1745 if (FindTextElement(parentElement, DATA_REACTIVE_POWER)) return false;
1746 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(0, 50), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1747 newText->SetElement(parentElement);
1748 newText->SetDataType(DATA_REACTIVE_POWER);
1749 if (unit == ElectricalUnit::UNIT_NONE)
1751 else
1752 newText->SetUnit(unit);
1753 newText->SetDecimalPlaces(precision);
1754 newText->SetElementTypeText(parentElement->GetElementType());
1755 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1756
1757 m_textList.emplace_back(newText);
1758 } break;
1759 case ID_TXT_BRANCH_ACTIVE_POWER_1_2:
1760 case ID_TXT_BRANCH_ACTIVE_POWER_2_1: {
1761 if (FindTextElement(parentElement, DATA_PF_ACTIVE)) return false;
1762 wxPoint2DDouble position(0.0, -10.0);
1763 if (textID == ID_TXT_BRANCH_ACTIVE_POWER_1_2)
1765 else
1767
1768 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1769 newText->SetElement(parentElement);
1770 newText->SetDataType(DATA_PF_ACTIVE);
1771 if (unit == ElectricalUnit::UNIT_NONE)
1773 else
1774 newText->SetUnit(unit);
1775 newText->SetDecimalPlaces(precision);
1776 newText->SetElementTypeText(parentElement->GetElementType());
1777 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1778 if (textID == ID_TXT_BRANCH_ACTIVE_POWER_2_1)
1779 newText->SetDirection(1);
1780
1781 m_textList.emplace_back(newText);
1782 } break;
1783 case ID_TXT_BRANCH_REACTIVE_POWER_1_2:
1784 case ID_TXT_BRANCH_REACTIVE_POWER_2_1: {
1785 if (FindTextElement(parentElement, DATA_PF_REACTIVE)) return false;
1786 wxPoint2DDouble position(0.0, 10.0);
1787 if (textID == ID_TXT_BRANCH_REACTIVE_POWER_1_2)
1789 else
1791
1792 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1793 newText->SetElement(parentElement);
1794 newText->SetDataType(DATA_PF_REACTIVE);
1795 if (unit == ElectricalUnit::UNIT_NONE)
1797 else
1798 newText->SetUnit(unit);
1799 newText->SetDecimalPlaces(precision);
1800 newText->SetElementTypeText(parentElement->GetElementType());
1801 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1802 if (textID == ID_TXT_BRANCH_REACTIVE_POWER_2_1)
1803 newText->SetDirection(1);
1804
1805 m_textList.emplace_back(newText);
1806 } break;
1807 case ID_TXT_BRANCH_LOSSES: {
1808 if (FindTextElement(parentElement, DATA_PF_LOSSES)) return false;
1810 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1811 newText->SetElement(parentElement);
1812 newText->SetDataType(DATA_PF_LOSSES);
1813 if (unit == ElectricalUnit::UNIT_NONE)
1815 else
1816 newText->SetUnit(unit);
1817 newText->SetDecimalPlaces(precision);
1818 newText->SetElementTypeText(parentElement->GetElementType());
1819 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1820
1821 m_textList.emplace_back(newText);
1822 } break;
1823 case ID_TXT_BRANCH_CURRENT_1_2:
1824 case ID_TXT_BRANCH_CURRENT_2_1: {
1825 if (FindTextElement(parentElement, DATA_PF_CURRENT)) return false;
1826 wxPoint2DDouble position(0.0, 10.0);
1827 if (textID == ID_TXT_BRANCH_CURRENT_1_2)
1829 else
1831
1832 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1833 newText->SetElement(parentElement);
1834 newText->SetDataType(DATA_PF_CURRENT);
1835 if (unit == ElectricalUnit::UNIT_NONE)
1837 else
1838 newText->SetUnit(unit);
1839 newText->SetDecimalPlaces(precision);
1840 newText->SetElementTypeText(parentElement->GetElementType());
1841 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1842 if (textID == ID_TXT_BRANCH_CURRENT_2_1)
1843 newText->SetDirection(1);
1844
1845 m_textList.emplace_back(newText);
1846 } break;
1847 case ID_TXT_BRANCH_FAULT_CURRENT_1_2:
1848 case ID_TXT_BRANCH_FAULT_CURRENT_2_1: {
1849 if (FindTextElement(parentElement, DATA_SC_CURRENT)) return false;
1850 wxPoint2DDouble position(0.0, 25.0);
1851 if (textID == ID_TXT_BRANCH_FAULT_CURRENT_1_2)
1853 else
1855
1856 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1857 newText->SetElement(parentElement);
1858 newText->SetDataType(DATA_SC_CURRENT);
1859 if (unit == ElectricalUnit::UNIT_NONE)
1861 else
1862 newText->SetUnit(unit);
1863 newText->SetDecimalPlaces(precision);
1864 newText->SetElementTypeText(parentElement->GetElementType());
1865 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1866 if (textID == ID_TXT_BRANCH_FAULT_CURRENT_2_1)
1867 newText->SetDirection(1);
1868
1869 m_textList.emplace_back(newText);
1870 } break;
1871 default:
1872 return false;
1873 break;
1874 }
1875 return true;
1876}
virtual std::vector< wxPoint2DDouble > GetPointList() const
Get the list of points that connect the element to bus.
wxPoint2DDouble GetPosition() const
Get the element position.