123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- using Edge.Core.IndustryStandardInterface.ATG;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- using System.Text;
- namespace Application.ATG_Classic_App.Model
- {
- public abstract class BaseConfig
- {
- [Key]
- public int Id { get; set; }
- /// <summary>
- /// </summary>
- public DateTime CreatedTimeStamp { get; set; }
- public DateTime? ModifiedTimeStamp { get; set; }
- }
- /// <summary>
- /// the config shared by all tanks, so one copy for a ATG system.
- /// </summary>
- public class TankOverallConfig : BaseConfig
- {
- public enum DeliveryOperationMode
- {
- Manual,
- Automatic
- }
- /// <summary>
- /// TC温度补偿值参考(TC Reference, by centigrade),float, 最多3位小数,可以为正负,
- /// 用于计算温度补偿后的油品体积。
- /// 此值与地域有关, 典型值15C. 当探棒所测量温度与此值发生偏差,则结束Termal Coefficient进行
- /// “温度补偿体积”计算。即当实际测量温度与参考基准值不一样时,统一通过算法补正到基准值下的体积。
- /// </summary>
- public double TcReference { get; set; }
- /// <summary>
- /// the interval to read inventory data and save to db.
- /// default 60 seconds, by ms.
- /// </summary>
- public int InventorySamplingInterval { get; set; } = 60000;
- public DeliveryOperationMode DeliveryMode { get; set; }
- }
- public class TankLimitConfig : BaseConfig
- {
- /// <summary>
- /// The max volume of this tank can safely save material, by Liter.
- /// by considering the material expansion along with temp rise, the Max volume must less than Full Volume.
- /// </summary>
- public double MaxVolume { get; set; }
- /// <summary>
- /// 100% volume of this tank, by Liter.
- /// </summary>
- public double FullVolume { get; set; }
- /// <summary>
- /// % of the Max Volume, typical value 0.9
- /// above this value will trigger high product alarm.
- /// </summary>
- public double HighProduct { get; set; }
- /// <summary>
- /// Liter of the low product threashold value, by Liter, typical value 30.
- /// lower thatn this value will trigger low product alarm.
- /// </summary>
- public double LowProduct { get; set; }
- /// <summary>
- /// mm of the high water warning threashold value, by mm, typical value 100.
- /// higher than this value will trigger high water warning.
- /// </summary>
- public double HighWaterWarning { get; set; }
- /// <summary>
- /// mm of the high water alarm threashold value, by mm, typical value 125.
- /// higher than this value will trigger high water alarm.
- /// </summary>
- public double HighWaterAlarm { get; set; }
- /// <summary>
- /// by centigrade(celsius), typical value -50
- /// </summary>
- public double FuelTemperatureLowLimit { get; set; }
- /// <summary>
- /// by centigrade(celsius), typical value 60
- /// </summary>
- public double FuelTemperatureHighLimit { get; set; }
- }
- public class ProductConfig : BaseConfig
- {
- /// <summary>
- /// Each tank must have a product code defined.
- /// </summary>
- [Required]
- public string ProductCode { get; set; }
- /// <summary>
- /// descriptive info for the product.
- /// </summary>
- public string ProductLabel { get; set; }
- }
- public class ProbeConfig : BaseConfig
- {
- /// <summary>
- /// used for correlating the DeviceHandler of ProGauge_StartItaliana_Probe.Handler.DeviceId
- /// </summary>
- public int DeviceId { get; set; }
- /// <summary>
- /// the lowest point of the probe may not reached the bottom of the tank, this is the length of this distance.
- /// the fuel and water height readings will combine with this value before send out for ATG client applications.
- /// </summary>
- public double ProbeOffset { get; set; }
- /// <summary>
- /// user may want to 'hidden' some water in a tank, this is the value of the water height reading need to be substracted.
- /// </summary>
- public double WaterOffset { get; set; }
- }
- /// <summary>
- /// Also known as Tank strapping table or chart.
- /// </summary>
- public class TankProfileData
- {
- [Key]
- public int Id { get; set; }
- /// <summary>
- /// used to grouping a set of Data.
- /// </summary>
- public string BatchLabel { get; set; }
- [ForeignKey("TankConfig")]
- public int TankConfigId { get; set; }
- public TankConfig TankConfig { get; set; }
- public double Height { get; set; }
- public double Volume { get; set; }
- /// <summary>
- /// when measured height dropped from nearest height(>= measured height), how many Volume dropped.
- /// say at 2000mm, the volume is 2000L, and the nearst profile lower point has height 1900mm, and the Volume is 1800L, then ValumeChange is 200L.
- /// NOT USED for now, just see it in VR console, not sure how to use it.
- /// </summary>
- public double? VolumeChange { get; set; }
- }
- /// <summary>
- /// the config for an individual tank.
- /// </summary>
- public class TankConfig : BaseConfig
- {
- /// <summary>
- /// Gets or sets the tank number which assigned in device internal
- /// </summary>
- public byte TankNumber { get; set; }
- /// <summary>
- /// descriptive info for this Tank.
- /// </summary>
- public string Label { get; set; }
- /// <summary>
- /// by mm.
- /// </summary>
- public double Diameter { get; set; }
- /// <summary>
- /// by liter/centigrade, typical value 0.0007
- /// </summary>
- public double ThermalCoefficient { get; set; }
- /// <summary>
- /// after a deliver done, system will delay this time(by seconds) and then caculate
- /// the deliver data to generate a record.
- /// this is good for wait the level stablize and avoid false alarms.
- /// </summary>
- public int DeliveryDelay { get; set; }
- public List<TankProfileData> TankProfileDatas { get; set; }
- [ForeignKey("ProductConfig")]
- public int? ProductConfigId { get; set; }
- public ProductConfig ProductConfig { get; set; }
- [ForeignKey("TankLimitConfig")]
- public int? TankLimitConfigId { get; set; }
- public TankLimitConfig TankLimitConfig { get; set; }
- [ForeignKey("ProbeConfig")]
- public int? ProbeConfigId { get; set; }
- public ProbeConfig ProbeConfig { get; set; }
- }
- }
|