2019-06-01 22:13:01 +01:00
|
|
|
using System.Collections.Generic;
|
2019-06-01 23:48:54 +01:00
|
|
|
using System.ComponentModel;
|
2019-06-01 22:13:01 +01:00
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
2020-02-10 02:10:18 +00:00
|
|
|
namespace Marechai.Database.Models
|
2019-06-01 22:13:01 +01:00
|
|
|
{
|
|
|
|
|
public class Screen : BaseModel<int>
|
|
|
|
|
{
|
|
|
|
|
[Range(1, 131072)]
|
2019-06-01 23:48:54 +01:00
|
|
|
[DisplayName("Width (mm)")]
|
2019-06-01 22:13:01 +01:00
|
|
|
public double? Width { get; set; }
|
|
|
|
|
[Range(1, 131072)]
|
2019-06-01 23:48:54 +01:00
|
|
|
[DisplayName("Height (mm)")]
|
2019-06-01 22:13:01 +01:00
|
|
|
public double? Height { get; set; }
|
|
|
|
|
[Required]
|
2019-06-01 23:48:54 +01:00
|
|
|
[DisplayName("Diagonal (inches)")]
|
2019-06-01 22:13:01 +01:00
|
|
|
public double Diagonal { get; set; }
|
2019-06-01 23:55:06 +01:00
|
|
|
[DisplayName("Native resolution")]
|
2019-06-01 22:13:01 +01:00
|
|
|
public virtual Resolution NativeResolution { get; set; }
|
|
|
|
|
[Range(2, 281474976710656)]
|
2019-06-01 23:48:54 +01:00
|
|
|
[DisplayName("Effective colors")]
|
2019-06-01 22:13:01 +01:00
|
|
|
public long? EffectiveColors { get; set; }
|
|
|
|
|
[Required]
|
|
|
|
|
public string Type { get; set; }
|
|
|
|
|
|
|
|
|
|
[NotMapped]
|
|
|
|
|
public long? Colors => EffectiveColors ?? NativeResolution.Colors;
|
|
|
|
|
|
2019-06-01 23:48:54 +01:00
|
|
|
[NotMapped]
|
|
|
|
|
public string Size
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if(Width != null && Height != null) return $"{Width}x{Height} mm";
|
|
|
|
|
|
|
|
|
|
return "Unknown";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-01 22:13:01 +01:00
|
|
|
public virtual ICollection<ResolutionsByScreen> Resolutions { get; set; }
|
|
|
|
|
public virtual ICollection<ScreensByMachine> ScreensByMachines { get; set; }
|
2019-06-02 00:35:41 +01:00
|
|
|
[Required]
|
|
|
|
|
public int NativeResolutionId { get; set; }
|
2019-06-01 22:13:01 +01:00
|
|
|
}
|
|
|
|
|
}
|