From: Matthew G. <mat...@us...> - 2007-10-17 03:05:22
|
Update of /cvsroot/jsbsimcommander/src/gui In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23318/src/gui Modified Files: TreeItem.cpp Log Message: correct the <alphalimits> and <hysteresis> blocks output format Index: TreeItem.cpp =================================================================== RCS file: /cvsroot/jsbsimcommander/src/gui/TreeItem.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TreeItem.cpp 24 Jan 2007 00:18:52 -0000 1.4 --- TreeItem.cpp 17 Oct 2007 03:05:18 -0000 1.5 *************** *** 486,493 **** { JSBSim::Element * temp_element; if (temp_element = el->FindElement("alphalimits")) { has_alphalimits = true; ! alphaclmin = temp_element->FindElementValueAsNumberConvertTo("min", "DEG"); ! alphaclmax = temp_element->FindElementValueAsNumberConvertTo("max", "DEG"); } else { --- 486,496 ---- { JSBSim::Element * temp_element; + string scratch_unit=""; if (temp_element = el->FindElement("alphalimits")) { has_alphalimits = true; ! scratch_unit = temp_element->GetAttributeValue("unit"); ! if (scratch_unit.empty()) scratch_unit = "DEG"; ! alphaclmin = temp_element->FindElementValueAsNumberConvertFromTo("min", scratch_unit, "DEG"); ! alphaclmax = temp_element->FindElementValueAsNumberConvertFromTo("max", scratch_unit, "DEG"); } else { *************** *** 497,502 **** if (temp_element = el->FindElement("hysteresis_limits")) { has_hysteresis_limits = true; ! alphahystmin = temp_element->FindElementValueAsNumberConvertTo("min", "DEG"); ! alphahystmax = temp_element->FindElementValueAsNumberConvertTo("max", "DEG"); } else { --- 500,507 ---- if (temp_element = el->FindElement("hysteresis_limits")) { has_hysteresis_limits = true; ! scratch_unit = temp_element->GetAttributeValue("unit"); ! if (scratch_unit.empty()) scratch_unit = "DEG"; ! alphahystmin = temp_element->FindElementValueAsNumberConvertFromTo("min", scratch_unit, "DEG"); ! alphahystmax = temp_element->FindElementValueAsNumberConvertFromTo("max", scratch_unit, "DEG"); } else { *************** *** 536,549 **** if (has_alphalimits) { ! out << pre << wxT("<alphalimits>\n"); ! out << pre << wxT(" <min unit=\"DEG\"> ") << alphaclmin << wxT("</min>\n"); ! out << pre << wxT(" <max unit=\"DEG\"> ") << alphaclmax << wxT("</max>\n"); out << pre << wxT("</alphalimits>\n"); } if (has_hysteresis_limits) { ! out << pre << wxT("<hysteresis_limits>\n"); ! out << pre << wxT(" <min unit=\"DEG\"> ") << alphahystmin << wxT("</min>\n"); ! out << pre << wxT(" <max unit=\"DEG\"> ") << alphahystmax << wxT("</min>\n"); out << pre << wxT("</hysteresis_limits>\n"); } --- 541,554 ---- if (has_alphalimits) { ! out << pre << wxT("<alphalimits unit=\"DEG\">\n"); ! out << pre << wxT(" <min> ") << alphaclmin << wxT("</min>\n"); ! out << pre << wxT(" <max> ") << alphaclmax << wxT("</max>\n"); out << pre << wxT("</alphalimits>\n"); } if (has_hysteresis_limits) { ! out << pre << wxT("<hysteresis_limits unit=\"DEG\">\n"); ! out << pre << wxT(" <min> ") << alphahystmin << wxT("</min>\n"); ! out << pre << wxT(" <max> ") << alphahystmax << wxT("</max>\n"); out << pre << wxT("</hysteresis_limits>\n"); } |