79 lines
2.9 KiB
C#
79 lines
2.9 KiB
C#
///
|
|
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
/// This class holds the watermeter type specific data
|
|
/// that have all watermaters of the same type in common
|
|
|
|
namespace Config.Entities
|
|
{
|
|
public class WMType
|
|
{
|
|
// mapped
|
|
public virtual int Id { get; protected set; } /// primary key
|
|
public virtual DateTime CreateTime { get; set; } /// Date and time of the creation or change
|
|
public virtual string CreateUserName { get; set; } /// Name of the user who has created or changed this procedure
|
|
public virtual string CreateDescription { get; set; } /// Description\
|
|
|
|
public virtual string Name { get; set; } /// type name
|
|
public virtual float PulseRate { get; set; } /// Pulses per Liter
|
|
|
|
// not yet mapped
|
|
public virtual int IdentNr { get; protected set; } /// identification number of watermeter tzpe
|
|
public virtual int Diameter { get; set; } /// nominal diameter
|
|
public virtual int Pressure { get; set; } /// nominal pressure
|
|
public virtual int Length { get; set; } /// construction length
|
|
public virtual int Temperatur { get; set; } /// nominal temperature in C
|
|
public virtual float NominalFlow { get; set; } /// nominal flow Qn
|
|
|
|
/// ------------- Additional stuff not mapped into the database -------------
|
|
|
|
public WMType()
|
|
{
|
|
}
|
|
|
|
public static WMType DefaultWMType()
|
|
{
|
|
WMType procedure = new WMType()
|
|
{
|
|
CreateTime = DateTime.Now,
|
|
CreateUserName = Config.Data.CurrentUser.Name,
|
|
CreateDescription = "A default water meter created.",
|
|
Name = "Watermeter",
|
|
PulseRate = 1000,
|
|
};
|
|
return procedure;
|
|
}
|
|
|
|
public virtual WMType Clone()
|
|
{
|
|
WMType result = new WMType();
|
|
|
|
result.CreateTime = CreateTime;
|
|
result.CreateUserName = CreateUserName;
|
|
result.CreateDescription = CreateDescription;
|
|
result.Name = Name;
|
|
result.PulseRate = PulseRate;
|
|
|
|
return result;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
string result = "";
|
|
result += "WMTpe: " + Environment.NewLine;
|
|
result += " Name = " + Name + Environment.NewLine;
|
|
result += " Created by = " + CreateUserName + Environment.NewLine;
|
|
result += " Created on = " + CreateTime.ToString() + Environment.NewLine;
|
|
result += " Description = " + CreateDescription + Environment.NewLine;
|
|
result += " Pulse rate = " + PulseRate.ToString() + Environment.NewLine;
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
|