Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit daea2a2d authored by Harald Martini's avatar Harald Martini
Browse files

Changed display of square and cubic meter si,

removed background from AirdragView
parent 114a8212
No related branches found
No related tags found
No related merge requests found
......@@ -211,3 +211,4 @@ Documentation/VehiclesReleaseComparisonDeclarationMode/tmp/
.vs/
**/dev/*.vmod
**/dev/*.vsum
/VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration/testVif.VIF_Report_5.xml
......@@ -9,38 +9,34 @@ namespace VECTO3GUI2020.Helper.Converter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null) {
var unitString = getUnitString(value);
if (unitString != null) {
unitString = unitString.Replace("^2", ((char)0xB2).ToString());
unitString = unitString.Replace("^3", ((char)0xB3).ToString());
return unitString;
} else {
return Binding.DoNothing;
}
//if (value == null) {
// return Binding.DoNothing;
//}
if(value is SI SIValue)
{
if (SIValue.UnitString == "1/s")
{
return "rpm";
}
return SIValue.UnitString;
}
if (value is ConvertedSI convertedSI) {
return convertedSI.Units;
}
// if(value is SI SIValue)
// {
// if (SIValue.UnitString == "1/s")
// {
// return "rpm";
// }
// return SIValue.UnitString;
// }
return Binding.DoNothing;
//if (value is ConvertedSI convertedSI) {
// return convertedSI.Units;
//}
//TRY GET DYNAMIC UNIT STRING
try {
dynamic type = value?.GetType();
if (type == null) {
return Binding.DoNothing;
}
var unitString = type.GetUnitString();
return unitString;
} catch (Exception e){
return Binding.DoNothing;
}
//return Binding.DoNothing;
}
......@@ -48,5 +44,29 @@ namespace VECTO3GUI2020.Helper.Converter
{
throw new NotImplementedException();
}
private string getUnitString(object value)
{
if (value == null) {
return null;
}
if (value is SI SIValue)
{
if (SIValue.UnitString == "1/s")
{
return "rpm";
}
return SIValue.UnitString;
}
if (value is ConvertedSI convertedSI)
{
return convertedSI.Units;
}
return null;
}
}
}
......@@ -7,7 +7,7 @@
xmlns:customControls="clr-namespace:VECTO3GUI2020.Views.Multistage.CustomControls"
xmlns:implementation="clr-namespace:VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components" d:DataContext="{d:DesignInstance Type=implementation:AirDragViewModel_v2_8}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" Background="BlueViolet">
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<StackPanel>
<Label
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment