mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps] Display float in decimal mode in curve views and title
Change-Id: I3c069f3e001b43c98d4c54975b02636dad330acf
This commit is contained in:
@@ -71,11 +71,11 @@ int CurveView::numberOfLabels(Axis axis) const {
|
||||
}
|
||||
|
||||
void CurveView::computeLabels(Axis axis) {
|
||||
char buffer[Constant::FloatBufferSizeInScientificMode];
|
||||
char buffer[Constant::FloatBufferSizeInDecimalMode];
|
||||
float step = gridUnit(axis);
|
||||
for (int index = 0; index < numberOfLabels(axis); index++) {
|
||||
// TODO: change the number of digits in mantissa once the numerical mode is implemented
|
||||
Float(2.0f*step*(ceilf(min(axis)/(2.0f*step)))+index*2.0f*step).convertFloatToText(buffer, Constant::FloatBufferSizeInScientificMode, Constant::NumberOfDigitsInMantissaInScientificMode);
|
||||
Float(2.0f*step*(ceilf(min(axis)/(2.0f*step)))+index*2.0f*step).convertFloatToText(buffer, Constant::FloatBufferSizeInDecimalMode, Constant::NumberOfDigitsInMantissaInDecimalMode, Float::DisplayMode::Decimal);
|
||||
//TODO: check for size of label?
|
||||
strlcpy(label(axis, index), buffer, strlen(buffer)+1);
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ void ParametersController::updateTitle() {
|
||||
m_titleBuffer[currentChar++] = m_law->parameterNameAtIndex(index)[0];
|
||||
strlcpy(m_titleBuffer+currentChar, " = ", 4);
|
||||
currentChar += 3;
|
||||
char buffer[Constant::FloatBufferSizeInScientificMode];
|
||||
Float(m_law->parameterValueAtIndex(index)).convertFloatToText(buffer, Constant::FloatBufferSizeInScientificMode, Constant::NumberOfDigitsInMantissaInScientificMode);
|
||||
char buffer[Constant::FloatBufferSizeInDecimalMode];
|
||||
Float(m_law->parameterValueAtIndex(index)).convertFloatToText(buffer, Constant::FloatBufferSizeInDecimalMode, Constant::NumberOfDigitsInMantissaInDecimalMode, Float::DisplayMode::Decimal);
|
||||
strlcpy(m_titleBuffer+currentChar, buffer, strlen(buffer)+1);
|
||||
currentChar += strlen(buffer);
|
||||
m_titleBuffer[currentChar++] = ' ';
|
||||
|
||||
Reference in New Issue
Block a user