1950{
1951 switch (textID) {
1952 case ID_TXT_NAME: {
1953 if (FindTextElement(parentElement, DATA_NAME)) return false;
1954
1955 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(40, -30), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1956 newText->SetElement(parentElement);
1957 newText->SetDataType(DATA_NAME);
1958 newText->SetElementTypeText(parentElement->GetElementType());
1959 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1960
1961 m_textList.push_back(newText);
1962 } break;
1963 case ID_TXT_VOLTAGE: {
1964 if (FindTextElement(parentElement, DATA_VOLTAGE)) return false;
1965
1966 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(40, 15), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1967 newText->SetElement(parentElement);
1968 newText->SetDataType(DATA_VOLTAGE);
1969 if (unit == ElectricalUnit::UNIT_NONE)
1970 newText->SetUnit(ElectricalUnit::UNIT_PU);
1971 else
1972 newText->SetUnit(unit);
1973 newText->SetDecimalPlaces(precision);
1974 newText->SetElementTypeText(parentElement->GetElementType());
1975 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1976
1977 m_textList.emplace_back(newText);
1978 } break;
1979 case ID_TXT_ANGLE: {
1980 if (FindTextElement(parentElement, DATA_ANGLE)) return false;
1981
1982 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(40, 30), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1983 newText->SetElement(parentElement);
1984 newText->SetDataType(DATA_ANGLE);
1985 if (unit == ElectricalUnit::UNIT_NONE)
1986 newText->SetUnit(ElectricalUnit::UNIT_DEGREE);
1987 else
1988 newText->SetUnit(unit);
1989 newText->SetDecimalPlaces(precision);
1990 newText->SetElementTypeText(parentElement->GetElementType());
1991 newText->SetElementNumber(GetElementNumberFromList(parentElement));
1992
1993 m_textList.emplace_back(newText);
1994 } break;
1995 case ID_TXT_FAULTCURRENT: {
1996 if (FindTextElement(parentElement, DATA_SC_CURRENT)) return false;
1997
1998 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(-70, 30), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
1999 newText->SetElement(parentElement);
2000 newText->SetDataType(DATA_SC_CURRENT);
2001 if (unit == ElectricalUnit::UNIT_NONE)
2002 newText->SetUnit(ElectricalUnit::UNIT_A);
2003 else
2004 newText->SetUnit(unit);
2005 newText->SetDecimalPlaces(precision);
2006 newText->SetElementTypeText(parentElement->GetElementType());
2007 newText->SetElementNumber(GetElementNumberFromList(parentElement));
2008
2009 m_textList.emplace_back(newText);
2010 } break;
2011 case ID_TXT_FAULTVOLTAGE: {
2012 if (FindTextElement(parentElement, DATA_SC_VOLTAGE)) return false;
2013
2014 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(-70, 75), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
2015 newText->SetElement(parentElement);
2016 newText->SetDataType(DATA_SC_VOLTAGE);
2017 if (unit == ElectricalUnit::UNIT_NONE)
2018 newText->SetUnit(ElectricalUnit::UNIT_PU);
2019 else
2020 newText->SetUnit(unit);
2021 newText->SetDecimalPlaces(precision);
2022 newText->SetElementTypeText(parentElement->GetElementType());
2023 newText->SetElementNumber(GetElementNumberFromList(parentElement));
2024
2025 m_textList.emplace_back(newText);
2026 } break;
2027 case ID_TXT_SCC: {
2028 if (FindTextElement(parentElement, DATA_SC_POWER)) return false;
2029 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(-50, -30), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
2030 newText->SetElement(parentElement);
2031 newText->SetDataType(DATA_SC_POWER);
2032 newText->SetUnit(ElectricalUnit::UNIT_MVA);
2033 if (unit == ElectricalUnit::UNIT_NONE)
2034 newText->SetUnit(ElectricalUnit::UNIT_MVA);
2035 else
2036 newText->SetUnit(unit);
2037 newText->SetDecimalPlaces(precision);
2038 newText->SetElementTypeText(parentElement->GetElementType());
2039 newText->SetElementNumber(GetElementNumberFromList(parentElement));
2040
2041 m_textList.emplace_back(newText);
2042 } break;
2043 case ID_TXT_THD: {
2044 if (FindTextElement(parentElement, DATA_PQ_THD)) return false;
2045 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(-50, -15), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
2046 newText->SetElement(parentElement);
2047 newText->SetDataType(DATA_PQ_THD);
2048 newText->SetDecimalPlaces(precision);
2049 newText->SetElementTypeText(parentElement->GetElementType());
2050 newText->SetElementNumber(GetElementNumberFromList(parentElement));
2051
2052 m_textList.emplace_back(newText);
2053 } break;
2054 case ID_TXT_ACTIVE_POWER: {
2055 if (FindTextElement(parentElement, DATA_ACTIVE_POWER)) return false;
2056 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(0, 35), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
2057 newText->SetElement(parentElement);
2058 newText->SetDataType(DATA_ACTIVE_POWER);
2059 if (unit == ElectricalUnit::UNIT_NONE)
2060 newText->SetUnit(ElectricalUnit::UNIT_MW);
2061 else
2062 newText->SetUnit(unit);
2063 newText->SetDecimalPlaces(precision);
2064 newText->SetElementTypeText(parentElement->GetElementType());
2065 newText->SetElementNumber(GetElementNumberFromList(parentElement));
2066
2067 m_textList.emplace_back(newText);
2068 } break;
2069 case ID_TXT_REACTIVE_POWER: {
2070 if (FindTextElement(parentElement, DATA_REACTIVE_POWER)) return false;
2071 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(0, 50), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
2072 newText->SetElement(parentElement);
2073 newText->SetDataType(DATA_REACTIVE_POWER);
2074 if (unit == ElectricalUnit::UNIT_NONE)
2075 newText->SetUnit(ElectricalUnit::UNIT_Mvar);
2076 else
2077 newText->SetUnit(unit);
2078 newText->SetDecimalPlaces(precision);
2079 newText->SetElementTypeText(parentElement->GetElementType());
2080 newText->SetElementNumber(GetElementNumberFromList(parentElement));
2081
2082 m_textList.emplace_back(newText);
2083 } break;
2084 case ID_TXT_BRANCH_ACTIVE_POWER_1_2:
2085 case ID_TXT_BRANCH_ACTIVE_POWER_2_1: {
2086 if (FindTextElement(parentElement, DATA_PF_ACTIVE)) return false;
2087 wxPoint2DDouble position(0.0, -10.0);
2088 if (textID == ID_TXT_BRANCH_ACTIVE_POWER_1_2)
2090 else
2092
2093 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
2094 newText->SetElement(parentElement);
2095 newText->SetDataType(DATA_PF_ACTIVE);
2096 if (unit == ElectricalUnit::UNIT_NONE)
2097 newText->SetUnit(ElectricalUnit::UNIT_MW);
2098 else
2099 newText->SetUnit(unit);
2100 newText->SetDecimalPlaces(precision);
2101 newText->SetElementTypeText(parentElement->GetElementType());
2102 newText->SetElementNumber(GetElementNumberFromList(parentElement));
2103 if (textID == ID_TXT_BRANCH_ACTIVE_POWER_2_1)
2104 newText->SetDirection(1);
2105
2106 m_textList.emplace_back(newText);
2107 } break;
2108 case ID_TXT_BRANCH_REACTIVE_POWER_1_2:
2109 case ID_TXT_BRANCH_REACTIVE_POWER_2_1: {
2110 if (FindTextElement(parentElement, DATA_PF_REACTIVE)) return false;
2111 wxPoint2DDouble position(0.0, 10.0);
2112 if (textID == ID_TXT_BRANCH_REACTIVE_POWER_1_2)
2114 else
2116
2117 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
2118 newText->SetElement(parentElement);
2119 newText->SetDataType(DATA_PF_REACTIVE);
2120 if (unit == ElectricalUnit::UNIT_NONE)
2121 newText->SetUnit(ElectricalUnit::UNIT_Mvar);
2122 else
2123 newText->SetUnit(unit);
2124 newText->SetDecimalPlaces(precision);
2125 newText->SetElementTypeText(parentElement->GetElementType());
2126 newText->SetElementNumber(GetElementNumberFromList(parentElement));
2127 if (textID == ID_TXT_BRANCH_REACTIVE_POWER_2_1)
2128 newText->SetDirection(1);
2129
2130 m_textList.emplace_back(newText);
2131 } break;
2132 case ID_TXT_BRANCH_LOSSES: {
2133 if (FindTextElement(parentElement, DATA_PF_LOSSES)) return false;
2135 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
2136 newText->SetElement(parentElement);
2137 newText->SetDataType(DATA_PF_LOSSES);
2138 if (unit == ElectricalUnit::UNIT_NONE)
2139 newText->SetUnit(ElectricalUnit::UNIT_MW);
2140 else
2141 newText->SetUnit(unit);
2142 newText->SetDecimalPlaces(precision);
2143 newText->SetElementTypeText(parentElement->GetElementType());
2144 newText->SetElementNumber(GetElementNumberFromList(parentElement));
2145
2146 m_textList.emplace_back(newText);
2147 } break;
2148 case ID_TXT_BRANCH_CURRENT_1_2:
2149 case ID_TXT_BRANCH_CURRENT_2_1: {
2150 if (FindTextElement(parentElement, DATA_PF_CURRENT)) return false;
2151 wxPoint2DDouble position(0.0, 10.0);
2152 if (textID == ID_TXT_BRANCH_CURRENT_1_2)
2154 else
2156
2157 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
2158 newText->SetElement(parentElement);
2159 newText->SetDataType(DATA_PF_CURRENT);
2160 if (unit == ElectricalUnit::UNIT_NONE)
2161 newText->SetUnit(ElectricalUnit::UNIT_A);
2162 else
2163 newText->SetUnit(unit);
2164 newText->SetDecimalPlaces(precision);
2165 newText->SetElementTypeText(parentElement->GetElementType());
2166 newText->SetElementNumber(GetElementNumberFromList(parentElement));
2167 if (textID == ID_TXT_BRANCH_CURRENT_2_1)
2168 newText->SetDirection(1);
2169
2170 m_textList.emplace_back(newText);
2171 } break;
2172 case ID_TXT_BRANCH_FAULT_CURRENT_1_2:
2173 case ID_TXT_BRANCH_FAULT_CURRENT_2_1: {
2174 if (FindTextElement(parentElement, DATA_SC_CURRENT)) return false;
2175 wxPoint2DDouble position(0.0, 25.0);
2176 if (textID == ID_TXT_BRANCH_FAULT_CURRENT_1_2)
2178 else
2180
2181 auto newText = std::make_shared<Text>(position, m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
2182 newText->SetElement(parentElement);
2183 newText->SetDataType(DATA_SC_CURRENT);
2184 if (unit == ElectricalUnit::UNIT_NONE)
2185 newText->SetUnit(ElectricalUnit::UNIT_kA);
2186 else
2187 newText->SetUnit(unit);
2188 newText->SetDecimalPlaces(precision);
2189 newText->SetElementTypeText(parentElement->GetElementType());
2190 newText->SetElementNumber(GetElementNumberFromList(parentElement));
2191 if (textID == ID_TXT_BRANCH_FAULT_CURRENT_2_1)
2192 newText->SetDirection(1);
2193
2194 m_textList.emplace_back(newText);
2195 } break;
2196 case ID_TXT_TAP: {
2197 if (FindTextElement(parentElement, DATA_TRANSFORMER_TAP)) return false;
2198 auto newText = std::make_shared<Text>(parentElement->
GetPosition() + wxPoint2DDouble(25, -15), m_properties->GetGeneralPropertiesData().labelFont, m_properties->GetGeneralPropertiesData().labelFontSize);
2199 newText->SetElement(parentElement);
2200 newText->SetDataType(DATA_TRANSFORMER_TAP);
2201 newText->SetUnit(unit == ElectricalUnit::UNIT_NONE ? ElectricalUnit::UNIT_PU : unit);
2202 newText->SetDecimalPlaces(precision);
2203 newText->SetElementTypeText(parentElement->GetElementType());
2204 newText->SetElementNumber(GetElementNumberFromList(parentElement));
2205
2206 m_textList.emplace_back(newText);
2207 } break;
2208 default:
2209 return false;
2210 break;
2211 }
2212 return true;
2213}
virtual std::vector< wxPoint2DDouble > GetPointList() const
Get the list of points that connect the element to bus.
wxPoint2DDouble GetPosition() const
Get the element position.