Inconsistency between min/max values in color dynamic widget and values stored in descriptor.xml
Mantis Issue 745, reported by mgrizonnet, assigned to salbert, created: 2013-07-22
I noticed that min/max values in color dynamic widgets are modified if you close/open Monteverdi on the same modify
Using the WV2 MS sample image over Rome, at startup after the ingestion of the product, the max value in the red channel (fourth band) is : 811.6931553846151246034423820674419403076171875
If you close and reopen mvd2 the max value with the same settings is : 811.692999999999983629095368087291717529296875
I think that it is due to the fact that dynamic values are stored with 3 digits of precision in the descriptor.xml file and displayed with the maximum of precision in the Color dynamic widget.
In my opinion this inconsistency is confusing at the user point of you and could be even dangerous and could be a cause of bugs in the future
1381318120 - salbertThere is an accuracy loss when converting from double/float to QString using QString("%6.6.0").arg(double/float) or equivalent QString().sprintf("%g", double/float): string is limited to 4 digits after decimal point.
The result is equivalent using std::cout << double or C sprintf("%g", double).
This is used when writing descriptor.xml file keeping (truncated) color-dynamics values.
This problem is more general since there are several other conversions from double/float to QString or std::string such as saving of histogram.
Such truncated conversions must be replaced by QString ToQString< T >(const T& val) global conversion function in the whole source code.
1381757158 - salbertImplemented QString ToQString< T >( const T& ) methods to correctly convert double/float to QStrings.