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