fixed wrong offset of evaluation lights (traffic) due to erroneous cast to int
This commit is contained in:
parent
29618fbf93
commit
db0bcea485
@ -228,13 +228,13 @@ namespace BreCalClient
|
|||||||
|
|
||||||
switch(this.ShipcallControlModel?.LightMode)
|
switch(this.ShipcallControlModel?.LightMode)
|
||||||
{
|
{
|
||||||
case ShipcallControlModel.TrafficLightMode.GREEN:
|
case EvaluationType.Green:
|
||||||
this.imageEvaluation.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalTestClient;component/Resources/check.png"));
|
this.imageEvaluation.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalTestClient;component/Resources/check.png"));
|
||||||
break;
|
break;
|
||||||
case ShipcallControlModel.TrafficLightMode.YELLOW:
|
case EvaluationType.Yellow:
|
||||||
this.imageEvaluation.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalTestClient;component/Resources/sign_warning.png"));
|
this.imageEvaluation.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalTestClient;component/Resources/sign_warning.png"));
|
||||||
break;
|
break;
|
||||||
case ShipcallControlModel.TrafficLightMode.RED:
|
case EvaluationType.Red:
|
||||||
this.imageEvaluation.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalTestClient;component/Resources/delete2.png"));
|
this.imageEvaluation.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalTestClient;component/Resources/delete2.png"));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -251,13 +251,12 @@ namespace BreCalClient
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (this.ShipcallControlModel?.Shipcall?.Evaluation != null)
|
if (this.ShipcallControlModel?.Shipcall?.Evaluation != null)
|
||||||
{
|
{
|
||||||
ShipcallControlModel.TrafficLightMode resultColor = (ShipcallControlModel.TrafficLightMode)(this.ShipcallControlModel?.Shipcall?.Evaluation ?? 0); // der nullable Operator hier ist so doof, die VS validation blickts einfach nicht
|
this.Background = this.ShipcallControlModel.LightMode switch
|
||||||
this.Background = resultColor switch
|
|
||||||
{
|
{
|
||||||
// ShipcallControlModel.TrafficLightMode.GREEN => this.Background = Brushes.LightGreen,
|
// ShipcallControlModel.TrafficLightMode.GREEN => this.Background = Brushes.LightGreen,
|
||||||
ShipcallControlModel.TrafficLightMode.YELLOW => Brushes.LightYellow,
|
EvaluationType.Yellow => Brushes.LightYellow,
|
||||||
ShipcallControlModel.TrafficLightMode.RED => new SolidColorBrush(Color.FromArgb(200, 255, 100, 100)),
|
EvaluationType.Red => new SolidColorBrush(Color.FromArgb(200, 255, 100, 100)),
|
||||||
_ => Brushes.Transparent,
|
_ => Brushes.Transparent,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,17 +16,7 @@ namespace BreCalClient
|
|||||||
public class ShipcallControlModel
|
public class ShipcallControlModel
|
||||||
{
|
{
|
||||||
|
|
||||||
#region Enumerations
|
#region Enumerations
|
||||||
|
|
||||||
public enum TrafficLightMode
|
|
||||||
{
|
|
||||||
OFF,
|
|
||||||
GREEN,
|
|
||||||
YELLOW,
|
|
||||||
RED,
|
|
||||||
RED_YELLOW,
|
|
||||||
ALL
|
|
||||||
};
|
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum StatusFlags
|
public enum StatusFlags
|
||||||
@ -74,20 +64,20 @@ namespace BreCalClient
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public TrafficLightMode LightMode
|
public EvaluationType LightMode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
TrafficLightMode tlm = TrafficLightMode.OFF;
|
EvaluationType elm = EvaluationType.Undefined;
|
||||||
|
|
||||||
if (this.Shipcall != null)
|
if (this.Shipcall != null)
|
||||||
{
|
{
|
||||||
if(this.Shipcall.Evaluation.HasValue)
|
if(this.Shipcall.Evaluation.HasValue)
|
||||||
{
|
{
|
||||||
tlm = (TrafficLightMode)this.Shipcall.Evaluation;
|
elm = this.Shipcall.Evaluation.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tlm;
|
return elm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user