1747{
1748 switch (textID) {
1749 case ID_TXT_NAME: {
1750 if (FindTextElement(parentElement, DATA_NAME)) return false;
1751
1752 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(40, -30), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1753 newText->SetElement(parentElement);
1754 newText->SetDataType(DATA_NAME);
1755 newText->SetElementTypeText(parentElement->GetElementType());
1756 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1757
1758 m_textList.push_back(newText);
1759 } break;
1760 case ID_TXT_VOLTAGE: {
1761 if (FindTextElement(parentElement, DATA_VOLTAGE)) return false;
1762
1763 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(40, 15), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1764 newText->SetElement(parentElement);
1765 newText->SetDataType(DATA_VOLTAGE);
1766 if (unit == ElectricalUnit::UNIT_NONE)
1767 newText->SetUnit(ElectricalUnit::UNIT_PU);
1768 else
1769 newText->SetUnit(unit);
1770 newText->SetDecimalPlaces(precision);
1771 newText->SetElementTypeText(parentElement->GetElementType());
1772 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1773
1774 m_textList.emplace_back(newText);
1775 } break;
1776 case ID_TXT_ANGLE: {
1777 if (FindTextElement(parentElement, DATA_ANGLE)) return false;
1778
1779 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(40, 30), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1780 newText->SetElement(parentElement);
1781 newText->SetDataType(DATA_ANGLE);
1782 if (unit == ElectricalUnit::UNIT_NONE)
1783 newText->SetUnit(ElectricalUnit::UNIT_DEGREE);
1784 else
1785 newText->SetUnit(unit);
1786 newText->SetDecimalPlaces(precision);
1787 newText->SetElementTypeText(parentElement->GetElementType());
1788 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1789
1790 m_textList.emplace_back(newText);
1791 } break;
1792 case ID_TXT_FAULTCURRENT: {
1793 if (FindTextElement(parentElement, DATA_SC_CURRENT)) return false;
1794
1795 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(-70, 30), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1796 newText->SetElement(parentElement);
1797 newText->SetDataType(DATA_SC_CURRENT);
1798 if (unit == ElectricalUnit::UNIT_NONE)
1799 newText->SetUnit(ElectricalUnit::UNIT_A);
1800 else
1801 newText->SetUnit(unit);
1802 newText->SetDecimalPlaces(precision);
1803 newText->SetElementTypeText(parentElement->GetElementType());
1804 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1805
1806 m_textList.emplace_back(newText);
1807 } break;
1808 case ID_TXT_FAULTVOLTAGE: {
1809 if (FindTextElement(parentElement, DATA_SC_VOLTAGE)) return false;
1810
1811 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(-70, 75), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1812 newText->SetElement(parentElement);
1813 newText->SetDataType(DATA_SC_VOLTAGE);
1814 if (unit == ElectricalUnit::UNIT_NONE)
1815 newText->SetUnit(ElectricalUnit::UNIT_PU);
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_SCC: {
1825 if (FindTextElement(parentElement, DATA_SC_POWER)) return false;
1826 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(-50, -30), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1827 newText->SetElement(parentElement);
1828 newText->SetDataType(DATA_SC_POWER);
1829 newText->SetUnit(ElectricalUnit::UNIT_MVA);
1830 if (unit == ElectricalUnit::UNIT_NONE)
1831 newText->SetUnit(ElectricalUnit::UNIT_MVA);
1832 else
1833 newText->SetUnit(unit);
1834 newText->SetDecimalPlaces(precision);
1835 newText->SetElementTypeText(parentElement->GetElementType());
1836 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1837
1838 m_textList.emplace_back(newText);
1839 } break;
1840 case ID_TXT_THD: {
1841 if (FindTextElement(parentElement, DATA_PQ_THD)) return false;
1842 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(-50, -15), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1843 newText->SetElement(parentElement);
1844 newText->SetDataType(DATA_PQ_THD);
1845 newText->SetDecimalPlaces(precision);
1846 newText->SetElementTypeText(parentElement->GetElementType());
1847 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1848
1849 m_textList.emplace_back(newText);
1850 } break;
1851 case ID_TXT_ACTIVE_POWER: {
1852 if (FindTextElement(parentElement, DATA_ACTIVE_POWER)) return false;
1853 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(0, 35), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1854 newText->SetElement(parentElement);
1855 newText->SetDataType(DATA_ACTIVE_POWER);
1856 if (unit == ElectricalUnit::UNIT_NONE)
1857 newText->SetUnit(ElectricalUnit::UNIT_MW);
1858 else
1859 newText->SetUnit(unit);
1860 newText->SetDecimalPlaces(precision);
1861 newText->SetElementTypeText(parentElement->GetElementType());
1862 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1863
1864 m_textList.emplace_back(newText);
1865 } break;
1866 case ID_TXT_REACTIVE_POWER: {
1867 if (FindTextElement(parentElement, DATA_REACTIVE_POWER)) return false;
1868 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(0, 50), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1869 newText->SetElement(parentElement);
1870 newText->SetDataType(DATA_REACTIVE_POWER);
1871 if (unit == ElectricalUnit::UNIT_NONE)
1872 newText->SetUnit(ElectricalUnit::UNIT_Mvar);
1873 else
1874 newText->SetUnit(unit);
1875 newText->SetDecimalPlaces(precision);
1876 newText->SetElementTypeText(parentElement->GetElementType());
1877 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1878
1879 m_textList.emplace_back(newText);
1880 } break;
1881 case ID_TXT_BRANCH_ACTIVE_POWER_1_2:
1882 case ID_TXT_BRANCH_ACTIVE_POWER_2_1: {
1883 if (FindTextElement(parentElement, DATA_PF_ACTIVE)) return false;
1884 wxPoint2DDouble position(0.0, -10.0);
1885 if (textID == ID_TXT_BRANCH_ACTIVE_POWER_1_2)
1887 else
1889
1890 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1891 newText->SetElement(parentElement);
1892 newText->SetDataType(DATA_PF_ACTIVE);
1893 if (unit == ElectricalUnit::UNIT_NONE)
1894 newText->SetUnit(ElectricalUnit::UNIT_MW);
1895 else
1896 newText->SetUnit(unit);
1897 newText->SetDecimalPlaces(precision);
1898 newText->SetElementTypeText(parentElement->GetElementType());
1899 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1900 if (textID == ID_TXT_BRANCH_ACTIVE_POWER_2_1)
1901 newText->SetDirection(1);
1902
1903 m_textList.emplace_back(newText);
1904 } break;
1905 case ID_TXT_BRANCH_REACTIVE_POWER_1_2:
1906 case ID_TXT_BRANCH_REACTIVE_POWER_2_1: {
1907 if (FindTextElement(parentElement, DATA_PF_REACTIVE)) return false;
1908 wxPoint2DDouble position(0.0, 10.0);
1909 if (textID == ID_TXT_BRANCH_REACTIVE_POWER_1_2)
1911 else
1913
1914 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1915 newText->SetElement(parentElement);
1916 newText->SetDataType(DATA_PF_REACTIVE);
1917 if (unit == ElectricalUnit::UNIT_NONE)
1918 newText->SetUnit(ElectricalUnit::UNIT_Mvar);
1919 else
1920 newText->SetUnit(unit);
1921 newText->SetDecimalPlaces(precision);
1922 newText->SetElementTypeText(parentElement->GetElementType());
1923 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1924 if (textID == ID_TXT_BRANCH_REACTIVE_POWER_2_1)
1925 newText->SetDirection(1);
1926
1927 m_textList.emplace_back(newText);
1928 } break;
1929 case ID_TXT_BRANCH_LOSSES: {
1930 if (FindTextElement(parentElement, DATA_PF_LOSSES)) return false;
1932 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1933 newText->SetElement(parentElement);
1934 newText->SetDataType(DATA_PF_LOSSES);
1935 if (unit == ElectricalUnit::UNIT_NONE)
1936 newText->SetUnit(ElectricalUnit::UNIT_MW);
1937 else
1938 newText->SetUnit(unit);
1939 newText->SetDecimalPlaces(precision);
1940 newText->SetElementTypeText(parentElement->GetElementType());
1941 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1942
1943 m_textList.emplace_back(newText);
1944 } break;
1945 case ID_TXT_BRANCH_CURRENT_1_2:
1946 case ID_TXT_BRANCH_CURRENT_2_1: {
1947 if (FindTextElement(parentElement, DATA_PF_CURRENT)) return false;
1948 wxPoint2DDouble position(0.0, 10.0);
1949 if (textID == ID_TXT_BRANCH_CURRENT_1_2)
1951 else
1953
1954 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1955 newText->SetElement(parentElement);
1956 newText->SetDataType(DATA_PF_CURRENT);
1957 if (unit == ElectricalUnit::UNIT_NONE)
1958 newText->SetUnit(ElectricalUnit::UNIT_A);
1959 else
1960 newText->SetUnit(unit);
1961 newText->SetDecimalPlaces(precision);
1962 newText->SetElementTypeText(parentElement->GetElementType());
1963 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1964 if (textID == ID_TXT_BRANCH_CURRENT_2_1)
1965 newText->SetDirection(1);
1966
1967 m_textList.emplace_back(newText);
1968 } break;
1969 case ID_TXT_BRANCH_FAULT_CURRENT_1_2:
1970 case ID_TXT_BRANCH_FAULT_CURRENT_2_1: {
1971 if (FindTextElement(parentElement, DATA_SC_CURRENT)) return false;
1972 wxPoint2DDouble position(0.0, 25.0);
1973 if (textID == ID_TXT_BRANCH_FAULT_CURRENT_1_2)
1975 else
1977
1978 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1979 newText->SetElement(parentElement);
1980 newText->SetDataType(DATA_SC_CURRENT);
1981 if (unit == ElectricalUnit::UNIT_NONE)
1982 newText->SetUnit(ElectricalUnit::UNIT_kA);
1983 else
1984 newText->SetUnit(unit);
1985 newText->SetDecimalPlaces(precision);
1986 newText->SetElementTypeText(parentElement->GetElementType());
1987 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1988 if (textID == ID_TXT_BRANCH_FAULT_CURRENT_2_1)
1989 newText->SetDirection(1);
1990
1991 m_textList.emplace_back(newText);
1992 } break;
1993 default:
1994 return false;
1995 break;
1996 }
1997 return true;
1998}
virtual std::vector< wxPoint2DDouble > GetPointList() const
Get the list of points that connect the element to bus.
wxPoint2DDouble GetPosition() const
Get the element position.