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