437 lines
12 KiB
C#
437 lines
12 KiB
C#
///
|
|
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Reflection;
|
|
|
|
namespace Config.Entities
|
|
{
|
|
/// <summary>
|
|
/// Helper class to assign descriptions to enum values
|
|
/// </summary>
|
|
public class Description : Attribute
|
|
{
|
|
public string Text;
|
|
public Description(string t)
|
|
{
|
|
Text = t;
|
|
}
|
|
}
|
|
|
|
public static class GetDescription
|
|
{
|
|
/// Extension method for enum-s
|
|
public static string ToDescription(this Enum en)
|
|
{
|
|
Type type = en.GetType();
|
|
MemberInfo[] memInfo = type.GetMember(en.ToString());
|
|
|
|
if (memInfo != null && memInfo.Length > 0)
|
|
{
|
|
object[] attrs = memInfo[0].GetCustomAttributes(typeof(Description), false);
|
|
if (attrs != null && attrs.Length > 0)
|
|
return ((Description)attrs[0]).Text;
|
|
}
|
|
|
|
return en.ToString(); /// Return ToString() value in case there is no description
|
|
}
|
|
}
|
|
|
|
public enum ProcedureState
|
|
{
|
|
Active,
|
|
History,
|
|
Count,
|
|
}
|
|
|
|
/// <summary> Kind of meters for the procedure / test </summary>
|
|
public enum MetersKind
|
|
{
|
|
#if LANG_DE
|
|
[Description("Wasserzähler")] Single,
|
|
[Description("Verbundwasserzähler")] Combined,
|
|
[Description("Wärmezähler")] HeatMeter,
|
|
#elif LANG_CS
|
|
[Description("Vodoměry")] Single,
|
|
[Description("Kombinované vodoměry")] Combined,
|
|
[Description("Měřiče tepla")] HeatMeter,
|
|
#elif LANG_RU
|
|
[Description("Счетчик")] Single,
|
|
[Description("Комбинированный счетчик")] Combined,
|
|
[Description("Счетчик тепла")] HeatMeter,
|
|
#else
|
|
[Description("Water meters")] Single,
|
|
[Description("Compound water meters")] Combined,
|
|
[Description("Heat meters")] HeatMeter,
|
|
#endif
|
|
}
|
|
|
|
public enum CompoundMeterId : byte
|
|
{
|
|
Single,
|
|
CompoundMain,
|
|
CompoundAux,
|
|
Compound,
|
|
HeatMeterVolume,
|
|
HeatMeterEnergy,
|
|
SingleOrCompound, /// Only used when querying results
|
|
}
|
|
|
|
public enum Medium
|
|
{
|
|
[Description("")] NotSpecified,
|
|
ColdWater,
|
|
HotWater,
|
|
Count
|
|
}
|
|
|
|
public enum Mounting
|
|
{
|
|
[Description("")] NotSpecified,
|
|
#if LANG_DE
|
|
[Description("H")] H, /// horizontal
|
|
[Description("V")] V, /// vertical
|
|
[Description("STR")] S, /// standrohre
|
|
[Description("F")] F, /// fall
|
|
#else
|
|
[Description("H")] H, /// horizontal
|
|
[Description("V")] V, /// vertical
|
|
[Description("S")] S, /// steig
|
|
[Description("F")] F, /// fall
|
|
#endif
|
|
Count
|
|
}
|
|
|
|
public enum TemperatureClass
|
|
{
|
|
[Description("")] NotSpecified,
|
|
[Description("T30")] T30,
|
|
[Description("T50")] T50,
|
|
[Description("T70")] T70,
|
|
[Description("T90")] T90,
|
|
[Description("T130")] T130,
|
|
[Description("T180")] T180,
|
|
[Description("T30/70")] T30_70,
|
|
[Description("T30/90")] T30_90,
|
|
[Description("T30/130")] T30_130,
|
|
[Description("T30/180")] T30_180,
|
|
[Description("30")] t30,
|
|
[Description("50")] t50,
|
|
[Description("70")] t70,
|
|
[Description("90")] t90,
|
|
[Description("130")] t130,
|
|
[Description("180")] t180,
|
|
Count
|
|
}
|
|
|
|
public enum FlowProfileSensitivityClass
|
|
{
|
|
[Description("")] NotSpecified,
|
|
[Description("U0")] U0, /// ?
|
|
[Description("D0")] D0, /// ?
|
|
Count
|
|
}
|
|
|
|
public enum PressureLossClass
|
|
{
|
|
[Description("")] NotSpecified,
|
|
[Description("dp63")] dp63, /// 0.063 MPa = 0.63 bar, TODO: Change to "Δp63"
|
|
[Description("dp40")] dp40, /// 0.040 MPa = 0.40 bar
|
|
[Description("dp25")] dp25, /// 0.025 MPa = 0.25 bar
|
|
[Description("dp16")] dp16, /// 0.016 MPa = 0.16 bar
|
|
[Description("dp10")] dp10, /// 0.010 MPa = 0.10 bar
|
|
Count
|
|
}
|
|
|
|
/// <summary> Maximum Admissible Pressure </summary>
|
|
public enum MaxAdmissiblePressure
|
|
{
|
|
[Description("")] NotSpecified,
|
|
[Description("MAP6")] MAP6,
|
|
[Description("MAP10")] MAP10,
|
|
[Description("MAP16")] MAP16,
|
|
[Description("MAP25")] MAP25,
|
|
[Description("MAP40")] MAP40,
|
|
Count
|
|
}
|
|
|
|
/// <summary> Transition step is finished when this condition is fulfilled </summary>
|
|
public enum StepCondition
|
|
{
|
|
None,
|
|
Scale1Empty,
|
|
Scale2Empty,
|
|
Scale3Empty,
|
|
AllScalesEmpty,
|
|
Count
|
|
}
|
|
|
|
public enum Publish : sbyte
|
|
{
|
|
#if LANG_DE
|
|
/// german
|
|
[Description("nie")] Never = 0,
|
|
[Description("immer")] Always = 1,
|
|
[Description("Bildschirm")] OnScreen = 2,
|
|
[Description("intern")] Internal = 3,
|
|
#elif LANG_CS
|
|
/// czech
|
|
[Description("nikdy")] Never = 0,
|
|
[Description("vždy")] Always = 1,
|
|
[Description("na obrazovku")] OnScreen = 2,
|
|
[Description("interně")] Internal = 3,
|
|
#elif LANG_SK
|
|
/// slovak
|
|
[Description("nikdy")] Never = 0,
|
|
[Description("vždy")] Always = 1,
|
|
[Description("na obrazovku")] OnScreen = 2,
|
|
[Description("interne")] Internal = 3,
|
|
#elif LANG_PL
|
|
/// polish
|
|
[Description("nigdy")] Never = 0,
|
|
[Description("zawsze")] Always = 1,
|
|
[Description("na ekranie")] OnScreen = 2,
|
|
[Description("wewnętrznie")] Internal = 3,
|
|
#elif LANG_RU
|
|
/// russian
|
|
[Description("никогда")] Never = 0,
|
|
[Description("всегда")] Always = 1,
|
|
[Description("толька экран")] OnScreen = 2,
|
|
[Description("внутренно")] Internal = 3,
|
|
#else
|
|
/// english
|
|
[Description("Never")] Never = 0,
|
|
[Description("Always")] Always = 1,
|
|
[Description("On screen")] OnScreen = 2,
|
|
[Description("Internal")] Internal = 3,
|
|
#endif
|
|
Count
|
|
}
|
|
|
|
public enum MassMethod : byte
|
|
{
|
|
#if LANG_DE
|
|
/// nemecky
|
|
[Description("Waage")] Scale,
|
|
[Description("Spanne")] Spread,
|
|
[Description("Standardabw.")] StdDev,
|
|
#elif LANG_CS
|
|
/// cesky
|
|
[Description("váhou")] Scale,
|
|
[Description("max.rozdíl")] Spread,
|
|
[Description("std.dev.")] StdDev,
|
|
#else
|
|
[Description("Scale")] Scale,
|
|
[Description("Spread")] Spread,
|
|
[Description("Std.dev.")] StdDev,
|
|
#endif
|
|
Count
|
|
}
|
|
|
|
public enum TestRedType
|
|
{
|
|
Fix,
|
|
/// etc.
|
|
Count,
|
|
}
|
|
|
|
public enum FQC1
|
|
{
|
|
FQC1,
|
|
FQP1,
|
|
Count,
|
|
}
|
|
|
|
public enum Progress
|
|
{
|
|
JustStarted,
|
|
TransitionBefore,
|
|
SwitchingFlowDetection,
|
|
FlowSetting,
|
|
Aborted, /// Use as an argument when a test was aborted
|
|
Test,
|
|
TransitionAfter,
|
|
Completed,
|
|
Count,
|
|
}
|
|
|
|
public enum Device
|
|
{
|
|
Screen,
|
|
Printer,
|
|
Disk,
|
|
}
|
|
|
|
public enum PageOrientation
|
|
{
|
|
Portrait,
|
|
Landscape,
|
|
Count,
|
|
}
|
|
|
|
public enum ItemCategory
|
|
{
|
|
#if LANG_DE
|
|
[Description("Allgemein")] Other,
|
|
[Description("Prüfstanddaten")] BenchData,
|
|
[Description("Prüfstandergebnisse")] BenchResult,
|
|
[Description("Prüfpunktdaten")] TestData,
|
|
[Description("Prüfpunktergebnisse")] TestResult,
|
|
[Description("Wasserzelledaten")] MeterData,
|
|
[Description("Wasserzelleergebnisse")] MeterResult,
|
|
#else
|
|
[Description("Other")] Other,
|
|
[Description("Bench data")] BenchData,
|
|
[Description("Bench result")] BenchResult,
|
|
[Description("Test data")] TestData,
|
|
[Description("Test result")] TestResult,
|
|
[Description("Meter data")] MeterData,
|
|
[Description("Meter result")] MeterResult,
|
|
#endif
|
|
Count,
|
|
}
|
|
|
|
/// <summary> Possible modes of operation of components and devices. </summary>
|
|
public enum DebugMode
|
|
{
|
|
#if LANG_DE
|
|
[Description("Erkennen-aus")] DetectedOff = -2,
|
|
[Description("Erkennen-ein")] DetectedOn = -1,
|
|
[Description("Normal")] Normal = 0, /// Normal operation
|
|
[Description("Auto-erkennen")] AutoDetect, /// The component (device) will be auto-detected
|
|
[Description("Fehler")] FailureDuringOperation, /// Failure during operation -> disabled
|
|
[Description("Aus")] Off, /// The component is off
|
|
[Description("Aufzeichnen")] Record,
|
|
[Description("Reply")] Reply,
|
|
[Description("Simuliert")] Simulate, /// Test bench simulation, this mode does not require any hardware
|
|
[Description("Geerbt")] Inherit,
|
|
#else
|
|
[Description("Detected off")] DetectedOff = -2,
|
|
[Description("Detected on")] DetectedOn = -1,
|
|
[Description("Normal")] Normal = 0, /// Normal operation
|
|
[Description("Auto detect")] AutoDetect, /// The component (device) will be auto-detected
|
|
[Description("Run-time error")] FailureDuringOperation, /// Failure during operation -> disabled
|
|
[Description("Off")] Off, /// The component is off
|
|
[Description("Record")] Record,
|
|
[Description("Reply")] Reply,
|
|
[Description("Simulate")] Simulate, /// Test bench simulation, this mode does not require any hardware
|
|
[Description("Inherit")] Inherit,
|
|
#endif
|
|
Count,
|
|
}
|
|
|
|
public enum LogLevel
|
|
{
|
|
#if LANG_DE
|
|
[Description("Aus")] Off,
|
|
[Description("Schwerwiegend")] Fatal,
|
|
[Description("Fehler")] Error,
|
|
[Description("Warnung")] Warn,
|
|
[Description("Info")] Info,
|
|
[Description("Debug")] Debug,
|
|
[Description("Alles")] All,
|
|
#else
|
|
[Description("Off")] Off,
|
|
[Description("Fatal")] Fatal,
|
|
[Description("Error")] Error,
|
|
[Description("Warn")] Warn,
|
|
[Description("Info")] Info,
|
|
[Description("Debug")] Debug,
|
|
[Description("All")] All,
|
|
#endif
|
|
Count,
|
|
}
|
|
|
|
|
|
/// <summary> Arrangement of tests </summary>
|
|
public enum TestsArrangement
|
|
{
|
|
Rows,
|
|
Columns,
|
|
}
|
|
|
|
/// <summary> Arrangement of meters </summary>
|
|
public enum MetersArrangement
|
|
{
|
|
Vertically,
|
|
Horizontally,
|
|
}
|
|
|
|
public enum Alignment
|
|
{
|
|
#if LANG_DE
|
|
[Description("links")] Left,
|
|
[Description("zentriert")] Center,
|
|
[Description("rechts")] Right,
|
|
[Description("angepasst")] Justified,
|
|
#else
|
|
[Description("Left")] Left,
|
|
[Description("Center")] Center,
|
|
[Description("Right")] Right,
|
|
[Description("Justified")] Justified,
|
|
#endif
|
|
Count
|
|
}
|
|
|
|
public enum VertAlignment
|
|
{
|
|
[Description("Top")] Top,
|
|
[Description("Middle")] Middle,
|
|
[Description("Bottom")] Bottom,
|
|
}
|
|
|
|
public enum TableForm
|
|
{
|
|
None,
|
|
Rows,
|
|
Columns,
|
|
ColumnsPL,
|
|
Count,
|
|
}
|
|
|
|
public enum ImageRotation
|
|
{
|
|
[Description("0 deg")] None,
|
|
[Description("90 deg")] Deg90,
|
|
[Description("180 deg")] Deg180,
|
|
[Description("270 deg")] Deg270,
|
|
Count
|
|
}
|
|
|
|
public enum CameraDisplayResolution
|
|
{
|
|
Small,
|
|
Medium,
|
|
Large,
|
|
// FullScreen,
|
|
Count,
|
|
}
|
|
|
|
public enum ErrorFlagsMode : sbyte
|
|
{
|
|
#if LANG_DE
|
|
[Description("aus")] Off,
|
|
[Description("info")] Info,
|
|
[Description("ein")] On,
|
|
#elif LANG_CS
|
|
[Description("vypnuto")] Off,
|
|
[Description("info")] Info,
|
|
[Description("zapnuto")] On,
|
|
#elif LANG_RU
|
|
[Description("выкл")] Off,
|
|
[Description("инфо")] Info,
|
|
[Description("вкл")] On,
|
|
#elif LANG_PL
|
|
[Description("nie")] Off,
|
|
[Description("info")] Info,
|
|
[Description("tak")] On,
|
|
#else // LANG_EN
|
|
[Description("off")] Off,
|
|
[Description("info")] Info,
|
|
[Description("on")] On,
|
|
#endif
|
|
Count
|
|
}
|
|
}
|